Rulvar API reference / @rulvar/rulvar / InvoiceRow
Interface: InvoiceRow
Defined in: packages/core/dist/index.d.ts
One billable provider call (or an unattributed usage remainder).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
abandoned? | true | The row lies under an abandoned subtree: in grossUsd, not in netUsd. | packages/core/dist/index.d.ts |
agentType? | string | The spawn's agent type from the terminal's cost attribution (RV3906, the fourth comparison experiment): in dynamic runs the scope grammar nests every orchestrator spawn under one agent:<seq> bucket, so per-child money used to require a join through the journal; the row now names the profile directly. Additive and policy, never identity: absent on entries journaled before cost attribution shipped, on empty attributions, and on every pre-RV3906 export byte, so old journals and old consumers read exactly what they always read. | packages/core/dist/index.d.ts |
allocatedUsd | number | The additive FinOps column: this row's share of totalUsd, always present (zero for rows on unpriced models). Shares are computed within the row's own (entry, serving model) slice of the same gross fold the totals run, proportional to per-row usd, and one row absorbs the IEEE rounding dust, so summing allocatedUsd over rows reproduces totalUsd exactly where summing usd does not. | packages/core/dist/index.d.ts |
attempt? | number | 1-based try number on the serving target (retries increment it). | packages/core/dist/index.d.ts |
entrySeq | number | The terminal journal entry the row folds from. | packages/core/dist/index.d.ts |
key | string | - | packages/core/dist/index.d.ts |
label? | string | The dispatch label from the same attribution (RV2803 journaled it; RV3906 lifts it onto the row), what tells two spans of one role apart without a journal join. Absent on unlabelled dispatches, additive exactly like agentType. | packages/core/dist/index.d.ts |
ordinal | number | The call's dispatch ordinal within its invocation; remainder and slice rows continue past it. | packages/core/dist/index.d.ts |
outcome | "ok" | "error" | "aborted" | "unattributed" | - | packages/core/dist/index.d.ts |
reconciliation | InvoiceReconciliation | - | packages/core/dist/index.d.ts |
responseId? | string | - | packages/core/dist/index.d.ts |
role? | InvocationRole | - | packages/core/dist/index.d.ts |
scope | string | - | packages/core/dist/index.d.ts |
servedBy | `${string}:${string}` | - | packages/core/dist/index.d.ts |
usage | Usage | - | packages/core/dist/index.d.ts |
usageApprox? | boolean | - | packages/core/dist/index.d.ts |
usageUnknown? | true | Present and true when this unconfirmed row recorded ZERO usage on every counter (the v1.71 experiment review, P1.4): a failed attempt whose usage this ledger never saw. The zeros mean "nothing recorded", never "the provider metered nothing": the provider may have billed prompt processing before the failure, so a statement join must treat this row's usage as unknown, not as zero. Derived at export time from the journaled record; rows with any recorded usage, and every other verdict, never carry it. | packages/core/dist/index.d.ts |
usd? | number | This row priced at its own model's rate; absent when no price row covers it. | packages/core/dist/index.d.ts |
wireRequests? | number | Provider HTTP requests this ONE row represents (RV1210), from the adapter's reported count rather than the id list: a provider that left an absorbed segment unnamed still billed it. Absent on single-wire rows, where the row IS the request. | packages/core/dist/index.d.ts |
wireResponseIds? | string[] | Every wire request's response id when the adapter absorbed provider-side continuations into this one dispatch (RV905); a per-request statement bills each segment as its own row, so the reconciliation joins this row by ANY id of the set. Absent on single-wire rows. | packages/core/dist/index.d.ts |