Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/core / sanitizeUsage

Function: sanitizeUsage()

ts
function sanitizeUsage(usage): Usage;

Defined in: packages/core/src/l0/usage.ts:210

Conservative repair for accounting. Pairs with usageViolations: the violation fails the call loud, and the sanitized numbers are the only ones the journal, the cost report, and the budget may see. After the per-field repair the cache subsets clamp into the input with reads keeping priority, mirroring the adapter-level subset clamp. Valid usage passes through structurally unchanged.

Parameters

ParameterType
usageUsage

Returns

Usage