xerg audit --jsonreturns the local audit summaryxerg audit --push --dry-runandxerg push --dry-runreturn the exact Push v7 payload
@xerg/schemas. Runtime cost may be observed, locally catalog-estimated, or unpriced; it is not provider-invoice reconciliation.
Local audit summary
findings and signals arrays:
wasteSpendUsd,structuralWasteRate,wasteByDay, recommendations, and gates use only detector-ownedavoidableSpendUsdaffectedSpendUsddescribes the full proved pattern and is not a savings estimate- signals expose observed metrics, optional human-readable
scopeLabel, and optionalassociatedSpendUsdplusassociatedSpendBasis; chain-backeddeep-loop-activitymay includechainOccurrenceCount,fingerprintedToolExecutionCount, andtoolInputDistinctRatio; associated spend is descriptive, not waste or savings. Earlier Push v7/v6 and stored v5 history remain readable withoutscopeLabel. - component-level ownership prevents overlapping findings from double-counting one charge
- missing required evidence appears in detector coverage rather than being inferred
pricingCoveragereports priced and unpriced calls/tokens; unknown cost is not treated as zeroauditWindowrecords the requested analysis interval;endAtis the exclusive upper boundarywasteByWorkflowis detector-attributed waste grouped by the owning workflow; it reconciles exactly to audit waste and usesUnattributedwhen ownership cannot be resolvedspendByAgentis the authoritative flat agent rollup when call-level agent identity is availableagentDelegationsrecords observed immediate parent-to-child relationships. Its spend is already included in the child row and audit total, so never add relationship spend to either totalagentDelegationsis omitted when no parent relationship was observed. Older summaries can contain delegated totals without the relationship rows needed to identify their children
toolChains and localDiagnostics (xerg-local-diagnostics/v1) plus source-specific blocks such as mechanicalEfficiency, analysisCoverage, toolActivity, workloadEconomics, Cursor usage detail, or QM reconciliation detail. Diagnostic packets retain SHA-256 digests and byte counts, never raw or truncated tool arguments/results. These local blocks, source paths, per-TTL cache-write buckets, and local pricing-limitation details do not cross Push v7. The existing aggregate tokenEconomics.cacheWriteTokens remains the wire total.
Multi-source JSON
With--remote-config, more than one successful source returns a top-level sources array. Exactly one successful source returns the normal single-summary shape.
Push v7
version: 7:
auditWindow, wasteByWorkflow, observed agentDelegations, detector-versioned comparison.findingChanges, and comparison.spendComparisonAvailable. The last flag is true only when both measurements have priced calls; consumers treat an absent flag as unavailable. Older Push v7, v6, and stored history remain valid without these fields.
Legacy v5
The API continues to accept and store v5 payloads unchanged. Readers display them with a Legacy detection method badge and an upgrade advisory. New v5 pushes cannot create or recur current optimization records. Push v6 remains accepted and meters the same daily runtime spend as v7; v7 adds daily priced and unpriced call counts for coverage transparency.When to use which format
- use
audit --jsonfor local automation that needs source metadata or local-only diagnostics - use
--push --dry-runto inspect the privacy-bounded payload before sending it