Repository navigation
fix(setup): retain symlinked data roots during uninstall - #1821
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
Owner
|
Protecting data beneath a linked |
2 tasks done
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
Fixes #1816.
rea uninstall --purge-datafollowed a symlink at~/.reaand deleted the target'scacheandstatedirectories. Validate the managed data root before inspecting either child, retaining linked roots and their target data.Problem and expected behavior
When
.realinks to an unrelated directory containingcache/andstate/, checking only the children withlstatsees ordinary directories and permits recursive deletion. The documented uninstall contract preserves symlinks and unknown paths; the managed root must satisfy that contract too, including dangling links.Change and scope
The shared uninstall host checks
.reawith its existinglstatboundary before purging either child. Linked or non-directory roots retain both entries; missing roots skip them; inspection errors fail both entries without deletion. Ordinary roots continue through the existing leaf checks. Legitimate HOME directory links remain supported.Contract and boundary impact
retained,skipped, andfailedstatuses for rejected or unavailable roots.Evidence and regression coverage
f178bf1c; the CLI reported the target's cache and state as removed, and both sentinels were deleted.{"status":"complete","items":[{"name":"cache","status":"retained"},{"name":"state","status":"retained"}]}.Evidence-bearing analysis outputs are not changed by this PR.
Validation performed
npm run test:focused -- tests/boundary/filesystem/clientLifecycle.test.ts tests/boundary/cli/clientProfileLifecycle.test.ts— 52/52 passed.npm run check— passed (repository lint reports warnings but no errors).npm run verify:package— passed, including setup/uninstall, package update, CLI, and MCP checks. The first attempt hit the host proxy when connecting to the local registry fixture; rerunning withNO_PROXY,no_proxy, andnpm_config_noproxyset to127.0.0.1,localhost,::1passed. No repository workaround was added.npm pack --dry-run— passed.git diff --check— passed.Compatibility, safety, and release
Review checklist
type(scope): outcome.