check:packets-all asserts zone coverage only where a zone was generated

gates:pre's check:packet-offline writes the four fixture packets into the
same directory this gate reads, so after gates:pre that directory is never
empty. A tree that had generated no zone then failed here on all 28 zones,
and gates:post was red on every landing for nothing anyone could fix.

Fixtures exercise the renderer, not a zone. With only fixtures present the
coverage assertion now says it did not run, and the per-packet checks still
run on the fixtures. One zone packet present and all 28 are required, as
before: planted with laos alone, it fails on the other 27.
This commit is contained in:
Doxa Maps 2026-09-29 03:53:42 +00:00
parent c62db6ee4c
commit 2b05ddce3c

View file

@ -88,7 +88,14 @@ if (!files.length) {
const { buildLegendNodes, leafZones } = await import(pathToFileURL(resolve(REPO, 'plugin-designs/my-upg-100-list/data/legend-tree.js')).href)
const zones = leafZones(buildLegendNodes(z, { records: null })).map((l) => l.id)
const have = new Set(all.map((f) => f.replace(/\.html$/, '')))
for (const id of zones) if (!have.has(id)) failures.push(`zone '${id}' has NO generated packet at all`)
// ★ COVERAGE IS ASSERTED WHERE ZONES WERE GENERATED. gates:pre's check:packet-offline writes the four
// fixture-* packets into this directory, so after gates:pre it is never empty, and a tree that had
// generated no zone failed here on all 28: gates:post was red on every landing, for nothing anyone
// could fix. Fixtures exercise the renderer, not a zone. One zone packet here and all 28 are required.
if (!zones.some((id) => have.has(id))) {
console.log(`PACKETS-ALL (headless): coverage not asserted — no zone packet here, only ${all.length} fixture/variant packet(s)`)
console.log(' ONLY=<zone> node library/scripts/posters/packet.mjs generates one; then every zone is required.')
} else for (const id of zones) if (!have.has(id)) failures.push(`zone '${id}' has NO generated packet at all`)
}
// 2. PER PACKET: a non-empty map page and N > 0 groups. The map page is the FIRST sheet; without
// the lifted poster it holds only the kicker/title/subtitle, so "contains an <img or <svg" is the