M4: TLS + HTTP/2 test vhost, client dist, chromium #66

Closed
opened 2026-11-20 22:31:44 +01:00 by SirStone · 1 comment
Owner

Part of #63

Goal

Root devbox gains chromium; the test nginx serves dist at / (SPA fallback, hashed cache, index no-cache) over TLS with HTTP/2, mirroring DESIGN 11.1.

Acceptance criteria

  • Generated self-signed cert
  • An HTTP/2 client negotiates h2
  • Direct /_tiles/ 404
  • Static cache headers correct
  • Headless chromium launches and reports h2
  • Existing tile/doors/oneway harnesses green with the new config
  • Standing gate: full devbox run test green on a clean checkout, no test weakened or skipped, and the behaviour above proven at the seam(s) listed under "Proven at".

User stories covered

  • 68 — As the owner, I want HTTP/2 verified end-to-end before the phone gate, so that the phone run measures the app and not six-connection HTTP/1.1.

Proven at

test nginx, devbox, e2e harness

Notes

  • Size: S (about one agent session, ~100K tokens). Lane: I (infra, alone).
Part of #63 ## Goal Root devbox gains chromium; the test nginx serves `dist` at `/` (SPA fallback, hashed cache, index no-cache) over TLS with HTTP/2, mirroring DESIGN 11.1. ## Acceptance criteria - [ ] Generated self-signed cert - [ ] An HTTP/2 client negotiates h2 - [ ] Direct `/_tiles/` 404 - [ ] Static cache headers correct - [ ] Headless chromium launches and reports h2 - [ ] Existing tile/doors/oneway harnesses green with the new config - [ ] Standing gate: full `devbox run test` green on a clean checkout, no test weakened or skipped, and the behaviour above proven at the seam(s) listed under "Proven at". ## User stories covered - 68 — As the owner, I want HTTP/2 verified end-to-end before the phone gate, so that the phone run measures the app and not six-connection HTTP/1.1. ## Proven at test nginx, devbox, e2e harness ## Notes - Size: S (about one agent session, ~100K tokens). Lane: I (infra, alone).
SirStone added the ready-for-agentenhancement labels 2026-11-20 22:31:44 +01:00
SirStone added a new dependency 2026-11-20 22:31:45 +01:00
SirStone added a new dependency 2026-11-20 22:31:46 +01:00
Author
Owner

Done on main (1dff520, rebased on 0448002).

What landed

  • tools/nginx.mjs: TLS-only vhost with http2 on (nginx >= 1.25.1 form), a self-signed certificate generated per run by the new tools/tlsdev.mjs (SAN localhost/127.0.0.1, added to the process's default CA list, so verification stays on), and the client build at /: SPA fallback to index.html, Cache-Control: no-cache for index/routes, /assets/ with public, max-age=31536000, immutable and =404 for a missing hash, so a stale index fails loudly instead of booting the app. /_tiles/ stays internal (direct 404).
  • The tile/doors/oneway/wallbehaviour harnesses now set the server's publicOrigin to the https vhost (httpsBaseUrl), so they run through the same listener the browser uses.
  • tools/vhost.test.mjs (built-ins, node:http2, in devbox run test): cert self-signed + SANs, ALPN h2, index no-cache, immutable asset, SPA fallback, missing asset 404, direct /_tiles/ 404, and an HTTP/1.1 client still served over TLS.
  • e2e/h2.test.mjs + e2e/run.sh (devbox run e2e): devbox chromium via pinned playwright-core, loads the dist and asserts nextHopProtocol === 'h2' for the document and subresources over TLS. npm deps stay outside tools/ (TESTING 10.4); dist is the throwaway tools/distfixture.mjs build until T4 ships Vite.
  • Root devbox gains chromium + openssl (lock adds only those two entries). Harness server builds use a worktree-local run/nimcache so parallel worktrees stop corrupting each other's object files (hit for real this run).

Acceptance

  • Generated self-signed cert (per run, never committed)
  • An HTTP/2 client negotiates h2 (tools/vhost.test.mjs, node:http2)
  • Direct /_tiles/ 404 (over TLS, still pinned in tools/tiles.test.mjs too)
  • Static cache headers correct (index no-cache, hashed assets immutable, no fallback for a missing hash)
  • Headless chromium launches and reports h2 (devbox run e2e)
  • Existing tile/doors/oneway harnesses green with the new config (now over the TLS origin)
  • Standing gate: full devbox run test green on the rebased tree — 154/154 tests, evidence check 16/16 groups; devbox run e2e 1/1. No test weakened or skipped; scratch results/* reverted.

Docs: TESTING §10.3 (vhost + e2e harness), §10.4 (devbox chromium/openssl, playwright-core outside tools/), §11.1 (TLS/h2 listener, per-run cert, distDir).

Done on `main` (1dff520, rebased on 0448002). **What landed** - `tools/nginx.mjs`: TLS-only vhost with `http2 on` (nginx >= 1.25.1 form), a self-signed certificate generated per run by the new `tools/tlsdev.mjs` (SAN `localhost`/`127.0.0.1`, added to the process's default CA list, so verification stays on), and the client build at `/`: SPA fallback to `index.html`, `Cache-Control: no-cache` for index/routes, `/assets/` with `public, max-age=31536000, immutable` and `=404` for a missing hash, so a stale index fails loudly instead of booting the app. `/_tiles/` stays `internal` (direct 404). - The tile/doors/oneway/wallbehaviour harnesses now set the server's `publicOrigin` to the https vhost (`httpsBaseUrl`), so they run through the same listener the browser uses. - `tools/vhost.test.mjs` (built-ins, `node:http2`, in `devbox run test`): cert self-signed + SANs, ALPN `h2`, index no-cache, immutable asset, SPA fallback, missing asset 404, direct `/_tiles/` 404, and an HTTP/1.1 client still served over TLS. - `e2e/h2.test.mjs` + `e2e/run.sh` (`devbox run e2e`): devbox chromium via pinned `playwright-core`, loads the dist and asserts `nextHopProtocol === 'h2'` for the document and subresources over TLS. npm deps stay outside `tools/` (TESTING 10.4); `dist` is the throwaway `tools/distfixture.mjs` build until T4 ships Vite. - Root devbox gains `chromium` + `openssl` (lock adds only those two entries). Harness server builds use a worktree-local `run/nimcache` so parallel worktrees stop corrupting each other's object files (hit for real this run). **Acceptance** - [x] Generated self-signed cert (per run, never committed) - [x] An HTTP/2 client negotiates h2 (`tools/vhost.test.mjs`, `node:http2`) - [x] Direct `/_tiles/` 404 (over TLS, still pinned in `tools/tiles.test.mjs` too) - [x] Static cache headers correct (index no-cache, hashed assets immutable, no fallback for a missing hash) - [x] Headless chromium launches and reports h2 (`devbox run e2e`) - [x] Existing tile/doors/oneway harnesses green with the new config (now over the TLS origin) - [x] Standing gate: full `devbox run test` green on the rebased tree — 154/154 tests, evidence check 16/16 groups; `devbox run e2e` 1/1. No test weakened or skipped; scratch `results/*` reverted. Docs: TESTING §10.3 (vhost + e2e harness), §10.4 (devbox chromium/openssl, playwright-core outside `tools/`), §11.1 (TLS/h2 listener, per-run cert, `distDir`).
Sign in to join this conversation.