tooling: diagnose missing or ambiguous integrity manifests #236

Merged
Vonsek merged 1 commit from upstream-pr/239 into main 2026-11-21 19:12:41 +00:00
Vonsek commented 2026-11-21 18:56:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T18:56:46Z.


Change

When the integrity verifier finds zero or multiple top-level torrent files or layout XML files, it now exits with CLI usage status 2, names the expected pattern, and reports how many files matched. A directory whose name matches the pattern does not count. This came from running the verifier against an extracted package directory containing a layout but no torrent.

Verification

Commit 3a54f33 on c04e65a, x64 Windows build 26200, MSVC 19.44.35230, Debug.

python -m venv out/pe-env
./out/pe-env/Scripts/python.exe -m pip install -r requirements-dev.txt
. ./tools/dev.ps1
cmake --preset dev
cmake --build --preset dev --target intake_candidate intake_provider
./out/pe-env/Scripts/python.exe -B tests/layout_chunks_check.py
ctest --preset dev --no-tests=error -R '^(layout_chunk_summary|static_exe_intake)$' -V

The Python test passed. Both CTests passed with zero skips. Four CLI cases cover zero and two matches for each input. Each checks exit 2, the pattern and count on stderr, and that the verifier writes no report. The existing intake test runs the verifier with one valid manifest pair and checks the piece count.

Before the change, the new test failed both directly and under ctest --preset dev --no-tests=error -R '^layout_chunk_summary$' -V. The no-torrent case returned 1 with ValueError: not enough values to unpack (expected 1, got 0). Repeating python -B tools/verify_build.py <package-directory> --output out/local-layout-only.json on the original local directory after the change returned 2 with expected exactly one *.torrent file in <package-directory>, found 0. No output report was created.

Evidence and follow-up

The new test uses temporary directories and empty placeholder files. The failure happens during manifest selection. A matching manifest pair still enters the existing integrity verification path.

This contribution was AI-assisted.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I reviewed the existing documentation. It already specifies a multi-file v1 torrent and a layout XML file.
  • I did not include game files, dumps, distribution links or secrets.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6533051237 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/239). Originally posted by [Vonsek](https://github.com/Vonsek) on 2026-11-21T18:56:46Z. --- ## Change When the integrity verifier finds zero or multiple top-level torrent files or layout XML files, it now exits with CLI usage status 2, names the expected pattern, and reports how many files matched. A directory whose name matches the pattern does not count. This came from running the verifier against an extracted package directory containing a layout but no torrent. ## Verification Commit `3a54f33` on `c04e65a`, x64 Windows build 26200, MSVC 19.44.35230, Debug. ```powershell python -m venv out/pe-env ./out/pe-env/Scripts/python.exe -m pip install -r requirements-dev.txt . ./tools/dev.ps1 cmake --preset dev cmake --build --preset dev --target intake_candidate intake_provider ./out/pe-env/Scripts/python.exe -B tests/layout_chunks_check.py ctest --preset dev --no-tests=error -R '^(layout_chunk_summary|static_exe_intake)$' -V ``` The Python test passed. Both CTests passed with zero skips. Four CLI cases cover zero and two matches for each input. Each checks exit 2, the pattern and count on stderr, and that the verifier writes no report. The existing intake test runs the verifier with one valid manifest pair and checks the piece count. Before the change, the new test failed both directly and under `ctest --preset dev --no-tests=error -R '^layout_chunk_summary$' -V`. The no-torrent case returned 1 with `ValueError: not enough values to unpack (expected 1, got 0)`. Repeating `python -B tools/verify_build.py <package-directory> --output out/local-layout-only.json` on the original local directory after the change returned 2 with `expected exactly one *.torrent file in <package-directory>, found 0`. No output report was created. ## Evidence and follow-up The new test uses temporary directories and empty placeholder files. The failure happens during manifest selection. A matching manifest pair still enters the existing integrity verification path. This contribution was AI-assisted. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I reviewed the existing documentation. It already specifies a multi-file v1 torrent and a layout XML file. - [x] I did not include game files, dumps, distribution links or secrets.
upstream-sync closed this pull request 2026-11-24 06:41:58 +00:00
chatgpt-codex-connector[bot commented 2026-11-24 06:47:52 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T18:56:57Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T18:58:56.494569Z 3a54f33 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7067637287 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/239#issuecomment-7067637287). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-21T18:56:57Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"3a54f336ebb72dd508b4c5abaa73db9497149935","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-21T18:58:56.494569Z">2026-11-21T18:58:56.494569Z</relative-time> | `3a54f33` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
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
R0Y00/Xbox2Windows!236
No description provided.