Validate UI XML in lint, and fix the two files that failed it #5

Merged
joeyr merged 1 commit from fix/ui-xml-validation into main 2026-08-16 18:02:33 -05:00
Owner

XML forbids a double hyphen inside a comment. Both games/_template/ui/Global.xml and Hanabi UI used one as a dash, in the same prose style the Lua files use, so both were invalid — and because the template was wrong, every game copied from it would have inherited the problem.

The failure mode is what makes this worth a lint gate rather than just a fix. TTS pushes UI XML as a channel separate from the Lua script and fails it separately: the panel silently never appears while the Lua half loads and reports itself perfectly healthy. Chat carries one red line and then scrolls away.

Found by pasting Hanabi UI into a live table and getting an engine with no buttons.

tools/check_ui_xml.py parses every games/*/ui/*.xml and is wired into make lint. TTS accepts several top-level elements where XML insists on exactly one root, so each file is wrapped before parsing. The checker also notices a stray -- and says so explicitly, because not well-formed (invalid token) is not a useful thing to read at position 32 of a comment.

Verified both directions: lint passes on the corrected files, and reintroducing a double hyphen fails it with exit 2.

XML forbids a double hyphen inside a comment. Both `games/_template/ui/Global.xml` and Hanabi UI used one as a dash, in the same prose style the Lua files use, so both were invalid — and because the **template** was wrong, every game copied from it would have inherited the problem. The failure mode is what makes this worth a lint gate rather than just a fix. TTS pushes UI XML as a channel separate from the Lua script and fails it separately: **the panel silently never appears while the Lua half loads and reports itself perfectly healthy.** Chat carries one red line and then scrolls away. Found by pasting Hanabi UI into a live table and getting an engine with no buttons. `tools/check_ui_xml.py` parses every `games/*/ui/*.xml` and is wired into `make lint`. TTS accepts several top-level elements where XML insists on exactly one root, so each file is wrapped before parsing. The checker also notices a stray `--` and says so explicitly, because *not well-formed (invalid token)* is not a useful thing to read at position 32 of a comment. Verified both directions: lint passes on the corrected files, and reintroducing a double hyphen fails it with exit 2.
Validate UI XML in lint, and fix the two files that failed it
All checks were successful
lint / lua (pull_request) Successful in 19s
7e1356fb01
XML forbids a double hyphen inside a comment. Both games/_template/ui/Global.xml
and Hanabi's UI used one as a dash, in the same prose style the Lua files use,
so both were invalid -- and because the template was wrong, every game copied
from it would have inherited the problem.

The failure mode is what makes this worth a lint gate rather than a fix. TTS
pushes UI XML as a channel separate from the Lua script and fails it separately:
the panel silently never appears while the Lua half loads and reports itself
perfectly healthy. Chat carries one red line about it and then scrolls away.
Found by pasting Hanabi's UI into a live table and getting an engine with no
buttons.

tools/check_ui_xml.py parses every games/*/ui/*.xml and is wired into make lint,
so CI now catches this. TTS accepts several top-level elements where XML insists
on exactly one root, so each file is wrapped before parsing. The checker also
notices a stray `--` and says so explicitly, because "not well-formed (invalid
token)" is not a useful thing to read at position 32 of a comment.

Verified both ways: lint passes on the corrected files, and reintroducing a
double hyphen fails it with exit 2.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
joeyr merged commit b21fdf5e32 into main 2026-08-16 18:02:33 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
joeyr/tts-games!5
No description provided.