Skip to main content

Overview

The cross-app smoke harness (scripts/cutover-smoke.mjs) provides the standardized, reusable D15 verification required for every app during cutover from Vercel to Cloudflare Workers (TanStack Start + Vite+ + Void). Under D74 and COMMON migration invariants, every cutover requires a rapid, non-destructive smoke check immediately after routing or preview deployment to verify service availability before the watch window begins.

Verified Checks

  1. Anonymous 200 on Entry Route: Verifies unauthenticated visitors can access the root entry route (/) or resolve canonical locale redirects to HTTP 200 without authentication challenges or failures.
  2. Login Page Renders: Confirms the authentication entrypoint (/login) responds with HTTP 200 and non-empty HTML content containing interactive login/form markers.
  3. No Redirect Loops: Tracks the complete redirect history for every probed route and asserts that no circular redirects or excessive chain lengths occur.
  4. No 5xx Server Errors on 5 Listed Paths: Probes at least 5 distinct routes configured per app in scripts/cutover-smoke-config.json (such as landing, login, pricing/about, health, robots.txt, or manifest.json) and verifies none return a 5xx server status code (500-599).
  5. Deterministic JSON Output: Outputs machine-readable PASS/FAIL JSON report to stdout with detailed timings, redirect chains, and failure reasons. Exits with code 0 on PASS and 1 on FAIL.

Usage

Basic CLI Invocations

Run directly with Node or Bun:

CLI Flags


Route Configuration Table

Per-app paths and entry routes are defined in scripts/cutover-smoke-config.json. Each application entry specifies:
If an app is not explicitly listed, the harness falls back to _default, guaranteeing that any new worker service or micro-frontend can immediately be tested without code modifications.

Output Schema

The harness prints formatted JSON to stdout:
On failure, status is "FAIL", pass is false, errors contains human-readable failure descriptions, and the process exits with 1.

Cutover Integration & Rollback Threshold

During a cutover:
  1. Run smoke immediately after pointing preview/staging route:
  2. If status === "FAIL":
    • Check errors array in JSON output.
    • Any 5xx or redirect loop on entry or login triggers immediate rollback to Vercel origin per D74 invariant.
    • Record the prior Vercel deployment ID in the lane packet.
  3. If status === "PASS":
    • Proceed to the 10-minute observation window.

Unit Testing

Run unit tests via Node test runner or Vitest:
All HTTP calls are fully mocked, validating:
  • Base URL normalizer and protocol enforcement.
  • Per-app config resolution and 5-path guarantee.
  • Step-by-step redirect resolution, cycle detection, and max redirect guards.
  • Anonymous entry route assertions.
  • Login page render validation.
  • Non-5xx boundary assertions.