Documentation
¶
Overview ¶
Package overflow supplies the pure pre-send decision for one planner step.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Size ¶
func Size(f contextmeasure.RequestFacts) int
Size measures input plus reserve at the uncalibrated default rate, so usage reported by an overflow cannot change the progress comparison.
Types ¶
type Action ¶
type Action uint8
Action is the pre-send decision, independent of provider I/O or recovery.
func Check ¶
func Check(step Step, facts contextmeasure.RequestFacts, guard contextmeasure.GuardCount, limits Limits) Action
Check evaluates guard rejection first, then the per-model provider baseline. It performs no state transitions and never spends ProviderLeft.
type Limits ¶
type Limits struct {
Budget int
GuardMargin contextmeasure.Rate
}
Limits supplies the input budget B and its nonnegative rational guard margin. A nonpositive Budget disables the guard. A zero margin means zero; callers supply Rate{Tokens: 1, Bytes: 10} for the default ten-percent margin.