Skip to content

manifest: take the --out/input guard from report_paths (EGEN-MANIFEST-SHARED-PATH) - #6677

Merged
shayderrr merged 2 commits into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/6-manifest-shared-path
Nov 23, 2026
Merged

shayderrr merged 2 commits into
ItsNotRexed:mainfrom
evilclanker9000:deepseek/6-manifest-shared-path

Conversation

@evilclanker9000

@evilclanker9000 evilclanker9000 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

tools/manifest.py kept its own same_output_path (realpath + normcase + samefile) for the guard that refuses an --out naming one of the files it hashes. That copy is the rule tools/report_paths.py already implements for the other tools, and it misses the case the shared helper covers: on a case-insensitive (or accent-folding) volume a differently spelled --out is the same file, so manifest.py create <folder> --out <one of the hashed files> would replace an input after the run. This uses report_paths.same_report_path and drops the copy.

Test

python -I tests/test_manifest.py

  • before (new test against main's tool): FAILED (errors=1, skipped=1), AttributeError: module 'manifest' has no attribute 'same_report_path'. Did you mean: 'same_output_path'?
  • after: Ran 37 tests ... OK (skipped=1)

The new case, ManifestOutGuardTest.test_out_guard_follows_the_folding_volume, mocks report_paths as a darwin case-insensitive volume (NFC vs NFD café.json) and asserts the guard calls them one file, then with the volume not folding says two; the private copy answered "two files" in both.

End to end on this Windows box (NTFS, case-insensitive) with a synthetic folder:

  • python -I tools/manifest.py create <tmp> --out <tmp>\A.BIN (the folder holds a.bin): ERROR: --out would overwrite the input ...\A.BIN, exit 1.
  • python -I tools/manifest.py create <tmp> --out <tmp>\m.json: 1 files, exit 0; verify: OK, exit 0.

No GPU needed (standard library, CPU only).

Notes

  • Used the tool-level sys.path.insert of the script's folder before importing the sibling module, as the other tools do under python -I.
  • The call stays one line: the shared helper's docstring covers the hard-link case the old comment named.

AI-assisted.

@Ingenioeren

Copy link
Copy Markdown
Contributor

Tested d34d4975 on Windows build 26200, Python 3.11.4. CPU-only synthetic tests, run by the Leonida batch runner (AI-assisted setup).

  • python -I -B tests/test_manifest.py: 37 run, OK (skipped=1).
  • python -I -B tests/test_manifest_verifier.py: 48 run, OK (skipped=2).

@memorypressure

Copy link
Copy Markdown

Dedup verified: manifest now defers to report_paths.same_report_path, whose realpath+samefile+folding logic strictly contains the deleted private helper, so the macOS case/NFD hole closes with Linux behavior unchanged. 37/37 at the head; the new folding test errors on main. Out of scope but worth a follow-up: vertex_types, ttpf_mips, tex_headers and text_tables still carry private same_output_path copies — same EGEN-MANIFEST-SHARED-PATH pattern. Watch: #4152 also touches report_paths.py (no textual conflict, semantic watch only). Checks pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

tools/manifest.py drops its private same_output_path() and imports report_paths.same_report_path() for the --out overwrite guard, including the explicit sys.path insert needed under -I. A test simulates a case-insensitive APFS volume with canonically equivalent composed/decomposed filenames.

Why merge

The local realpath/normcase check failed to detect aliases on folding, Unicode-normalizing filesystems, allowing a manifest to replace a hashed input. Delegating to the shared helper applies the same volume-aware rules used by other tools.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

tools/manifest.py drops its private same_output_path() and imports report_paths.same_report_path() for the --out overwrite guard, including the explicit sys.path insert needed under -I. A test simulates a case-insensitive APFS volume with canonically equivalent composed/decomposed filenames.

Why merge

The local realpath/normcase check failed to detect aliases on folding, Unicode-normalizing filesystems, allowing a manifest to replace a hashed input. Delegating to the shared helper applies the same volume-aware rules used by other tools.

Verdict: Approve

@shayderrr
shayderrr merged commit 3e1e6ea into ItsNotRexed:main Nov 23, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants