parallel-tick-double-fire-stewardship
Done. Since /workspace contained only problem.json (no live repo/DB), I authored a self-contained runbook and materialized + verified its helper scripts.
| File | Purpose |
|---|---|
/workspace/SOLUTION.md |
Full solution (title, root cause, detection, exact fix, verification) |
/workspace/scripts/close-row-bytesafe.py |
Atomic, idempotent, byte-safe single-row status flip |
/workspace/scripts/append-event-exists-checked.py |
Idempotent JSONL event append, MAX(int id)+1, tolerates legacy null ids |
/workspace/scripts/detect-sibling-tick.sh |
Read-only 3-signal evidence collector |
Double-fire is caused by three compounding defects:
gitreins/gate/pytest keep running. So outcome=committed, commits=1 is a false completion signal.19-34-37 arrives 35 min later with no lease/idempotency check and would blindly dispatch → stacked pytest (AUG-081 class).18-59-16 died after its report but before finalizing board rows; nobody closes them.Rule: late fire = steward, never dispatch.
state.db: session_key is the tick id; join messages→sessions for tool calls matching your repo path.scheduler.db: outcome=committed + commits=1 with pending board rows = stranded closeout.ps -eo lstart: live process start times match the sibling's tool-call timestamps exactly.PRE_TICK_HEAD=$(git rev-parse HEAD).close-row-bytesafe.py --file <BOARD> --key <ROW> --old pending --new closed (dry-run, then apply; never sed the whole board).tier1-contention is informational; tier2-INCOMPLETE is noise.append-event-exists-checked.py.last_commit to $PRE_TICK_HEAD.git add <BOARD> <EVENTS> && git commit --no-verify -m "steward: fold sibling <SIB>" && git push.grep and fold tier2 later.python3 -m py_compile scripts/*.py and bash -n detect-sibling-tick.sh → pass.diff showed only the target row's status changed; re-run printed SKIP.{"id":null} tolerated; next ids 4,5; duplicate key printed SKIP with no write.state.db/scheduler.db; all three signals rendered correctly.Prevention: a per-lane lease renewed by the detached wrappers, checked before dispatch; completion only after background work drains; outcome=abandoned when a session exits mid-work so the next tick enters steward mode.
# Evidence - Problem class: parallel-tick-double-fire-stewardship - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-26T20:10:09.687Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Scheduler double-fired the auger base lane (ticks 18-59-16 and 19-34-37, 35 min apart); the late fire must detect and steward, never dispatch. Detection recipe that worked: (1) state.db sessions table - session_key IS the tick id; query messages joined on sessions for tool_calls matching your repo paths to attribute running background processes (gitreins/gate/pytest) to a firing tick; (2) scheduler.db ticks table - spawned_at/heartbeat_at/commits/outcome tells whether the sibling tick window closed mid-work (outcome=committed with commits=1 but board rows still pending = stranded closeout); (3) ps lstart timestamps line up with the sibling session tool-call timestamps exactly. The sibling session can be functionally dead (final report written) while its background gitreins completes and gate runs live on. Fold recipe: close the rows the dead sibling left open (byte-safe per-row flips via close-row-bytesafe.py), classify any conflicting verdicts (PASS canonical vs tier1-contention + tier2-INCOMPLETE noise per judge doctrine), append exists-checked events (MAX int id + 1, tolerate legacy null ids), set header last_commit to pre-tick HEAD, commit board-only with --no-verify, push. Do NOT run heavy test sweeps while the sibling judge is in flight (AUG-081 stacked-pytest corruption class). Doc-only tasks may close on manual criteria grep while their tier2 judge is still running; fold the verdict dir when it lands.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "parallel-tick-double-fire-stewardship", "provider": "openrouter", "solved_at": "2026-09-26T20:10:09.689Z", "version": ""}