Failure scenario
The current budget requirements describe a halt after cumulative spend exceeds a cap. In a concurrent fleet, multiple agents can observe remaining budget and start model calls before the governor's next poll. Their combined in-flight cost can overshoot an operator's supposed hard ceiling by several calls.
Accounting and yield behavior are also not deterministic enough for independent implementations to agree:
- “cumulative wall-clock runtime” does not say whether pauses are excluded or concurrent agent time is summed;
- retries, failed calls, cached/reasoning tokens, delayed provider cost, and pricing changes are not covered;
- the “fraction estimated” could mean fraction of calls or fraction of spend;
- the trailing window is denominated in spend while finding membership is timestamp-based, but the boundary algorithm is unspecified;
- stop and hot-reload transitions do not define whether new calls are admitted, how in-flight calls settle, or whether cumulative totals reset.
These gaps can produce cap overruns and make the dashboard, status command, and yield auto-stop disagree even when each implementation appears to satisfy the present text.
Constitutional alignment
- Principle V — The Provider Is The Rate Arbiter: budget admission is based only on an operator-authored spend cap. It is not a provider-rate or concurrency throttle, and it does not alter adaptive 429 handling.
- Principle VI — Coverage Before Yield: the four-part low-yield conjunction remains unchanged. The amendment only makes the spend-window calculation deterministic.
- Principle XI — Persist Atomically: reservations and settlements must be atomic/idempotent so concurrent callers cannot spend the same remaining budget.
The proposal does not match the prohibited “static internal cap below the provider quota” anti-pattern. A budget cap controls total authorized spend; a rate cap controls call throughput.
Amendment level
FR-level amendment to spec.md §9.3–§9.4 and FR-128, with corresponding operational guidance, reference index, success criterion, and changelog updates. This is a MINOR spec change because it adds testable requirements and narrows implementation ambiguity without removing or inverting an FR.
Proposed FR diff
- Clarify FR-112 so runtime means active evaluation wall time across runs, excluding operator-requested pauses and not multiplying concurrent agent time.
- Add FR-112a: before each spend-creating model call, atomically reserve its maximum estimated cost; deny admission if settled spend plus outstanding reservations would exceed the cap; settle the reservation exactly once against actual cost. State explicitly that this is budget admission, not provider pre-throttling.
- Expand FR-113 to require an idempotent per-call ledger with call identity, role, provider/model, timestamps, token categories when available, immutable rate-card version, reported/estimated status, retries/failures when billable, and dollar-weighted estimated fraction.
- Clarify FR-115 by defining a trailing spend window as the newest chronological suffix of settled accounting events whose total is at least
W and would be below W if its oldest event were removed. Use the resulting time boundary for confirmed-finding membership.
- Add FR-116a: a stop decision atomically closes new spend admission, allows already-reserved calls to settle, permits bounded non-LLM cleanup, and persists the stop reason.
- Clarify FR-128 hot reload: lowering a cap below settled spend plus reservations triggers immediate stop; raising a cap can clear the FR-011 restart block; cumulative accounting never resets implicitly.
Acceptance checks
- Concurrent admission near a cap never reserves more than the remaining budget.
- Duplicate/retried delivery of one call's accounting event is counted once.
- Paused time and fleet width do not inflate evaluation runtime.
- The same ordered spend/finding event stream produces the same trailing yield.
- Cap lowering, cap raising, stop, and restart transitions preserve cumulative totals and expose one durable reason.
Failure scenario
The current budget requirements describe a halt after cumulative spend exceeds a cap. In a concurrent fleet, multiple agents can observe remaining budget and start model calls before the governor's next poll. Their combined in-flight cost can overshoot an operator's supposed hard ceiling by several calls.
Accounting and yield behavior are also not deterministic enough for independent implementations to agree:
These gaps can produce cap overruns and make the dashboard, status command, and yield auto-stop disagree even when each implementation appears to satisfy the present text.
Constitutional alignment
The proposal does not match the prohibited “static internal cap below the provider quota” anti-pattern. A budget cap controls total authorized spend; a rate cap controls call throughput.
Amendment level
FR-level amendment to
spec.md§9.3–§9.4 and FR-128, with corresponding operational guidance, reference index, success criterion, and changelog updates. This is a MINOR spec change because it adds testable requirements and narrows implementation ambiguity without removing or inverting an FR.Proposed FR diff
Wand would be belowWif its oldest event were removed. Use the resulting time boundary for confirmed-finding membership.Acceptance checks