# Billing and admission failure drills

Synthetic specifications v1, authored 28 October 2026. No billing account, live webhook, payment, model call or test harness was executed. No runnable mock service is supplied. All observations are not_run. These are proposed app tests, not documented vendor guarantees.

## Shared setup

Use a controller-owned account, logical task/event IDs, customer-unit ledger, internal cost/reservation ledger, billing-state adapter and bounded model stub. Keep customer charges, entitlement, provider costs and admission allowance separate. Protect actual ingress with supported authentication/verification when implementing it; no fabricated webhook signature is supplied.

Record desired policy, period/currency/unit, implementation version, actual state/effect records, request/attempt IDs, unresolved exposure and owner decision. Exact HTTP status/timeouts belong to the implementation; none are presented as observed here.

## DF-01 — held concurrent reservation

Fixture: internal allowance 5 cents; each bounded mock task requires 5 cents reservation. Start two admission attempts concurrently and hold the first allowed reservation until both admission decisions complete. This hold condition matters: a later request after release could legitimately be admitted.

Expected: one reservation admitted, other denied/queued per policy, no double hold or unauthorized stub dispatch. Atomic decision includes all relevant outstanding reservations. On known actual cost 3 cents for the admitted stub, settle 3 and release only unused 2. Numbers are synthetic cents, not model rates/customer prices. Evidence: admission/hold/dispatch/settlement records. Observed: not_run.

## DF-02 — unknown provider outcome

Fixture: reserve a declared bounded allowance; dispatch to mock, then lose response/usage evidence. Expire the local wait timer and mark reservation stale for investigation.

Expected: do not zero/release full cost exposure merely because client timed out or TTL passed. Keep pending_reconciliation or apply a documented conservative settlement; later evidence can justify releasing unused amount. Separately record any customer billing/refund choice. Known-not-started work may be released only when that fact is established. Evidence: dispatch and unknown-state records, sweeper action, later reconciliation and no duplicate release. Observed: not_run.

## DF-03 — duplicate event and interrupted processing

Fixture: deliver same logical accepted-task event twice. Also interrupt receiver between recording receipt and committing effect; retry.

Expected: one completed customer-unit effect. An unfinished processing record must recover rather than be treated as already completed. Atomic business-state/event intent and supported downstream idempotency/reconciliation are required by the chosen design; event_id alone is not exactly-once delivery. Repeated settlement cannot charge/release twice. Evidence: stable event ID, processing/committed state, ledger/effect and retry records. Observed: not_run.

## DF-04 — out-of-order subscription state

Fixture: mock billing authority currently reports a changed entitlement-relevant state. Deliver its newer update, then an older delayed event. Duplicate one delivery. Adapter-level mock only, not a forged Stripe request.

Expected: applicable app entitlement matches verified authoritative state and declared trial/grace/cancellation policy. Arrival order and event.created alone do not establish correctness. In the real adapter, verify authenticity through the provider-supported mechanism and reconcile under concurrency. Evidence: authority state, event IDs, app policy and entitlement history. Observed: not_run.

## DF-05 — partial batch and linked adjustment

Fixture: bounded mock batch has allowance for 14 units, remaining work would exceed it. Controller holds relevant concurrent reservations; pause before further dispatch. Later one completed customer unit is credited under the fictional terms.

Expected: completed/queued/unresolved portions accurately reported, no extra unapproved dispatch, provider-cost exposure retained even when customer receives credit. Correction references original event and is applied once; do not erase history. No fixed provider charge or generated token count assumed. Evidence: scheduler states, reservation/cost record, billable units, linked correction and final reconciliation. Observed: not_run.

## Decision

A missing/failing required check remains unresolved. Passing stubs is scoped evidence, not proof of real-provider behavior, full business profitability or instant account-wide spending protection. Assign recovery owners and repeat after pricing, provider, adapter, retry or admission changes. No publication/deployment/purchase approval supplied.
