gamedata_graph: fix manifest/root summary invariants and --json path guards (GAMEDATA-GRAPH-COUNTS-AND-CLI-GUARDS) #1550
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1550
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/gamedata-graph-counts-and-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
What
Fix four summary-accounting and CLI path-guard bugs in
tools/gamedata_graph.py:manifest_documents(build_graph):summary["manifest_documents"]counts only parsed manifest documents (report["parsed"] and report["root"] in MANIFEST_ROOT_SET), whereascategory_statsandroot_statsomittedreport["parsed"]. Requirereport["parsed"]in both so per-category and per-root totals matchsummary["manifest_documents"]."") counted as a named root incategories["uncatalogued"]["roots"](build_graph):summary["root_count"]excludes""(empty/rootless payloads are counted undersummary["rootless"]), yet the category root count included"", makingsum(c["roots"])exceedsummary["root_count"]by 1 whenever any rootless payload exists. Skip empty root names when counting named roots per category.complete=False(scan_document):ET.fromstring(data)succeeds, markreport["complete"] = True(matchinggamedata_xml.py:file_row) instead of keepingdoc.get("complete", True), sosummary["parsed"]can never exceedsummary["documents"].--jsonand directory-mode.binguard (main):args.json is not Noneand reject empty/whitespace--jsonvalues withparser.error(...)instead of silently ignoring--json ""or writing a whitespace filename..bin/.bk2overwrite guard onis_carve(directory containingindex.json) usingrealpathand case-insensitive suffix matching, so directory mode does not reject unrelated.binoutputs while carve mode protects both.binand.bk2streams.Claimed in the coordination issue as
GAMEDATA-GRAPH-COUNTS-AND-CLI-GUARDS— verified 0 open PRs and 0 prior claims; unable to post a comment on#14because GitHub disabled commenting once#14reached its 2,500-comment cap (and no successor"Coordinating who works on what"issue is open yet).Testing
python3 -I -W error tests/test_gamedata_graph.py -v: 24/24 OK (including 3 new regression tests).python3 -I -W error tests/test_gamedata_graph_bad_index.py -v: 5/5 OK.python3 -I tests/test_text_write_line_endings.py: 3/3 OK.python3 -I scripts/check_no_game_data.py tools/gamedata_graph.py tests/test_gamedata_graph.py: clean.python3 -m compileall -q tools/gamedata_graph.py tests/test_gamedata_graph.py: clean.Mutation check against unpatched
main:tools/gamedata_graph.py: all 3 new tests (4 assertions/subtests) fail onmain(FAILED (failures=4)).AI-assisted: yes
GPUs tested: none (CPU-only XML graph tool tests on macOS; no GPU or game files needed)
Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 19 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)