awc_cue_labels: reject excessively nested JSON (AWC-CUE-JSON-DEPTH) #1186

Open
github-bot wants to merge 2 commits from github-bot/gh-1186 into main AGit
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-24 19:49 UTC · original
Taffyyy-ops:fix/awc-cue-json-depth → main · +89 −1 · 2 files · 2 commits · open

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

  • python -I tests/test_awc_cue_json_depth.py: 2 passed, synthetic inputs only.
  • python -I tests/test_awc_cue_labels.py: 2 passed.
  • python -I scripts/check_no_game_data.py; git diff --check: passed.
  • Windows 11, Python standard library. GPU not required.

AI-assisted: yes.

**@⁠Taffyyy-ops** on GitHub · 2026-11-24 19:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1186) `Taffyyy-ops:fix/awc-cue-json-depth` → `main` · +89 −1 · 2 files · 2 commits · open 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 - python -I tests/test_awc_cue_json_depth.py: 2 passed, synthetic inputs only. - python -I tests/test_awc_cue_labels.py: 2 passed. - python -I scripts/check_no_game_data.py; git diff --check: passed. - Windows 11, Python standard library. GPU not required. AI-assisted: yes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:42:01 +00:00
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:09 UTC · original

Recommendation: [MERGE]

Reasoning: awc_cue_labels turns a RecursionError from deeply nested cue-sheet JSON into a clean ValueError, 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 with main. Merge once the queued checks are green.

Impact level: 2/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:09 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1186#issuecomment-7143113221) **Recommendation:** [MERGE] **Reasoning:** `awc_cue_labels` turns a `RecursionError` from deeply nested cue-sheet JSON into a clean `ValueError`, 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 with `main`. Merge once the queued checks are green. **Impact level:** 2/10
Author
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-25 10:43 UTC · original

@⁠Deedlyy Thanks for the [MERGE] review!

  • Identified why ests/test_awc_cue_json_depth.py failed on Linux and macOS CI (stdlib-tests-linux / macos-python, run 45474369073): CPython's C _json scanner parses 3,000 nested [ tokens without raising RecursionError on platforms with a larger C stack than Windows.
  • Pushed commit 6722fc8c6 adding 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.
  • Re-verified locally (AI-assisted, synthetic only): ests/test_awc_cue_json_depth.py (3/3 OK), ests/test_awc_cue_labels.py (2/2 OK), ests/test_tool_stdout_encoding.py (4/4 OK), ests/test_text_write_line_endings.py (3/3 OK), scripts/check_no_game_data.py (␀), and git diff --check (␀).
**@⁠Taffyyy-ops** on GitHub · 2026-11-25 10:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1186#issuecomment-7160077525) @⁠Deedlyy Thanks for the [MERGE] review! - Identified why ests/test_awc_cue_json_depth.py failed on Linux and macOS CI (stdlib-tests-linux / macos-python, run 45474369073): CPython's C _json scanner parses 3,000 nested [ tokens without raising RecursionError on platforms with a larger C stack than Windows. - Pushed commit `6722fc8c6` adding 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. - Re-verified locally (AI-assisted, synthetic only): ests/test_awc_cue_json_depth.py (3/3 OK), ests/test_awc_cue_labels.py (2/2 OK), ests/test_tool_stdout_encoding.py (4/4 OK), ests/test_text_write_line_endings.py (3/3 OK), scripts/check_no_game_data.py (␀), and git diff --check (␀).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1186/head:github-bot/gh-1186'
git switch 'github-bot/gh-1186'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1186'
git switch 'github-bot/gh-1186'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1186'
git switch 'github-bot/gh-1186'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1186'
git switch 'main'
git merge --squash 'github-bot/gh-1186'
git switch 'main'
git merge --ff-only 'github-bot/gh-1186'
git switch 'main'
git merge 'github-bot/gh-1186'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.