Skip to main content

A — receipts and runtime

Goal

Every call emits a valid cost_call receipt under the contract and architecture. During the owner/tenant rungs, adopt emitter/key prerequisites, not per-call coverage redesign. The scoreboard holds current values.

Metric

Share of AI provider-charge dollars whose rows carry required attribution fields for their work level. This is an interim readiness query, not a full exit proof. It checks the existing slim financial projection’s attribution fields over the last completed UTC hour, deduplicating metric identities. It does not claim that legacy metric rows are already valid CostCall objects. Legacy scope is conversation when conversation_id is present, tenant when only tenant is present, otherwise company; missing company initiators remain uncovered. The contract validator remains the authority for explicit work level, identity, Unicode, timestamps, usage and prices after adoption. Price-book-only/unbilled calls are outside this diagnostic’s provider-charge denominator and need the bill reconciliation gate; do not report this as coverage of all invoiced spend. occurrence_hash is the projection’s hash of the raw idempotency_key, and has_call_identity preserves whether source_event_id was nonempty. The window and provider-charge denominator are unchanged from the raw diagnostic. No raw payloads or event-ID strings need to be scanned.

Proof query

PRs to adopt now

From the merged map: #11538 (runtime labels), #11515 (account resolution/legacy retirement; coordinate C/E), #11321 (emitter config). Adopt approved work rather than rewrite it. Coverage call-ID rework waits for the run/message rungs; B’s six parked coverage PRs are not runtime prerequisites.

Stop-and-ask conditions

Ask before the cost_call migration, flipping any per-app flag, or any runtime package change. Also stop on ambiguous scope, missing invoice coverage or a proposal to substitute a random/default identity. Follow standing rules.

Exit check

The query’s field_readiness_pass must pass with a nonempty dollar denominator; unknown is fail. Full lane exit is blocked until the cost_call table exists and has a contract-level proof query. It additionally requires validateCostCall to accept the emitted receipts in both languages and approved per-app canary evidence. Do not label the SQL prerequisite alone as full contract compliance.