Core audit metrics
Runtime spend
totalSpendUsd is the sum of all normalized call costs in the audit window. The dashboard calls this Runtime spend when every call has pricing, Known runtime spend when some calls are unpriced, Cost unavailable when none are priced, and Reported spend when historical pricing-completeness metadata is unavailable. Runtime spend can be observed or catalog-estimated and is not a provider invoice.
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.Identified waste spend
The sum of detector-ownedavoidableSpendUsd from current monetary findings.
Today that means:
- correlated retry waste
- exact no-progress tool-loop waste
- net-negative cache churn
Neutral signals
Signals report ordered observed metrics for deep-loop activity, context outliers/growth, fixed cadence, premium-model routine labels, cache-read concentration, and Max Mode concentration. Optional associated spend carries its cost basis and is labeled as non-waste. Signals have no classification or avoidable-spend value and never enter monetary totals.Identified waste rate
--fail-above-waste-rate. The denominator is always total spend, including spend that was not eligible for a particular detector.
Detector coverage
detectionCoverage reports total and eligible request/spend measures overall,
for each active finding and signal, and by UTC day. Every UI renders the assessment context as
“assessed $X of $Y.” A zero finding is conclusive only for detectors with full
coverage. Under aggregate-only Hermes data, Xerg retains every aggregate
economic metric but says request-sequence waste was not assessed.
sourceStability reports a stable snapshot, open source period, unresolved
live-source drift, or legacy unknown state. Drifted audits do not participate
in identified-waste comparisons.
Waste by evidence basis
Local audit summaries includewasteBySignalSource:
observedUsdinferredUsddeclaredUsdunknownUsdinferredShare
observedUsd or declaredUsd from their evidenceBasis. inferredUsd remains zero for current producers. unknownUsd is reserved for historical summaries, and Xerg never defaults 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.
When call-level agent identity is available, spendByAgent adds authoritative flat agent totals. Each row’s delegatedSpendUsd and delegatedCallCount describe work initiated by that agent but remain informational and are not added to its direct spend.
Current Push v7 summaries can also include agentDelegations, one row per observed immediate parent-to-child relationship. Relationship spend is already included in the child’s spendByAgent.spendUsd and the audit total. It must never be summed again. Xerg does not infer a hierarchy when the source did not supply parent identity, and older measurements are not backfilled.
Daily rollups
Every audit now includes:spendByDaywasteByDay
YYYY-MM-DD format.
spendByDayincludesspendUsd,observedSpendUsd,estimatedSpendUsd, andcallCountwasteByDayincludes detector-owned avoidable spend onlysum(spendByDay.spendUsd)reconciles tototalSpendUsdsum(wasteByDay.wasteUsd)reconciles towasteSpendUsd
Compare metrics
When a baseline exists and you runxerg audit --compare, source and time-window semantics must match. Monetary before-and-after values render only when spendComparisonAvailable is explicitly true, which establishes that both measurements contain priced calls. Older comparisons without that availability field remain readable, but their monetary deltas are unavailable rather than treating an unpriced placeholder zero as exact. Identified-waste rates, deltas, and finding changes additionally require wasteComparisonAvailable to be explicitly true, which establishes compatible detector modes and eligible-spend ratios. Compatible comparisons add:
- waste rate before and after
- waste per run before and after
- waste per 1k calls before and after
- evidence-basis rollups before and after when available
- workload-dependent runtime spend delta
- workload-dependent structural waste delta
- delta run count
- delta call count
- top workflow swings
- top model swings
- high-confidence waste changes
-5.0 pp, which is a 25% relative decrease rather than a 5% relative decrease.
The compare block leads with normalized rates and per-unit metrics so the before and after read survives workload changes. Absolute spend and waste deltas are still shown, but they are labeled workload-dependent because volume changes can affect them.
Push v7 carries the top-line comparison fields, explicit spend and waste availability gates, and detector-versioned finding changes. The fuller workflow and model comparison details stay in the local summary. Consumers must not present monetary fields when their corresponding availability gate is absent or false.
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.
--require-detection-coverage full|partialexits5when the request-sequence assessment is insufficient.- 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).