Unblock studio's landing 13: drop the dead fallback, make the zoning gate measure on a clean tree
Both halves of studio's L13U refusal were correct and both are mine. 1. THE LEGACY upg100WallIntro FALLBACK IS GONE. It existed for exactly one window — the three plain-text keys were landing in studio's catalogue while this consumer was already written, so the branch rendered the old markup-bearing key until they arrived. They are on main in all eleven locales, so the condition can no longer be true: it is DEAD CODE that keeps a key alive, because studio cannot delete upg100WallIntro while a line still reads it. A fallback whose condition cannot fire is not safety, it is a reference. The three remaining mentions in this file are COMMENTS, not code — verified that no live call site anywhere in plugin-designs/ or library/ reads it, so it is now safe to delete. 2. THE GATE DEFAULTED TO A GITIGNORED FILE. check:zoning-declared read library/scripts/posters/out/_records.json, which .gitignore:94 excludes, so on a clean checkout it exited 75 — NOT MEASURED forever, indistinguishable from an unwired gate. studio measured exactly that and correctly refused to wire it into gates:post. This tree has been here before: check:packets-all SKIPped on every build for weeks for the same reason. ★ THE FIX IS A COMMITTED FIXTURE, NOT A LOOSER GATE. data/people-groups/zoning-records.json carries slug plus every field a selector actually reads — 2,107 records, ~300 KB. country_code alone would not do: the deaf zone reads rop1 and five African/European zones read wagf_block/wagf_region, which is the same omission that made six zones silently resolve to nothing in the packet generator. The live cache is still PREFERRED when present, so a local run measures the freshest data and CI measures the committed one. VERIFIED on a genuinely clean tree (git archive of the staged tree, no cache, no network): PASS — 28 zones, 2,107 records, 2,096 covered, all five assertions green, exit 0. check:i18n-keys-exist PASS, check:sfc-parse PASS.
This commit is contained in:
parent
810ffa2643
commit
8d739edfcd
3 changed files with 25 additions and 10 deletions
1
data/people-groups/zoning-records.json
Normal file
1
data/people-groups/zoning-records.json
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -166,14 +166,26 @@ const decl = JSON.parse(readFileSync(declPath, 'utf8'))
|
|||
|
||||
// Records: the same source everything else uses. NOT fetched here — a gate that needs the network is a
|
||||
// gate that SKIPs in CI, which is how check:packets-all went unevaluated on every build for weeks.
|
||||
const recordsPath = flag('records', join(REPO, 'library/scripts/posters/out/_records.json'))
|
||||
// ★ THE COMMITTED FIXTURE IS THE DEFAULT, the live cache only an override.
|
||||
// ⚠ IT USED TO DEFAULT TO library/scripts/posters/out/_records.json, WHICH IS GITIGNORED
|
||||
// (.gitignore:94) — so on a clean checkout this gate exited 75 and reported NOT MEASURED forever,
|
||||
// which is indistinguishable from an unwired gate. studio measured exactly that before wiring it into
|
||||
// gates:post (L13U) and correctly refused to take it. A gate that cannot run in CI protects nothing;
|
||||
// this tree has been here before with check:packets-all, which SKIPped on every build for weeks.
|
||||
// data/people-groups/zoning-records.json carries slug + every field a selector reads — 2,107 records,
|
||||
// ~300 KB — so the gate measures on a clean tree with no network and no generation step.
|
||||
const DEFAULT_RECORDS = join(REPO, 'data/people-groups/zoning-records.json')
|
||||
const LIVE_CACHE = join(REPO, 'library/scripts/posters/out/_records.json')
|
||||
const recordsPath = flag('records', existsSync(LIVE_CACHE) ? LIVE_CACHE : DEFAULT_RECORDS)
|
||||
if (!existsSync(recordsPath)) {
|
||||
console.log(`${TAG}: NOT MEASURED — no records at ${recordsPath}.`)
|
||||
console.log(' Generate them once (OFFLINE=1 or a packet run caches them), or pass --records <file>.')
|
||||
console.log(' Exit 75 rather than 0: "found no records" is not "found nothing wrong".')
|
||||
console.log(' The committed fixture is data/people-groups/zoning-records.json; pass --records <file>')
|
||||
console.log(' to use another. Exit 75 rather than 0: "found no records" is not "found nothing wrong".')
|
||||
process.exit(75)
|
||||
}
|
||||
const records = JSON.parse(readFileSync(recordsPath, 'utf8'))
|
||||
const rawRecords = JSON.parse(readFileSync(recordsPath, 'utf8'))
|
||||
// The fixture wraps its rows so it can carry its own provenance; the live cache is a bare array.
|
||||
const records = Array.isArray(rawRecords) ? rawRecords : (rawRecords.records || [])
|
||||
|
||||
const clusters = JSON.parse(readFileSync(join(DATA, 'clusters.json'), 'utf8'))
|
||||
const { buildLegendNodes, leafZones } = await import(pathToFileURL(join(DATA, 'legend-tree.js')).href)
|
||||
|
|
|
|||
|
|
@ -223,12 +223,14 @@ const intro = computed(() => {
|
|||
const b = t('messages.upg100WallIntroEmph')
|
||||
const c = t('messages.upg100WallIntroB')
|
||||
const missing = (v, key) => !v || v === key
|
||||
if (missing(a, 'messages.upg100WallIntroA') || missing(b, 'messages.upg100WallIntroEmph')) {
|
||||
// ⚠ THE LEGACY KEY STILL CONTAINS THE MARKUP, so it is passed through unescaped exactly as before.
|
||||
// Escaping it here would print a literal "<strong>" to the reader — a visible regression traded for
|
||||
// a console warning, which is the wrong way round.
|
||||
return t('messages.upg100WallIntro')
|
||||
}
|
||||
// ★ THE LEGACY upg100WallIntro FALLBACK IS GONE (2026-09-27). It existed for exactly one window: the
|
||||
// three plain-text keys were landing in studio's catalogue while this consumer was already written,
|
||||
// so the branch rendered the old single markup-bearing key until they arrived. They are on main in
|
||||
// all eleven locales, so the branch is now DEAD CODE — and dead code that names a key keeps that key
|
||||
// alive: studio cannot delete upg100WallIntro while this line reads it (their L13U measurement).
|
||||
// A fallback whose condition can no longer be true is not safety, it is a reference.
|
||||
// If A or Emph ever went missing the per-key fallback still yields English from the en block, and
|
||||
// check:i18n-keys-exist fails the build before a reader could see it.
|
||||
const tail = missing(c, 'messages.upg100WallIntroB') ? '' : escHtml(c)
|
||||
return `${escHtml(a)}<strong>${escHtml(b)}</strong>${tail}`
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue