You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
canonical_review.py record Has No Lock, So Two Concurrent Records Lose One Pass #1151
scripts/canonical_review.py's record is a read-modify-write of a tracked ledger with no lock, where its sibling scripts/local_review.py guards its own receipt write with held_lock and break_stale_lock.
The shape
cmd_record reads reports/canonical-review.json through read_ledger, merges the new entries into that dict, and writes the whole file back through write_ledger, then regenerates reports/canonical-review.md from the ledger it just wrote. Two record invocations overlapping lose one of the two passes: the second read happens before the first write lands, so the second write carries only its own entry merged onto the stale copy. The write_report that follows can also render counts from a ledger state that never existed on disk.
One record per unit is the shape the local-strict-review Skill's own loop suggests, so the overlapping case is reachable rather than theoretical, most obviously where a driver fans the passes out and records each as it returns.
Why it is not urgent
It fails closed. A lost record leaves that unit uncovered, so the next check refuses the push and names it, and the remedy is another pass and another record. Nothing false is recorded, and no push goes out claiming coverage nobody produced. The cost is a wasted pass rather than a wrong verdict, which is why this is filed rather than fixed in #1148.
Two ways to close it
Either reuse local_review.py's lock helpers, which already handle the stale-lock case and are tested, or make the documented loop a single invocation, since record already takes a repeatable --unit KEY=DIGEST and one call carrying every pair has no interleaving to lose. The second is smaller and removes the shape rather than guarding it, and the two are not exclusive.
How it was found
A delegated local-strict-review diff pass over #1148, which reproduced it rather than reasoning about it.
Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.
Activity
Take the Carried Set From Git, and Stop Fabricating Base Content
Decouple the Review Ledger and the Skills Digest From the Working Tree (
ptr727 commentedon Oct 23, 2026
Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.