fix(generate): tighten the symlink-aware orphan sweep follow-ups from #3288 - #3297
Merged
Merged
Conversation
…3288 - Keep a refused skill directory that leads out of the output root out of the generated-tree claims, so a .claude/skills/foo -> $HOME link no longer silences every --delete sweep in the run. - Warn once when a sweep keeps a candidate because its links cannot be followed (a cycle or an unreadable directory). - Document that isGenerated compares paths lexically only and must not decide deletions, and that symlinked orphans landing on a claim are kept. - Read getPath once per item in rejectClaimed and comment on the cost of following every claim. - Test the cycle branch, landing-claim cache invalidation, and the kept symlinked orphan. Refs #3294 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
…he root A skill directory linked onto the output root itself (for example ~/.claude/skills/foo -> ~ in global mode) passed the escape check and still claimed the whole root. Require the landing to be strictly below the root, and cover both the outside and the root case in e2e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj
Owner
Author
|
@dyoshikawa Thank you! |
This was referenced Oct 3, 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.
Summary
Follow-ups 1-6 from #3294 (the non-blocking review notes on #3288). Item 7, the deletion through a symlinked output directory, is fixed separately in #3295.
OrphanSweepPlanand covered by a test.createOrphanSweepPlan({ logger })now warnsRefusing to sweep "<path>": its symbolic links cannot be followed (a link cycle or an unreadable directory), once per path.a -> b,b -> acycle branch, and for landing-claim cache invalidation afterrejectClaimedhas already run, for bothregisterGeneratedandregisterGeneratedTree. Both cache tests fail when thelandingClaims = undefinedlines are removed.isGeneratedrejectClaimed/isGeneratedExactly. It is still public becauserejectClaimedand the existing tests use it.rejectClaimedreadsgetPath(item)once. Added a comment on the cost of the one unboundedPromise.allingetLandingClaims.--deleteprocessDirFeatureGenerationno longer registers a tree claim for a directory whose path leads out of the output root, whichwriteAiDirsrefuses to write anyway. Before this,.claude/skills/review -> <parent of project>claimed the whole parent tree, so.claude/commands/stale.mdsurvivedgenerate --delete. A new e2e test ine2e-skills.spec.tsfails onmainand passes here. The lexical claim on the directory path itself is unchanged.Verification
pnpm cicheckandpnpm cicheck:contentpass locally.Refs #3294
🤖 Generated with Claude Code
https://claude.ai/code/session_01Y4MwhqMc6s4ct5MzMReGJj