Reject duplicate state ID attributes in the script state probe #123

Manually merged
github merged 2 commits from gh-pr/123/head into gh-pr/123/base 2026-11-26 21:28:36 +00:00
Owner

@⁠Vonsek on GitHub · 2026-11-21 16:39 UTC · original
Vonsek:script-duplicate-state-ids → main · +13 −2 · 3 files · 2 commits · merged 2026-11-21 17:20 UTC

Change

Follow-up to #102. inspect_tree in tools/script_state_probe.py let the last of several id attributes on one state node win silently, while state_index in tools/script_path_replay.py raises Duplicate state ID attribute. The probe now raises the same error for a state node with more than one label-kind id attribute, so both tools treat duplicate state IDs the same way. A sentence in the state-probe section of docs/experiments.md describes this for contributors who run the probe.

Verification

python -B tests/script_state_check.py: 4 tests, OK. The new DuplicateStateIdTests case fails without the probe change and passes with it. It merges cleanly with #102.

Windows: at 3a24823 on Windows 11 build 26200.9974, VS Build Tools 2022 17.14 (MSVC 14.44.35207), Windows SDK 10.0.26100, Python 3.12: python -B tests/script_state_check.py ran 4 tests, OK, and ctest --preset dev --no-tests=error -R script_state_literals -V passed (1/1).

Evidence and follow-up

The regression is a synthetic node and attribute list built in the test, with no external fixture and no local data. Assumption: only label-kind (5) id attributes count as state IDs, matching the replay and #102. Duplicates of other kinds are ignored, as in the replay.

**@⁠Vonsek** on GitHub · 2026-11-21 16:39 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/123) `Vonsek:script-duplicate-state-ids` → `main` · +13 −2 · 3 files · 2 commits · merged 2026-11-21 17:20 UTC ## Change Follow-up to #102. `inspect_tree` in `tools/script_state_probe.py` let the last of several `id` attributes on one state node win silently, while `state_index` in `tools/script_path_replay.py` raises `Duplicate state ID attribute`. The probe now raises the same error for a state node with more than one label-kind `id` attribute, so both tools treat duplicate state IDs the same way. A sentence in the state-probe section of `docs/experiments.md` describes this for contributors who run the probe. ## Verification `python -B tests/script_state_check.py`: 4 tests, OK. The new `DuplicateStateIdTests` case fails without the probe change and passes with it. It merges cleanly with #102. Windows: at 3a24823 on Windows 11 build 26200.9974, VS Build Tools 2022 17.14 (MSVC 14.44.35207), Windows SDK 10.0.26100, Python 3.12: `python -B tests/script_state_check.py` ran 4 tests, OK, and `ctest --preset dev --no-tests=error -R script_state_literals -V` passed (1/1). ## Evidence and follow-up The regression is a synthetic node and attribute list built in the test, with no external fixture and no local data. Assumption: only label-kind (5) `id` attributes count as state IDs, matching the replay and #102. Duplicates of other kinds are ignored, as in the replay.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:28:35 +00:00
github manually merged commit 2d9dda3bef into gh-pr/123/base 2026-11-26 21:28:36 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.