Skip to content

anim tools: use shared report path guard - #1084

Closed
j-weiner wants to merge 2 commits into
ProjectLeonida:mainfrom
j-weiner:fix/anim-clips-shared-report-path
Closed

j-weiner wants to merge 2 commits into
ProjectLeonida:mainfrom
j-weiner:fix/anim-clips-shared-report-path

Conversation

@j-weiner

@j-weiner j-weiner commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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).

@veqzo

veqzo commented Nov 24, 2026

Copy link
Copy Markdown

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 abnalstlll-byte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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
j-weiner force-pushed the fix/anim-clips-shared-report-path branch from 5c660e8 to e4d5041 Compare November 25, 2026 17:35
@j-weiner
j-weiner force-pushed the fix/anim-clips-shared-report-path branch from e4d5041 to eac7353 Compare November 25, 2026 17:38
@j-weiner j-weiner changed the title anim_clips: use shared report path guard (ANIM-CLIPS-SHARED-REPORT-PATH) anim tools: use shared report path guard Nov 25, 2026
@j-weiner

Copy link
Copy Markdown
Contributor Author

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.

MoonEyes pushed a commit to MoonEyes/leonida that referenced this pull request Nov 27, 2026
From ProjectLeonida#1084 (head eac7353), applied as a reviewed patch.

Co-authored-by: j-weiner <j-weiner@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 28, 2026
@DadaCap

DadaCap commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Contributor Author

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.

@j-weiner j-weiner closed this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants