Skip to content

test(e2e): Batch A LIVE prod read specs (W-OBS/RES/VAULT/APIKEYS/BILLING/AUDIT)#181

Merged
mastermanas805 merged 1 commit into
mainfrom
live-reads-batch-a
Jun 5, 2026
Merged

test(e2e): Batch A LIVE prod read specs (W-OBS/RES/VAULT/APIKEYS/BILLING/AUDIT)#181
mastermanas805 merged 1 commit into
mainfrom
live-reads-batch-a

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

What

Adds e2e/live-reads.spec.ts — real-backend (LIVE) integration specs covering every authed READ user-flow against PRODUCTION via the minted PRO cohort account (Authorization: Bearer ${E2E_SESSION_JWT}). Run by e2e-prod.yml; gated on E2E_LIVE=1 + a sanctioned minted session. Whole file test.skips loudly in normal PR CI (default config testIgnore: ['live-*.spec.ts'] — mocked suite unaffected).

Executes Batch A of the prod-coverage expansion (docs/sessions/2026-06-04/PROD-COVERAGE-MATRIX.md §3, waves W1–W6).

Routes moved to LIVE-PROD-NOW (~32 route-legs, 19 tests)

No prodLiveTestMap exists in the api repo yet, so per the DONE-BAR these routes are recorded here as graduating LIVE-PROD-TODO → LIVE-PROD-NOW (and exported as coveredRoutes for the future done-bar, matrix §4 Option B):

W-OBS (unauthed/minted GETs, zero write risk): GET /livez, /healthz (+commit_id), /readyz, /openapi.json (3.1 + vault paths), /api/v1/capabilities (plans.Registry tiers incl. pro), /api/v1/status, /.well-known/oauth-protected-resource, /api/v1/incidents, /llms.txt, /security.txt.

W-RES: GET /api/v1/whoami (+ tampered-bearer 401 authz), /api/v1/resources, /resources/:id (asserts no connection_url leak in detail), /:id/credentials (redis URL revealed), /:id/metrics (200 Pro / 402 tier-gated), explicit DELETE /resources/:id, /resources/families, /:id/family, /:id/backups, /:id/restores. Seeded with one fast cache resource (Redis hot-pool, no dedicated DB) + reaped.

W-VAULT: PUT /vault/:env/:keyGET /vault/:env/:key (encrypt-at-rest decrypt round-trip) → GET /vault/:env (list, names-only). Key reaped inline; account cascade backstop.

W-APIKEYS: POSTGET (plaintext-once; list is metadata-only, asserts no key leak) → DELETE (revoked flips) on /api/v1/auth/api-keys.

W-BILLING (reads only, NO charge): GET /api/v1/billing, /billing/invoices, /billing/usage, /usage/wall.

W-AUDIT: GET /api/v1/audit (paginated envelope + next_cursor + masked-email redaction) + GET /api/v1/audit.csv (text/csv + header parity).

Skipped-with-reason (matching matrix PROD-EXEMPT reasoning)

  • GET /api/v1/billing/invoicestest.skip on 503 (Razorpay portal unavailable on prod, recurring disabled — documented contract); 200 path asserts invoices[].
  • GET /:id/metrics → accepts 402 when the stack isn't Pro (the minted account is PRO, so 200 expected on prod).
  • Every authed leg test.skips loudly when E2E_SESSION_JWT is absent.
  • Cache-seed legs test.skip on a 503 cache backend.

Safety (rule 24)

Mirrors live-anon-provision/live-claim-deploy exactly: assertSafeApiTarget() refuses an un-sanctioned prod target, cohort-branded cohortName, recordEntity before any throwing assert, inline reap + afterAll backstop + out-of-process reap-cohort.ts in the workflow if: always() teardown. Reads create nothing; the few seed rows (cache resource, vault key, api-key) are reaped inline and double-covered by the account cascade.

Verification

  • npm run gate GREEN (tsc + build + vitest: 1115 passed / 3 skipped, 80 files).
  • playwright test --config=playwright.live.config.ts --list lists all 19 new tests cleanly.
  • Default mocked suite unaffected.

🤖 Generated with Claude Code

…BILLING/AUDIT)

Adds e2e/live-reads.spec.ts — real-backend (LIVE) integration specs that
exercise every authed READ user-flow against PRODUCTION via the minted PRO
cohort account (E2E_SESSION_JWT), run by e2e-prod.yml. Gated on E2E_LIVE=1 +
a sanctioned minted session; the whole file SKIPS loudly in normal PR CI.

Covers the matrix Batch A read waves (docs/sessions/2026-06-04/
PROD-COVERAGE-MATRIX.md §3, W1-W6), moving ~32 route-legs to LIVE-PROD-NOW:
- W-OBS: livez/healthz/readyz (+commit_id), openapi (3.1 + vault paths),
  capabilities (plans.Registry tiers), status, oauth-protected-resource,
  incidents, llms.txt/security.txt static.
- W-RES: whoami (+tampered-bearer 401 authz), resources list, resources/:id
  (no creds leak), /credentials (redis URL), /metrics (200/402 tier),
  explicit DELETE, families, /:id/family, /:id/backups, /:id/restores —
  seeded with a fast cache resource (hot-pool, no dedicated DB) + reaped.
- W-VAULT: PUT secret -> GET decrypts (encrypt-at-rest round-trip) -> list
  keys; key reaped inline + account-cascade backstop.
- W-APIKEYS: POST -> GET (plaintext-once, metadata-only list, no key leak)
  -> DELETE (revoked flips).
- W-BILLING: billing state, invoices (503-skip on Razorpay-external),
  usage, usage/wall (near_wall bool) — reads only, NO charge.
- W-AUDIT: audit JSON feed (paginated envelope + email redaction) +
  audit.csv (text/csv + header parity).

Mirrors live-anon-provision/live-claim-deploy conventions exactly:
assertSafeApiTarget prod guard, cohort-branded ledger-before-assert, inline
reap + afterAll backstop (rule 24). Exports coveredRoutes manifest for the
future prod-coverage done-bar (matrix §4 Option B). No prodLiveTestMap exists
yet, so these routes are noted in the PR body as moving to LIVE-PROD-NOW.

npm run gate green; default mocked suite unaffected (testIgnore live-*).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805
mastermanas805 enabled auto-merge (squash) June 5, 2026 07:29
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/assets/index-902QtfQT.js 161.98 KB (0%)
dist/assets/index-BsJUZYRr.css 6.13 KB (0%)

@mastermanas805
mastermanas805 merged commit 27b6005 into main Jun 5, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant