Skip to content

feat(install-targets): generic plan-diff retirement for all install targets - #3

Open
kunaaaalcodes wants to merge 2 commits into
mainfrom
feat/generic-plan-retirements
Open

kunaaaalcodes wants to merge 2 commits into
mainfrom
feat/generic-plan-retirements

Conversation

@kunaaaalcodes

Copy link
Copy Markdown
Owner

Summary

Extends the plan-diff retirement mechanism from OpenCode-only (Fmarzochi#1411) to every install target. When a file leaves an install plan, the copy an earlier install wrote is cleaned up on the next install/auto-update.

Problem

PR Fmarzochi#1411 added \planRetirements\ to the OpenCode adapter, but every other install target (Cursor, Windsurf, Claude, Copilot, Kiro, etc.) had \planRetirements: () => []\ as a no-op default. Files copied to non-EGC-managed destinations accumulate silently when modules are deselected or plans change.

What Changed

  • **\scripts/lib/install-targets/helpers.js**: Added \planGenericRetirements(), \collectCurrentlyCoveredDestinations(), and \isDestinationCovered(). Updated the default \planRetirements\ in \createInstallTargetAdapter\ to call \planGenericRetirements\ instead of returning [].
  • **\scripts/lib/install-targets/registry.js**: Passes precomputed \operations\ into \planRetirements()\ to avoid redundant planning.
  • **\scripts/lib/install-lifecycle.js**: Clarifying comment on \pruneOrphanedOperations\ explaining the split between source-gone pruning and plan-diff retirement.
  • **\ ests/lib/install-targets.test.js**: 2 new tests — generic default retirement + directory scaffold shielding.
  • *\CHANGELOG.md* + **\docs/ROADMAP.md**: Entries added.

Identity Rules

The same identity rules from Fmarzochi#1411 apply: only regular files, no linked ancestor, byte-identical to the source EGC copied, are actually deleted (enforced by \�pply.js's \isRetirableFile). Sources no longer in the repository are left in place (report-and-leave). Only \copy-file\ operations are diffed; \merge-json\ and \hook\ have no retirement counterpart yet (open follow-up).

Validation

  • All 150 install-targets tests pass (2 new tests added)
  • ESLint clean (0 errors)
  • CHANGELOG.md and docs/ROADMAP.md follow existing format

…argets (Fmarzochi#1412)

Extend the plan-diff retirement mechanism from OpenCode-only (Fmarzochi#1411) to
every install target. When a file leaves an install plan, the copy an
earlier install wrote is cleaned up on the next install/auto-update.

Changes:
- Add planGenericRetirements(), collectCurrentlyCoveredDestinations(),
  and isDestinationCovered() helpers to install-targets/helpers.js
- Update the default planRetirements in createInstallTargetAdapter to
  call planGenericRetirements instead of returning []
- Pass precomputed operations into planRetirements in registry.js to
  avoid redundant planning
- Add clarifying comment to install-lifecycle.js explaining the split
  between pruneOrphanedOperations and planGenericRetirements
- Add 2 new tests: generic retirement and directory scaffold shielding
- Update CHANGELOG.md and docs/ROADMAP.md

Signed-off-by: Kunal Jaiswal <rajputkunal5675@gmail.com>
@kunaaaalcodes

Copy link
Copy Markdown
Owner Author

I have read the CLA Document and I hereby sign the CLA.

@github-actions

Copy link
Copy Markdown

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.


I have read the CLA Document and I hereby sign the CLA.


Kunal Jaiswal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@kunaaaalcodes

Copy link
Copy Markdown
Owner Author

recheck

@kunaaaalcodes

Copy link
Copy Markdown
Owner Author

I have read the CLA Document and I hereby sign the CLA.

@kunaaaalcodes

Copy link
Copy Markdown
Owner Author

recheck

1 similar comment
@kunaaaalcodes

Copy link
Copy Markdown
Owner Author

recheck

…8.30

Move @opencode-ai/plugin from peerDependencies to dependencies and update
the lockfile to the restored plugin dependency graph.

Signed-off-by: Kunal Jaiswal <rajputkunal5675@gmail.com>
@kunaaaalcodes

Copy link
Copy Markdown
Owner Author

recheck

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