Repository navigation
tools: read story content-definition XML (ASSET-149) - #2268
Conversation
Preserve ordered records and expose file/include/setup views, with synthetic tests and counts from four complete archives. No game data included. AI-assisted.
|
Independent review & local CPU verification (AI-assisted) on Windows 11 x64 / Python 3.14.8 against commit Tests run locally:
Code & diff review (
No issues found; looks ready to merge from a CPU/code-read perspective. |
|
AI-assisted code read (Claude), not run. One functional issue, otherwise looks good. 1. One bad document in a carve directory aborts the rest of that directory and leaves partial counts. Suggested fix: report the error per payload instead of raising it. For example, yield the exception as the third value and let callers decide: try:
doc = parse_content(source.read(r) for r in group)
except ContentError as exc:
doc = exc
yield row["offset"], row["stored"], docThen have 2. Minor. The Everything else checks out: the scalar rules ( |
|
Independent check of
So: 30 documents, all accepted (22 change sets, 4 content definitions, 4 setup documents), 65 file entries, 22 included change-set references and 8 setup groups, as in the description. I didn't repeat the record-by-record ElementTree comparison. @jbot1324's point about one bad document aborting the rest of a carve folder doesn't show up on this data:
|
|
Ran this on
One failure: jbot1324's point 1 reproduces with the PR's own fixtures in a synthetic carve: AI-assisted (Claude Code). |
Claimed as ASSET-149: #2078 (comment)
What and why
The story/rest-of-world archives contain readable content change sets, content definitions and setup XML, but the existing index only classifies those payloads.
tools/content_definitions.pynow reads the three measured roots into ordered immutable records and exposes file entries, included change sets/sets, and setup groups. Unknown fields, attributes, text and tails are preserved; symbolic references and values are not resolved or coerced.The CLI accepts local XML files or existing carve directories and prints aggregate counts only. Missing blocks and malformed/ambiguous input fail explicitly; DTDs are refused. Documentation explains the API, parser limits, existing grouping limitations and the remaining runtime/resource-mapping work. This is independent of ASSET-139 and PR #1995; neither patch is included.
Tested
Windows 11 Pro 10.0.26200, Python 3.13.15. CPU-only change: no GPU required or exercised (host GPU: RTX 5070, driver 32.0.16.1656).
python -I tests/test_content_definitions.py: 11 passed.test_gamedata_index.py(19),test_gamedata_xml.py(6),test_restofworld_index.py(23),test_docs_links.py(5), andtest_text_write_line_endings.py(2): all passed.python -m compileall -q make_game.py tools testsandgit diff --check: passed.core_restofworld,story000_restofworld,core_restofworld001, andcore_licenses_data: all 30 recovered content XML documents accepted (22 change sets, 4 content definitions, 4 setup documents), 65 file entries, 22 included change-set references, 8 setup groups. Zero record differences against an independent ElementTree parse of each reassembled payload (tags, attributes, text, tails, child order). No claim about the separate 20 GB story000.rpf or runtime interpretation.Checklist