text_tables: ask report_paths for the report-path guard (TEXT-TABLES-SHARED-REPORT-PATH) #1228

Closed
breachato wants to merge 1 commit from upstream-pr/1228 into main
breachato commented 2026-11-24 20:37:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-24T20:37:46Z.


Claimed in the coordination issue as: TEXT-TABLES-SHARED-REPORT-PATH (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143809865)

Depends on: none

Fixes: none

What and why

tools/text_tables.py answered the report-path question two ways: a private _same_output_path (:427, realpath

  • normcase + samefile) for the --dialogue/--tables/--strings outputs against each other (:460) and against
    a source folder's index.json (:466), and an inline os.path.exists(...) and os.path.samefile(...) against every
    input (:463). CONTRIBUTING.md asks a report writer to call tools/report_paths.same_report_path instead of
    deriving it again, and the private copy missed that helper's folding-volume probe: on a Linux mount that ignores
    case (vfat, exFAT, CIFS) two outputs differing only in case passed as distinct and the second replaced the first,
    and an output named like an input with a different case was not refused.

Both places and the inline check now call same_report_path. The tool already puts its own folder on sys.path
for file_mode and hashdict, so the import is one line; no test calls the private name, so it goes with the
duplication. Different topic from TEXT-TABLES-RO-CLEANUP (#818, staged-file permissions). No behaviour change on
Windows, macOS or a case-sensitive Linux filesystem.

Tested

  • tests/test_text_tables.py: 33 passed, 13 subtests passed.
  • python -I tools/text_tables.py --help: prints its usage (the import works under -I).
  • python -m compileall -q tools/text_tables.py: clean.
  • Not tested: the folding-volume case this fixes, which needs a case-folding mount (vfat/exFAT/CIFS); this
    machine is NTFS, where normcase already folds case. tests/test_report_paths.py covers the helper's own
    folding-volume answer.
  • No game files, no GPU; nothing was built.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5479931746 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1228). Originally posted by [breachato](https://github.com/breachato) on 2026-11-24T20:37:46Z. --- Claimed in the coordination issue as: TEXT-TABLES-SHARED-REPORT-PATH (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143809865) Depends on: none Fixes: none ### What and why `tools/text_tables.py` answered the report-path question two ways: a private `_same_output_path` (`:427`, realpath + normcase + samefile) for the `--dialogue`/`--tables`/`--strings` outputs against each other (`:460`) and against a source folder's `index.json` (`:466`), and an inline `os.path.exists(...) and os.path.samefile(...)` against every input (`:463`). CONTRIBUTING.md asks a report writer to call `tools/report_paths.same_report_path` instead of deriving it again, and the private copy missed that helper's folding-volume probe: on a Linux mount that ignores case (vfat, exFAT, CIFS) two outputs differing only in case passed as distinct and the second replaced the first, and an output named like an input with a different case was not refused. Both places and the inline check now call `same_report_path`. The tool already puts its own folder on `sys.path` for `file_mode` and `hashdict`, so the import is one line; no test calls the private name, so it goes with the duplication. Different topic from TEXT-TABLES-RO-CLEANUP (#818, staged-file permissions). No behaviour change on Windows, macOS or a case-sensitive Linux filesystem. ### Tested - `tests/test_text_tables.py`: **33 passed**, 13 subtests passed. - `python -I tools/text_tables.py --help`: prints its usage (the import works under `-I`). - `python -m compileall -q tools/text_tables.py`: clean. - **Not tested:** the folding-volume case this fixes, which needs a case-folding mount (vfat/exFAT/CIFS); this machine is NTFS, where `normcase` already folds case. `tests/test_report_paths.py` covers the helper's own folding-volume answer. - No game files, no GPU; nothing was built. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
PierreEbele commented 2026-11-25 07:15:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T07:15:28Z.


Reviewed 0d6800a: sandboxed on arm64 Linux against origin/main and the PR head: test_text_tables (33 ran, 1 Windows-only skip), test_report_paths (22 ok), test_report_path_case (4 ran, 1 macOS skip), test_missing_input_exit_codes, compileall, and check_no_game_data pass identically on both trees; git merge-tree vs main is clean. Guard probes match main on this case-sensitive volume, and with a patched folding volume the PR refuses nonexistent case-colliding output pairs (D.csv/d.csv) that main still accepts and routes the --labels/input and carve index.json guards through same_report_path as intended, with no regressions. Pre-existing, also on main: --tables naming a carve chunk file (or a file inside a source directory) overwrites it; worth a finding: in the coordination issue. Consider adding text_tables to tests/test_report_paths.py's SHARED or adding a guard test like #1216/#1052. AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7155660686 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1228#issuecomment-7155660686). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T07:15:28Z. --- Reviewed 0d6800a: sandboxed on arm64 Linux against origin/main and the PR head: test_text_tables (33 ran, 1 Windows-only skip), test_report_paths (22 ok), test_report_path_case (4 ran, 1 macOS skip), test_missing_input_exit_codes, compileall, and check_no_game_data pass identically on both trees; git merge-tree vs main is clean. Guard probes match main on this case-sensitive volume, and with a patched folding volume the PR refuses nonexistent case-colliding output pairs (`D.csv`/`d.csv`) that main still accepts and routes the `--labels`/input and carve `index.json` guards through `same_report_path` as intended, with no regressions. Pre-existing, also on main: `--tables` naming a carve chunk file (or a file inside a source directory) overwrites it; worth a `finding:` in the coordination issue. Consider adding `text_tables` to `tests/test_report_paths.py`'s `SHARED` or adding a guard test like #1216/#1052. AI-assisted review. **Recommendation:** Merge
zmasi commented 2026-11-28 22:20:21 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:20:21Z.


Native Windows 11 NTFS Verification (0d6800ad02)

Verified 0d6800ad026387ac6c5b3034598d39bb4365719c merged cleanly onto origin/main (c7753ed98a56677f10e34078b37eab0540e190ec, git merge-tree --write-tree rc=0) on native Windows 11 (26200) + NTFS:

  • Red (origin/main c7753ed98a): Enabled real Windows 11 per-directory NTFS case sensitivity (fsutil.exe file setCaseSensitiveInfo <dir> enable) and probed text_tables._same_output_path on src.rpf vs SRC.RPF: origin/main returned True (false collision) because os.path.normcase lowercased both paths before os.path.samefile.
  • Green (origin/main + 0d6800ad02): Delegating output/input alias checks to report_paths.same_report_path returned False on the live case-sensitive NTFS directory while still returning True on a standard case-insensitive NTFS directory; python -I tests/test_text_tables.py passed (OK).

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246665645 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1228#issuecomment-7246665645). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:20:21Z. --- ### Native Windows 11 NTFS Verification (`0d6800ad02`) Verified `0d6800ad026387ac6c5b3034598d39bb4365719c` merged cleanly onto `origin/main` (`c7753ed98a56677f10e34078b37eab0540e190ec`, `git merge-tree --write-tree` `rc=0`) on native **Windows 11 (`26200`) + NTFS**: - **Red (`origin/main` `c7753ed98a`)**: Enabled real Windows 11 per-directory NTFS case sensitivity (`fsutil.exe file setCaseSensitiveInfo <dir> enable`) and probed `text_tables._same_output_path` on `src.rpf` vs `SRC.RPF`: `origin/main` returned `True` (false collision) because `os.path.normcase` lowercased both paths before `os.path.samefile`. - **Green (`origin/main + 0d6800ad02`)**: Delegating output/input alias checks to `report_paths.same_report_path` returned `False` on the live case-sensitive NTFS directory while still returning `True` on a standard case-insensitive NTFS directory; `python -I tests/test_text_tables.py` passed (`OK`). AI-assisted.
TheGeogeo commented 2026-11-29 01:12:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T01:12:53Z.


Checked 0d6800ad0 merged (no commit) with main 87a39df94: Python 3.12.4, Windows 11 10.0.26300, CPU only.

Blocker: it no longer merges with main. git merge conflicts in tools/text_tables.py. Since this branch, main changed that file (13395c437 TEXT-TABLES-RO-CLEANUP, and #1300's merge 795e0904c). A rebase is needed before it can be tested.

  • The same pattern runs through #1162, #1170-#1173, #1214, #1215, #1227-#1229, #1243 and #1244. Each one replaces its tool's own copy of the same-path check with report_paths.same_report_path (tools/report_paths.py:117 on main). They share that one helper and touch one different tool each, so they do not depend on each other. Only #1228 conflicts with main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248636223 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1228#issuecomment-7248636223). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T01:12:53Z. --- Checked `0d6800ad0` merged (no commit) with `main` `87a39df94`: Python 3.12.4, Windows 11 10.0.26300, CPU only. **Blocker: it no longer merges with `main`.** `git merge` conflicts in `tools/text_tables.py`. Since this branch, `main` changed that file (`13395c437` TEXT-TABLES-RO-CLEANUP, and #1300's merge `795e0904c`). A rebase is needed before it can be tested. - The same pattern runs through #1162, #1170-#1173, #1214, #1215, #1227-#1229, #1243 and #1244. Each one replaces its tool's own copy of the same-path check with `report_paths.same_report_path` (`tools/report_paths.py:117` on `main`). They share that one helper and touch one different tool each, so they do not depend on each other. Only #1228 conflicts with `main`. AI-assisted (Claude Code).
breachato commented 2026-11-29 13:26:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-29T13:26:59Z.


Closing: upstream #1655 merged the same change (my commit is already in main — after a rebase this branch has no diff at all), so there is nothing left for this pull request to carry. The other eleven tools in the series are unaffected.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7256545822 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1228#issuecomment-7256545822). Originally posted by [breachato](https://github.com/breachato) on 2026-11-29T13:26:59Z. --- Closing: upstream #1655 merged the same change (my commit is already in `main` — after a rebase this branch has no diff at all), so there is nothing left for this pull request to carry. The other eleven tools in the series are unaffected.

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