Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/rulvar / buildCostReport

Function: buildCostReport() ​

ts
function buildCostReport(
   attribution, 
   totalUsd, 
   abandoned?): CostReport;

Defined in: packages/core/dist/index.d.ts

Folds the per-run attribution buckets into the normative CostReport. Live attribution buckets never see abandoned subtrees, so a host that tracked abandoned spend itself passes it as abandoned; omitted, the report shows a gross equal to the net. Non-finite numbers anywhere in the inputs are a typed refusal (RV705): this exported builder is the same public surface as costReportFromJournal and holds the same RV610 doctrine, instead of letting an Infinity or NaN serialize into null downstream.

Parameters ​

ParameterType
attributionCostAttribution
totalUsdnumber
abandoned?{ unpriced: { model: string; usage: Usage; }[]; usageApprox?: boolean; usd: number; }
abandoned.unpriced?{ model: string; usage: Usage; }[]
abandoned.usageApprox?boolean
abandoned.usd?number

Returns ​

CostReport