Core audit metrics
Total spend
The sum of all normalized call costs in the audit window.Observed spend
Spend taken directly from the telemetry source when a call already includes cost data.Estimated spend
Spend computed from token counts and Xerg’s pricing catalog when observed cost is missing.Waste spend
The dollar impact of findings classified as confirmedwaste.
Today that means:
- retry waste
- loop waste
- cache carryover for Cursor CSV audits when the billed pattern clears the waste bar
Opportunity spend
The dollar impact of findings classified asopportunity.
Today that means:
- context outliers
- idle spend
- downgrade candidates
- max mode concentration for Cursor CSV audits when the billed mix is heavily premium
Structural waste rate
--fail-above-waste-rate.
Waste by signal source
Local audit summaries includewasteBySignalSource:
observedUsdinferredUsddeclaredUsdunknownUsdinferredShare
unknownUsd is used for older summaries that predate provenance fields. Xerg does not default missing provenance to observed.
Breakdowns
Every audit includes spend breakdowns:- by workflow
- by model
spendUsdcallCountobservedShare
observedShare tells you what fraction of that row’s spend came from directly observed cost rather than estimation.
Daily rollups
Every audit now includes:spendByDaywasteByDay
YYYY-MM-DD format.
spendByDayincludesspendUsd,observedSpendUsd,estimatedSpendUsd, andcallCountwasteByDayincludes confirmed waste onlysum(spendByDay.spendUsd)reconciles tototalSpendUsdsum(wasteByDay.wasteUsd)reconciles towasteSpendUsd
Compare metrics
When a compatible baseline exists and you runxerg audit --compare, Xerg adds:
- waste rate before and after
- waste per run before and after
- waste per 1k calls before and after
- inferred waste share before and after when provenance is available
- workload-dependent total spend delta
- workload-dependent structural waste delta
- delta run count
- delta call count
- top workflow swings
- top model swings
- high-confidence waste changes
Cost per outcome
When runs carry outcome signals, audits include an outcomes rollup: success rate, cost per successful run, and spend on failed runs. Outcomes come from two places:- observed terminal states: explicit success statuses, error or abort stop reasons
- declared outcomes:
xerg outcome --run <id>|--workflow <name> --status success|failure|partial|unknown, stored locally and applied to future audits (declared outcomes override derived ones)
Notes that always matter
- Cost per outcome requires outcome signals; audits without any outcome signal say so instead of showing numbers.
- Opportunity metrics are directional. They are worth testing, but they are not proven waste.
- Threshold gates only use confirmed structural waste, not opportunity impact.
- Detected source files with zero included calls are called out explicitly in a count-only extraction note instead of silently vanishing from the audit. Totals may understate real spend when that happens; use
xerg doctor --runtime <runtime> --verboselocally to see which files (paths stay on your machine).