anim tools: use shared report path guard #1084

Closed
j-weiner wants to merge 2 commits from upstream-pr/1084 into main
j-weiner commented 2026-11-24 18:05:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by j-weiner on 2026-11-24T18:05:29Z.


Claimed in the coordination issue as: ANIM-CLIPS-SHARED-REPORT-PATH

What and why

tools/anim_clips.py and tools/anim_glb.py shared a private same_output_path helper across modules. This PR moves the guard to the common tools/report_paths.py:same_report_path implementation and updates both callers. Updating anim_glb.py is necessary because it referenced anim_clips.same_output_path; removing that helper without updating the caller caused an AttributeError when output/input checks ran. A regression covers identical, not-yet-created GLB and report paths, which must be refused before either path is created.

Tested

  • python3 -I tests/test_anim_glb.py — 37 passed.
  • python3 -I tests/test_anim_clips.py — 53 passed.
  • python3 -I tests/test_report_paths.py — 22 tests, 1 skipped.
  • python3 -I tests/test_text_write_line_endings.py — 3 passed.
  • python3 -I tools/anim_clips.py --help and python3 -I tools/anim_glb.py --help — passed.
  • python3 -I scripts/check_no_game_data.py tools/anim_clips.py tools/anim_glb.py tests/test_anim_glb.py — clean.
  • git diff --check — passed.

GPUs tested: n/a (CPU-only synthetic tests; no game files used).

AI-assisted: yes.

