fix(init): refuse a file/directory collision before the first write (PHARN-16) - #210
Merged
Merged
Conversation
…PHARN-16) A directory where init writes a file (or a file where it needs a directory) used to surface from cpSync part-way, leaving ~300 new files with no pharn.config.json and no records. The destination pre-flight now also walks every manifest path's component TYPES (findTypeCollision, beside findSymlinkComponent in symlink-guard.ts) and refuses the whole install, naming each collision. The optional features/README.md keeps its skip-on-collision contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TvcuVhk8hTeDskp5pAJhnc
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Problem
A directory where
initwrites a file (e.g..claude/commands/pharn-spec.md/), or a file where it needs a directory, madecpSyncfail part-way through the install. The project was left with about 300 new files, nopharn.config.json, and no records.Fix
installCapabilitiesnow also checks entry types for every path in the install manifest..claude/settings.jsonis left out of the check, since init never overwrites it.features/README.mdkeeps its skip-on-collision behaviour. A directory there is now skipped; the old code threw.findTypeCollisionlives insymlink-guard.tsnext tofindSymlinkComponent, becausetests/symlink-guard.test.tsrequires every path-component walk to be in that module. That was a plan amendment, approved by the user.docs/troubleshooting.md.Tests
features/README.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01TvcuVhk8hTeDskp5pAJhnc
Generated by Claude Code