feat(install-targets): generic plan-diff retirement for all install targets (#1412) - #4
Open
kunaaaalcodes wants to merge 7 commits into
Open
kunaaaalcodes wants to merge 7 commits into
kunaaaalcodes wants to merge 7 commits into
Conversation
…argets (Fmarzochi#1412) Signed-off-by: Kunal Jaiswal <kunaaaalcodes@gmail.com>
…8.30 Signed-off-by: Kunal Jaiswal <kunaaaalcodes@gmail.com>
|
Thank you for your contribution to EGC! Please sign our Contributor License Agreement to get this PR merged. Read .github/CLA.md, then post the comment below:
I have read the CLA Document and I hereby sign the CLA. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
…d root and protects shared destinations (Fmarzochi#1412) Signed-off-by: Kunal Jaiswal <kunaaaalcodes@gmail.com>
…a second managed root in the apply, and prove renames by content (Fmarzochi#1412) Review round on the generic plan-diff retirement: - A destination is a candidate only when the module that recorded it is still part of the current plan and the file no longer belongs to it. A targeted --modules install or a narrower profile leaves the files of the modules it did not select where they are, instead of retiring everything outside the new plan. - The managed roots an adapter declares (Amp's plugin config directory next to its skills root) ride along in the plan, and the apply checks each candidate against the root it belongs to: the linked-ancestor walk and the empty-parent climb stay inside that root, and a candidate under the second root is no longer dropped on the floor after being planned. - A recorded source that is gone because the file was renamed or moved in the package is retired when the bytes on disk match a file the plan copies today, hashed once per plan and only when a candidate needs it; a missing source that matches nothing stays, listed nowhere. - No repoRoot means identities cannot be compared: nothing is retired instead of guessing the working directory. - The retirement planner is split into small helpers (recorded copies, state reading, candidate boundaries) under the complexity limit. - The @opencode-ai/plugin bump is taken out of this change: it is unrelated to Fmarzochi#1412, turned the SDK into a runtime dependency of the published egc-universal package and pulled 23 packages into its lockfile. - CHANGELOG and comments without the double hyphen as a separator. Tests: the subset install (module not selected keeps its files, no modules and no repoRoot retire nothing), the managed roots carried by planInstallTargetScaffold, a second root on the apply side, and the content match for a renamed source. Proven on a real machine with a synthetic home: a full install followed by a minimal one retires nothing; a skill directory renamed in the package is listed by the dry run, removed by the apply, replaced by its new copy and recorded as such. Signed-off-by: Felipe Marzochi <fmarzochi@gmail.com>
… be read (Fmarzochi#1412) A sibling adapter sharing the root (codex, goose and openhands under ~/.agents) may still own a candidate destination. A sibling with no state file owns nothing; a sibling whose state exists but cannot be read or parsed may own any of them, so the planner now retires nothing until that state can be trusted again, instead of treating it as empty. Tests cover the absent, malformed and unreadable sibling states. Signed-off-by: Felipe Marzochi <fmarzochi@gmail.com>
…ngs to (Fmarzochi#1412) The linked-ancestor check bounded its walk by the target root, so a destination under a second root an adapter declares (Amp's plugin config directory) was only checked at the destination itself: a link planted above it in that root was never seen. The preflight and the apply now pick the managed root each destination falls under and walk that root; the legacy layout migration stays limited to the target root, where it lived, and a link under a second root is refused outright. Test covers the root lookup, the refusal and the empty migration list. Signed-off-by: Felipe Marzochi <fmarzochi@gmail.com>
…state absent (Fmarzochi#1412) The presence probe followed links and folded every lookup failure into "missing", so a dangling link at a sibling's state path, or a parent that cannot be inspected, read as no state at all and let retirement proceed. The path is now probed with lstat: nothing there is absent, anything else is a state that cannot be trusted and retires nothing. Tests cover the dangling link and the sealed parent. Signed-off-by: Felipe Marzochi <fmarzochi@gmail.com>
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.
Summary
Generalizes the OpenCode-only
planRetirementshook (added in Fmarzochi#1411) into a defaultplanGenericRetirementsthat every install target inherits. When a file leaves an install plan, the copy an earlier install wrote is now cleaned up on the next install/auto-update.Identity rules (from Fmarzochi#1411)
copy-fileoperations are diffed;merge-jsonandhookhave no retirement counterpart yet (open follow-up).planRetirements, unaffected by this change.Component Type
Validation
node tests/run-all.jspasses locally (install-targets suite: 150 tests, including 2 new).Checklist
Signed-off-by