awc_cue_labels: reject excessively nested JSON (AWC-CUE-JSON-DEPTH) #1186
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1186"
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 ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T19:49:56Z.
Claimed in the coordination issue as: AWC-CUE-JSON-DEPTH
What and why
A deeply nested invalid cue sheet raises RecursionError during JSON decoding and prints a traceback. Convert it to a concise ValueError so the CLI exits cleanly without publishing a label directory.
Tested
AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:09:08Z.
Recommendation: [MERGE]
Reasoning:
awc_cue_labelsturns aRecursionErrorfrom deeply nested cue-sheet JSON into a cleanValueError, so the CLI exits without publishing a partial label directory. Tiny tool fix with a test. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict withmain. Merge once the queued checks are green.Impact level: 2/10
Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T10:43:03Z.
@Deedlyy Thanks for the [MERGE] review!
6722fc8c6adding an explicit string/escape-aware _check_json_depth(text, max_depth=64) pre-check in ools/awc_cue_labels.py (while keeping the RecursionError fallback) and expanding ests/test_awc_cue_json_depth.py to test both deep object/array nesting and bracket/escaped-quote characters inside string literals.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:49:08Z.
#1186 | head
6722fc8c64(merged cleanly with maina9e247cd69) |python -I tests/test_awc_cue_json_depth.py -v+python -I tests/test_awc_cue_labels.py -v| red on main:FAILED (failures=2)(RecursionErrortraceback on 3000-deep[array andJSONDecodeErrorinstead of the depth guard on 100-deep{object) | green on PR+main:3 ran, OK(test_awc_cue_json_depth.py) and2 ran, OK(test_awc_cue_labels.py) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
6722fc8c64(tools/awc_cue_labels.pyandtests/test_awc_cue_json_depth.py) merged cleanly ontomain(a9e247cd69) on Windows 11 — first Windows verification report on this PR. Confirmed_check_json_depth()rejects nesting aboveMAX_JSON_DEPTH = 64beforejson.loads()runs (avoiding CPython's shallower C stack limit on Windows x64), ignores brackets inside JSON string literals with escaped quotes/backslashes, leaves the output directory uncreated on failure, and passesscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:44:23Z.
RUN for #1186 (red/green, synthetic inputs only, no build, no game, GPU not used)
Heads tested
6722fc8c64829530dbd0(origin/main at the time of the run)git merge --no-edit --no-ff(local only, merge was clean, nothing pushed)Commands (one process per file, from the repo root, CPython 3.13.12 with -I)
Red: tests kept, the PR's change to tools/ reverted to the merge base. behavioural: with tools/awc_cue_labels.py reverted, 2 of 3 tests fail (failures=2); the CLI dies with a RecursionError traceback instead of the concise "nesting is too deep" error and exit status the PR adds.
Green at PR head: yes (tests/test_awc_cue_json_depth.py: 3 passed; tests/test_awc_cue_labels.py: 2 passed)
Green merged into main: yes, same files all pass on the merged tree (counts as above)
Plain main (other covering tests, without the PR): pass, so nothing pre-existing fails and nothing breaks once merged.
Kind of red: behavioural (test fails for the reason the PR fixes).
Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12; GPU not used.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T00:54:46Z.
Merged after enlight3d's red/green check (check) (RTX 3090, driver 621.40, Windows 11) and a local re-check here. Merged after local re-verification: this PR merged onto
main7100865c4without conflict, and its test file(s) (tests/test_awc_cue_json_depth.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.