Skip to content

test(e2e): Batch C LIVE prod specs (W-STACKS/STACKS-ADV/LIFECYCLE/AUTH2) - #186

Merged
mastermanas805 merged 1 commit into
mainfrom
test/live-stacks-lifecycle-batch-c
Jun 5, 2026
Merged

test(e2e): Batch C LIVE prod specs (W-STACKS/STACKS-ADV/LIFECYCLE/AUTH2)#186
mastermanas805 merged 1 commit into
mainfrom
test/live-stacks-lifecycle-batch-c

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

Batch C — live-PRODUCTION integration coverage

Adds e2e/live-stacks-lifecycle.spec.ts covering the stack, resource-lifecycle, and secondary-auth user-flows against https://api.instanode.dev via the minted PRO cohort account. Closes Batch C of docs/sessions/2026-06-04/PROD-COVERAGE-MATRIX.md (waves 11–14). Copies the Batch B / Batch A conventions exactly for the safety machinery (rule 24).

Waves

  • W-STACKSPOST /stacks/new (single-service minimal manifest → 202 accepted contract) → GET /api/v1/stacks (list) + GET /api/v1/stacks/:slug + GET /stacks/:slug (get) → PATCH /stacks/:slug/env (merge → 200, merged key present; incremental + invalid-key 400) → missing-slug 404 → two-step DELETE /stacks/:slug (paid 202 pending OR 200 immediate) + confirm-deletion cancel → skip-email reap → gone. Full multi-service Kaniko build DEFERRED (202-accepted contract only, mirrors live-writes deploy 202).
  • W-STACKS-ADVGET /api/v1/stacks/:slug/family (PRO 200 + private Cache-Control), POST /api/v1/stacks/:slug/promote (non-destructive contract: 412 needs-build / 402 / 400 / 202, never 5xx; reaps any sibling), DELETE confirm-deletion cancel arm (404 with no pending row).
  • W-LIFECYCLE — on a FAST cache resource (no dedicated DB): pause → resume (Pro+), rotate-credentials, backup CONTRACT (cache → 400 unsupported_resource_type, postgres-only; never waits for a real backup), backups/restores list, reap.
  • W-AUTH2POST /auth/email/start accepted contract (Brevo-gated, delivery NOT asserted), POST /auth/github body-flow no-credential contract (400 missing_code / 401 oauth_failed / 503 not-configured), and a DISPOSABLE claimed-session logout round-trip (/auth/me 200 → logout → SAME bearer 401). The logout leg NEVER revokes the shared minted JWT (Batch B lesson) — it claims a throwaway team and revokes THAT session.

Ledger

cleanup-ledger.ts gains a stack entity kind: DELETE /stacks/:slug with X-Skip-Email-Confirmation so a paid team's two-step flow doesn't strand the reap behind an undeliverable confirmation email (account cascade is the backstop).

Safety (rule 24)

E2E_LIVE=1 gating (whole file SKIPS in normal PR CI), assertSafeApiTarget(), ledger-before-assert + inline reap + afterAll backstop, per-service 503 skips. Brevo/Razorpay contract-only; no team-tier minting; slow services pinned off (cache hot-pool).

npm run gate green (tsc --noEmit + build + 1115 vitest pass).

🤖 Generated with Claude Code

Adds e2e/live-stacks-lifecycle.spec.ts driving the stack, resource-
lifecycle, and secondary-auth user-flows against PROD via the minted
cohort account. Closes Batch C of the prod-coverage matrix (waves 11-14).

W-STACKS: POST /stacks/new (single-service minimal manifest -> 202
accepted contract) -> GET /api/v1/stacks (list) + GET /api/v1/stacks/:slug
+ GET /stacks/:slug (get) -> PATCH /stacks/:slug/env (merge -> 200, merged
key present; incremental + invalid-key 400) -> missing-slug 404 -> two-step
DELETE /stacks/:slug (paid 202 pending OR 200) + confirm-deletion cancel
-> skip-email reap -> gone. Full multi-service Kaniko build DEFERRED
(202-accepted contract only, mirrors live-writes deploy 202).

W-STACKS-ADV: GET /api/v1/stacks/:slug/family (PRO 200 + private
Cache-Control), POST /api/v1/stacks/:slug/promote (non-destructive
contract: 412 needs-build / 402 / 400 / 202, never 5xx; reaps any
accidentally-created sibling), DELETE confirm-deletion cancel arm (404 with
no pending row).

W-LIFECYCLE: on a FAST cache resource (no dedicated DB) -- pause -> resume
(Pro+), rotate-credentials, backup CONTRACT (cache -> 400
unsupported_resource_type, postgres-only; never waits for a real backup),
backups/restores list, reap.

W-AUTH2: POST /auth/email/start accepted contract (Brevo-gated, delivery
NOT asserted), POST /auth/github body-flow no-credential contract
(400 missing_code / 401 oauth_failed / 503 not-configured), and a
DISPOSABLE claimed-session logout round-trip (/auth/me 200 -> logout ->
SAME bearer 401). The logout leg NEVER revokes the shared minted JWT
(Batch B lesson) -- it claims a throwaway team and revokes THAT session.

cleanup-ledger.ts: add a `stack` entity kind (DELETE /stacks/:slug with
X-Skip-Email-Confirmation so a paid team's two-step flow doesn't strand
the reap behind an undeliverable confirmation email; account cascade is
the backstop).

Safety machinery mirrors live-writes/live-reads EXACTLY (rule 24):
E2E_LIVE=1 gating, assertSafeApiTarget, ledger-before-assert + inline reap
+ afterAll backstop, 503 per-service skips. Brevo/Razorpay contract-only;
no team-tier minting; slow services pinned off (cache hot-pool).

npm run gate green (tsc --noEmit + build + 1115 vitest pass).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805
mastermanas805 enabled auto-merge (squash) June 5, 2026 08:51
@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 33457bc into main Jun 5, 2026
18 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