Skip to content

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

Closed
breachato wants to merge 1 commit into
ProjectLeonida:mainfrom
breachato:text-tables-shared-report-path
Closed

breachato wants to merge 1 commit into
ProjectLeonida:mainfrom
breachato:text-tables-shared-report-path

Conversation

@breachato

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEXT-TABLES-SHARED-REPORT-PATH (#14 (comment))

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)

@PierreEbele

Copy link
Copy Markdown
Contributor

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

MoonEyes pushed a commit to MoonEyes/leonida that referenced this pull request Nov 27, 2026
…path guard (TEXT-TABLES-SHARED-REPORT-PATH)

From ProjectLeonida#1228 (head 0d6800a), applied as a reviewed patch.

Co-authored-by: breachato <breachato@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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.

AI-assisted (Claude Code).

@breachato

Copy link
Copy Markdown
Contributor Author

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.

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