Repository navigation
fix: enforce independent semaphore release guards - #123
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Parent verification and correctionsExact reviewed head: The full independent review follows unchanged except link normalization. I accept its APPROVE verdict after checking the implementation and raw evidence, with these corrections:
The source/generated executable agree. Required CI run 37293986010 passed on this exact head. No actionable defect remains in this review. CodeRabbit's success context represents a rate-limit response, not a substantive review. Local evidence paths below identify retained receipts; they are not public hosted artifacts. Independent Adversarial Code Review: PR 123 (
|
| Item | Status | Verification & Coordinates |
|---|---|---|
| CLI Parser Separation | Verified |
lib/170-semaphores.sh:233, lib/170-semaphores.sh:283-294: distinct record and acquisition variables. |
| Retry Loop Argument Propagation | Verified |
lib/170-semaphores.sh:187-195: sem_release_once passes "${3:-}" "${4:-}" to sem_release_attempt across all 200 retries. |
| Exact Field Matching | Verified |
lib/170-semaphores.sh:218: independent checks want_record != own_oid and want_acquisition != own_acq. |
| Authority & Capacity Preservation | Verified |
test/release-guards.py:105-108: state(env) == before on mismatch; competing acquire refused with capacity. |
| Path Release Parity | Verified |
lib/110-release.sh:52-61: identical conjunction rules, error exits, and event diagnostics. |
| Wrapper Cleanup Parity | Verified |
lib/160-with.sh:374-380: acquisition identity check prevents release of superseded slots. |
| Empty/Multiline/UTF-8 Validation | Verified |
lib/030-time-refs-records.sh:48: valid_holder rejects empty, newline, and invalid UTF-8 with exit code 2. |
| Absence Handling | Verified |
lib/170-semaphores.sh:212-215: empty own_oid returns {"event":"nothing"} with exit 0. |
| Committed Executable Synchronized | Verified |
bin/git-locks:3033-3200 contains identical logic to lib/170-semaphores.sh. |
| Merge & Invariant Audit | Verified | Direct fast-forward descendant of 7ba2c09; no intermediate merges; preserves PR #114, #116, #118, #119 invariants. |
| Evidence & Resource Bounds | Verified |
semaphore-guards-full-resources.json: all runtime metrics verified within bounds ($\le$20 GiB build, $\le$4 GiB runtime, $\le$128 MiB logs, $\ge$50 GiB host/VM free). |
| Documentation Standards | Verified |
docs/usage.md:68-70, CHANGELOG.md:7: one physical line per paragraph; claims adhere to repo style. |
7. Execution Status Summary
- Static Inspection: Executed across all 7 modified files and surrounding subsystems.
- Evidence Verification: Completed against all
.test-results/semaphore-guards-*artifacts and checksums. - Container Tests: Inspected completed container runs (
semaphore-guards-red,semaphore-guards-green,semaphore-guards-full). - Host Tests: Prohibited and skipped in compliance with workspace safety instructions.
APPROVE
A semaphore release could discard an earlier ownership guard because
--recordand--acquisitionshared one parser variable. A stale guard followed by a matching guard could release the slot; a record OID passed as an acquisition guard could also release it.Keep both guards separately through every retry and compare each against its own field. Every supplied guard must match, regardless of option order. A mismatch returns the existing
nothing/supersededevent without changing the authority or freeing capacity. Matching and unguarded release behavior remains supported.Closes #122. Discovered during the acquisition contract audit for #74. This fixes guard semantics; it does not introduce a new identifier grammar or finish #74.
Validation: Docker regression failed in four cases against main 7ba2c09, then all 31 guard checks passed with the fix. Lint passed. A shell-suite regression also checks preservation of both live holders. Full integration, hosted CI, and exact-head independent review are pending.