test(e2e): Batch A LIVE prod read specs (W-OBS/RES/VAULT/APIKEYS/BILLING/AUDIT)#181
Merged
Conversation
…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
enabled auto-merge (squash)
June 5, 2026 07:29
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 bye2e-prod.yml; gated onE2E_LIVE=1+ a sanctioned minted session. Whole filetest.skips loudly in normal PR CI (default configtestIgnore: ['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
prodLiveTestMapexists 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 ascoveredRoutesfor 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 noconnection_urlleak in detail),/:id/credentials(redis URL revealed),/:id/metrics(200 Pro / 402 tier-gated), explicitDELETE /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/:key→GET /vault/:env/:key(encrypt-at-rest decrypt round-trip) →GET /vault/:env(list, names-only). Key reaped inline; account cascade backstop.W-APIKEYS:
POST→GET(plaintext-once; list is metadata-only, asserts no key leak) →DELETE(revokedflips) 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/invoices→test.skipon 503 (Razorpay portal unavailable on prod, recurring disabled — documented contract); 200 path assertsinvoices[].GET /:id/metrics→ accepts 402 when the stack isn't Pro (the minted account is PRO, so 200 expected on prod).test.skips loudly whenE2E_SESSION_JWTis absent.test.skipon a 503 cache backend.Safety (rule 24)
Mirrors
live-anon-provision/live-claim-deployexactly:assertSafeApiTarget()refuses an un-sanctioned prod target, cohort-brandedcohortName,recordEntitybefore any throwing assert, inline reap +afterAllbackstop + out-of-processreap-cohort.tsin the workflowif: 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 gateGREEN (tsc + build + vitest: 1115 passed / 3 skipped, 80 files).playwright test --config=playwright.live.config.ts --listlists all 19 new tests cleanly.🤖 Generated with Claude Code