Rulvar API reference / @rulvar/evals / SpendEnvelope
Class: SpendEnvelope
Defined in: packages/evals/src/envelope.ts:123
One envelope bounds one whole sweep invocation: share the instance across the canary loop and runSweepMatrix so canary, target, and judge runs all draw from the same remainder.
Constructors
Constructor
new SpendEnvelope(maxTotalUsd): SpendEnvelope;Defined in: packages/evals/src/envelope.ts:128
Parameters
| Parameter | Type |
|---|---|
maxTotalUsd | number |
Returns
SpendEnvelope
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
maxTotalUsd | readonly | number | packages/evals/src/envelope.ts:124 |
Accessors
authorizedUsd
Get Signature
get authorizedUsd(): number;Defined in: packages/evals/src/envelope.ts:150
Total authorized so far (debit-only; never decreases).
Returns
number
remainingUsd
Get Signature
get remainingUsd(): number;Defined in: packages/evals/src/envelope.ts:154
Returns
number
Methods
authorize()
authorize(ceilingUsd, runLabel): void;Defined in: packages/evals/src/envelope.ts:164
Authorizes one run's immutable ceiling or throws SweepBudgetError. An unbounded run cannot be authorized: under an envelope every run MUST carry an explicit positive ceiling, otherwise the aggregate bound would be unaccountable.
Parameters
| Parameter | Type |
|---|---|
ceilingUsd | number | undefined |
runLabel | string |
Returns
void