awc_shorts: refuse a catalog destination that aliases an input bank (DRAFT-196) #934

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

@⁠fin-github on GitHub · 2026-11-24 15:17 UTC · original
fin-github:draft/196 → main · +35 −1 · 2 files · 1 commits · open

Claimed in the coordination issue as: DRAFT-196 (#14)

Supersedes draft #196, carried over from the original repository. This is the same commit rebased onto current main, with the original author (neoisg8) kept and git cherry-pick -x recording where it came from. The change and its explanation are theirs; see #196 for the original description.

Tested

  • python -I tests/test_awc_shorts.py: OK (1 symlink case skipped: no symlink privilege on this Windows account)
  • python -I scripts/check_no_game_data.py on the changed files: clean.

Windows 11 (10.0.26200), Python 3.14.4. No game files, nothing online.

AI-assisted (Claude Code): rebasing, conflict resolution and test runs.

**@⁠fin-github** on GitHub · 2026-11-24 15:17 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/934) `fin-github:draft/196` → `main` · +35 −1 · 2 files · 1 commits · open Claimed in the coordination issue as: `DRAFT-196` (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) Supersedes draft #196, carried over from the original repository. This is the same commit rebased onto current `main`, with the original author (neoisg8) kept and `git cherry-pick -x` recording where it came from. The change and its explanation are theirs; see #196 for the original description. ### Tested - `python -I tests/test_awc_shorts.py`: OK (1 symlink case skipped: no symlink privilege on this Windows account) - `python -I scripts/check_no_game_data.py` on the changed files: clean. Windows 11 (10.0.26200), Python 3.14.4. No game files, nothing online. AI-assisted (Claude Code): rebasing, conflict resolution and test runs.
ools/awc_shorts.py previously published <out>/shorts.csv without
checking whether the catalog path collided with an input bank. When
an input was named shorts.csv or exported into a directory of that
name, publishing the catalog replaced the source input file with CSV
output and exited 0.

Verify upfront using same_report_path() that <out>/shorts.csv does
not alias any input bank or bank export destination directory, refusing
the collision with error diagnostic and exit code 2 before creating
directories or exporting clips.

Add regression tests covering input bank and directory export collisions.

AI-assisted: yes.
(cherry picked from commit 2496beffe5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:29:09 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 21:41 UTC · original

Reviewed dc4c32ac: I ran tests/test_awc_shorts.py on the PR head (18/18) and on main (16/16); copied the new tests onto main, where the two of them fail, so they cover the fix. A probe with synthetic banks reproduces the bug on main - an input named shorts.csv is overwritten by the catalog with exit 0, and export-dir collisions end in rc=1 "Is a directory" after clips are written; the PR refuses both upfront with exit 2 and the input intact, in serial and pool mode. Optional tidy-ups: do the destination check before makedirs so a refused run leaves no empty out dir, and mention the catalog refusal in docs/awc_shorts.md. AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 21:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/934#issuecomment-7175424263) Reviewed dc4c32ac: I ran tests/test_awc_shorts.py on the PR head (18/18) and on main (16/16); copied the new tests onto main, where the two of them fail, so they cover the fix. A probe with synthetic banks reproduces the bug on main - an input named shorts.csv is overwritten by the catalog with exit 0, and export-dir collisions end in rc=1 "Is a directory" after clips are written; the PR refuses both upfront with exit 2 and the input intact, in serial and pool mode. Optional tidy-ups: do the destination check before makedirs so a refused run leaves no empty out dir, and mention the catalog refusal in docs/awc_shorts.md. AI-assisted review. **Recommendation:** Merge
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/934/head:github-bot/gh-934'
git switch 'github-bot/gh-934'

Merge

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