opus_tags: reject duplicate CSV headers used for tagging #467

Manually merged
github merged 1 commit from gh-pr/467/head into gh-pr/467/base 2026-11-26 09:02:10 +00:00
Owner

@⁠EdenBendheim on GitHub · 2026-11-24 05:50 UTC · original
EdenBendheim:ubiq/opus-tags-duplicate-headers → main · +86 −2 · 3 files · 1 commits · merged 2026-11-24 06:58 UTC

Claim: #14

What changed

  • tools/opus_tags.py: Validate CSV headers before reading rows in both the names CSV (bank, stream_id, name, source) and dialogue CSV (wave, label, speaker, text_<lang>), preserving required-header and Ogg CRC checks. Duplicate consumed headers exit 2 with a deterministic diagnostic before touching any Ogg file; repeated unused extra columns remain ignored.
  • tests/test_opus_tags.py & docs/audio.md: Synthetic tests covering all consumed columns in both CSVs, UTF-8 BOM, untouched Ogg bytes/mtime on rejection, and extra-column stability, plus updated docs.

Testing & Disclosure

  • AI-assisted: Implemented with Codex (gpt-6.2-sol) and reviewed with Codex (gpt-6.2-astra).
  • Environment: macOS 27.3, Apple M1 Max, Python 3.14.3 (CPU-only, synthetic fixtures, zero game data).
  • Verified on ubiquitarianism/leonida main (8f481cf16): test_opus_tags*.py (34/34), compileall, check_no_game_data.py, LF check — all passed.
**@⁠EdenBendheim** on GitHub · 2026-11-24 05:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/467) `EdenBendheim:ubiq/opus-tags-duplicate-headers` → `main` · +86 −2 · 3 files · 1 commits · merged 2026-11-24 06:58 UTC Claim: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 ### What changed - **`tools/opus_tags.py`**: Validate CSV headers before reading rows in both the names CSV (`bank`, `stream_id`, `name`, `source`) and dialogue CSV (`wave`, `label`, `speaker`, `text_<lang>`), preserving required-header and Ogg CRC checks. Duplicate consumed headers exit `2` with a deterministic diagnostic before touching any Ogg file; repeated unused extra columns remain ignored. - **`tests/test_opus_tags.py` & `docs/audio.md`**: Synthetic tests covering all consumed columns in both CSVs, UTF-8 BOM, untouched Ogg bytes/mtime on rejection, and extra-column stability, plus updated docs. ### Testing & Disclosure - **AI-assisted:** Implemented with Codex (`gpt-6.2-sol`) and reviewed with Codex (`gpt-6.2-astra`). - **Environment:** macOS 27.3, Apple M1 Max, Python 3.14.3 (CPU-only, synthetic fixtures, zero game data). - **Verified on `ubiquitarianism/leonida` `main` (`8f481cf16`):** `test_opus_tags*.py` (34/34), `compileall`, `check_no_game_data.py`, LF check — all passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:02:07 +00:00
github manually merged commit d85e326eb7 into gh-pr/467/base 2026-11-26 09:02:10 +00:00
Author
Owner

@⁠QemmHD on GitHub · 2026-11-24 06:58 UTC · original

Merging. Why merged: repeated tagging columns in either CSV are refused (exit 2) before any Ogg file is modified, and the docs say so.
Why it's good: security-reviewed; tested on Windows 11 merged onto main c023a36: 3 new tests (11 subtest failures on main), all passing on the merge. The one remaining failure, test_cli_reports_incomplete_directory_discovery (a Windows path repr), fails the same way on main.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠QemmHD** on GitHub · 2026-11-24 06:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/467#issuecomment-7124481483) Merging. Why merged: repeated tagging columns in either CSV are refused (exit 2) before any Ogg file is modified, and the docs say so. Why it's good: security-reviewed; tested on Windows 11 merged onto main c023a36: 3 new tests (11 subtest failures on main), all passing on the merge. The one remaining failure, test_cli_reports_incomplete_directory_discovery (a Windows path repr), fails the same way on main. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.