Commit Graph

9 Commits

Author SHA1 Message Date
8f2c0e3512 psin_names: publish --refs atomically and match .JSON case-insensitively 2026-11-25 19:37:15 +08:00
b763516e8c psin_names: use shared same_report_path for all --refs input and carve-index checks (#6531)
Squash-merged after diff review of PR #6531
2026-11-23 12:51:53 -06:00
7e177f6897 Protect carved PSIN inputs from aliased refs reports 2026-11-22 23:38:35 +01:00
3f4e414579 fix(tools): guard --refs against directories and files inside src in psin_names 2026-11-22 20:15:03 +02:00
51ac2a6957 psin_names: a --names JSON of the wrong shape is one ERROR line, not a traceback
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>
2026-11-22 11:10:14 -05:00
452d6b52a1 Merge pull request #1815 from Tayar 2026-11-22 09:48:24 -05:00
2e425c1708 psin_names: protect source files from the refs writer 2026-11-22 11:24:43 -03:00
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
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.
2026-11-22 14:20:30 +00:00
58919a9faa tools: resolve PSIN name-hash members against known resource names
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>
2026-11-22 13:46:28 +01:00