2026-06-22 · Architecture

We deleted a magic number

Our hallucination guardrail stopped reading a fixed 150 tokens before generating. It now starts at 40, checks for grounding, and reads more only when it's unsure — confident hits settle in 40, hard cases read further, the initial budget is still configured, while subsequent retrieval can vary.

That's portioned output: emit one portion, check if it's enough, take more only if it isn't, stop the moment it is. The total isn't a setting — it's whatever the task turned out to need.

The same shape fits anything that ships a fixed amount. Read the first 150 tokens. Return 20 rows per page. Buffer 4 KB. Summarize to 500 words. Each is a guess frozen into code — too big for the small case, too small for the big one. A feedback loop can make the amount adaptive. It still needs stopping rules, bounds and a cost budget; not every fixed limit should be removed.

This is the implementation described in ADR-157 for the June 2026 snapshot. The public distribution excludes some internal records, so an internal ADR number is not itself a public source.


Correction · 29 September 2026: Kept the historical engineering example and removed the claim that adaptive retrieval eliminates configured constants or makes all internal ADRs public.

Learn more →