# Credit-ledger replay/reconciliation audit

> Project brief for Claude Code from NixInc Ideas: https://nixinc.co/ideas/2026-09-27-credit-ledger-replay-reconciliation-audit
> Scored 5.3/10 on 27 Sept 2026, verdict PASS. Prices are as of the dates shown.

## What we're building
Teams adding prepaid, promotional or expiring credits on Stripe Billing find that a simple credit balance becomes one of the harder parts of the product, and balance or invoice mismatches are hard to reproduce.

## Who pays
Product, platform or finance engineer at an AI or API SaaS implementing credits on Stripe Billing.

## What they already pay
- Stripe, Billing (share of Billing volume): 0.7% (as of 27 Sept 2026)
- Orb, Custom pricing based on billings and events: Quote only (as of 27 Sept 2026)

## Milestone 0: the 72-hour test, before any code
Ask 20 qualified SaaS teams for an anonymized credit-policy matrix and offer a manual 12-case replay audit.

- Pass line: Success requires five usable policies, three paid audit deposits, and two reproducible balance/invoice discrepancies.
- Stop rule: Kill: fewer than three paid deposits, no reproducible failures, or vendor-native test tooling fully covers two of the first three audits.

Do not start milestone 1 until the pass line is met.

## Milestone 1: the smallest version worth shipping
A manual 12-case replay audit: take a team's anonymized credit-policy matrix, run deterministic event fixtures for grants, expiry, rollover, backfills, duplicate events and overages, and report every balance or invoice disagreement it reproduces.

## Skip in v1
A billing engine, metering, invoicing, and anything Stripe, Orb, Metronome or Lago already provide.

## Needs
The buyer's anonymized credit-policy matrix, a Stripe test-mode setup with credit grants, scripted event fixtures, and outreach to usage-priced SaaS teams and billing implementers.

## How to work in this repo
1. Plan before you edit: say which files change, the smallest change that works and how you will check it, then wait for a yes.
2. One task at a time, small enough to read in one diff.
3. After each change, run the checks, then say what changed, what you tested and what still needs a person to look at.
4. Check it like a first-time customer: run the real thing and try the empty, error and success paths.
5. Keep secrets out of the repo and out of chat. Environment files stay local.
6. Ask before installing dependencies, touching payments or sign-in, or deleting files.
7. Do not build anything listed under "Skip in v1".
