TokenBudget
@forge/monorepo / backend/src / TokenBudget
Type Alias: TokenBudget
TokenBudget =
object
Defined in: backend/src/core/budget.ts:19
A token ceiling on a catalogue, and the rule that truncation is never quiet — REQ-045 (#204), task #210.
The tool catalogue and the skill catalogue have the same problem: a compact entry per item, resident on every turn, linear in how many exist. #221 measured ~35 tokens per tool entry, so 200 tools is ~7,000 tokens before a word of the conversation. Two-tier loading bounded the schemas and left the entries.
Truncation must be loud, and this is the whole guarantee
A silently shortened catalogue is indistinguishable from correct behaviour. The model is not told an item was withheld; it simply never uses it, and the transcript reads as a run where the model chose not to. Nobody reviewing that run has anything to notice. So dropping is never quiet: the outcome names every dropped item, the engine turns that into a run event, and #210's AC-7 is a test that removing the event fails the build.
In core/ because both callers need it and neither owns it — and because a second copy for skills would drift
from the first, which is the shape this repository keeps finding defects in.
Properties
maxTokens
readonlymaxTokens:number
Defined in: backend/src/core/budget.ts:21
The ceiling. A catalogue at or under it is untouched and no event is emitted.