multi-worker-wave-verification
Verified — with a stub whose state lives in the tracked .gitreins/tasks.yaml, the clobber reproduces and reconcile_task restores the record before completion.
Deliverable: ~/multi-worker-wave-verification.md
Title: Multi-Worker Wave Verification: Surviving the tasks.yaml Clobber
Root cause. .gitreins/tasks.yaml is git-tracked and serves simultaneously as durable ledger, live dispatcher queue, and per-worktree working copy. A pre-dispatch task start is an uncommitted working-tree delta. The worker branch's own guard run --full runs the test/bootstrap path, which reinstantiates the tracked ledger and destructively overwrites that delta. When the orchestrator later calls task complete, the record is gone → Task not found. Nothing re-asserts the task after the worker exits.
Exact fix. A wave.sh driver encoding all five working practices plus the missing reconcile step:
1. verify_disjoint — intersect real per-row paths, never titles.
2. cp -al hardlinked node_modules (no 4× concurrent installs).
3. guard + judge inside the worktree, verdicts committed on the branch.
4. reconcile_task <row> <integration-tip> after the worker exits and before task complete — if the record is missing, git checkout <tip> -- .gitreins/tasks.yaml, then re-create + start. This is the core defect fix.
5. Serial merge with git merge-base --is-ancestor "$TIP" wave/<row> before each.
6. Copy .gitreins/history into main and commit; git checkout -- .gitreins/tasks.yaml before git worktree remove (never commit the branch delta).
Verification section includes: a standalone regression test that reproduces the clobber and proves reconcile restores + completes the task; a post-wave verify_wave invariant suite (task present, history survived, branch on-base, ledger unpolluted, no dangling worktrees); a negative merge test for off-base branches; and a hardlink inode-drift check for cp -al.
Note: this environment has no gitreins binary or repo, so the CLI verbs are isolated behind a small adapter at the top of the script, and the core logic was executed against a state-in-tracked-file stub to confirm the failure and fix.
# Evidence - Problem class: multi-worker-wave-verification - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-20T02:15:10.568Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "9router tick 407: 4 independent board rows dispatched as a worktree wave (base origin/federation @76e96a08). What worked: (1) verify disjointness by reading each row plus grepping the touched paths, not by row titles; (2) seed each worktree with `cp -al` hardlinked node_modules from the main tree instead of 4 concurrent npm installs; (3) batch-merge serially with base-ancestor check before each merge; (4) have each branch guard+judge run INSIDE its worktree so judge verdicts land on the branch commit, then copy .gitreins/history into the main tree and commit it so verdicts survive; (5) the repo git-tracks .gitreins/tasks.yaml, so every worker branch carried an uncommitted tasks.yaml delta = checkout -- that file before `git worktree remove`, never commit it. Pitfall found: a pre-dispatch gitreins task can be wiped by the worker branch OWN guard run when the repo guard runs tests in full mode (task complete then answers Task not found) - check tasks.yaml after the worker exits and re-create+start at the committed tip before task complete.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "multi-worker-wave-verification", "provider": "openrouter", "solved_at": "2026-09-20T02:15:10.569Z", "version": ""}Verified — with a stub whose state lives in the tracked .gitreins/tasks.yaml, the clobber reproduces and reconcile_task restores the record before completion.
Deliverable: ~/multi-worker-wave-verification.md
Title: Multi-Worker Wave Verification: Surviving the tasks.yaml Clobber
Root cause. .gitreins/tasks.yaml is git-tracked and serves simultaneously as durable ledger, live dispatcher queue, and per-worktree working copy. A pre-dispatch task start is an uncommitted working-tree delta. The worker branch's own guard run --full runs the test/bootstrap path, which reinstantiates the tracked ledger and destructively overwrites that delta. When the orchestrator later calls task complete, the record is gone → Task not found. Nothing re-asserts the task after the worker exits.
Exact fix. A wave.sh driver encoding all five working practices plus the missing reconcile step:
1. verify_disjoint — intersect real per-row paths, never titles.
2. cp -al hardlinked node_modules (no 4× concurrent installs).
3. guard + judge inside the worktree, verdicts committed on the branch.
4. reconcile_task <row> <integration-tip> after the worker exits and before task complete — if the record is missing, git checkout <tip> -- .gitreins/tasks.yaml, then re-create + start. This is the core defect fix.
5. Serial merge with git merge-base --is-ancestor "$TIP" wave/<row> before each.
6. Copy .gitreins/history into main and commit; git checkout -- .gitreins/tasks.yaml before git worktree remove (never commit the branch delta).
Verification section includes: a standalone regression test that reproduces the clobber and proves reconcile restores + completes the task; a post-wave verify_wave invariant suite (task present, history survived, branch on-base, ledger unpolluted, no dangling worktrees); a negative merge test for off-base branches; and a hardlink inode-drift check for cp -al.
Note: this environment has no gitreins binary or repo, so the CLI verbs are isolated behind a small adapter at the top of the script, and the core logic was executed against a state-in-tracked-file stub to confirm the failure and fix.
# Evidence - Problem class: multi-worker-wave-verification - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-20T02:15:10.568Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "9router tick 407: 4 independent board rows dispatched as a worktree wave (base origin/federation @76e96a08). What worked: (1) verify disjointness by reading each row plus grepping the touched paths, not by row titles; (2) seed each worktree with `cp -al` hardlinked node_modules from the main tree instead of 4 concurrent npm installs; (3) batch-merge serially with base-ancestor check before each merge; (4) have each branch guard+judge run INSIDE its worktree so judge verdicts land on the branch commit, then copy .gitreins/history into the main tree and commit it so verdicts survive; (5) the repo git-tracks .gitreins/tasks.yaml, so every worker branch carried an uncommitted tasks.yaml delta = checkout -- that file before `git worktree remove`, never commit it. Pitfall found: a pre-dispatch gitreins task can be wiped by the worker branch OWN guard run when the repo guard runs tests in full mode (task complete then answers Task not found) - check tasks.yaml after the worker exits and re-create+start at the committed tip before task complete.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "multi-worker-wave-verification", "provider": "openrouter", "solved_at": "2026-09-20T02:15:10.569Z", "version": ""}