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
fix: preserve wake grants when queue-lock acquisition fails - #7912
Authoring and no-mistakes review were single-family (Codex) by the owner's temporary choice.
Intent
1 p1-p7 codex only no cross model review
Context: this task is upstream scan 3 pick P3: upstream issue #3602 in kunchenguid/firstmate. The owner approved fixing scan picks P1-P7 upstream through PRs, written and reviewed by Codex only, with no cross-model review. Scan notes for this pick:
Wake-grant release and deactivate can mutate eligibility state after lock acquisition fails.
Size S.
Contract class: restore. Recorded triage.
Current-source evidence: bin/fm-wake-grant.sh:44,60,89,98 calls fm_lock_acquire_wait unchecked under set -u, then marks the lock held. Release and deactivate proceed to removal.
Competing-work check: No exact issue target in the complete index. #5798 changes lock failure detection in wake/procevent libraries, not this script. The inspected #5172 diff still leaves the acquire calls bare while adding owner-record durability. It does not close the failed-acquire path.
Closure test: Run the real grant command in a disposable copied fixture with an injected lock-acquire failure and preexisting owner/row records. release and deactivate must exit nonzero, retain both records and not release another owner's lock. Include activate/publish controls and successful acquisition controls. A narrow fixture or the existing wake-queue suite can own it. No real full disk, live grant, or home mutation is needed.
What Changed
Make fm-wake-grant.sh exit nonzero when queue-lock acquisition fails during activate, publish, release, or deactivate, preserving grant records and another owner's lock.
Add disposable-fixture regression coverage for failed and successful acquisition across all four actions, and document the failure behavior.
Risk Assessment
✅ Low: All four grant commands now stop on failed acquisition before mutating eligibility records or marking the lock held, with behavioral regression coverage and no unrelated changes.
Testing
The focused wake-queue suite passed after correcting fixture placement. Real CLI failures, successful acquisitions, contention, injected-failure controls, and baseline reproduction matched expectations. State evidence was retained and scratch removed.
Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario
Result
Live
Evidence
Release exits nonzero and preserves grant records when acquisition fails
Closes #3602
Authoring and no-mistakes review were single-family (Codex) by the owner's temporary choice.
Intent
1 p1-p7 codex only no cross model review
Context: this task is upstream scan 3 pick P3: upstream issue #3602 in kunchenguid/firstmate. The owner approved fixing scan picks P1-P7 upstream through PRs, written and reviewed by Codex only, with no cross-model review. Scan notes for this pick:
Issue: #3602
Wake-grant release and deactivate can mutate eligibility state after lock acquisition fails.
Size S.
Contract class: restore.
Recorded triage.
Current-source evidence:
bin/fm-wake-grant.sh:44,60,89,98callsfm_lock_acquire_waitunchecked underset -u, then marks the lock held. Release and deactivate proceed to removal.Competing-work check: No exact issue target in the complete index. #5798 changes lock failure detection in wake/procevent libraries, not this script. The inspected #5172 diff still leaves the acquire calls bare while adding owner-record durability. It does not close the failed-acquire path.
Closure test: Run the real grant command in a disposable copied fixture with an injected lock-acquire failure and preexisting owner/row records.
releaseanddeactivatemust exit nonzero, retain both records and not release another owner's lock. Include activate/publish controls and successful acquisition controls. A narrow fixture or the existing wake-queue suite can own it. No real full disk, live grant, or home mutation is needed.What Changed
fm-wake-grant.shexit nonzero when queue-lock acquisition fails during activate, publish, release, or deactivate, preserving grant records and another owner's lock.Risk Assessment
✅ Low: All four grant commands now stop on failed acquisition before mutating eligibility records or marking the lock held, with behavioral regression coverage and no unrelated changes.
Testing
The focused wake-queue suite passed after correcting fixture placement. Real CLI failures, successful acquisitions, contention, injected-failure controls, and baseline reproduction matched expectations. State evidence was retained and scratch removed.
Evidence: Grant CLI exits and before/after state, including baseline reproduction
Source: Grant CLI exits and before/after state, including baseline reproduction
Evidence: Live foreign-lock contention and successful handoff
Source: Live foreign-lock contention and successful handoff
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.