testsAndMisc/docs/superpowers/evidence/glyph-art-split-2026-08-21.json
Krzysztof kuhy Rudnicki 1d7271f023 Phase 2: enforce the 250-line cap and stop pushing red
Two pre-commit hooks and one pre-push extension, plus the _glyph_art split
that had to land first — the cap gate cannot be wired while any file is over
it, and the lyricanki note-ascender glyph had taken _glyph_art.py to 253.

file-length-cap runs check_file_length.sh --all repo-wide rather than on
staged files, so a file that grows past the cap in some other commit is still
caught. Proven to block, not assumed: with a deliberate 261-line file staged
the hook exits 1 and names it; with the file removed it passes.

ci-baseline-green is the user's option (a): refuse to build on a main that is
already red. It fails closed on a definitively failing baseline and warns-and-
passes on anything it cannot determine — offline, no gh, unauthenticated, no
settled runs — each call capped at 5s. Blocking every commit on network
reachability buys nothing when (b) is the real per-change guarantee.
CI_GREEN_SKIP=1 is the escape for a fix-forward commit. python-tests.yml is
excluded on purpose: it is path-filtered, so a shell-only commit never
triggers it and its "latest run" would produce false reds.

This hook already earned its place. Run against a red main earlier in this
session it refused with "Shell tests (failure)", which is how the broken
SETUP_SOURCES was found instead of being pushed over.

ci_mirror gains the shell-tests workflow's side-effect-free half — every
lib/tests/run_all.sh plus the workflow's own test list, the user's option (b).
That list is parsed out of shell-tests.yml rather than copied: a hardcoded
duplicate drifts the moment someone adds a test, and a mirror that quietly
checks less than CI is worse than no mirror because it reports safe. The
Arch-container half stays unmirrored — it wants root and an Arch userland.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F3PzGc75gBcdxP3PkHXGcV
2026-08-21 16:41:31 +02:00

48 lines
3.0 KiB
JSON

{
"intent": "Bring python_pkg/app_icons/_glyph_art.py (253 lines) back under the 250-line cap without discarding the lyricanki note-ascender glyph that pushed it over. This is the last blocker to wiring the cap into pre-commit.",
"scope": [
"python_pkg/app_icons/_glyph_art.py: 253 -> 208 lines",
"New: python_pkg/app_icons/_glyph_art_more.py (50)",
"python_pkg/app_icons/glyphs.py: imports _NOTE_ASCENDER and _TRACK_BARS from the new module",
"Non-goal: any change to the glyph artwork itself"
],
"changes": [
"Moved the two most recent glyph constants (_TRACK_BARS, _NOTE_ASCENDER) with their comments into a companion module. The division carries no meaning beyond the cap, and the module docstring says so, because a reader would otherwise look for a taxonomy that is not there.",
"glyphs.py imports from both modules. Nothing else changed: the Glyph dataclass, the registry and the lookup all stay put, so no caller or test needs to know which file a glyph lives in — the same contract the original _glyph_art split established."
],
"verification": [
{
"command": "python3 -c 'from python_pkg.app_icons.glyphs import GLYPHS ...'",
"result": "pass",
"evidence": "13 glyphs load; both moved names ('note-ascender', 'track-bars') are present in the registry."
},
{
"command": "build_svg(GLYPHS[name], '#7C9CF5', with_background=True) for the moved glyphs",
"result": "pass",
"evidence": "Ran the real renderer, not just the import: note-ascender produces 641 bytes and track-bars 444, both with the accent colour substituted. A control glyph (anvil, untouched) renders alongside them at 496 bytes."
},
{
"command": "python3 -m pytest python_pkg/app_icons -q",
"result": "pass",
"evidence": "44 passed. The coverage gate reports below 100% only because a single-package run does not exercise the rest of the repo."
},
{
"command": "bash meta/scripts/check_file_length.sh --all",
"result": "pass",
"evidence": "'all checked files are within 250 lines'. Both modules are under: 208 and 50."
},
{
"command": "pre-commit run --files <the four python files>",
"result": "pass",
"evidence": "ruff, ruff format, mypy, pylint, bandit, pytest-with-coverage and codespell all pass. No suppression added."
}
],
"risks": [
"A mid-edit slip removed the _NOTE_ASCENDER argument from its Glyph(...) call site as well as from the import list, which surfaced immediately as a TypeError on import. Repaired and re-verified by rendering; recorded because the import-only check would not have caught it — the registry has to be built for that failure to appear.",
"Two modules now hold glyph data, so someone adding a glyph must pick one. The docstring directs them to the cap rather than to a false distinction."
],
"rollback": [
"git revert the commit; _glyph_art.py returns to 253 lines and the file-length gate cannot be wired until it is under 250 again."
]
}