Repository navigation
Conversation
|
Verified by OreoFR on macOS 27.2.1, Apple M5, Python 3.12.16 (pytest, no GPU),
AI-assisted: Claude Code |
|
VERIFY-2741 — PASS
|
|
Independent check on Windows (not the author), at
Tool-only change; the report-path guard cases run under the standard library on Python 3.12.10. No game files needed. Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10. AI-assisted: yes (opencode). |
8f23a46 to
e61612a
Compare
|
Rebased onto Verified on the new head (
No behaviour change beyond the shared helper. Ready to merge: |
|
Rebased onto New head: Measured on that head, standard library only, Windows, Python 3.14, no game data: @OreoFR @aegish-zagi @KelboLive — your checks are on The diff is unchanged in substance: same two commits, same |
aslan2142
left a comment
There was a problem hiding this comment.
Reviewed the diff against main: delegating the report-path guard in tools/text_tables.py to report_paths.same_report_path is clean and clean-room verified, but this branch currently conflicts with main in tests/test_report_paths.py:8-12 (SHARED tuple updated by #2639 and earlier merges). Please rebase onto current main so CI runs cleanly.
(AI-assisted review.)
KelboLive
left a comment
There was a problem hiding this comment.
The behaviour is right and cleanly scoped: both former _same_output_path call sites now use same_report_path, the lazy import is gone, and all four report flags (--dialogue, --tables, --strings, --native-speakers) go through the one preflight loop — so a failing path is refused for every report write, not at a single call site. I reproduced the case-sensitive NTFS A/B end to end: old code rc=2, outputs must be distinct files, nothing written; this branch rc=0 with both T.csv and t.csv. That is exactly the bug the shared helper exists for (the old copy lowercased unconditionally via normcase, merging case-distinct files on a case-sensitive volume).
But the test edit only pins the import string. Restoring the old helper locally leaves all three suites green (39 / 26 / 4 measured), so the removal is not actually guarded. Please add _same_output_path to the forbidden names in test_switched_tools_import_the_helper_and_define_no_copy, or add text_tables to test_report_path_case.HELPERS — either would make the re-added copy fail.
It also needs the rebase already requested: merge-tree against current origin/main conflicts only in the SHARED tuple of tests/test_report_paths.py (main added meshlet_page); tools/text_tables.py merges cleanly.
Residual, outside this PR's two guards: the direct source-file check at tools/text_tables.py:487 still uses raw os.path.exists/os.path.samefile rather than the helper. It only runs when the output exists and I found no bypass, but it is the same class of check and worth a follow-up.
e61612a to
cfcf07c
Compare
The reviewers' red test: with this entry on main, test_switched_tools_import_the_helper_and_define_no_copy fails with "'from report_paths import same_report_path' not found"; with this branch it passes.
cfcf07c to
de374c4
Compare
Claimed in the coordination issue as: TEXT-TABLES-OUTPUT-GUARD-SHARED
What and why
tools/text_tables.pystill carried its own_same_output_path(os.path.normcaseoverrealpath, thensamefile) and used it for the distinct-outputs check and for the carveindex.jsonguard, whileinput_underin the same file already askedreport_paths.same_report_path. #1655 moved the source-file guard to the shared helper but left this copy, and #1228 was closed as superseded by it, so the remainder was still onmainat20fe0c75. This is that remainder.The private copy is wrong on a case-sensitive directory:
normcaselowercases both names beforesamefile, so--tables Out/T.csv --strings Out/t.csvis refused as one file. Measured on native Windows 11 NTFS withfsutil file setCaseSensitiveInfo <dir> enable,mainand this branch, same fixture:and on the two paths directly (old copy vs
same_report_path, in a case-sensitive directory that really holds both files):The private function is removed, the module imports
same_report_pathonce at the top (ROOT/sys.path.insertwas already there, so-Iworks), andinput_under's function-local import is dropped because the module-level one covers it. The tool also joinsSHAREDintests/test_report_paths.py.This is the same shape as the other tools in the series (#1162, #1170-#1173, #1214, #1215, #1227, #1229, #1243, #1244, #2636-#2640), and it edits the same tuple line, so it will need a rebase behind whichever of those lands first; the conflict is mechanical, both entries belong in the tuple alphabetically.
Tested
python -I tests/test_text_tables.py— 39 tests, OKpython -I tests/test_report_paths.py— 26 tests, OK (1 skipped: the macOS-only case), withtext_tablesinSHAREDpython -I tests/test_report_path_case.py— 4 tests, OK (1 skipped, same)python -I scripts/check_no_game_data.py tools/text_tables.py tests/test_report_paths.py— cleanmainvs this branch) on a case-sensitive NTFS directorySynthetic resources and temporary folders; no game data, no GPU workload.
GPUs tested: n/a
AI-assisted: yes
Checklist
main(20fe0c75) and merges cleanly.