Repository navigation
Conversation
Review: fix(codex): revalidate stale lock generation before takeoverVerified at head The fix holds upThe base code's
Cross-generation soundness also checks out: claimants of the same generation serialize on the shared Two semantic changes I want to explicitly endorse:
Verification
One coverage gap (non-blocking):
|
|
Added the inode-only regression in 58e8f12. It creates the replacement before renaming it over the old owner, avoiding allocator-dependent inode reuse, and asserts identical device/mtime but a different inode. The stale claimant is rejected, the owner content survives, and its claim directory is removed. The new test fails with |
58e8f12 to
7199039
Compare
Description
A stale-lock claimant can pause before creating its generation claim, then resume after another taker has stamped a fresh owner and entered the critical section. The delayed claimant currently overwrites that live owner and enters too. A release after claim creation can instead escape as ENOENT.
Revalidate the observed owner, inode and timestamp under the existing generation claim, require it still to be stale, and treat release races as a lost claim. Always remove the claim in finally. Keep the existing owner/heartbeat/release protocol and state format.
Human Involvement
Related Issue
Follow-up to #4591 and its unresolved generation-race finding:
#4591 (comment)
Type of Change
Changes Made
Testing
macOS arm64, Node 26.13.0. No real Codex/model call, live OpenViking deployment, cross-platform or full repository suite was run. Local plugin passes do not establish that the historical hosted API failure has been repaired; checks for the refreshed head are reported separately.
Checklist