publish_current: skip the rewrite when the pointer already resolves - #168
Merged
Merged
Conversation
The unconditional symlink swap is a write, and identities that can only read the shared engine tree (the ai-agent user on the human-owned tree, plans#26) crash on it: caught live at the plans#36 ceremony, where the already-installed short-circuit still called publish_current and dev install-deps died with EACCES on /Users/Shared/dev/engines. A pointer that already resolves to the target version is converged — recognize it and return. Test-first: the new case reproduces the exact EACCES (read-only base dir, correct pointer) before the fix. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Caught live at the plans#36 ceremony smoke run (cellbound-3d run), diagnosed by the agent's own
FIX:line:dev install-depscrashed withErrno::EACCESfor theai-agentidentity because the already-installed short-circuit still callspublish_current, and the unconditional symlink swap is a write against the human-owned shared engine tree — which the agent by design cannot write.Fix: when
currentalready resolves to the target version's basename, the pointer is converged — return without touching the tree. The atomic tmp+rename swap is unchanged for every pointer that actually needs to move.Test-first: the new case (published version, correct pointer, mode-0555 base dir) reproduced the exact live EACCES before the fix and passes after. Full suite green except the 4 known environmental BuildContainerTest failures (#165, pre-existing).
Made with Cursor