feat(code-review): review non-application files + three TestQuality shapes - #183
mikeangstadt wants to merge 2 commits into
Conversation
…hapes Extends the shared reviewer prompt to cover CI/pipeline definitions, guard and meta-test scripts, migrations, and docs/API specs, plus the wiring-unproven, assertion-of-existence, and input-invariant-fixture TestQuality shapes. Prompt-only: no dispatch, roster, or schema change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
wongk
left a comment
There was a problem hiding this comment.
this adds explicit things to review to the shared reviewer prompt, rather than assigning these things to specific reviewers. this means every review agent is going to duplicate these reviews, and it will dilute the agent-specific review areas.
|
Beginning a code-review. Please allow time for me to finish before merging the PR |
Merge resolution (two conflicts, both "both sides appended at the top"):
- CHANGELOG.md: kept every main entry (v3.10.0 / v3.9.0 / v3.8.1 / v3.8.0)
and placed this branch's entry above them.
- plugin.json: main moved to 3.10.0 while this branch claimed 3.8.0, a
version main had already shipped. Resolved to 3.11.0, not either side.
Review-thread fixes, applied in the same commit because they rewrite the
same CHANGELOG region the merge resolved:
1. Routing (shafty023 #3786554000, wongk CHANGES_REQUESTED). The two
checklists no longer live in shared_prompt.txt, where every BHA
partition, BHB, auditor, design critic, impact analyzer and verifier
paid for them and was told to review outside its role. shared_prompt.txt
keeps only a <file_scope_classes> scope declaration, which is what the
reviewer allowed. Every defect class is preserved and moved, split by
whether it is decidable from the changed file:
- bha_suffix.txt (diff-local correctness): CI/pipeline, migrations,
guard-script shape, and the two test shapes readable in the test.
- The Bug Hunter B suffix in spawn-reviewers/SKILL.md (cross-file,
unpartitioned, standard + fast-path copies): pinned-file pair,
wiring-unproven, and docs/API-spec. No class was dropped.
2. Pinned-file-pair evidence bar (shafty023 #3786555873). A path reference
is no longer sufficient: the reviewer must quote the assertion whose
expected value the pinned file contradicts, and name both values. The
"not in the diff" inference is removed outright, because a partitioned
BHA worker sees only its own patch and cannot establish full-PR diff
membership. test_code_review_helpers.py:21401-21412 is exactly the false
positive the old text produced: it names plugin.json as fixture input
and asserts nothing about its version.
3. /fix routing (shafty023 #3786557414). The class emits
Correctness/pinned-file-pair, and skills/fix/SKILL.md routes that
subcategory to manual-surface with a new
templates/correctness_pinned_file_pair.md. Generic Correctness would
have hit the auto-fix row, whose drift check and edit both anchor on
finding.file — the changed config — so --apply would have reverted the
intended change. The companion test rides in the existing
other_locations[] field; no schema change.
4. CHANGELOG derivability (shafty023 #3786558809). Rewritten to the sources
.claude/commands/update-documentation.md allows. The corpus counts,
per-reviewer percentages, five-day window, and the token estimate under
a non-Keep-a-Changelog "#### Notes" heading are gone.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@wongk — your CHANGES_REQUESTED is addressed in 01e357f. You and @shafty023 (thread on The checklists are out of The assignment is split by whether the defect is decidable from the changed file:
No defect class was dropped. The auditor, design critic, impact analyzer, domain critics and verifier now carry the 17-line declaration and nothing outside their role. Also in that commit, from @shafty023's three other threads: the pinned-file-pair class now requires citing the contradicting assertion rather than a path reference (his Merged I have not dismissed your review — only you can. Re-review when you have a moment. |
Summary
Extends the shared reviewer prompt to cover the file classes the fleet currently does not review, plus three
TestQualityshapes that stay green while proving nothing.Prompt-only. All behavior lives in
tools/prompts/shared_prompt.txt, which every reviewer role loads. No dispatch, roster, category, or schema change; no new agent; no new stage.Why: the fleet's coverage is categorically absent outside application source
Measured against five days of one consuming repo — 2,617 original review comments (replies excluded) across 326 PRs, 2026-07-30 → 2026-08-04, attributed per reviewer agent:
.github/).tsx.tsThe fleet is strong where it is pointed and produces zero findings on four whole file classes. Those classes are 22% of the corpus and are carried almost entirely by other reviewer agents — so the capability gap is real, not a question of whether those files contain reviewable defects.
Note the limit of this measurement: it shows output, not cause. It does not by itself prove the reviewers would have found these defects if prompted — only that they are not reporting them today. If the zeros turn out to come from file-scope filtering in partitioning rather than from prompt silence, this PR is necessary but not sufficient, and the follow-up is in
derive-spawn-spec/partitioning rather than here.What changed
<non_application_files>— declares those files in scope and enumerates the generic defect classes per class, all repo-agnostic:Pinned-file pair detection — repos routinely hold meta-tests asserting another file's literal content (an action-version pin, a config snapshot, a required-context manifest, an allowlist). Reviewers now grep for a test referencing the changed path or a distinctive changed literal and report when that test exists but is not in the diff. Emitted as
Correctness, notCompanionChange, deliberately: it is a provable CI failure with a concrete assertion to cite, and it carries no rule-drivenreasoning_certificate— whichtemplates/companion_change.mdinterpolates and would render empty for an LLM-emitted finding.<test_quality>— three shapes, all generic:New
TestQualitysubcategories route to the existingtemplates/testquality_specialized.mdvia theTestQuality/*fallback row, so/code-review fixneeds no new template.Test plan
python3 -m pytest test_code_review_helpers.py test_code_review_schema.py— 1,286 passed, 0 failed.shared_prompt.txtcontent before editing it (the same rule this PR teaches): every test writes a synthetic prompt file totmp_path; the real file is only ever copied verbatim into the CR dir bycode_review_helpers.py:13719. No pinned-file pair broken..claude-plugin/plugin.jsonis bumped per release (.codex-plugin/plugin.jsontracks separately and was last touched by an unrelated commit), matching the v3.7.0 release commit's file set. Bumped 3.7.0 → 3.8.0 with a CHANGELOG entry.git diff --checkclean;plugin.jsonparses.Cost.
shared_prompt.txtgrows 317 → 409 lines (~17.5 KB → ~24 KB), about +1.6k input tokens per reviewer agent. It is identical across agents and stable across runs so it caches, but on a large fleet the uncached first-touch cost is real —/code-review costwill show the fleet-side delta.What could still break. Prompt additions can shift reviewer attention: a fleet told to review workflow YAML may spend budget there on PRs where the application diff mattered more, and the new heuristics could produce false positives on repos whose CI conventions differ (a deliberate
cancel-in-progress, an intentionally broad allowlist). The existing FLAG criteria and the verifier pass both still apply, and every new heuristic requires a concrete file:line, so these should surface as verifier-refuted rather than shipped — but the first few runs on a CI-heavy PR are worth watching.