Repository navigation
Description
Problem
Two plain loopzero check callers can start expensive work concurrently for the same checkout, HEAD and settings before either has a complete receipt. The existing task-state lock covers receipt publication, not execution. #1368 protects the result of concurrent writers. This issue is about preventing duplicate stage execution, including the interval when no pass can yet be reused by #1526.
Capacity evidence
From 25 Nov 03:28:50Z to 26 Nov 03:28:50Z, Three checks began before an earlier check at the same head for the same mapped PR or worktree ended. Generic worktree basenames were excluded unless the PR was independently matched. Two later checks had a prior successful overlapping run at the same clean head, logged base and command. They used 10.3 run-wall minutes and 10.2 recorded CPU minutes, 0.14% and 0.08% of all recorded check-wrapper wall and CPU time. The logs do not guarantee identical effective settings.
- Keep PR content from hiding changed code from the reviewer #1366, head
70e478b77, same checkout. The second execution started at 02:19:03Z with 147s remaining before the first successful wrapper ended. The second used 235s. - Reject whitespace-only local check commands #1399, head
0f7ff4f8b, same PR across checkouts. The second started at 02:47:00Z, 27s before the first successful wrapper ended, and used 384s. Separate worktrees require an already-shared coordinator identity to coalesce safely.
Offline reproduction and acceptance
- Use an existing temporary-repo CLI concurrency fixture. Stub a stage to pause after Check A starts, then invoke Check B on the same checkout, clean HEAD and settings.
- Reuse existing task coordination to prevent the second invocation from starting a duplicate stage in that checkout. Let it report a check already in progress or reuse the completed pass. If the first run fails or is interrupted, a later invocation can run normally. Distinct checkouts or heads stay independent unless the existing coordinator can establish a shared execution. Do not serialize unrelated work.
- Preserve receipt publication and readiness validation. Keep tests net-zero in lines and preserve coverage. Add no flags, config keys or state.
Activity
eowca commentedon Nov 26, 2026
Parked (Lean178, 26 Nov): draft #1557 (head
2c53ecaa) passes checks, but two lock findings remain and the proposed persistent lock file conflicts with the keep-minimal rule (no new state files). A future attempt should avoid new on-disk state, for example by reusing an existing lock or receipt, or should be closed as not worth the cost.