FE-1089: Reconcile executor with alpha branch#274
Conversation
PR SummaryMedium Risk Overview The core adds Tool gating: the shell registers the full execute tool set, but execute mode only activates read-only footholds ( Canon/process: Tests expand registry, runtime policy, TUI registration, and executor unit coverage for projections, bounded paths, and lifecycle transitions. Reviewed by Cursor Bugbot for commit 8166015. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Addressed the Bugbot review findings:
Each fix has test coverage. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d Co-authored-by: Amp <amp@ampcode.com>
Aligns src/orchestration with the TOPOLOGY.md convention used by every other src/** subtree (AGENTS.md topology-files rule). Updates the two canonical-doc references (memory/SPEC.md D99-L materialized-state list and memory/PLAN.md cook frontier traceability lines). No code change. Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d Co-authored-by: Amp <amp@ampcode.com>
The identical readRunMetadata(path) helper (try/JSON.parse/catch) was privately copy-pasted into 13 cook-*.ts lifecycle files. Move it to cook-run.ts as the exported readCookRunMetadata, alongside the run-dir and metadata-path helpers it already owns, and import it everywhere. Drop the now-unused readFile imports. Behavior identical; existing cook tests cover every caller. Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d Co-authored-by: Amp <amp@ampcode.com>
Every cook transition tool hand-wrote the same run.json write followed by
a { kind: 'write_file', path: metadataPath, ifExists: 'overwrite' }
side-effect literal. Add persistCookRunMetadata to cook-run.ts, which
writes the metadata and returns that canonical side-effect record, and
adopt it across the 13 transition tools. Tools keep their own status
guard, result shape, and any artifact write; only the metadata write +
side-effect encoding is centralized. Drop now-unused writeFile imports.
Behavior identical; existing cook tests cover every caller.
Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d
Co-authored-by: Amp <amp@ampcode.com>
The subtree owns the execute-mode projection seam and cook lifecycle contracts; 'executor' names that role in the codebase's own vocabulary (execute_* tools, executor prompt/runtime) and matches the single-word src/** house style. Directory rename only: cook-* filenames are unchanged. Updates the 23 Pi extension import paths, both TOPOLOGY.md files, and the src/executor path pointers in memory/SPEC.md and memory/PLAN.md. No behavior change. Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d Co-authored-by: Amp <amp@ampcode.com>
Renames the 17 src/executor/cook-*.ts files (+ their tests) to drop the legacy cook- prefix (cook-run.ts -> run.ts, etc.), now that the subtree itself is named executor. Updates internal imports, the 23 Pi extension import paths, and the filename references in both TOPOLOGY.md files plus memory/SPEC.md and memory/PLAN.md. Left intentionally unchanged (separate surfaces): the Cook* exported symbols, the execute_cook_* Pi tool names and execute-cook-* extension dirs, the .brunch/cook/ runtime artifact paths, the cook-sandbox/ cook-agent-runner/cook-land frontier names, and the stashed src/app/cook-*.ts port work. No behavior change. Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d Co-authored-by: Amp <amp@ampcode.com>
Renames the 17 execute-cook-* Pi extension dirs to execute-*, and the matching tool identifiers (execute_cook_* -> execute_*) and constants (BRUNCH_EXECUTE_COOK_*_TOOL -> BRUNCH_EXECUTE_*_TOOL) in session/schema/tool-names.ts, execute-status pendingTools, the extension registry, active-tools allowlist, executor.md prompt, .pi/settings.json, and the SPEC/PLAN references. No two tool names collide after the drop. Runtime .brunch/cook/ artifact paths, the Cook* exported symbols, and the cook-sandbox/cook-agent-runner/cook-land frontier names are unchanged. No behavior change. Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d Co-authored-by: Amp <amp@ampcode.com>
Removes the legacy Cook/cook token from ~130 identifiers across the
executor module and its Pi adapters: types (CookRunMetadata ->
RunMetadata, CookPlanPreview -> PlanPreview, ExecuteCookRunCreateParams ->
ExecuteRunCreateParams, ...), functions (createCookRun -> createRun,
readCookRunMetadata -> readRunMetadata, copyCookHostSource ->
copyHostSource, ...), and tool-param prose ('Cook run id' -> 'Run id').
The two dir-path helpers that would collapse to the ubiquitous local var
names are given a Path suffix instead (cookRunDir -> runDirPath,
cookWorktreeDir -> worktreeDirPath), matching sibling runMetadataPath /
planFilePath / reportsPath. .brunch/cook/ runtime paths and the stashed
CookExecutionPorts seam are unchanged. No behavior change.
Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d
Co-authored-by: Amp <amp@ampcode.com>
Renames the orchestrator-cutover arc frontiers in memory/PLAN.md and memory/SPEC.md: cook-sandbox -> executor-sandbox, cook-agent-runner -> executor-agent-runner, cook-land -> executor-land, and the superseded cook-real-execution -> executor-real-execution. The cook-execution-ports seam name, CookExecutionPorts type, src/app/cook-*.ts port impls, and .brunch/cook/ paths are left for the stashed cook-sandbox work. Amp-Thread-ID: https://ampcode.com/threads/T-019f1a7b-422b-74bd-a47d-df4ac4ad810d Co-authored-by: Amp <amp@ampcode.com>
Address Cursor Bugbot review findings on the fs-only cook lifecycle: - plan_only runs now advance to source_copied instead of stalling at source_policy_selected, so report init and slices can proceed. - execute_slice_start accepts slice_completed and picks the next incomplete slice, so multi-slice plans can walk the full chain. - execute_status lists execute_test_result among ported tools. - runId is validated before building filesystem paths, rejecting values like ../escape that would leave .brunch/cook/runs/.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
0e53a63 to
e7fee47
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e7fee47. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
lunelson
left a comment
There was a problem hiding this comment.
This sets up the executor tool surface cleanly around explicit run artifacts and side effects.
One thing I’d like to keep visible: active-tools.ts, pi-extensions.ts, and the executor prompt admit the full execute lifecycle in one scaffold step, while the later stack entries are still making individual steps real. That seems fine if the surface remains gated until the stack lands together; I would not want these tools reachable independently while some of the side-effecting steps are still placeholders.
|


FE-1089: Reconcile executor with alpha branch
Reconciles the legacy orchestration path onto alpha's executor architecture as bounded Pi tools. This PR is the scaffold layer: it proves the selected-spec graph can be projected into execution inputs, materialized into artifacts, advanced through a run lifecycle, and prepared for promotion without reviving a separate orchestrator role.
The important boundary is what it deliberately does not do: it does not run agents or tests, mutate graph truth, or touch git. Those irreversible or environment-dependent effects move behind injected ports in follow-up frontiers: FE-1109 sandbox -> FE-1111 agent runner -> FE-1112 promotion.
Transition
ExecutionSpecSnapshotplus durable outline/draft artifacts. The graph-to-execution seam is now explicit and testable..brunch, keeping the trust boundary reviewable.Changed
src/executor/owns the pure product contracts: projection, plan shaping, run lifecycle state, Petri export, and promotion-prep data.src/.pi/extensions/agent-runtime/execute-*/registers thin Pi adapters that validate params, call executor core, and surface side effects.src/agents/runtime/executor/admits these execute tools into the live executor allowlist and prompt surface.memory/SPEC.md/memory/PLAN.mdrecord the D99-L split into scaffold, sandbox, agent runner, and promotion.Follow-ups
Verification
npm run verifypasses: 163 test files, 1102 tests, 0 errors, 3 pre-existing lint warnings.