-
Notifications
You must be signed in to change notification settings - Fork 0
FE-883: Cook artifact lifecycle — git-merge slice composition #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
kostandinang
wants to merge
8
commits into
ka/fe-881-cook-agent-skills
from
ka/fe-883-orchestrator-improvements
+660
−83
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bfdd7b0
FE-883: fix run-artifact fold false-conflict on dependency-seeded files
kostandinang 0874cd6
FE-883: register cook-artifact-lifecycle frontier + execution queue
kostandinang 3c90c5d
FE-883: prove the fold 3-way merges different-hunk edits to one file
kostandinang 27d073c
FE-883: materialize the fold as a worktree for consistent verify (1c …
kostandinang 01fd4cd
FE-883: record 1c decision (verify against folded tree) + integration…
kostandinang 35efd80
FE-883: wire the git-merge fold into verify-epic + promotion (1b + 1c)
kostandinang 57f1be8
FE-883: reconcile docs for the wired fold (TODO + SPEC I124-K)
kostandinang 4cc6d23
FE-883: print a navigable finish block on cook promotion
kostandinang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| # Scope cards — cook-artifact-lifecycle (FE-883) | ||
|
|
||
| Execution queue for `cook-artifact-lifecycle` (FE-883, branch | ||
| `ka/fe-883-orchestrator-improvements`, on FE-864). | ||
|
|
||
| **Reality check (corrected after basing on FE-864, the current seam):** the | ||
| brownfield git-merge composer already exists — `run-artifact.ts` (commit | ||
| 871ef087): `commitSliceWorktree` + `foldSliceBranches` do a real `git merge-tree` | ||
| 3-way fold of per-slice branches in dependency order, fail-closed on conflicts, | ||
| pure plumbing (I135-K preserved). It was deliberately left **unwired** pending "a | ||
| live-run check of the dependency-seed interaction". So FE-883 is *wire the | ||
| existing composer*, not *build it*. | ||
|
|
||
| This matches the Slice-1 spike decision (2026-06-18): git-merge for brownfield | ||
| (common ancestor → real 3-way), file-copy union for greenfield (no common | ||
| ancestor), elevate collisions to a first-class outcome. | ||
|
|
||
| --- | ||
|
|
||
| ## Slice 1 — wire the run-artifact composer into the live path | ||
|
|
||
| Status: **in progress.** | ||
|
|
||
| ### Sub-steps | ||
|
|
||
| ``` | ||
| ✓ 1a (done, commit 2357f941) — composer correct under dependency-seeding. The | ||
| deferred "live-run check" failed: a dependent slice extending a dep-seeded file | ||
| false-conflicted because slice branches share no inter-slice ancestry. Fix: | ||
| commit each slice recording its dependency commits as parents, so the fold's | ||
| merge-base is the dependency. Regression test added; unfaithful happy-path test | ||
| corrected. (epic-sandbox-merge.ts file-copy untouched.) | ||
|
|
||
| ✓ mechanism (commits fadb1b52, 5e1d8d32) — proved + factored the fold so both | ||
| 1b and 1c can use it: foldToCommit (fold N slice commits onto a base, fail-closed, | ||
| no ref write) + materializeFoldedWorktree (fold + `git worktree add --detach`, | ||
| rework-safe). Tests pin: 3-way merge of different-hunk edits to one file keeps | ||
| both; the fold materializes on disk in a verify worktree. | ||
|
|
||
| ✓ 1c DECISION (2026-06-18): verify against the folded tree (option i). One | ||
| composition path → the tree verified == the tree shipped; no verify≠ship gap on | ||
| same-file edits. The worktree-checkout unknown is de-risked by materializeFoldedWorktree. | ||
|
|
||
| ✓ 1b/1c INTEGRATION (done, commit d92ce38b) — engine wired end-to-end: | ||
| - net-compiler verify-epic: brownfield uses materializeEpicVerifyTree (commit | ||
| slices dep-order → fold → detached worktree at __epic__/<epicId>/ → relink | ||
| node_modules); fold conflict → fail the epic (passed:false report → fail sibling). | ||
| Greenfield keeps the file-copy union. | ||
| - cook-cli promotion: brownfield calls harvestCookRun; fold conflicts → fatal run | ||
| outcome. I135-K preserved (all plumbing). | ||
| - commitSliceWorktree made idempotent so promotion reuses the commits verify made. | ||
| - Stale epic-sandbox-merge.ts TODO updated; SPEC I124-K amended (plan.mode fork). | ||
| - Full orchestrator suite green (672). Single-slice brownfield-smoke exercises the | ||
| engine plumbing; a *multi-slice* end-to-end engine test is still a gap to add. | ||
|
|
||
| ○ 1d (remaining) — retire the now-dead promoteBrownfieldRun + BrownfieldPromoteOptions. | ||
| Blocked on rewriting the landCookBranch test fixture (repoWithPromotedCook uses | ||
| promoteBrownfieldRun to build a promoted branch — rebuild it via harvestCookRun or | ||
| a plain commit). mergeSlicesIntoEpicSandbox STAYS (it is the greenfield composer). | ||
| ``` | ||
|
|
||
| ### Acceptance Criteria (slice-level) | ||
|
|
||
| ``` | ||
| ✓ dep-seed — a dependent slice extending a dep-seeded file folds clean (done, 1a) | ||
| ○ brownfield-3way — two brownfield slices editing different hunks of the same | ||
| pre-existing file both survive promotion (the file-copy union drops one) | ||
| ○ brownfield-conflict — a true overlapping-hunk conflict surfaces as a fatal run | ||
| outcome, not a buried event field | ||
| ○ checkout-untouched — promotion still never touches the user's branch / tree / | ||
| index (I135-K) | ||
| ○ greenfield-unchanged — serial-greenfield shared-tree + parallel-greenfield | ||
| file-copy paths preserved | ||
| ``` | ||
|
|
||
| ### Verification Approach | ||
|
|
||
| ``` | ||
| - Inner: run-artifact.test.ts (done), promote-run.test.ts, epic-sandbox-merge.test.ts | ||
| - Middle: brownfield-smoke.integration.test.ts — seeded repo, overlapping slices | ||
| - Outer: dogfood a multi-slice brownfield cook with an intentional file overlap | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Slice 2 — worktree + branch GC / lifecycle (light) — `next` after Slice 1 | ||
|
|
||
| A finished run reclaims its worktrees + `brunch/{run,slice}/*` refs instead of the | ||
| operator-owned cleanup `worktree.ts` documents. Ref-set depends on Slice 1's final | ||
| branch topology, so scope after it lands. Keep-on-failure for inspection; promoted | ||
| artifact survives GC. | ||
|
|
||
| ## Slice 3 — per-slice build-cache write isolation (candidate) | ||
|
|
||
| May instead be an FE-879 follow-on (FE-879 owns `SHAREABLE_TOP_LEVEL_ENTRIES`). | ||
| Decide ownership before scoping. | ||
|
|
||
| ## Out of scope (noted) | ||
|
|
||
| - Sync `git worktree add` serialization (`epic-sandbox-merge.ts:288`) — perf, not | ||
| correctness; FE-879 laziness already bounds worktree count. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.