Skip to content

FE-1112: Reconcile run-local executor promotion#279

Open
kostandinang wants to merge 9 commits into
ka/fe-1111-executor-agent-runnerfrom
ka/fe-1112-executor-promotion
Open

FE-1112: Reconcile run-local executor promotion#279
kostandinang wants to merge 9 commits into
ka/fe-1111-executor-agent-runnerfrom
ka/fe-1112-executor-promotion

Conversation

@kostandinang

@kostandinang kostandinang commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What

Adds run-local executor promotion.

execute_promotion_prepare now commits verified changes inside the executor run worktree and records the sandbox commit SHA in promotion.json and run.json.

This does not apply changes back to the host project branch. Host promotion is handled by FE-1118.

Verification

npm run verify

kostandinang commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kostandinang kostandinang changed the base branch from ka/fe-1111-executor-agent-runner to graphite-base/279 July 1, 2026 09:06
@kostandinang kostandinang marked this pull request as ready for review July 1, 2026 10:04
@cursor

cursor Bot commented Jul 1, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
First irreversible git mutation in the executor seam; recovery and idempotency logic are non-trivial though heavily tested and confined to run worktrees, not host branches.

Overview
Run-local promotion replaces the descriptive-only preparePromotion path: Petri-exported runs with a worktree call an injected GitLandPort to stage/commit inside the run worktree only, then write promotion.json (including land.commitSha) and advance run.json to promotion_prepared with promotionBaseSha / promotionCommitSha. Failures and true no-ops leave the run at petri_exported; a clean worktree after an earlier promote is distinguished from “never promoted” via HEAD vs base SHA and recovery logic.

Wiring: createGitLandPort in app runs git status / add / commit / rev-parse in the worktree; Pi extensions default-inject it, and execute_promotion_prepare takes gitLand. execute_status clears pending land and notes run-local promotion is ported.

Recovery: Retries can finish metadata when a promoted commit already exists (matching report + HEAD, or no_changes with HEAD ahead of base) without trusting stale report SHAs. Scope cards document the git-before-metadata failure mode and follow-up work.

Reviewed by Cursor Bugbot for commit 8cb164a. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread src/executor/promotion.ts Outdated
Comment thread src/executor/promotion.ts
Comment thread src/app/git-land-port.ts
Comment thread src/executor/promotion.ts
@kostandinang kostandinang changed the title FE-1112: Reconcile executor promotion FE-1112: Reconcile run-local executor promotion Jul 1, 2026

@lunelson lunelson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The run-local promotion boundary is scoped well: the git mutation stays inside the run worktree and host promotion remains out of scope.

One thing to consider before FE-1118: promotion.json records the commit SHA, but not changed files or diff stats. Since host promotion will need to explain what is being carried forward, it may be useful for this report to include a small audit summary. Not blocking this PR.

@kostandinang kostandinang force-pushed the ka/fe-1112-executor-promotion branch from d93ee6c to 318a3a2 Compare July 1, 2026 16:46
@kostandinang kostandinang changed the base branch from graphite-base/279 to ka/fe-1111-executor-agent-runner July 1, 2026 16:46
@kostandinang kostandinang force-pushed the ka/fe-1112-executor-promotion branch from 318a3a2 to fc35e8d Compare July 1, 2026 17:40
@kostandinang kostandinang force-pushed the ka/fe-1111-executor-agent-runner branch from 1ec2beb to e7de782 Compare July 1, 2026 17:40

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fc35e8d. Configure here.

Comment thread src/executor/promotion.ts
@kostandinang kostandinang force-pushed the ka/fe-1112-executor-promotion branch from fc35e8d to 3e8bb5b Compare July 1, 2026 18:05
@kostandinang kostandinang self-assigned this Jul 3, 2026
@kostandinang kostandinang force-pushed the ka/fe-1112-executor-promotion branch from 3e8bb5b to 7d771f0 Compare July 3, 2026 16:52
@kostandinang kostandinang force-pushed the ka/fe-1111-executor-agent-runner branch from 2777558 to 7582dd2 Compare July 3, 2026 16:52
@kostandinang kostandinang force-pushed the ka/fe-1112-executor-promotion branch from 7d771f0 to 8cb164a Compare July 3, 2026 16:59
@kostandinang kostandinang force-pushed the ka/fe-1111-executor-agent-runner branch from 7582dd2 to 21ceeea Compare July 3, 2026 16:59

kostandinang commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants