diff --git a/.github/check-token-names.py b/.github/check-token-names.py index e4871d6..e632139 100644 --- a/.github/check-token-names.py +++ b/.github/check-token-names.py @@ -56,9 +56,26 @@ def main() -> int: value.upper(), [] ).append(slug) + # §11.4.1 — every palette carries a reference name, and the TOML is where it + # lives. The Standard and the skills both print these names in prose, so a + # palette without one looks complete everywhere a reader looks and is empty + # in the only place a program reads. Three palettes shipped that way at + # v2.08 and nine gates let it through, because every other check asks about + # values and this is the one required key that is not a colour. + missing = sorted(s for s, p in palettes.items() if not p.get("reference")) + if missing: + for slug in missing: + print(f"`[palettes.{slug}]` has no `reference` key (§11.4.1).", file=sys.stderr) + print( + " Every palette carries a reference name for prose; the slug stays the\n" + " machine identifier. Add `reference = \"-color-palette\"`.", + file=sys.stderr, + ) + return 1 + collisions = {name: v for name, v in seen.items() if len(v) > 1} if not collisions: - print(f"token names OK ({len(seen)} distinct names across {len(palettes)} palettes)") + print(f"token names OK ({len(seen)} distinct names across {len(palettes)} palettes; all carry a reference)") return 0 for name, by_hex in sorted(collisions.items()): diff --git a/steelbore-color-palette/assets/steelbore.toml b/steelbore-color-palette/assets/steelbore.toml index 0ff13a4..997e4b5 100644 --- a/steelbore-color-palette/assets/steelbore.toml +++ b/steelbore-color-palette/assets/steelbore.toml @@ -800,6 +800,7 @@ border = "11.79:1" # still keeps Hot Pink above 4.5:1 on it (4.72:1) — pinker fails the floor. # ------------------------------------------------------------------------- [palettes.steelbore-blackpinkpanther] +reference = "blackpinkpanther-color-palette" "Runway Black" = "#000000" "Backlit Rose" = "#2E0020" "Backstage Black" = "#18000E" @@ -897,6 +898,7 @@ border = "8.31:1" # For a neutral-text reading of the same colours, see steelbore-greenalt. # ------------------------------------------------------------------------- [palettes.steelbore-green] +reference = "green-color-palette" "Vampire Black" = "#0D0208" "Rain Shadow" = "#08180C" "Royal Black" = "#030303" @@ -992,6 +994,7 @@ border = "7.87:1" # canvas, surfaces and status tones; a project picks one, never both (§11.4). # ------------------------------------------------------------------------- [palettes.steelbore-greenalt] +reference = "greenalt-color-palette" "Vampire Black" = "#0D0208" "Rain Shadow" = "#08180C" "Royal Black" = "#030303"