Skip to content

publish_current: skip the rewrite when the pointer already resolves - #168

Merged
JPDuchesne merged 1 commit into
mainfrom
jpd/current-pointer-converged
Sep 13, 2026
Merged

JPDuchesne merged 1 commit into
mainfrom
jpd/current-pointer-converged

Conversation

@JPDuchesne

Copy link
Copy Markdown
Contributor

Caught live at the plans#36 ceremony smoke run (cellbound-3d run), diagnosed by the agent's own FIX: line: dev install-deps crashed with Errno::EACCES for the ai-agent identity because the already-installed short-circuit still calls publish_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 current already 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

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

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@JPDuchesne
JPDuchesne merged commit 25052ac into main Sep 13, 2026
5 checks passed
@JPDuchesne
JPDuchesne deleted the jpd/current-pointer-converged branch September 13, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant