Commit Graph

17 Commits

Author SHA1 Message Date
d4dcde4cc1 gamedata_graph: fix manifest/root summary invariants and --json path guards 2026-11-25 05:11:14 +01:00
755283da59 gamedata_graph: index sibling parentPath lookups and write JSON atomically 2026-11-24 15:01:34 +00:00
c2d7dea381 gamedata_graph: keep scanning after an unsupported XML encoding (#6765)
Squash-merged after diff review of PR #6765 - gamedata_graph: keep scanning after an unsupported XML encoding
2026-11-23 10:05:27 -06:00
0af07f09b1 Merge pull request #4217 from Alpaca-exe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:12:27 -05:00
b54e0d385f Merge pull request #4013 from bbareth
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:10:24 -05:00
5948c690b8 tests: skip the hard-link cases where hard links are unavailable
Guard the remaining unguarded os.link() calls in test_awc_names.py, test_gamedata_graph.py, test_navmesh_decode.py, test_restofworld_index.py, test_rtti_scan.py, test_save_keys.py, test_swizzle_search.py, and test_tex_headers_report_paths.py with try/except (OSError, NotImplementedError) so only the hard-link subtest/check is skipped when hard links are unavailable and the rest of each test still runs.
2026-11-23 01:01:33 +01:00
1ee2c46faa Protect game-data graph inputs from aliased report paths 2026-11-22 23:54:14 +01:00
51a6feece1 Merge main into test-windows-nonascii
hw_oracle's vcvars script is fixed on main by #2667 (UTF-8 + chcp 65001), so this
branch takes main's runner.py and drops its own 8.3-name version. Two of main's
new hw_oracle tests decoded that UTF-8 script as ASCII, which fails when %TEMP%
holds a non-ASCII user name; they now decode it as UTF-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:28:03 +03:00
511732b468 hw_oracle: write the vcvars script for non-ASCII paths; more tests read child output right
A full run with the temp folder in a profile named in Cyrillic found:

- tools/hw_oracle/runner.py wrote build_hw_oracle.cmd with encoding
  "ascii", so any non-ASCII path (the temp work folder, Visual Studio,
  the source) raised UnicodeEncodeError before hw_oracle compiled
  anything. Non-ASCII paths now go in as their 8.3 short names, the file
  in the OEM code page cmd.exe reads it with (UTF-8 elsewhere). New check
  in test_hw_oracle: a work folder named "Пользователь".
- test_spirv_metal_set0_extra: its subprocess stubs didn't take the
  errors= argument this branch added to tools/spirv_metal_set0.py.
- test_user_sgpr_census, test_anim_index, test_awc_manifest,
  test_gamedata_graph, test_manifest_verifier, test_world_build: they
  decoded the Python child's output as UTF-8, but the tool writes in the
  locale encoding (the ANSI code page on Windows), so a non-ASCII temp
  path never matched; test_awc_manifest's reader thread died (no errors=).

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:52:11 +03:00
9e141492d6 gamedata_graph: protect XML inputs found in directories 2026-11-22 18:00:21 +01:00
d188c59670 gamedata_graph: refuse report paths that overwrite source documents or carved inputs 2026-11-22 17:49:58 +05:30
6a2273c916 Merge pull request #1206 from Lucy 2026-11-22 03:37:49 -05:00
78193fb931 gamedata_graph: follow parentPath inheritance inside its own document
A parentPath of the form ../Tag[@attr='value'] is resolved against the
siblings of the element that carries it (exact match) and reported under
parent_path_inheritance: resolved, ambiguous and unresolved sites, chain
depths and cycles. Existing counts and edges are unchanged. On common.rpf
all 40 sites resolve, depth 1-4, no cycles. Synthetic tests cover chains,
both quote styles, case, a non-matching form, a duplicate key, a cycle and
a locator whose parent list lacks the key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:17:53 +00:00
83b285c612 gamedata_graph: report JSON write failures 2026-11-22 05:05:26 -03:00
380464f81b gamedata_graph.py: every <filename> is a graph target, as the module docstring says
The docstring promises a target node for every <filename>, but
scan_document() only read <filename> inside a top-level or content-set
<fileList>, so a filename anywhere else (e.g. <group><filename>) was
dropped. Remaining filenames are now added as document-owned references
(owner "", like loadPath), each element counted once. The docstring line
for <loadPath> is corrected: only those in <includedChangesets> are read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:53:11 +01:00
ad4f2b3017 gamedata_graph.py: handle deep include chains without recursion 2026-11-22 01:01:59 +01:00
b262056ac7 Tools: measure the common.rpf content-set graph
Add gamedata_graph.py, which rebuilds the XML payloads from a carve and measures document -> content-set -> target edges. Include ids are joined only on exact equality; missing ids stay dangling and common:/ is not normalized to $(common)/.

Add synthetic tests for includes, a cycle, reachability, prefix classification, unparsed payloads and output redaction. Add a measured docs page linked from the index.
2026-11-21 22:47:26 +00:00