STAGE 11 · FINOPS MIDDLEWARE
An agent loop that projects its total spend before every step, halts the instant the projection breaks the budget, and degrades to a cached partial answer instead of dying.
Tier prices per step: Frontier $0.045 · Mid $0.012 · Local $0.002 · Cache $0. The loop plans up to 24 steps. Task B is a near-duplicate of A on purpose: run A first, then B. Then try a $0.25 budget on task C to watch the kill switch and the fallback chain fire.
Nothing served yet. Run the loop.
projected = spent + cost(next step) + rate × steps remaining. The rate is the run's real average cost per step, shrunk toward the router policy rate ($0.012 expected per step under the 12/45/43 tier mix) with a prior weight of 8 steps, so one expensive opening step cannot poison the estimate, but a run that keeps reaching for the frontier tier still watches its projection climb. The check runs before the step executes: if projected is greater than the budget, the step never runs, the halt is logged with the exact numbers, and the fallback chain serves the best partial answer assembled from the steps that did complete.