Skip to content

ops: cross-rail revenue reporting — one internal view of consumption, settlement health, and rail mix #9202

Description

@JSONbored

Context

Part of the dual-rail revenue epic. With consumption metered once (#6314 ledger, #7660 units) and settled on either rail, the operator needs one internal view answering "what did the loop earn, on which rail, and is settlement healthy" — otherwise revenue reporting fragments into rail-specific queries that disagree (the system already has a history of two-sources-two-numbers bugs; revenue must not repeat it).

Requirements

  1. An internal, operator-only reporting surface aggregating per period: consumption (compute-units) by tenant, settlement outcomes by rail (settled/pending/failed with the shared failure taxonomy from the conformance harness), and rail mix — all derived from the rental ledger + settlement-interface records, no parallel bookkeeping tables.
  2. Reconciliation is first-class: the report surfaces consumption-vs-settlement gaps (unsettled consumption, settlement without matching consumption) as explicit categories rather than silently netting them.
  3. Access and privacy: operator-tier only; per-tenant identity limited to what ops needs (tenant key, not GitHub PII beyond it); nothing from this surface is ever published to public stats (structural separation from the public-stats path, not a filter).
  4. Rail-native amounts render only alongside their rail; cross-rail totals exist solely in compute-units (converting rails into a single currency figure is pricing/finance territory — out of scope, per the epic's no-pricing constraint).
  5. Export path (CSV/JSON) for the operator, consistent with the config-as-code/ops conventions.

Deliverables

  • The reporting queries + operator surface (or CLI/endpoint per ops convention) + export.
  • Tests: aggregation correctness against fixture ledgers (both rails, mixed states), reconciliation-gap categorization, access denial below operator tier, public-stats separation assertion.

Expected outcome

One trustworthy answer to "what did the loop earn this week," with settlement health and gaps visible instead of implied.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions