# Release, cache, and rollback contract Each deployment is an immutable `releases//` artifact set. The provider adapter must upload assets, release manifest, runtime config, and verify asset reachability before atomically switching the active HTML pointer. The post-switch boot, route, API, telemetry, and reload-loop smoke checks close the deployment. Rollback selects a prior release tuple, confirms its assets and runtime/API compatibility, atomically switches the complete set, performs the provider cache action, and repeats the smoke checks. Rebuilding an old commit, replacing HTML alone, or declaring recovery from cache-purge completion is prohibited. Recovery is established by old/new reachability probes. Before deploying a promoted release later, or rolling back to one, re-verify its promoted bundle (the five files uploaded by the `promotion` job) with the archived mode (review 13-04). Provider evidence expires two hours after issue, so the normal mode refuses any release promoted before that. The archived mode still checks signatures, digests and the exact five members, and judges freshness at the release's recorded promotion time (`promotion-verification.json` `verifiedAt`, which may not lie in the future). New promotion never uses it (`scripts/lib/exact-promotion-bundle.ts`). ```bash VULNERABILITY_PUBLIC_KEY_PATH=... VULNERABILITY_KEY_ID=... \ PROVENANCE_PUBLIC_KEY_PATH=... PROVENANCE_KEY_ID=... \ EXPECTED_PROMOTION_RUN_ID= EXPECTED_PROMOTION_RUN_ATTEMPT= \ EXPECTED_PROMOTION_SOURCE_REVISION= \ EXPECTED_PROMOTION_ARCHIVE_SHA256= \ corepack pnpm verify:promotion -- --root --archived mkdir && tar -xzf /release-candidate.tar.gz -C corepack pnpm drill:runbook -- FE-RB-005 --release-root ``` The expected values come from the release record, not from the bundle. The drill then checks that release's build/config/manifest tuple and its assets, not the local build. It ends `UNVERIFIED` until the provider switch and smoke are recorded, because those happen outside this repository. The provider-independent cache defaults are: - hashed assets: `public, max-age=31536000, immutable` - HTML: `no-cache` - runtime config and release manifest: `no-store` - public source maps: disabled - service worker/offline cache: disabled, unless the static selection in `src/features/installed-runtime-capabilities.ts` is `ACTIVE`; then `dist` holds exactly the selected `service-worker.js` HTML, JSON config/manifest, and hashed JavaScript MIME types are also compared to the declared allowlist; a cache-correct response with a mismatched `Content-Type` still fails the hosting gate. `corepack pnpm verify:hosting-headers` compares the declared headers with a deterministic fixture when `HOSTING_BASE_URL` is unset. That only shows the declarations agree with each other, so its result is `UNVERIFIED` (exit 3), not `PASS` (review 13-05, `scripts/lib/hosting-probe.ts` `hostingVerdict`). Only `mode: "live"` can pass. The live target must be its canonical, non-loopback HTTPS root URL. Each required surface must return HTTP 200 without leaving that origin before its cache, content-type, and security headers can count as deployment evidence. The hashed asset it requests is the entry script named by the served `index.html`, so it checks the release that is actually deployed. FE-GATE-019 is therefore a production-stage gate (`production_gate` job, `PROD_PROMOTION_READY`). It runs after `promotion` and after the project has deployed the promoted release. This repository's workflow stops at promotion: uploading the release, switching the active pointer, and the post-switch smoke are the project's provider adapter, chosen with the hosting provider. Keep a retired release's hashed assets reachable while any open tab may still request them. The minimum is the previous release while the next one is active (the rolling window modeled in `tests/release/release-fixture.ts`). Size it to the longest session the product supports; a tab older than that depends on the reload-once recovery (FE-RB-002).