feat(models): pharn-oss owns the models block — init copies it, update migrates it, status labels it - #231
Merged
Conversation
…e migrates it, status labels it Roadmap Phase 2.0. The CLI hardcoded its own `models` default (ids `opus-4-8`/`sonnet-5`/…, a top-level `default`) that pharn-oss's own checker REDs three times, that `claude --model sonnet-5` rejects, and that disagreed with the installed command frontmatter. - pharn-oss now owns the `models` schema and defaults (CLAUDE.md amended). `init` copies pharn-oss's root `models` block verbatim — none when it ships none — checked at the ingest boundary. - The CLI's MODEL_IDS / EFFORT_LEVELS / PIPELINE_STAGES are retired. `lib/model-config.ts` is a copy of pharn-oss's `check-model-config.mjs` validate/resolve rules, pinned by `tests/model-config-parity.test.ts` against the vendored checker (sha256, constants read from its source, 93-case verdict + RED-line + resolve parity). A copy, not a call: the CLI never executes a file it installs (THREAT-MODEL §1). - `update` decides the block with the per-file rows (`decideFileAction`, over the block's hash, recorded as `pharn.config.json#/models`): absent → restored, pharn's (record or an old default) → updated, the user's → kept, `--force` → config backed up, then replaced. An edited pre-0.7.0 block is converted (default → stages.default, old ids → aliases), never reset; anything unconvertible is named and left as is. The migration reaches current installs; the gate is bounded. - `status` and `init` show every product stage resolved, under a truthful label: Claude Code applies each command's frontmatter; the block is the source of truth it is held to. - `readPharnConfig` no longer validates `models`, so no command refuses to run over a block this CLI does not own. Pipeline: .dev/features/models-pharn-oss-owned/ (PLAN, GRILL, REGRESSION, VERIFY, REVIEW, SHIP). Floor verdicts (iteration 2): validate=0, regress=no-regressions, verify=PASS, check-ship=STOP_GREEN. GATE 1 and GATE 2 were decided by the model under the maintainer's delegation of 2026-09-25. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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 |
picocolors enables color when CI is set, so pc.dim's escape codes counted toward the 70-column bound and a 62-column line read as 71. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Roadmap Phase 2.0 (token-reduction roadmap, approved by the maintainer 2026-09-25).
Why
Pre-check P2 found three things wrong with the
modelsblockpharn initwrote (hardcoded insrc/lib/model-routing.ts):pharn/floor/check-model-config.mjs, REDs it three times: nodefaultinsidestages, andopus-4-8is not an accepted model. Re-measured against pharn-ossmain@767bf61.claude --model sonnet-5→ 404unrecognized_model.opus-4-8 · max, where the command saysopus/high.Decision: pharn-oss owns the
modelsschemaCLAUDE.mdis amended: the CLI still owns thepharn.config.jsonschema — for every key exceptmodels.What changed
initcopies pharn-oss's rootpharn.config.jsonmodelsblock verbatim. If upstream ships none, it writes none. If the block fails pharn-oss's rules, it writes none and says why. The block is checked at the ingest boundary and recorded inpharn.records.jsonunderpharn.config.json#/models.Validation: the CLI's
MODEL_IDS/EFFORT_LEVELS/PIPELINE_STAGESare gone.src/lib/model-config.tsis a copy of pharn-oss's checker'svalidate/resolverules.tests/model-config-parity.test.tspins it to the vendored checker: a sha256 pin, the stage/alias/regex/effort sets read out of its source, and verdict + RED-line + resolve parity over a 93-case corpus that must reach every validate-path RED kind.status --strictruns in CI on PRs, and atinitthe only checker is inside the untrusted clone.updatedecides the block through the per-file rows. It callsdecideFileActionover the block's hash:--force→pharn.config.jsonbacked up, then replaced.An edited old-format block is converted, not reset:
default→stages.default, andopus-4-8/sonnet-5/fable-5/haiku-4-5→opus/sonnet/fable/haiku. Anything unconvertible is named and left as is. The migration reaches installs already at the current skills version, and the gate is bounded. A kept block never withholds the version.status(and theinitsummary) shows every product stage resolved, under a truthful label: Claude Code applies each command's frontmatter, and the block is the source of truth that frontmatter is held to (check-model-config.mjs agreement). It no longer presents the block as routing.Config loading:
readPharnConfigno longer validatesmodels, so no command refuses to run over it.Docs (
pharn-config,pharn-records,init/update/status/add/list, roadmap, troubleshooting, contributing),CLAUDE.mdandCHANGELOG.mdupdated.Verification
/pharn-dev-shipchain, 2 iterations:validateexit 0, regressno-regressions, verifyPASS,check-shipSTOP_GREEN. Artifacts:.dev/features/models-pharn-oss-owned/.npm run checkgreen; coverage 97.61 / 93.32 / 98.43 / 98.44.main, from a project holding the 0.6.0 default:pharn update --yesreplaced the block;check-model-config.mjsthen passedvalidate(12 stages) andagreement(11/11 product stages);Gates
GATE 1 (plan) and GATE 2 (fix, then merge) were decided by the model under the maintainer's delegation of 2026-09-25, recorded as such in
SHIP.md. They are not human approvals.For the maintainer — human-only reconciliations (protected docs, not edited)
CONSTITUTION.mdP3: "this CLI owns thepharn.config.jsonschema" is now true for every key exceptmodels.THREAT-MODEL.md§3.1:modelsis listed among the local-origin fields. It is now a fourth network-derived field, validated at ingest bycheckModelsBlock.pharn-oss should raise
MIN_CLIto 0.7.0 only after npm has 0.7.0.🤖 Generated with Claude Code