One gate owns the source rule; this one keeps the six measurements

check:no-silent-engine is in gates:post as of main 23976fb0 and scans every plugin for
a cross-engine fallback, so this leaf's own static arm is deleted. Two gates owning one
source-level rule meant my leaf was checked twice while every other leaf was checked
once, and the narrower copy is always the one that drifts.

What stays is the part no source read can do: two providers across engine present,
engine blocked and both blocked, with the CDN blocked by request routing the way a proxy
or an offline kiosk does it, and the engine identified from the canvas class rather than
a debug handle. All six still pass after the deletion.

--poison now NAMES where the falsifiable arm went instead of exiting 0 as though it had
self-tested — and it names it correctly: the tree-wide gate's flag is --self-test, not
--poison, which I checked in its source rather than assuming the convention my own gates
use. Its package.json description no longer claims a static arm this file does not have.
This commit is contained in:
Doxa Maps 2026-09-27 03:49:05 +00:00
parent a1f3bb57bd
commit e5398c072f

View file

@ -93,28 +93,20 @@ const run = async (browser, provider, block) => {
const fails = []
/* ═══ THE STATIC ARM, AND WHY THE SELF-TEST LIVES HERE ════════════════════════════════════════
* The six runtime measurements are the behavioural evidence, but they cannot be made to fail on
* demand: with the fallback deleted, planting a substitute engine on the PAGE proves nothing —
* the leaf correctly ignores it, so the arms pass and a --poison that expected a failure was
* asserting the wrong thing (measured: it reported "this check cannot see the defect", about
* itself). The defect is a line of SOURCE, so the falsifiable arm reads the source. */
const LEAF_SRC = resolve(HERE, '../plugin-designs/gospel-resources/resources-map.vue')
let src = readFileSync(LEAF_SRC, 'utf8')
if (POISON) src = src.replace('const gl = engineGlobal(grProvider)\n', 'const gl = engineGlobal(grProvider) || window.mapboxgl\n')
/* COMMENTS STRIPPED FIRST. The fix's own comment QUOTES the deleted line — "this used to read
`engineGlobal(grProvider) || window.mapboxgl`" — and the first version of this arm read that
quotation as the defect, failing the very commit that removed it. A gate that cannot tell code
from prose about code will keep flagging the explanation forever. */
const code = src.replace(/\/\*[\s\S]*?\*\//g, ' ').replace(/(^|[^:'"\\])\/\/[^\n]*/g, '$1')
const BAD = /engineGlobal\([^)]*\)\s*\|\|/
if (BAD.test(code)) {
fails.push('resources-map.vue falls back from engineGlobal() to another engine global — a page that asked for the keyless engine would silently get the one that needs a token')
}
/* ⚠ THE STATIC ARM LIVES ELSEWHERE NOW, DELIBERATELY. It used to read this leaf's source for a
* cross-engine fallback, and check:no-silent-engine-substitution does that for EVERY plugin. Two
* gates owning one source-level rule means this leaf was checked twice while the others were
* checked once, and the copy that drifts is always the narrower one. What stays here is the part
* no source read can do: the six RUNTIME measurements below.
*
* ⚠ SO --poison HAS NOTHING TO FALSIFY HERE. With the fallback deleted, planting a substitute
* engine on the PAGE proves nothing (the leaf correctly ignores it), which is measured: an earlier
* runtime poison reported "this check cannot see the defect" about itself. The falsifiable arm went
* with the static check, and this one says so rather than pretending.
*/
if (POISON) {
if (!fails.length) { console.error('ENGINE-CONTRACT --poison: the reintroduced `|| window.mapboxgl` was NOT caught — this check cannot see the defect it exists for.'); process.exit(1) }
console.log(`ENGINE-CONTRACT --poison: caught it — ${fails[0]}`)
console.log('ENGINE-CONTRACT: SELF-TEST PASS — the static arm fails as designed. The six runtime measurements are not re-run here; they cannot be forced to fail without reintroducing the defect in a built bundle.')
console.log('ENGINE-CONTRACT --poison: the falsifiable source arm is check:no-silent-engine, run with --self-test; it owns that rule tree-wide and sits in gates:post as of main 23976fb0.')
console.log('ENGINE-CONTRACT: the six runtime measurements cannot be forced to fail without reintroducing the defect in a built bundle.')
process.exit(0)
}
@ -152,7 +144,7 @@ try {
for (const f of fails) console.error(` ${f}`)
process.exit(1)
}
console.log('ENGINE-CONTRACT: PASS — the source keeps no cross-engine fallback, and 2 providers x 3 load states: the engine asked for or a named failure, never a substitute.')
console.log('ENGINE-CONTRACT: PASS — 2 providers x 3 load states: the engine asked for or a named failure, never a substitute.')
} finally {
try { await browser?.close() } catch (_) {}
try { srv?.close?.() } catch (_) {}