feat: suit off cleans up injected components (+ --keep-injected)#73
Merged
Conversation
suit off iterated only the up-applied files[] and then deleted the lockfile, orphaning any inject-recorded files on disk — fatal for an inject-only lockfile (files:[], injected:[...]) created when a worker was launched via stateless prepare. - extract detectDrift() + removeTrackedFile() + RemovalState so up-applied and injected files traverse one removal contract (drift scan, additive block-strip, replace unlink, dir-prune, tallies) - default off now removes injected files too, then deletes the lockfile - --keep-injected: remove only up files, preserve injected files on disk, rewrite the lockfile with files:[] + reset resolution + injected intact; degrades to a full off when there are no injected entries - off now accepts --project/--home <dir> (was cwd-only), matching current Lifecycle verified end-to-end: inject -> off --keep-injected (preserves) -> off (clean teardown, no orphans).
This was referenced May 25, 2026
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.
Increment 2 of
suit inject(follows #66). Closes the inject lifecycle: you could inject a component but not cleanly remove it.The bug
suit offiterated only theup-appliedfiles[]then deleted the lockfile — orphaning anyinject-recorded files on disk. Fatal for an inject-only lockfile (files: [],injected: [...]), which is exactly whatsuit injectcreates when a worker was launched via statelessprepare.Fix
detectDrift()+removeTrackedFile()+ a sharedRemovalStateso up-applied and injected files flow through one removal contract (drift scan, additive marker-block strip, replace unlink, empty-dir prune, tallies). No copy-paste.suit offnow removes injected files too, then deletes the lockfile.--keep-injected: removes only the up-applied files, leaves injected files on disk, and rewrites (rather than deletes) the lockfile withfiles: []+ resetresolution+ theinjectedlist preserved. Degrades to a normal fulloffwhen there are no injected entries.suit offnow accepts--project/--home <dir>(was cwd-only), matching thecurrentparsing added in feat: suit inject — realtime component injection (proposal + increment 1) #66 — needed because inject targets a worker home, not cwd.Verification
npm run typecheck,npm run build,npm test→ 625 tests pass (+7 new: both up+injected, inject-only orphan fix, injected drift refuse/force, additive strip, additive empty-delete, keep-injected, keep-injected-without-injected).inject philosophy(174 files) →off --keep-injected(removes 0 up, keeps 173 injected, lockfile retained) →off(removes 173 injected, lockfile gone, 0 files left — no orphans).Next increments (deferred, per the multi-session plan)
--skill/--hooksugar (needs a non-name-based resolve path)--targetdiscovery — flagged: introduces NATS into a currently NATS-free suit, an architecture decision to confirm before building