fix(add): accept the version a user-edit-withheld update applied (PHARN-05) - #199
Merged
Merged
Conversation
…RN-05) One kept local edit dead-ended `pharn add`: `update` withholds the skillsVersion bump while any file is skipped, so a user keeping an edit could never finish the upgrade, and `add`'s version gate kept sending them back to `pharn update` in a loop. When `update` withholds the bump SOLELY because of `modified`/`unrecorded` skips (the user's own edits — every other file is at the new version), it now records `pendingSkillsVersion` (additive, VERSION_RE-validated, cleared by the next complete run). `add` accepts a clone at that version while keeping the config's own (skillsVersion, commit) pair, so it never claims an upgrade the kept edits did not get and the records stamp stays consistent. Other skip kinds still refuse, and the refusal now names the real ways out. 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.
What this changes
Keeping a single local edit could block
pharn addfor good.Reproduced:
initat 6.11.1, then edit one file locally.update --yesto 6.17.1, twice. Each run reports "skipped 1" and the config stays at 6.11.1.pharn add a11yexits 1: "Skills version mismatch … runpharn updatefirst". Runningpharn updateagain changes nothing, so the advice loops.The fix:
update: when the only skipped files are the user's own edits (modified/unrecorded), every other file is already at the new version.updatenow records that version inpharn.config.jsonaspendingSkillsVersion. It is a new optional field, validated againstVERSION_REwhen the config is read. The next completeupdateremoves it. Other skip kinds (unverifiable,unreadable) can leave most of the project on the old version, so they do not record it.add: accepts a clone atpendingSkillsVersion. In that case it keeps the config's existingskillsVersionandcommit(addStamp), and stamps the records file with the same pair. Soaddnever claims an upgrade that the user's edited files did not receive.addstill never raisesskillsVersion.addstill refuses, it now names the options that actually work: revert the edits, or runupdate --force(which backs them up first).docs/commands/add.md,docs/reference/pharn-config.mdandCLAUDE.mdupdated.Built with
/pharn-dev-ship; stage artifacts are in.dev/features/add-after-withheld-update/. Results:no-regressionsPASSType of change
feat— new stack option, wizard step, or command capabilityfix— bug fixdocs— docs-only changechore/refactor— tooling or internal restructure, no behavior changeArea(s) touched
types | lib/pharn-config | commands/update, add | docs
Checklist
.js-extension import convention.docs/pages.Quality gates
npm run checkpasses locally (1332/1332; non-root user, node 22).npm run buildsucceeds (left to CI).npm run test:coveragepasses (left to CI).Notes for the reviewer
The main thing to check is that
addkeeps the existing version and commit when it installs atpendingSkillsVersion. The plan review (grill) caught thataddwould otherwise record the clone's newer version and commit, hiding the unfinished upgrade.🤖 Generated with Claude Code
https://claude.ai/code/session_01TvcuVhk8hTeDskp5pAJhnc
Generated by Claude Code