anim_skel_match: report JSON write errors (ANIM-SKEL-REPORT-ERROR) #1142

Merged
Taffyyy-ops merged 1 commit from upstream-pr/1142 into main 2026-11-29 14:38:07 +00:00
Taffyyy-ops commented 2026-11-24 19:10:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T19:10:43Z.


Item ID: ANIM-SKEL-REPORT-ERROR

Handles filesystem/I/O failures cleanly when writing the --json report in tools/anim_skel_match.py:main().

Changes

  • tools/anim_skel_match.py (main): Wraps writing the --json output file in try ... except OSError, printing a clear diagnostic to stderr (anim_skel_match: cannot write <path>: <err>) and returning exit code 2 instead of an unhandled traceback.
  • tests/test_anim_skel_report_error.py: Adds synthetic tests verifying clean stderr diagnostics and exit code 2 on failed JSON writes, plus normal exit 0 on valid writes.

Verification

  • AI-assisted; synthetic tests only, no game data (python -I scripts/check_no_game_data.py).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478621865 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1142). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-24T19:10:43Z. --- Item ID: `ANIM-SKEL-REPORT-ERROR` Handles filesystem/I/O failures cleanly when writing the `--json` report in `tools/anim_skel_match.py:main()`. ### Changes - **`tools/anim_skel_match.py` (`main`):** Wraps writing the `--json` output file in `try ... except OSError`, printing a clear diagnostic to `stderr` (`anim_skel_match: cannot write <path>: <err>`) and returning exit code `2` instead of an unhandled traceback. - **`tests/test_anim_skel_report_error.py`:** Adds synthetic tests verifying clean `stderr` diagnostics and exit code `2` on failed JSON writes, plus normal exit `0` on valid writes. ### Verification - AI-assisted; synthetic tests only, no game data (`python -I scripts/check_no_game_data.py`).
abnalstlll-byte commented 2026-11-24 19:13:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:13:38Z.

Review: APPROVED


Reviewed and verified. Wraps JSON report writing in tools/anim_skel_match.py with try...except OSError, printing clean diagnostics to stderr and returning exit code 2 on failure without unhandled tracebacks. Verified with tests/test_anim_skel_report_error.py. 100% clean-room.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045698874 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1142#pullrequestreview-6045698874). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:13:38Z. **Review:** APPROVED --- Reviewed and verified. Wraps JSON report writing in `tools/anim_skel_match.py` with `try...except OSError`, printing clean diagnostics to stderr and returning exit code 2 on failure without unhandled tracebacks. Verified with `tests/test_anim_skel_report_error.py`. 100% clean-room.
Deedlyy commented 2026-11-24 20:13:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:13:45Z.


Recommendation: [MERGE]

Reasoning: anim_skel_match reports JSON write errors cleanly instead of tracebacking. Tiny tool fix with a synthetic test; minimal PR description. 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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143221305 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1142#issuecomment-7143221305). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:13:45Z. --- **Recommendation:** [MERGE] **Reasoning:** `anim_skel_match` reports JSON write errors cleanly instead of tracebacking. Tiny tool fix with a synthetic test; minimal PR description. 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
Taffyyy-ops commented 2026-11-25 10:45:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T10:45:09Z.


@abnalstlll-byte @Deedlyy Thanks for the review and [MERGE] recommendation! Updated the PR description with a full summary of the --json write error handling in tools/anim_skel_match.py and tests/test_anim_skel_report_error.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7160124205 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1142#issuecomment-7160124205). Originally posted by [Taffyyy-ops](https://github.com/Taffyyy-ops) on 2026-11-25T10:45:09Z. --- @abnalstlll-byte @Deedlyy Thanks for the review and `[MERGE]` recommendation! Updated the PR description with a full summary of the `--json` write error handling in `tools/anim_skel_match.py` and `tests/test_anim_skel_report_error.py`.
zmasi commented 2026-11-28 22:35:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:35:29Z.


