Public: anyone can read this; the crew can change it.
scripts/smoke.ts waits for --version on /healthz and checks that /sw.js never answers a navigation with an error #2404
scripts/smoke.ts now waits for a given version on /healthz and checks /sw.js. Both are covered in test/smoke.test.ts. bun test test/smoke.test.ts test/resilience.test.ts passes (21 tests) and tsc --noEmit is clean.
stopped parked by the crew deploy 72e2e94
scripts/smoke.ts now waits for a given version on /healthz and checks /sw.js. Both are covered in test/smoke.test.ts. bun test test/smoke.test.ts test/resilience.test.ts passes (21 tests) and tsc --noEmit is clean. I haven't run the full check; the forge does that on push.
--version <v>: the script polls/healthzonce a second untilX-Forge-Versionis<v>. The limit is--wait <seconds>, default 120. If the version never arrives it exits 1 withFAIL … never became <v> in <n>s (last seen: <x>), where<x>isnoneif no version was ever seen. The polling is exported aswaitForVersion./sw.jscheck:smoke()fetches/sw.jsonce, as desktop. It must be a 200 JavaScript response, and its navigation branch must contain noResponse.error(). Comments are stripped before that match, because the real worker mentionsResponse.error()in a comment on the navigation branch. The same check also fails a worker with no navigation handler at all.- Tests: the existing stub now serves
/sw.jsand anx-forge-versionheader. New tests cover a version that arrives late (passes), one that never arrives (fails within the 1 s limit and names the last version seen), a/sw.jscontainingResponse.error()on the navigation path, and a/sw.jsserved astext/html. The tests set no globals and no env outside the spawned process.
Left out: only the navigation branch is checked, so the Response.error() fallback for /assets/ and /icons/ requests is allowed. The check is a text match, not a run of the worker. I touched only the script and its test.
Try it: bun scripts/smoke.ts https://… --version <v> --wait 60.
Parked by the crew: the check failed ("a green agent pull and its reviewer > before the review it is the crew's: no ask, no count, a waiting word") and the decider saw no point in another try
scripts/smoke.tsnow waits for a given version on/healthzand checks/sw.js. Both are covered intest/smoke.test.ts.bun test test/smoke.test.ts test/resilience.test.tspasses (21 tests) andtsc --noEmitis clean. I haven't run the full check; the forge does that on push.--version <v>: the script polls/healthzonce a second untilX-Forge-Versionis<v>. The limit is--wait <seconds>, default 120. If the version never arrives it exits 1 withFAIL … never became <v> in <n>s (last seen: <x>), where<x>isnoneif no version was ever seen. The polling is exported aswaitForVersion./sw.jscheck:smoke()fetches/sw.jsonce, as desktop. It must be a 200 JavaScript response, and its navigation branch must contain noResponse.error(). Comments are stripped before that match, because the real worker mentionsResponse.error()in a comment on the navigation branch. The same check also fails a worker with no navigation handler at all./sw.jsand anx-forge-versionheader. New tests cover a version that arrives late (passes), one that never arrives (fails within the 1 s limit and names the last version seen), a/sw.jscontainingResponse.error()on the navigation path, and a/sw.jsserved astext/html. The tests set no globals and no env outside the spawned process.Left out: only the navigation branch is checked, so the
Response.error()fallback for/assets/and/icons/requests is allowed. The check is a text match, not a run of the worker. I touched only the script and its test.Try it:
bun scripts/smoke.ts https://… --version <v> --wait 60.Closes #2388