Repository navigation
feat(review): findings-only review contract; verdict derives approval - #189
Conversation
`review.json` becomes a findings-only handoff inside `schema_version` `"1"`:
every finding carries `path`, a strict integer `line`, `severity`, `claim`,
`quote` and `confidence`, with optional `start_line`, `side`, `rigor`,
`category`, `suggestion`, `brief`, `sources` and `kb`. `spec_checks[]` and
`receipts[]` reserve the evidence the verifier slice will enforce, and
`summary` carries at most 2000 characters of prose.
- The document is closed. `approved`, `body`, `comments[]`, `sections[]` and a
top-level `confidence` are no longer published, so an old file refuses
through the ordinary unknown-field and missing-`findings` problems; there is
no dedicated detector, repair hint or shim.
- Verdict renders the body from the findings: `claim` is stored as the finding
body, `confidence` as `finder_confidence`, and every fresh finding records
`verification.quote` as `unchecked`. `inBounds` is derived from the pinned
hunks instead of being claimed.
- Approval is verdict-derived (`internal/core/approval`): any open, visible
finding at `important` or above whose quote standing is not `unverified`
withholds, as does a violated spec check. `record` decides once and stores
the receipt in `record.json` beside the `review_sha256` it decided on, the
rendered body's lead follows that same decision, and `post` publishes the
stored decision instead of reading `review.approved` — refusing
`record-stale` when the review, diff, or head moved after the record rather
than deciding again over a review nobody recorded.
- New store fields: `FindingEntry.quote`/`finder_confidence`, a typed
`verification` object, plus `approval`, `spec_checks` and `receipts` on the
record. Additive for readers; the review input is the breaking half.
- The dry run's `data.check` counts `findings` and `anchors_moved_to_body`
instead of the old `comments`/`sections` pair.
- `schemas/review.schema.json` is regenerated closed, the envelope carries the
new definitions, and the TypeScript envelope types follow.
- No new `//nolint`: the store entry's `category`, `status` and `source`
closed lists move to the schemagen overlay (the widest tag was widening the
column past the line limit for seven neighbours), `Comment` and `SectionTag`
go with `comments[]`/`sections[]`, and the review-complexity splits are
structural. `Finding`, `SpecEvidence` and `ApprovalReceipt` order their
fields the way the field-alignment analyzer requires, so the generated
property order changes with no value, type, enum or required key moving.
- Size: darwin/amd64 17,827,744 B, darwin/arm64 16,220,546 B, linux/amd64
17,518,752 B, linux/arm64 15,859,872 B, windows/amd64 17,914,368 B,
windows/arm64 15,973,888 B. The ceilings hold at 17830000, 17520000,
15870000, 17920000, 15980000; darwin/arm64 crossed its first line, so it
moves one 10 kB step to 16230000.
Review of the first cut fixed four regressions it shipped: the sweep had
rewritten `cost.json`'s `schema_version` to `"1"` in `review.md` and
`PROCEDURE.md` (the cost record is `2`), left the agent-facing messages
naming the retired `{body, approved, comments[]}` shape, dropped the
`rigor-unset` warning for a finding with no rung, and let the self-review
recipe keep reading `comments` so its retry never fired — with the eval then
rewritten to assert the broken stop. The checker also now counts `summary`
in runes as the schema's `maxLength` does and refuses an empty `claim`,
`quote`, `spec_checks[].item` or receipt string, and the TS client fixtures
plus the bench loop fixtures write the findings shape.
Rebased onto #187's backtest fixtures (13 commits). Two conflicts: the
archtest core-subpackage list and facade allowlist needed `quality` from #187
alongside `approval` and `reviewdoc`, and `scripts/size-baseline.txt` keeps
main's ratchet as the base the numbers above move past.
Do not release this slice before S4 verifies quotes and receipt coverage.
🦋 Changeset detectedLatest commit: 883295b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedToo many files! This PR contains 349 files, which is 249 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files.
|
Summary
review.jsonbecomes a findings-only contract, and verdict derives approval. No model's approval bias reaches the gate any more. This is STA-452, S1 of STA-443 (see the spec doc "evidence-checked review handoff").pack test, the run/stage directive, the shipped prompts, the SDK/TS client, the self-review recipe.basis-replacedis retired (the agent writes no body).//nolintgoes 798 → 773. The new enum lists live in the schemagen overlay, not in struct tags.Evidence
record→postrefusesrecord-stale.bad-review-inputpath. There is no v1 detector (pre-v1, no compat).rigor-unsetstill warns;summaryis counted in runes;claim/quoteis refused;cost.jsonstays"2".rung→rigor,file→path) stay, by design.938bc6d1d, all exit 0:make test-racemake evals(143 passed)make vet(native and Windows)make deadcodemake crossschemas-checkts-types-checkclients-tsmake sizegofmtMerge Danger
Door: two-way in code, but do not release this alone. Until S4 (STA-456) adds proof-of-reading receipts, a findings-free review derives approval. The changeset says so.
Blast Radius: review-contract. Every agent, prompt, SDK and fixture that writes
review.jsonchanges shape (333 files, mostly migrated fixtures and goldens). Binary size budgets moved one 10 kB step, with the measurements in the commit.