Checklist

  • Rebased on current main and merges cleanly.
  • One topic; the anim_glb.py change fixes a missed caller of the same shared-guard migration.
  • No game data, keys or decryption.
  • No translator rule change (not applicable).
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5477656708 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1084). Originally posted by [j-weiner](https://github.com/j-weiner) on 2026-11-24T18:05:29Z. --- Claimed in the coordination issue as: [ANIM-CLIPS-SHARED-REPORT-PATH](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140060112) ### What and why `tools/anim_clips.py` and `tools/anim_glb.py` shared a private `same_output_path` helper across modules. This PR moves the guard to the common `tools/report_paths.py:same_report_path` implementation and updates both callers. Updating `anim_glb.py` is necessary because it referenced `anim_clips.same_output_path`; removing that helper without updating the caller caused an `AttributeError` when output/input checks ran. A regression covers identical, not-yet-created GLB and report paths, which must be refused before either path is created. ### Tested - `python3 -I tests/test_anim_glb.py` — 37 passed. - `python3 -I tests/test_anim_clips.py` — 53 passed. - `python3 -I tests/test_report_paths.py` — 22 tests, 1 skipped. - `python3 -I tests/test_text_write_line_endings.py` — 3 passed. - `python3 -I tools/anim_clips.py --help` and `python3 -I tools/anim_glb.py --help` — passed. - `python3 -I scripts/check_no_game_data.py tools/anim_clips.py tools/anim_glb.py tests/test_anim_glb.py` — clean. - `git diff --check` — passed. GPUs tested: n/a (CPU-only synthetic tests; no game files used). AI-assisted: yes. ### Checklist - [x] Rebased on current `main` and merges cleanly. - [x] One topic; the `anim_glb.py` change fixes a missed caller of the same shared-guard migration. - [x] No game data, keys or decryption. - [x] No translator rule change (not applicable).
veqzo commented 2026-11-24 18:43:16 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by veqzo on 2026-11-24T18:43:16Z.


Removing anim_clips.same_output_path breaks anim_glb, which still calls it from same_path at tools/anim_glb.py:622. When an output already exists, or when both an output and a report are specified, the path check raises AttributeError.

Could this PR also update anim_glb to use report_paths.same_report_path and add a regression test? I reproduced the error with synthetic paths.

AI-assisted review.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7141055413 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1084#issuecomment-7141055413). Originally posted by [veqzo](https://github.com/veqzo) on 2026-11-24T18:43:16Z. --- Removing `anim_clips.same_output_path` breaks `anim_glb`, which still calls it from `same_path` at `tools/anim_glb.py:622`. When an output already exists, or when both an output and a report are specified, the path check raises `AttributeError`. Could this PR also update `anim_glb` to use `report_paths.same_report_path` and add a regression test? I reproduced the error with synthetic paths. AI-assisted review.
abnalstlll-byte commented 2026-11-24 18:49:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T18:49:45Z.

Review: APPROVED


Reviewed and verified. Cleanly replaces duplicate path collision check in ools/anim_clips.py with standard ools/report_paths.py:same_report_path. Verified with est_anim_clips.py and est_report_paths.py. 100% clean-room.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045337450 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1084#pullrequestreview-6045337450). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T18:49:45Z. **Review:** APPROVED --- Reviewed and verified. Cleanly replaces duplicate path collision check in ools/anim_clips.py with standard ools/report_paths.py:same_report_path. Verified with est_anim_clips.py and est_report_paths.py. 100% clean-room.
j-weiner commented 2026-11-25 17:23:01 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by j-weiner on 2026-11-25T17:23:01Z.


Addressed the review: anim_glb.py now imports and uses report_paths.same_report_path directly instead of calling the removed anim_clips.same_output_path. Added a synthetic regression for identical GLB/report output paths under a missing parent; it verifies the CLI refuses before creating either path. Rebased onto current main (fe1553456).

Checks: tests/test_anim_glb.py (37 passed), tests/test_anim_clips.py (53 passed), tests/test_report_paths.py (21 passed, 1 skipped), tests/test_text_write_line_endings.py (3 passed), scripts/check_no_game_data.py on all changed files (clean), and git diff --check (pass). No game files or GPU used.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7169423303 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1084#issuecomment-7169423303). Originally posted by [j-weiner](https://github.com/j-weiner) on 2026-11-25T17:23:01Z. --- Addressed the review: `anim_glb.py` now imports and uses `report_paths.same_report_path` directly instead of calling the removed `anim_clips.same_output_path`. Added a synthetic regression for identical GLB/report output paths under a missing parent; it verifies the CLI refuses before creating either path. Rebased onto current `main` (`fe1553456`). Checks: `tests/test_anim_glb.py` (37 passed), `tests/test_anim_clips.py` (53 passed), `tests/test_report_paths.py` (21 passed, 1 skipped), `tests/test_text_write_line_endings.py` (3 passed), `scripts/check_no_game_data.py` on all changed files (clean), and `git diff --check` (pass). No game files or GPU used.
j-weiner commented 2026-11-25 17:31:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by j-weiner on 2026-11-25T17:31:40Z.


Updated again to current main (b0e11f234) after new merges. The anim_glb.py shared-guard fix and regression remain intact. Re-ran test_anim_glb.py (37 passed), test_anim_clips.py (53 passed), test_report_paths.py (22 tests, 1 skipped), test_text_write_line_endings.py (3 passed), check_no_game_data.py (clean), and git diff --check (pass). CI is queued on GitHub.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7169630915 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1084#issuecomment-7169630915). Originally posted by [j-weiner](https://github.com/j-weiner) on 2026-11-25T17:31:40Z. --- Updated again to current `main` (`b0e11f234`) after new merges. The `anim_glb.py` shared-guard fix and regression remain intact. Re-ran `test_anim_glb.py` (37 passed), `test_anim_clips.py` (53 passed), `test_report_paths.py` (22 tests, 1 skipped), `test_text_write_line_endings.py` (3 passed), `check_no_game_data.py` (clean), and `git diff --check` (pass). CI is queued on GitHub.
j-weiner commented 2026-11-25 17:45:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by j-weiner on 2026-11-25T17:45:14Z.


Final base check: rebased onto current main (b9320a118). Re-ran the targeted anim/report-path tests after that rebase; all passed. The previous anim_glb.py caller issue is fixed. GitHub CI is queued, not failing.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7169950737 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1084#issuecomment-7169950737). Originally posted by [j-weiner](https://github.com/j-weiner) on 2026-11-25T17:45:14Z. --- Final base check: rebased onto current `main` (`b9320a118`). Re-ran the targeted anim/report-path tests after that rebase; all passed. The previous `anim_glb.py` caller issue is fixed. GitHub CI is queued, not failing.
DadaCap commented 2026-11-28 11:49:40 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T11:49:40Z.


Thanks @j-weiner! This PR was reviewed and its fix looks good, but it now conflicts with main, which moved a lot today. Could you rebase it onto current main? It will be looked at again for merge once it merges cleanly.

AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238808367 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1084#issuecomment-7238808367). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T11:49:40Z. --- Thanks @j-weiner! This PR was reviewed and its fix looks good, but it now conflicts with main, which moved a lot today. Could you rebase it onto current main? It will be looked at again for merge once it merges cleanly. AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.
j-weiner commented 2026-11-30 16:58:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by j-weiner on 2026-11-30T16:58:13Z.


Closing as superseded by #2636. That PR routes anim_clips through report_paths.same_report_path while keeping same_output_path as an alias, so anim_glb's existing caller continues to work; the direct caller migration here would duplicate the active report-path change. No game data involved. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7285513465 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1084#issuecomment-7285513465). Originally posted by [j-weiner](https://github.com/j-weiner) on 2026-11-30T16:58:13Z. --- Closing as superseded by #2636. That PR routes anim_clips through report_paths.same_report_path while keeping same_output_path as an alias, so anim_glb's existing caller continues to work; the direct caller migration here would duplicate the active report-path change. No game data involved. AI-assisted.

Pull request closed

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!1084
No description provided.