opus_tags: validate the CSV columns required by the requested operation #2459

Merged
leonida/mandy
kirigayakazima merged 1 commit from codex/opus-tags-required-csv-schema into main 2026-11-28 15:16:02 +00:00

Pull request successfully merged and closed

kirigayakazima commented 2026-11-27 11:09:42 +00:00

Claimed in the coordination issue as: OPUS-TAGS-REQUIRED-CSV-SCHEMA

What and why

Require a source column when filtering names by --source, and require a wave column whenever a dialogue table is supplied. Previously a header-only malformed table could produce success, skip every name, or allow files to be retagged without dialogue. Both regressions exercise the CLI and verify that the original audio file stays intact.

Tested

Windows, Python 3.14.7. The added regression failed on the parent and passed with this change.

  • python -I tests/test_opus_tags.py -k operation_specific_csv
  • python -I tests/test_opus_tags_dialogue_conflicts.py
  • Changed-path game-data scan and git diff --check passed. Shared main baseline: 6,374 semantic tests passed across 500 files.
  • Full Windows opus_tags suite has one pre-existing path-format assertion failure in test_cli_reports_incomplete_directory_discovery. Confirmed before applying this patch.

GPUs tested: N/A (CPU-only).

AI-assisted: Yes.

Checklist

  • Based on current main and merges cleanly with the tested base.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract table: N/A.
Claimed in the coordination issue as: [OPUS-TAGS-REQUIRED-CSV-SCHEMA](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7216624385) ### What and why Require a source column when filtering names by --source, and require a wave column whenever a dialogue table is supplied. Previously a header-only malformed table could produce success, skip every name, or allow files to be retagged without dialogue. Both regressions exercise the CLI and verify that the original audio file stays intact. ### Tested Windows, Python 3.14.7. The added regression failed on the parent and passed with this change. - `python -I tests/test_opus_tags.py -k operation_specific_csv` - `python -I tests/test_opus_tags_dialogue_conflicts.py` - Changed-path game-data scan and `git diff --check` passed. Shared main baseline: 6,374 semantic tests passed across 500 files. - Full Windows opus_tags suite has one pre-existing path-format assertion failure in test_cli_reports_incomplete_directory_discovery. Confirmed before applying this patch. GPUs tested: N/A (CPU-only). AI-assisted: Yes. ### Checklist - [x] Based on current main and merges cleanly with the tested base. - [x] One topic. - [x] No game data, keys or decryption. - Translator contract table: N/A.
MSedgeMC reviewed 2026-11-27 14:47:39 +00:00
MSedgeMC left a comment
No description provided.
Verified on the PR branch: python3 -m unittest tests.test_opus_tags -v -> 29 tests OK, including the new checks that --names requires a 'source' column and --dialogue requires a 'wave' column before any OGG is touched. Not approving yet: this branch is 613 commits behind current main, so a merge would carry unrelated history. Please rebase and re-run the suite.
zmasi commented 2026-11-28 06:36:08 +00:00

#2459 | head 6ed6438c68243ceab210e385b85e63f8d357a62f (merged cleanly with main 6dfca6428) | python -I tests/test_opus_tags.py | red on main: -k test_cli_checks_operation_specific_csv_headers_before_tagging FAILED (failures=2: source and wave subtests returned 0 instead of 2) | green on PR+main: Ran 29 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes

Diff reviewed across both touched files (git merge origin/main at 6dfca6428 applies cleanly, including #1792's Windows error-path fix so the full 29-test file passes on Windows). Also verified combining #2459 + #2458 together onto main 6dfca6428 (0 merge conflicts, test_opus_tags.py 30/30 OK), plus test_opus_tags_dialogue_conflicts.py (6/6 OK), test_runner_calls_all_tests.py (3/3 OK), test_text_write_line_endings.py (3/3 OK), compileall, git diff --check, and scripts/check_no_game_data.py (clean).

#2459 | head 6ed6438c68243ceab210e385b85e63f8d357a62f (merged cleanly with main 6dfca6428) | `python -I tests/test_opus_tags.py` | red on main: `-k test_cli_checks_operation_specific_csv_headers_before_tagging` FAILED (failures=2: `source` and `wave` subtests returned 0 instead of 2) | green on PR+main: Ran 29 tests, OK | Windows 11, Python 3.12.10 | AI-assisted: yes Diff reviewed across both touched files (`git merge origin/main` at `6dfca6428` applies cleanly, including `#1792`'s Windows error-path fix so the full 29-test file passes on Windows). Also verified combining `#2459` + `#2458` together onto `main` `6dfca6428` (`0` merge conflicts, `test_opus_tags.py` 30/30 OK), plus `test_opus_tags_dialogue_conflicts.py` (6/6 OK), `test_runner_calls_all_tests.py` (3/3 OK), `test_text_write_line_endings.py` (3/3 OK), `compileall`, `git diff --check`, and `scripts/check_no_game_data.py` (clean).
MoonEyes commented 2026-11-28 15:15:59 +00:00

Red/green: classified READY by oreo-lot3 (red on main b1619e0a3, green on head merged with main); head 6ed6438c6824 unchanged since 2026-11-27, before that run.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: classified READY by oreo-lot3 (red on main b1619e0a3, green on head merged with main); head 6ed6438c6824 unchanged since 2026-11-27, before that run. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.