From b0d0fcaf91e9b26afcd509e97f9699f322d8e5c9 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Wed, 30 Sep 2026 21:23:59 +0000 Subject: [PATCH] seriesFor: state that every no-sheet country shares one series, and gate it A second country without a sheet size would silently join India's oversized series and print India as "map 1 of 2". The comment now says so, and check:country-sheet-one-path fails when more than one country has no sheet, naming them, so that change is a decision rather than drift. Its self-test plants a second one (China) and requires the arm to fail. --- library/packet/countrySheet.js | 2 ++ .../country-posters/scripts/check-country-sheet-one-path.mjs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/library/packet/countrySheet.js b/library/packet/countrySheet.js index 65b89377a..ea4dbbc87 100644 --- a/library/packet/countrySheet.js +++ b/library/packet/countrySheet.js @@ -60,6 +60,8 @@ * A null sheet is a tier too: India (sheet null, too many groups for any paper size) is its own * 1-of-1 series. Skipping it printed "map 1 of 0" on India's packet page 1 from the Regions tab * while the wall's own copy printed "map 1 of 1" -- the two paths disagreeing again. + * Every null-sheet country shares that ONE oversized series: a second would make India "map 1 of 2". + * check:country-sheet-one-path fails when that happens, so it is decided, not drifted into. */ export function seriesFor(countries, item) { if (!item || !Array.isArray(countries)) return undefined diff --git a/plugin-designs/country-posters/scripts/check-country-sheet-one-path.mjs b/plugin-designs/country-posters/scripts/check-country-sheet-one-path.mjs index c3a06e1f9..8f8b00de8 100644 --- a/plugin-designs/country-posters/scripts/check-country-sheet-one-path.mjs +++ b/plugin-designs/country-posters/scripts/check-country-sheet-one-path.mjs @@ -93,6 +93,8 @@ export function armB(seriesFor, countries) { const by = (iso) => countries.find((c) => c.iso3 === iso) const ind = by('IND') const s = ind && seriesFor(countries, ind) + const oversized = countries.filter((c) => (c.sheet ?? null) === null) + if (oversized.length > 1) fails.push(`${oversized.length} countries have no sheet size (${oversized.map((c) => c.iso3).join(', ')}): they now share ONE oversized series, so India prints "map 1 of ${oversized.length}". Decide that deliberately, then update this expectation.`) if (!ind) fails.push('India is missing from country-posters.json') else if (!s || s.index !== 1 || s.totalLists !== 1 || s.totalGroups !== ind.count) fails.push(`India (sheet ${JSON.stringify(ind.sheet)}) should be map 1 of 1 with ${ind.count} groups; got ${JSON.stringify(s)}`) const t3 = countries.filter((c) => c.sheet === '3x3') @@ -126,6 +128,7 @@ async function main() { ['makeCountrySheet without countries', () => armA({ ...files, [wall]: files[wall].replace(/countries: data\.countries \|\| \[\],/, '') })], ['India skipped (the old guard)', () => armB((l, it) => (!it || !it.sheet ? undefined : seriesFor(l, it)), countries)], ['absent code given a position', () => armB((l, it) => seriesFor(l, it) || { index: 1, totalLists: 1, totalGroups: 0 }, countries)], + ['a second no-sheet country joins India', () => armB(seriesFor, countries.map((c) => (c.iso3 === 'CHN' ? { ...c, sheet: null } : c)))], ] let bad = 0 for (const [name, run] of cases) {