Skip to content

Rulvar API reference


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

ts
new SpendEnvelope(maxTotalUsd): SpendEnvelope;

Defined in: packages/evals/src/envelope.ts:128

Parameters

ParameterType
maxTotalUsdnumber

Returns

SpendEnvelope

Properties

PropertyModifierTypeDefined in
maxTotalUsdreadonlynumberpackages/evals/src/envelope.ts:124

Accessors

authorizedUsd

Get Signature

ts
get authorizedUsd(): number;

Defined in: packages/evals/src/envelope.ts:150

Total authorized so far (debit-only; never decreases).

Returns

number


remainingUsd

Get Signature

ts
get remainingUsd(): number;

Defined in: packages/evals/src/envelope.ts:154

Returns

number

Methods

authorize()

ts
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

ParameterType
ceilingUsdnumber | undefined
runLabelstring

Returns

void