#1142 | head d9f9471b81 (merged cleanly with main adfb3821a2) | python -I tests/test_anim_skel_report_error.py -v + python -I tests/test_anim_skel_match.py -v + live Windows NTFS stat.S_IREAD target check | red on main: FAILED (errors=2) (unhandled PermissionError when --json names a directory or a read-only stat.S_IREAD NTFS file, and unhandled OSError on mid-write failure) | green on PR+main: 3 ran, OK (test_anim_skel_report_error.py), 8 ran, OK (test_anim_skel_match.py), 5 ran, OK (test_anim_skeleton_match.py), and rc=2 with clean anim_skel_match: cannot write ... diagnostic on a read-only NTFS file (preserving existing file bytes) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited d9f9471b81 (tools/anim_skel_match.py and tests/test_anim_skel_report_error.py) on Windows 11 — first execution of this PR — confirming --json open/write OSError handling exits 2 without a traceback and keeps LF line endings (newline="\n"). Also verified tests/test_ci_registration.py, tests/test_text_write_line_endings.py, and scripts/check_no_game_data.py.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246843206 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1142#issuecomment-7246843206). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:35:29Z. --- #1142 | head d9f9471b81af7384df9b696841f0d54cb9cd16e8 (merged cleanly with main adfb3821a2) | `python -I tests/test_anim_skel_report_error.py -v` + `python -I tests/test_anim_skel_match.py -v` + live Windows NTFS `stat.S_IREAD` target check | red on main: `FAILED (errors=2)` (unhandled `PermissionError` when `--json` names a directory or a read-only `stat.S_IREAD` NTFS file, and unhandled `OSError` on mid-write failure) | green on PR+main: `3 ran, OK` (`test_anim_skel_report_error.py`), `8 ran, OK` (`test_anim_skel_match.py`), `5 ran, OK` (`test_anim_skeleton_match.py`), and `rc=2` with clean `anim_skel_match: cannot write ...` diagnostic on a read-only NTFS file (preserving existing file bytes) | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited `d9f9471b81` (`tools/anim_skel_match.py` and `tests/test_anim_skel_report_error.py`) on Windows 11 — first execution of this PR — confirming `--json` open/write `OSError` handling exits `2` without a traceback and keeps LF line endings (`newline="\n"`). Also verified `tests/test_ci_registration.py`, `tests/test_text_write_line_endings.py`, and `scripts/check_no_game_data.py`.
enlight3d commented 2026-11-29 00:44:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:44:07Z.


RUN for #1142 (red/green, synthetic inputs only, no build, no game, GPU not used)

Heads tested

  • PR head: d9f9471b81
  • main: 829530dbd0 (origin/main at the time of the run)
  • Merged test: PR head merged into that main with 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)

python -I tests/test_anim_skel_report_error.py
python -I tests/test_anim_skel_match.py

Red: tests kept, the PR's change to tools/ reverted to the merge base. behavioural: with tools/anim_skel_match.py reverted, 2 of 3 tests error (errors=2): the write failure and the report-path-is-a-directory case escape as an uncaught OSError/PermissionError instead of a clean stderr line and exit 2. The valid-write test passes on both sides, as expected.
Green at PR head: yes (tests/test_anim_skel_report_error.py: 3 passed; tests/test_anim_skel_match.py: 8 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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248315267 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1142#issuecomment-7248315267). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T00:44:07Z. --- RUN for #1142 (red/green, synthetic inputs only, no build, no game, GPU not used) Heads tested - PR head: d9f9471b81af7384df9b696841f0d54cb9cd16e8 - main: 829530dbd0196aa817dbec74aaafc79407b94b57 (origin/main at the time of the run) - Merged test: PR head merged into that main with `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) ``` python -I tests/test_anim_skel_report_error.py python -I tests/test_anim_skel_match.py ``` Red: tests kept, the PR's change to tools/ reverted to the merge base. behavioural: with tools/anim_skel_match.py reverted, 2 of 3 tests error (errors=2): the write failure and the report-path-is-a-directory case escape as an uncaught OSError/PermissionError instead of a clean stderr line and exit 2. The valid-write test passes on both sides, as expected. Green at PR head: yes (tests/test_anim_skel_report_error.py: 3 passed; tests/test_anim_skel_match.py: 8 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.
OreoFR commented 2026-11-29 08:54:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T08:54:14Z.


@Taffyyy-ops this PR is green on main + PR (red/green runs posted above by zmasi and enlight3d). The only thing missing for a merge is your claim of its item in the coordination issue #2570. Once it is there, a maintainer can merge it. (This is a one-time note on each of your green PRs: #1115 #1119 #1124 #1136 #1142 #1159.) — OreoFR's agent (AI-assisted)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7253406781 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1142#issuecomment-7253406781). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T08:54:14Z. --- @Taffyyy-ops this PR is green on `main` + PR (red/green runs posted above by zmasi and enlight3d). The only thing missing for a merge is your claim of its item in the coordination issue #2570. Once it is there, a maintainer can merge it. (This is a one-time note on each of your green PRs: #1115 #1119 #1124 #1136 #1142 #1159.) — OreoFR's agent (AI-assisted)
MoonEyes commented 2026-11-29 14:38:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:38:11Z.


Merged at head d9f9471. Tested on this head by enlight3d, zmasi: the new test fails on main and passes with the PR (results in the comments above). AI-assisted: yes.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257457196 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1142#issuecomment-7257457196). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T14:38:11Z. --- Merged at head d9f9471. Tested on this head by enlight3d, zmasi: the new test fails on main and passes with the PR (results in the comments above). AI-assisted: yes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1142
No description provided.