mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:50:52 +01:00
[PR #1550] gamedata_graph: fix manifest/root summary invariants and --json path guards (GAMEDATA-GRAPH-COUNTS-AND-CLI-GUARDS) #1575
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1575
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1550
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/gamedata-graph-counts-and-cli📝 Commits (1)
d4dcde4gamedata_graph: fix manifest/root summary invariants and --json path guards📊 Changes
2 files changed (+64 additions, -9 deletions)
View changed files
📝
tests/test_gamedata_graph.py(+51 -0)📝
tools/gamedata_graph.py(+13 -9)📄 Description
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)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.