Skip to content

critic: judge a long test file in batches of 20, so its schema fits - #381

Merged
pdbethke merged 1 commit into
mainfrom
fix/critic-batches
Oct 6, 2026
Merged

pdbethke merged 1 commit into
mainfrom
fix/critic-batches

Conversation

@pdbethke

@pdbethke pdbethke commented Oct 6, 2026

Copy link
Copy Markdown
Owner

rc.17's keyed schema put every test's name in one schema. On flask's tests/test_basic.py (about 90 tests), both providers refused it: Haiku past 20 names, with "compiled grammar is too large", and Gemini at 90. The critic then fell to the loop: 9 calls and 295k input.

The fix: lists longer than 20 are judged in batches of at most 20 names. Each batch has its own schema and its own retry, and their findings are joined. If a batch still won't answer, the whole file goes to the loop.

Measured on the same flask files (docs/design/critic-bench.md §9): Haiku and Gemini each judged all 90 tests in 5 calls, using 187k and 168k input.

VerdictGeneration 14 → 15. The full suite, vet, gofmt, security, licensing, CLI-docs and publication gates pass.

🤖 Generated with Claude Code

rc.17 put every listed test's name in one answer schema. A paid certify run
on flask showed what that does to a real file: tests/test_basic.py declares
about 90 tests, the critic seat made 9 calls on 295k input tokens, and it
had fallen to the loop. Probed directly, claude-haiku-4-5 refuses a keyed
schema of 40 names ("The compiled grammar is too large") and gemini-3.8-flash
refuses 90 with a bare 400; both accept 20. Size, not the pytest-style
names, was the cause.

A list longer than criticBatchSize (20) is now split: each batch carries the
whole code and test file but lists only its own tests, gets its own keyed
schema and its own retry, and the batches' findings are joined. A batch that
still will not answer sends the whole file to the loop, and the batches that
did answer are not kept beside it as a review of their own. On the same
flask files, through the production seat, both Haiku and Gemini judged all
90 tests in 5 calls (187k and 168k input).

VerdictGeneration moves 14 to 15. The bench doc records the probes and the
flask result as section 9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pdbethke
pdbethke merged commit ffbda55 into main Oct 6, 2026
5 checks passed
@pdbethke
pdbethke deleted the fix/critic-batches branch October 6, 2026 22:06
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant