FE-745: Epic-scoped sandbox merge for verify-epic#152
Conversation
PR SummaryMedium Risk Overview Per-slice execution now seeds each slice sandbox from completed dependency worktrees ( New module Also in the diff: Reviewed by Cursor Bugbot for commit 78bf6ee. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
🤖 Augment PR SummarySummary: This PR fixes multi-slice epic verification by running Changes:
Technical Notes: Merge order follows slice declaration order; later slices overwrite earlier paths and conflicts are surfaced in the event payload. Per-slice worktrees remain unmodified and the epic sandbox is rebuilt on each verification run. 🤖 Was this summary useful? React with 👍 or 👎 |
0f5cdbf to
9e6a0e8
Compare
701c569 to
257e1e0
Compare
1b11685 to
ad5652f
Compare
97540d6 to
2f0aba4
Compare
ad5652f to
fb39377
Compare
f1ff792 to
33a84c1
Compare
fb39377 to
2436dd5
Compare
33a84c1 to
71a21e2
Compare
2436dd5 to
46fe008
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 22167d1. Configure here.
b5c8c77 to
9ea1a4d
Compare
71a21e2 to
6f78604
Compare
verify-epic now runs against a freshly-merged <parentSandboxDir>/__epic__/<epicId>/
built from the epic's completed slice worktrees. Slices apply in plan declaration
order; later slices overwrite earlier ones on the same path and the collision is
reported via the new epic-sandbox-merged event. Per-slice worktrees are not mutated.
Unblocks multi-slice cook runs (verify-epic previously fell back to the empty
parent worktree root, halting every multi-slice plan).
- new src/orchestrator/src/epic-sandbox-merge.{ts,test.ts}
- net-compiler.ts verify-epic case wires the merger + emits epic-sandbox-merged
- engine-contract.test.ts: 'verify-epic receives parent sandboxDir' assertion
updated to pin the new __epic__/<epicId>/ invariant
- memory/SPEC.md: new I124-K invariant alongside I123-K
- memory/PLAN.md: petri-epic-verification-merge → Recently Completed; bullet
retired from petri-graph-compilation (no longer blocked on FE-700)
Validate epic/slice ids and relative paths, skip symlinks during merge walks, handle file/directory collisions safely, and only honor --version as a top-level flag. Co-authored-by: Cursor <cursoragent@cursor.com>
Slice sandboxes must not collide with the epic merge root; skip any accidental epic-root paths during merge and mirror the guard in net-compiler. Co-authored-by: Cursor <cursoragent@cursor.com>
Defer scaffolding epic verify in fixtures/txt plan and move CLI integration tests to text-ops. Merge verify-epic from worktree/<epicId>/ trees in plan order (target plus transitive deps) so slice work accumulates per epic instead of per-slice last-winner overwrites such as cli.ts. Co-authored-by: Cursor <cursoragent@cursor.com>
Restore per-slice runtime sandboxes with dependency seeding so parallel slices do not corrupt a shared epic worktree. verify-epic merges completed slice worktrees and follows slice depends_on across epics, not just epic depends_on. Co-authored-by: Cursor <cursoragent@cursor.com>
…rphans. Use preserveExisting for post-action test/assess passes; on action/rework reset, drop paths outside the dependency baseline before overlaying deps. Co-authored-by: Cursor <cursoragent@cursor.com>
The generic action transition was calling seedSliceSandboxFromDeps without preserveExisting, wiping files from prior steps in dependent slices. Co-authored-by: Cursor <cursoragent@cursor.com>
Seed dependency files in plan declaration order, always drop paths outside dep trees even when preserveExisting is set, and reuse resolveSliceWorktreeDir from net-compiler. Co-authored-by: Cursor <cursoragent@cursor.com>
Re-seeding before assess/run-tests must not delete slice-owned artifacts that are absent from dependency worktrees. Co-authored-by: Cursor <cursoragent@cursor.com>
visitSliceDeps now tracks visited slice ids so malformed plans with circular slice.depends_on cannot blow the stack. Co-authored-by: Cursor <cursoragent@cursor.com>
6f78604 to
421f18b
Compare
9ea1a4d to
78bf6ee
Compare


Summary
verify-epicnow runs in a merged tree at<parentSandbox>/__epic__/<epicId>/built from completed slice sandboxes, following plan order (later slice wins on duplicate relative paths).epic-sandbox-mergehandler/transition andepic-sandbox-mergedreport event; SPEC invariant I124-K captures merge semantics for reviewers and future automation.Context
What changed
epic-sandbox-merge: assembles slice outputs into an epic-scoped directory immediately beforeverify-epicruns.__epic__slice id rejected at validation time to prevent merge namespace poisoning.Verification
npm run verifygreen.Out of scope
Traceability
petri-epic-verification-mergeinmemory/PLAN.md; umbrella H-6476.