Usage reporting (§9.2) is best-effort and fire-and-forget today, so metering can silently lose events across a restart — which for a metered SKU means lost revenue and an unauditable bill. Make it durable.
What to change
A Mongo-backed usage outbox (agent.rs:75-120).
Batch and flush every ≤ 60 s.
Retry with the same idempotency key so a replay cannot double-count.
Skip demo tenants.
Acceptance
Usage events survive an agent restart mid-flush: a stage script asserts no loss and no duplication across a restart.
Retries reuse the idempotency key; the registry deduplicates.
Demo tenants produce no usage records.
The outbox backlog is exposed as a metric (MVP-1.7) and alerted on (MVP-5.1).
## Goal
Usage reporting (§9.2) is best-effort and fire-and-forget today, so metering can silently lose events across a restart — which for a metered SKU means lost revenue and an unauditable bill. Make it durable.
## What to change
- A Mongo-backed usage outbox (`agent.rs:75-120`).
- Batch and flush every ≤ 60 s.
- Retry with the same idempotency key so a replay cannot double-count.
- Skip demo tenants.
## Acceptance
- [ ] Usage events survive an agent restart mid-flush: a stage script asserts no loss and no duplication across a restart.
- [ ] Retries reuse the idempotency key; the registry deduplicates.
- [ ] Demo tenants produce no usage records.
- [ ] The outbox backlog is exposed as a metric (MVP-1.7) and alerted on (MVP-5.1).
sharang
added this to the Production MVP milestone 2026-09-20 20:17:21 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Goal
Usage reporting (§9.2) is best-effort and fire-and-forget today, so metering can silently lose events across a restart — which for a metered SKU means lost revenue and an unauditable bill. Make it durable.
What to change
agent.rs:75-120).Acceptance