load_names called .get() on whatever a --names x.json held, so a top-level
array, a 'files' value or row that is not what rpf9_names.py writes, or a
name that is not a string ended in AttributeError or TypeError. Only OSError
and ValueError are reported as a line by main.
load_names now checks the shape and raises ValueError naming the file, which
main already prints as "ERROR: ..." with exit 2, before --refs is opened. A
file that is not JSON is named too (the message used to be the parser's
alone, and --names is repeatable). An object without 'files', and a row
without 'names', load as before.
tests/test_psin_names.py: three new tests; the two that cover the error
paths fail on the tool as it was (12 failing cases).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.
AI-assisted (Claude), on behalf of dev-ewann.
psin_names.py walks PSIN instance data with psin_data.py and looks up every
u32 hash member (joaat of the lower-cased name) and u64 hash member
(MurmurHash3 x64 low 64 bits) in a dictionary from rpf9_names.py or name
lists, with a salted control. docs/psin.md no longer says PSIN has no model
names. Synthetic tests only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>