Repository navigation
Keep foreign-host lock owners and waiters (T152) - #90
Merged
Merged
Conversation
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #61
Sage task T152
What changes
The state tool retains a lock owned by another machine, even when its boot time is close and its PID looks dead or reused locally. It checks the host before any boot or process rule. Local stale-lock rules stay the same. Cleanup also retains foreign waiters.
The source change is in
packages/sage-core/state.mjs. The build regenerates both provider copies. The existing Claude skill already describes foreign locks correctly and needs no change.Validation
Final commit:
38d8a0e1747290a24952f5853ac05ed55f288619.npm run build:built 212 files.npm run check:all checks pass.tests 12; pass 12; fail 0; skipped 0.npm test:tests 708; pass 708; fail 0; cancelled 0; skipped 0.git diff --check: exit 0.Every test used fake
ps,pgrepandkillfirst on PATH,caffeinate -i, andenv -u NODE_TEST_CONTEXT. Injected PID evidence and process-call spies prevent real process inspection or signals. Tests use no tight timing bounds.A detached
origin/maincheckout at5431a74received only the exact final test file. The two T152 groups fail withERR_ASSERTION: main permits a write through a foreign owner's lock, and main deletes a foreign waiter. The branch retains both records byte for byte. Local dead, reused and live PID controls preserve the existing behavior. Baseline test bytes remain unchanged.An initial proof used invalid fixture branch names. That output was discarded as regression evidence. The final proof uses valid task branches. The repository checker also exposed identifier propagation in its clock scan; only new fixture names changed. Existing tests and the checker remain unchanged.
Review and limits
Independent code/security and QA reviews are clean on the exact final commit. Code review checked 26 foreign-host cases and 2,704 local baseline comparisons, plus both new integration groups. QA passed 185 assertions across 20 controlled lock scenarios and both new integration groups.
This verifies the lock through controlled owner and waiter fixtures. A live shared folder across two machines was not tested. It adds no automatic foreign-lock recovery and does not change the existing filesystem lock protocol.
GitHub CI
CI run 37865030362 passed on the exact reviewed commit
38d8a0e1747290a24952f5853ac05ed55f288619.