tools/anim_clips: write --out JSON report atomically (ANIM-CLIPS-ATOMIC-JSON) #2297

Open
github-bot wants to merge 1 commit from github-bot/gh-2297 into main AGit
Owner

@⁠Ch1mpleo on GitHub · 2026-11-26 13:02 UTC · original
Ch1mpleo:fix/anim-clips-atomic-json → main · +56 −5 · 2 files · 1 commits · open

Claimed in the coordination issue as: ANIM-CLIPS-ATOMIC-JSON (#1608)

What and why

Writes --out\ JSON atomically in \ ools/anim_clips.py\ via _write_json_atomic\ (\os.path.realpath\ + \ empfile.mkstemp\ + \ sync\ + \published_mode\ +
eplace_retry\ with cleanup on failure), preserving symlinks and permissions. Adds a regression test in \ ests/test_anim_clips.py.

Tested

  • \python -m compileall -q tools/anim_clips.py tests/test_anim_clips.py\ — exit 0.
  • \python -I tests/test_anim_clips.py\ — 54 tests, OK (Windows 11 x64, Python 3.14.7).
  • \python -I scripts/check_no_game_data.py tools/anim_clips.py tests/test_anim_clips.py\ — exit 0.

GPUs tested: n/a (CPU-only Python tool & unit tests)

AI-assisted: yes

Checklist

  • Based on current \main\ and merges cleanly (a conflicting pull request is labeled
    eeds rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of \docs/design.md, with how it was confirmed. (n/a — no translator change)
**@⁠Ch1mpleo** on GitHub · 2026-11-26 13:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2297) `Ch1mpleo:fix/anim-clips-atomic-json` → `main` · +56 −5 · 2 files · 1 commits · open Claimed in the coordination issue as: ANIM-CLIPS-ATOMIC-JSON (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why Writes \--out\ JSON atomically in \ ools/anim_clips.py\ via \_write_json_atomic\ (\os.path.realpath\ + \ empfile.mkstemp\ + \ sync\ + \published_mode\ + \ eplace_retry\ with cleanup on failure), preserving symlinks and permissions. Adds a regression test in \ ests/test_anim_clips.py\. ### Tested - \python -m compileall -q tools/anim_clips.py tests/test_anim_clips.py\ — exit 0. - \python -I tests/test_anim_clips.py\ — 54 tests, OK (Windows 11 x64, Python 3.14.7). - \python -I scripts/check_no_game_data.py tools/anim_clips.py tests/test_anim_clips.py\ — exit 0. GPUs tested: n/a (CPU-only Python tool & unit tests) AI-assisted: yes ### Checklist - [x] Based on current \main\ and merges cleanly (a conflicting pull request is labeled \ eeds rebase\). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of \docs/design.md\, with how it was confirmed. (n/a — no translator change)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:04:07 +00:00
Author
Owner

@⁠EdenBendheim on GitHub · 2026-11-26 21:43 UTC · original

Locally verified fcac19c23 against main at fac8b4bb9 on macOS 27.3 arm64 (Python 3.14.3). Claim confirmed in #1608; patch applies cleanly; no overlapping open PRs found.

  • tests/test_anim_clips.py: 53 passed, 1 expected error on plain main (missing _write_json_atomic); 54/54 passed with the patch.
  • tests/test_text_write_line_endings.py: 3/3 passed.
  • tests/test_report_paths.py: 23 passed, 1 skipped.
  • check_no_game_data.py and compileall both passed.

Same-directory staging file, UTF-8/LF writes, fsync, symlink resolution, cleanup on failure, and replace_retry usage all look solid (Windows replace_retry path reviewed by inspection only).

Synthetic fixtures only; no game data. GPUs tested: N/A (CPU-only). AI-assisted verification.

**@⁠EdenBendheim** on GitHub · 2026-11-26 21:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2297#issuecomment-7204002428) Locally verified `fcac19c23` against `main` at `fac8b4bb9` on macOS 27.3 arm64 (Python 3.14.3). Claim confirmed in #1608; patch applies cleanly; no overlapping open PRs found. - `tests/test_anim_clips.py`: 53 passed, 1 expected error on plain `main` (missing `_write_json_atomic`); 54/54 passed with the patch. - `tests/test_text_write_line_endings.py`: 3/3 passed. - `tests/test_report_paths.py`: 23 passed, 1 skipped. - `check_no_game_data.py` and `compileall` both passed. Same-directory staging file, UTF-8/LF writes, `fsync`, symlink resolution, cleanup on failure, and `replace_retry` usage all look solid (Windows `replace_retry` path reviewed by inspection only). Synthetic fixtures only; no game data. GPUs tested: N/A (CPU-only). AI-assisted verification.
Author
Owner

@⁠tiguan26 on GitHub · 2026-11-27 04:41 UTC · original · approved these changes

Approving fcac19c23.

The --out report is written through a temp file in the same folder, fsync and replace_retry with published_mode, and the temp file is removed on failure; the OSError handler around it still turns a failed write into a clean exit. The file now ends with a newline, which is harmless.

Merged onto main d1dff7949 together with #2403, #2410, #2299, #2330 and #2286 (no conflicts), on Linux with Python 3.13. tests/test_anim_clips.py: 54 passed (main: 53). AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠tiguan26** on GitHub · 2026-11-27 04:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2297#pullrequestreview-6083568492) · **approved these changes** Approving fcac19c23. The `--out` report is written through a temp file in the same folder, fsync and `replace_retry` with `published_mode`, and the temp file is removed on failure; the `OSError` handler around it still turns a failed write into a clean exit. The file now ends with a newline, which is harmless. Merged onto `main` `d1dff7949` together with #2403, #2410, #2299, #2330 and #2286 (no conflicts), on Linux with Python 3.13. `tests/test_anim_clips.py`: 54 passed (main: 53). AI-assisted (Claude Code, Claude Opus 5.5).
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/2297/head:github-bot/gh-2297'
git switch 'github-bot/gh-2297'

Merge

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