Add independent card-removal acceptance regressions

Draft
SS
24d ago
+449-0

Independent acceptance and review record for API #1054. That repair adopts the original nine-case suite unchanged. Keep this draft as the test/review record; do not merge it separately.

The suite connects real API-key authentication, removal/card/settings handlers, selectors, database adapters and automatic-purchase orchestration to synthetic external clients. It preserves other tagged customers' cards and characterizes the current GET selector. Account-wide card:null / checkout-only behavior remains a separate policy decision.

Validation:

  • Original pinned baseline 090f988060407e343d65dfdc3387156fb7dec0a5: nine new cases, six pass and three reproduce immediate-disablement, fallback-charge and settings-write-failure bugs; 239 related cases run, 236 pass and the same three fail. Full ESLint, changed-file TypeScript, formatting and diff checks pass.
  • Published repair bb7a492e5eec59ca54af033ea1f85e03e250edd1: all 15 focused cases independently pass in a separate checkout (nine independent cases plus six repair persistence/error cases). Standards and Spec reviews find no scoped issue.
  • This branch adds six public-readback assertions to the existing failure cases: settings-write failure retains the card; Stripe detachment failure leaves auto-top-up off and the automatic path skips. Applying only these test assertions over the same production candidate again passes all 15 focused cases. No production source was changed during review and the unchanged defective baseline was not rerun.

All Stripe/Supabase/Privy/email boundaries are synthetic, real fetch is prohibited, and subscription/invoice operations are rejected. No real provider or customer operation occurred. Exact-head required checks and release approval remain separate gates.

Run: pnpm exec vitest run lib/billing/tests/cardRemovalAcceptance.test.ts

Tracks recoupable/mono#343. Detailed results: docs/verification/card-removal-acceptance.md.