Skip to content

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

Closed
kunaaaalcodes wants to merge 1 commit into
mainfrom
feat/generic-plan-retirements
Closed

kunaaaalcodes wants to merge 1 commit 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)

Signed-off-by: Kunal Jaiswal <jaiswalkunal786@gmail.com>
@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

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

@kunaaaalcodes
kunaaaalcodes deleted the feat/generic-plan-retirements branch September 11, 2026 12:09
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