gitreins-wave-verdict-judged-at-pre-merge-base-commit
Done. I diagnosed the problem, built a runnable reproduction, verified the fix, and wrote the self-contained solution.
/workspace/SOLUTION.md — the full solution document/workspace/gitreins-wave-repro/ — runnable verification harness:mock_judge.py — emulates gitreins judge (judges current HEAD, records SHA in verdict.json)wave_tick.sh — correct ordering (merge → complete)wave_guard.sh — stale-verdict reconciliation (verdict.commit != HEAD)reproduce.sh — demonstrates bug + both fixes end-to-endgitreins judge evaluates whatever HEAD points at when it runs, not the task branch. Wave dispatch runs task complete in the window after workers exit but before the foreman's serial merges, so the judge checks out the pre-merge base (34842cb), never sees the fix (78192ab), and writes a FAIL with commit=34842cb and reason "core implementation entirely absent". The merge happens minutes later (bd5af40), but the verdict is never re-evaluated. A second defect — nothing compares verdict.json.commit to merged HEAD — lets the stale FAIL be trusted. Recovery is blocked because completed tasks refuse task complete re-runs.
task complete only after the serial merges, or per-branch inside each worktree. Added a fail-closed merge-base --is-ancestor assertion.tier2 == FAIL and verdict.commit != git rev-parse HEAD, re-run gitreins judge --async <id> with the repo venv on PATH.task complete to require the worktree branch be an ancestor of HEAD before judging, and record the actually-judged commit../reproduce.sh exits 0 and shows: pre-merge judge → FAIL at base; guard detects mismatch and re-judges at merged HEAD → PASS; correct ordering → PASS on first try with verdict.commit == merged HEAD (asserted).
One note: <tool> is a broken symlink (its pipx venv is missing) in this environment, so the harness uses a faithful mock rather than the real binary. The exact real-system commands for recovery and prevention are included verbatim in the document.
# Evidence - Problem class: gitreins-wave-verdict-judged-at-pre-merge-base-commit - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-26T01:34:33.749Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "In wave dispatch (foreman merges worker worktree branches serially AFTER workers finish), running gitreins task complete while merges are still pending means the judge evaluates the PRE-MERGE base commit: the verdict never sees the worker fix and fails claiming the core implementation is entirely absent even though the fix is merged minutes later. Proven 2026-09-25 <project> tick 589: MCP-005 verdict d77f2bcd recorded commit 34842cb (base) while fix 78192ab was already committed and merged as bd5af40; tier2 FAIL 'core implementation entirely absent'. Recovery: re-run the judge at merged HEAD (gitreins judge --async <id> with the repo venv on PATH; a completed task refuses task-complete re-runs). Prevention: in wave ticks run task complete AFTER the serial merges (or per-branch inside each worktree), never between worker-exit and merges; also check verdict.json commit field against the merged HEAD before trusting a FAIL that claims the fix is absent.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-wave-verdict-judged-at-pre-merge-base-commit", "provider": "openrouter", "solved_at": "2026-09-26T01:34:33.749Z", "version": ""}Done. I diagnosed the problem, built a runnable reproduction, verified the fix, and wrote the self-contained solution.
/workspace/SOLUTION.md — the full solution document/workspace/gitreins-wave-repro/ — runnable verification harness:mock_judge.py — emulates gitreins judge (judges current HEAD, records SHA in verdict.json)wave_tick.sh — correct ordering (merge → complete)wave_guard.sh — stale-verdict reconciliation (verdict.commit != HEAD)reproduce.sh — demonstrates bug + both fixes end-to-endgitreins judge evaluates whatever HEAD points at when it runs, not the task branch. Wave dispatch runs task complete in the window after workers exit but before the foreman's serial merges, so the judge checks out the pre-merge base (34842cb), never sees the fix (78192ab), and writes a FAIL with commit=34842cb and reason "core implementation entirely absent". The merge happens minutes later (bd5af40), but the verdict is never re-evaluated. A second defect — nothing compares verdict.json.commit to merged HEAD — lets the stale FAIL be trusted. Recovery is blocked because completed tasks refuse task complete re-runs.
task complete only after the serial merges, or per-branch inside each worktree. Added a fail-closed merge-base --is-ancestor assertion.tier2 == FAIL and verdict.commit != git rev-parse HEAD, re-run gitreins judge --async <id> with the repo venv on PATH.task complete to require the worktree branch be an ancestor of HEAD before judging, and record the actually-judged commit../reproduce.sh exits 0 and shows: pre-merge judge → FAIL at base; guard detects mismatch and re-judges at merged HEAD → PASS; correct ordering → PASS on first try with verdict.commit == merged HEAD (asserted).
One note: <tool> is a broken symlink (its pipx venv is missing) in this environment, so the harness uses a faithful mock rather than the real binary. The exact real-system commands for recovery and prevention are included verbatim in the document.
# Evidence - Problem class: gitreins-wave-verdict-judged-at-pre-merge-base-commit - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-26T01:34:33.749Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "In wave dispatch (foreman merges worker worktree branches serially AFTER workers finish), running gitreins task complete while merges are still pending means the judge evaluates the PRE-MERGE base commit: the verdict never sees the worker fix and fails claiming the core implementation is entirely absent even though the fix is merged minutes later. Proven 2026-09-25 <project> tick 589: MCP-005 verdict d77f2bcd recorded commit 34842cb (base) while fix 78192ab was already committed and merged as bd5af40; tier2 FAIL 'core implementation entirely absent'. Recovery: re-run the judge at merged HEAD (gitreins judge --async <id> with the repo venv on PATH; a completed task refuses task-complete re-runs). Prevention: in wave ticks run task complete AFTER the serial merges (or per-branch inside each worktree), never between worker-exit and merges; also check verdict.json commit field against the merged HEAD before trusting a FAIL that claims the fix is absent.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "gitreins-wave-verdict-judged-at-pre-merge-base-commit", "provider": "openrouter", "solved_at": "2026-09-26T01:34:33.749Z", "version": ""}