check:composite-embed-knobs: a composite with no map is N/A, not unmeasured

bp-big-picture could not be measured "because there's no canvas under a minimal config", and that was
the honest answer to a question it should never have been asked. Big Picture nests NO MAP: it composes
a research header and a people-groups grid, and its built bundle contains zero occurrences of
mapbox-gl or maplibre-gl. There is no canvas to draw and no Mapbox half to prove.

The target list was wrong, not the gate. A profile qualifies if `composes` names a map bundle OR the
type is nested-elements-mfe; that second arm exists because country-posters-mfe bakes its children and
names nothing in `composes`, but it is loose enough to admit composites that nest no map at all.

Now a non-`composes` candidate must also SHIP an engine, decided on the BUILT artefact rather than the
manifest, because whether a bundle compiled a map engine is a fact about what it built. Map-less
composites are printed as N/A so they stay visible instead of being silently dropped.

MEASURED: exactly 2 excluded — bp-big-picture (big-picture) and stack-demo — both genuinely map-less.
No other owner's map target is affected, so the set goes from 9 targets with 2 permanently unmeasured
to 7 real targets plus 2 declared N/A.

Gate only, no product code, no rebuild. Still needs a browser and a token to run: rega's, not mine.
This commit is contained in:
Doxa Maps 2026-09-27 05:40:02 +00:00
parent 42ce1e657b
commit d024b855bd

View file

@ -74,6 +74,7 @@ for (const b of manifest.bundles || []) {
if ((b.profiles || []).some((p) => p.isMap)) mapBundles.add(b.bundle)
}
const targets = []
const mapless = [] // composites that nest no map: reported as N/A, never as unmeasured
for (const b of manifest.bundles || []) {
// TWO WAYS A COMPOSITE DECLARES ITSELF, and taking only the first under-covered this gate.
// `composes` is written when a composite mounts children BY TAG; a composite that BAKES its
@ -84,8 +85,24 @@ for (const b of manifest.bundles || []) {
const byCompose = composes.some((c) => mapBundles.has(c))
const profile = (b.profiles || []).find((p) => p.element && (byCompose || p.type === 'nested-elements-mfe'))
if (!profile || !b.scriptUrl) continue
// ★ A COMPOSITE WITH NO MAP IS NOT A MAP-EMBED TARGET, and counting it as one buys a permanent
// UNMEASURED that reads like a gap. The `type` arm above is deliberately loose — country-posters-mfe
// BAKES its children, so `composes` names nothing — but loose enough to admit composites that nest no
// map at all: bp-big-picture composes a research HEADER and a people-groups GRID, and its built
// bundle contains zero occurrences of mapbox-gl or maplibre-gl. It can never draw a canvas, so
// "no canvas under a minimal config" was the honest answer to a question that should not have been
// asked of it. Decided on the BUILT artefact rather than the manifest, because whether a bundle
// ships an engine is a fact about what it compiled, not about what it declares.
if (!byCompose) {
let js = ''
try { js = readFileSync(resolve(ROOT, 'public', TREE_NAME, b.bundle, `${b.bundle}.js`), 'utf8') } catch (_) { js = '' }
if (js && !/mapbox-gl|maplibre-gl/.test(js)) { mapless.push(`${profile.element} (${b.bundle})`); continue }
}
targets.push({ bundle: b.bundle, element: profile.element, profile: profile.profile, script: `${b.bundle}/${b.bundle}.js` })
}
if (mapless.length) {
console.log(` · ${mapless.length} composite(s) nest NO map, so the knobs do not apply and they are not targets: ${mapless.join(', ')}`)
}
if (!targets.length) {
console.log('COMPOSITE-EMBED-KNOBS: SKIP — the manifest declares no composite that nests a map.')
process.exit(0)