Reject duplicate state ID attributes in the script state probe #122
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/123"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T16:39:25Z.
Change
Follow-up to #102.
inspect_treeintools/script_state_probe.pylet the last of severalidattributes on one state node win silently, whilestate_indexintools/script_path_replay.pyraisesDuplicate state ID attribute. The probe now raises the same error for a state node with more than one label-kindidattribute, so both tools treat duplicate state IDs the same way. A sentence in the state-probe section ofdocs/experiments.mddescribes this for contributors who run the probe.Verification
python -B tests/script_state_check.py: 4 tests, OK. The newDuplicateStateIdTestscase fails without the probe change and passes with it. It merges cleanly with #102.Windows: at
3a24823on 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.pyran 4 tests, OK, andctest --preset dev --no-tests=error -R script_state_literals -Vpassed (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)
idattributes count as state IDs, matching the replay and #102. Duplicates of other kinds are ignored, as in the replay.