tooling: reject TTPF manifest paths that overwrite DDS or profile inputs #3279

Manually merged
github merged 1 commit from github-bot/gh-3277 into gh-pr/3277/base 2026-11-28 05:08:37 +00:00 AGit
Owner

@⁠wish131400 on GitHub · 2026-11-28 04:58 UTC · original
wish131400:tooling/ttpf-output-collisions → main · +110 −1 · 3 files · 1 commits · merged 2026-11-28 05:04 UTC

The batch exporter's final JSON manifest write can replace a requested DDS or an input history/calibration profile. For example, selecting index 0 with --manifest out/tex_00000.dds -o out reports a successful export and then replaces the DDS with JSON, leaving the reported DDS checksum stale. A failed/skipped export can also lose a previously preserved DDS.

Fixes #3278.

Reject manifest collisions with input profiles before loading the decoder tools, and with the selected DDS destinations before creating the output directory or starting workers. Reuse the existing resolved-path/file-identity comparison. The separate-directory control permits the same filename and verifies the exported bytes against the manifest checksum.

Validation on Windows 10, Python 3.14, based on 240e0fb9c460f24d51683abe2d4cce2800b136c1:

  • python -B tests/ttpf_batch_export_check.py: 15 passed, 1 optional local integration test skipped.
  • python -B tests/ttpf_batch_export_cli_check.py: 9 passed.
  • Original-code negative controls fail for all six DDS collisions (strict/failed/skipped, each with and without an existing file), and for both profile input collisions.
  • git diff --check passed.

The regressions use generated files and the existing mocked exporter. They do not require or include texture assets and do not establish image-decoding correctness. Refs #458.

**@⁠wish131400** on GitHub · 2026-11-28 04:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3277) `wish131400:tooling/ttpf-output-collisions` → `main` · +110 −1 · 3 files · 1 commits · merged 2026-11-28 05:04 UTC The batch exporter's final JSON manifest write can replace a requested DDS or an input history/calibration profile. For example, selecting index 0 with `--manifest out/tex_00000.dds -o out` reports a successful export and then replaces the DDS with JSON, leaving the reported DDS checksum stale. A failed/skipped export can also lose a previously preserved DDS. Fixes #3278. Reject manifest collisions with input profiles before loading the decoder tools, and with the selected DDS destinations before creating the output directory or starting workers. Reuse the existing resolved-path/file-identity comparison. The separate-directory control permits the same filename and verifies the exported bytes against the manifest checksum. Validation on Windows 10, Python 3.14, based on `240e0fb9c460f24d51683abe2d4cce2800b136c1`: - `python -B tests/ttpf_batch_export_check.py`: 15 passed, 1 optional local integration test skipped. - `python -B tests/ttpf_batch_export_cli_check.py`: 9 passed. - Original-code negative controls fail for all six DDS collisions (strict/failed/skipped, each with and without an existing file), and for both profile input collisions. - `git diff --check` passed. The regressions use generated files and the existing mocked exporter. They do not require or include texture assets and do not establish image-decoding correctness. Refs #458.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:02:20 +00:00
github-bot changed target branch from main to gh-pr/3277/base 2026-11-28 05:08:36 +00:00
github manually merged commit b60ed5ab44 into gh-pr/3277/base 2026-11-28 05:08:37 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-28 05:04 UTC · original · approved these changes

Independent review of b60ed5ab. The guards reuse the resolved-path/file-identity check. Profiles are protected before the tools load, and requested DDS destinations are protected before directory creation or worker launch, including exports that would fail or skip. The separate-directory control preserves the DDS and matches its manifest checksum.

On Windows, python -B tests/ttpf_batch_export_check.py reported 15 passes and one optional integration skip. python -B tests/ttpf_batch_export_cli_check.py passed 9/9, and the docs-link check passed.

**@⁠R0Y00** on GitHub · 2026-11-28 05:04 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3277#pullrequestreview-6095933882) · **approved these changes** Independent review of `b60ed5ab`. The guards reuse the resolved-path/file-identity check. Profiles are protected before the tools load, and requested DDS destinations are protected before directory creation or worker launch, including exports that would fail or skip. The separate-directory control preserves the DDS and matches its manifest checksum. On Windows, `python -B tests/ttpf_batch_export_check.py` reported 15 passes and one optional integration skip. `python -B tests/ttpf_batch_export_cli_check.py` passed 9/9, and the docs-link check passed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.