feat(lab): per-file grep budget + coding_markdown_v5 arm
head_limit was a single corpus-global row accumulator spent in document order, so one verbose early file drained the whole allowance and every later file emitted nothing. Measured on the 2026-08-06 CoC run: the model worked around the starvation by re-issuing one fixed pattern 14 times, one path= per file, across 4 rounds - 469.5k logical input where the same bytes in one round cost 258.2k. Round count is the multiplier (confirmed twice: opus-5 did 32 calls in the same 8 rounds for the same logical input), so fair allocation here is a round-trip lever, not formatting. MIKE_GREP_PER_FILE_BUDGET renders each file into its own bucket and splits head_limit max-min fair after the sweep, once the matching-file count is known: files wanting less than an even share release the surplus, so a corpus where only three files match still spends the full budget on those three. The corpus sweep is never cut short, and truncated buckets are trimmed back to their last real content row so a dangling section-lead never reads as a match with no body. The v5 Grep description states the new semantics - a model that still reads head_limit as a first-come cap keeps paying for the per-path greps the mechanism removes. v5 = v4 + this one flag; system-prompt sha is identical to v4 and only tool_schema_sha256 moves, so the contrast has one lever. Frozen arms clear the flag explicitly and assert it in conformance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011pfUVhNFTRvhYGXBwoKNj6
| Repository | eliziff/Beaver |
|---|---|
| Author | Eli Ziff <eliasziff@gmail.com> |
| Authored | |
| Parents | a4b70616 |
| Stats | 4 files changed , +246 , -32 |
| Part of | Evaluation harness: Beaver-CAN and LegalBench-RAG adapters |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-359945d6.md
from inside the repo you want the change in.