Repository navigation
Description
WIP commit at divide time so parts see the parent's on-disk work
Parent: #228 · Depends on: #230, #231
Problem
Workers are told never to commit ("you never run git add"); the harness commits only at landing (commitTaskWork). So when a parent divides mid-run, each part's worktree is cut from the base commit — the HEAD the family started from. Anything the parent has written to disk by then (a repro, a failing test, scraped material, draft sections, a half-built fixture) is not on disk for any part.
The parent-stays law means the parent is the coordinator holding the findings — but the parts can't see the findings' artifacts, only whatever prose the parent restates in their briefs. For code work this is the difference between a part that can run the failing test and one that has to be told about it.
The sketch road (divideFromSketch) doesn't suffer — division happens before the first request, nothing is written yet. Mid-run divide_work after the parent wrote anything does.
Decision
Commit the parent's work-in-progress to the family branch at divide time. Before cutting part worktrees, the harness stages the parent's current ledger and commits it to the family branch — the harness committing, not the worker, so "you never run git add" stays true. Parts then branch from a HEAD that contains the parent's real files.
- No-op for the sketch road (nothing written yet — the commit is empty and skipped).
- Applies uniformly to repo families (worktree off parent worktree) and folder families (worktree off the mirror, post-task families: folder family tree — parts cut worktrees off the mirror #230).
- The WIP commit lands on the family branch, which the person never sees;
comeHomemerges the family branch home as one operation. No squash needed.
Acceptance
- A parent that wrote
repro.txtthen divides: each part's worktree containsrepro.txton disk at start. - Sketch-road division (nothing written) produces no empty commit.
- The family's final landing is unchanged — one merge home, WIP commits internal to the family branch.
- The parent's own subsequent writes after the WIP commit are still staged/committed at landing as today (the WIP commit is additive, not a replacement for
commitTaskWork).
Notes for the implementer
- The commit point is in
divideOnce's admission path (post-task families: scope-ownership enforcement at division admission #231 scope check, before part worktrees are cut) — but parts' trees are prepared lazily at node start (workTaskNode→prepareTaskTreeOn), so the WIP commit must happen before the first part's tree is prepared, not atdivideOncereturn. The clean seam is where the parent's tree is known and the parts are about to start. - Reuse
stageTaskWork+commitTaskWorkagainst the parent's tree; the commit message should name it as a WIP checkpoint (e.g.wip: <title> before divide). - Guard: only commit if the parent's ledger is non-empty (emptiness law).
Verification recipe
- Scripted nest, repo-mode parent; script the parent to
write repro.txt, thendivide_workinto one part. - Assert the part's worktree contains
repro.txtat its first step. - Assert the family branch log shows the WIP commit before the part's merge, and the person's branch shows a single merge at landing.
Drafted with CodeAF · reviewed and owned by the author
Activity
task families: a parent commits its work to the family branch before …
task families: a parent commits its work to the family branch before …
task families: an end-to-end lane that proves parts work apart and la…
task families: a parent commits its work to the family branch before …
task families: an end-to-end lane that proves parts work apart and la…
task families: an end-to-end lane that proves parts work apart and la…
task families: a real-model end-to-end lane on both grounds (#280)