feat(cli): DX, evidence & hardening — uniform --json, broader doctor, eval harness (Tranche D)#20
Merged
CodeWithJuber merged 1 commit intoJul 6, 2026
Conversation
… eval harness (Tranche D) - Uniform --json: doctor/route/preflight/verify/scope now emit machine-readable output (were human-only), so CI/scripts can gate on them. - forge doctor sees more silent misconfiguration: guard scripts present AND executable; jq/git availability (guards degrade without jq); atlas presence + freshness (stale graph misleads impact/verify); model-pricing staleness (>90d). - Evaluation harness (src/eval.js): the deterministic core of the prototype's mutation-testing idea — precision/recall/F1 of the impact oracle vs the edited-file-only baseline, checkable in CI. - model_tiers exports PRICING_CURRENCY + PRICING_VERIFIED (doctor uses the date). - One shared call-site extractor (src/extract.js): atlas.js and verify.js each kept a copy of the call regex + builtins ignore-list; now a single source so they can't drift. Deeper shell-guard fail-open hardening (rewriting protect-paths/secret-redact to avoid the no-jq degrade) is surfaced via the new doctor jq warning; a full jq-free parse rewrite is deferred as too fragile to do safely here. 222 tests pass (+4), typecheck + Biome clean, zero new runtime deps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HGZUYFdUb4EViXV5tRid19
CodeWithJuber
marked this pull request as ready for review
July 6, 2026 09:13
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 & why
Tranche D — developer-experience, evidence, and hardening from the review.
Uniform
--jsondoctor,route,preflight,verify, andscopenow accept--json(onlyimpact/substrate/anchordid before). CI and scripts can now gate on the health check, therouted tier, the assumption gap, and the verification result — not just parse human text.
forge doctorcatches more silent misconfigurationNew checks, each targeting a real "it silently stopped working" failure mode:
+xguard makes a hook silently no-op),jq/gitavailability (several guards degrade withoutjq— this surfaces the risk theaudit flagged for
secret-redact/protect-paths),Evaluation harness (
src/eval.js)The deterministic core of the Python prototype's mutation-testing idea, brought into the JS
runtime so the graph-quality claim is checkable in CI: score the impact oracle's
precision/recall/F1 over labeled cases and against the edited-file-only baseline the paper
measured against. A test asserts the oracle out-recalls the baseline on a fixture.
Smaller quality wins
model_tiersexportsPRICING_CURRENCY("USD") +PRICING_VERIFIED(the datedoctorchecks). The
haikuid already matched the canonical dated form, so no id change was needed.src/extract.js) —atlas.jsandverify.jseach kept acopy of the call regex + builtins ignore-list; they now share one module so they can't drift.
On the deeper guard hardening — scoped honestly
The audit flagged
protect-paths/secret-redactfail-open withoutjq. Rewriting their shellparsing to be safe without
jqis fragile to do correctly, so this PR surfaces the risk loudly(the new
doctorjqwarning) and defers the full jq-free rewrite rather than shipping a shaky one.Checklist
npm testpasses (Node 18/20/22) — 222 tests (+4)npm run checkpasses (Biome lint + format)eval, shared extractor, doctor checks)feat:)CHANGELOG.mdupdated under## [Unreleased]--jsonsurfaces)Risk & rollback
--jsonis additive; the doctor checks only report; the sharedextractor is behaviour-preserving (atlas keeps its own builtins;
CALL_REis identical).Extra checks
npm run typecheckpassesVerification
Full suite + typecheck + Biome green. Manual:
forge doctor --jsonlists the 14 checks incl.guards exec/jq/atlas/model pricing;forge route "…" --jsonemits the route object.evalunit test confirms oracle recall ≥ edited-file-only baseline on a fixture.Last up: Tranche E (visual docs treatment).
🤖 Generated with Claude Code
https://claude.ai/code/session_01HGZUYFdUb4EViXV5tRid19
Generated by Claude Code