FE-745: Merge slice worktrees into epic-scoped dir for verify-epic#152
FE-745: Merge slice worktrees into epic-scoped dir for verify-epic#152kostandinang wants to merge 8 commits into
Conversation
PR SummaryMedium Risk Overview New
Fixture plan ( Reviewed by Cursor Bugbot for commit 485f88e. 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
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>
33a84c1 to
71a21e2
Compare
2436dd5 to
46fe008
Compare
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>
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 485f88e. Configure here.
| } | ||
| } | ||
| pruneEmptyDirs(sliceDir); | ||
| } |
There was a problem hiding this comment.
preserveExisting seed deletes slice files
High Severity
The seedSliceSandboxFromDeps function, even with preserveExisting: true, removes files from the slice sandbox that are not provided by its dependencies. This unintended pruning deletes slice-owned artifacts before critical processing steps, breaking slices that rely on their own files.
Reviewed by Cursor Bugbot for commit 485f88e. Configure here.



TL;DR.
verify-epicnow runs against a freshly-rebuilt<parentSandboxDir>/__epic__/<epicId>/produced by merging the epic's completed slice worktrees in plan declaration order. Unblocks multi-slicecookruns end-to-end.What changed
epic-sandbox-merge.{ts,test.ts}— union of completed slice worktrees in plan declaration order; later slices overwrite earlier on path collisions; collisions surfaced via the newepic-sandbox-mergedevent; per-slice worktrees not mutated.net-compiler.ts—verify-epiccase wires the merger and emitsepic-sandbox-mergedbefore invoking the action.engine-contract.test.ts— pins the__epic__/<epicId>/invariant.memory/SPEC.md— adds invariant I124-K.memory/PLAN.md—petri-epic-verification-mergemoved to Recently Completed.Why now
verify-epicpreviously fell back to the empty parent worktree root, halting every multi-slice plan with cross-slice integration verification. Closes the last gap from the FE-730 → FE-738 → FE-743 PoC arc — the orchestrator now finishes a real multi-slice plan end-to-end.Verification
5 new unit tests for the merger + updated engine contract test pin the new sandbox layout.
npm run verifygreen.Traceability
Requirement 49; D159-K; invariant I124-K. Frontier
petri-epic-verification-mergeinmemory/PLAN.md. Under umbrella H-6476.