tools/anim_clips: write --out JSON report atomically (ANIM-CLIPS-ATOMIC-JSON) #2297
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2297
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/anim-clips-atomic-json"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: ANIM-CLIPS-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7192763047)
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
GPUs tested: n/a (CPU-only Python tool & unit tests)
AI-assisted: yes
Checklist
eeds rebase).
Locally verified
fcac19c23againstmainatfac8b4bb9on 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 plainmain(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.pyandcompileallboth passed.Same-directory staging file, UTF-8/LF writes,
fsync, symlink resolution, cleanup on failure, andreplace_retryusage all look solid (Windowsreplace_retrypath reviewed by inspection only).Synthetic fixtures only; no game data. GPUs tested: N/A (CPU-only). AI-assisted verification.
Approving fcac19c23.
The
--outreport is written through a temp file in the same folder, fsync andreplace_retrywithpublished_mode, and the temp file is removed on failure; theOSErrorhandler around it still turns a failed write into a clean exit. The file now ends with a newline, which is harmless.Merged onto
maind1dff7949together 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).#2297 | head
fcac19c235decc3c0c420c3bdf69a1429e662fa6|python3 -I tests/test_anim_clips.py -v| red: 54 run, 1 error | green: 54 passed | Baseline exception → passThe baseline raised AttributeError for the new writer. After merging, the test checked the output and exercised the simulated replace failure.
Pinned main
33db04a7010e81c40a7a6a15624525aa0c4a3a58, merged into this PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. Batch claim.Merged, thank you @Ch1mpleo!
What it does: tools/anim_clips: write --out JSON report atomically (ANIM-CLIPS-ATOMIC-JSON)
How it was checked: sodove tested this PR at head
fcac19c23on main33db04a70: the PR's own test fails on main and passes with this PR merged in (his result is linked from the batch summary in #1608). We then re-ran the same test locally on Windows 11 and got the same verdict: on main, red (1 error); with the PR, green (54 OK).CI: the red jobs on this PR fail the same way on main, or on the older main it was built on (the
cs_dpp_cmp.asmtranslator fixture, since fixed on main, and the Windows runner's Visual Studio setup), so none comes from this change.Merged one by one with 20 other PRs of the same reviewed batch, pinned to the tested head.
AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.