From 09b5d394a589c555fbad4efbf799381a65b8d8dd Mon Sep 17 00:00:00 2001 From: Matysh Date: Sat, 22 Aug 2026 01:53:24 +0300 Subject: [PATCH] fix: verify demo bundle freshness for smokes too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Golden runs, benchmarks and documentation captures each called assertFreshDemoBundle; the smoke launcher never did, so all ~128 smokes could silently test a stale demo/srv/assets bundle. On #234 that cost a round of analysis: three assertions went red and a fourth went green, because the old code was wrong in two places that agreed with each other, and a mixed result reads as a logic defect rather than a stale artefact. launch() now runs the check once for every smoke, against the repository root rather than the serving root — demo/srv has no src/** to fingerprint. HP_ALLOW_STALE_BUNDLE=1 skips it for debugging and warns out loud, because a guard that says nothing when it steps aside is the silent success this project keeps removing. A mutation entry proves the call cannot quietly disappear. Issue: #236 User-Visible: no --- scripts/mutation-gate.mjs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/mutation-gate.mjs b/scripts/mutation-gate.mjs index 3f77438b..db537861 100644 --- a/scripts/mutation-gate.mjs +++ b/scripts/mutation-gate.mjs @@ -81,6 +81,19 @@ export const MUTANTS = [ replace: ' for (let i = 0; i < Math.min(count, (recorded?.length ?? 0)); i++) {', }], }, + { + id: 'smoke-launcher-skips-freshness', + guard: 'node --test --test-name-pattern="launcher enforces the gate" ' + + 'test/bundle-freshness.test.mjs', + because: 'a smoke run against a stale demo bundle does not fail cleanly — on #234 three ' + + 'assertions went red while a fourth went green, because the old code was wrong in two ' + + 'places that agreed with each other, and the mixed result reads as a logic defect (#236)', + patches: [{ + file: 'demo/serve.mjs', + find: ' await assertFreshDemoBundleUnlessAllowed(page, REPO_ROOT);', + replace: ' // freshness intentionally skipped by the mutant', + }], + }, { id: 'snapn-returns-input-near-node', guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs ' @@ -684,8 +697,8 @@ export const MUTANTS = [ + 'changing the separate room-fill gradient', patches: [{ file: 'src/device-presentation.ts', - find: ' if (lqi <= 40) return \'low\';', - replace: ' if (lqi < 40) return \'low\';', + find: ' if (lqi <= 40) return \\'low\\';', + replace: ' if (lqi < 40) return \\'low\\';', }], }, {