feat(tools): list verified patch catalog entries #10719

Merged
WhiteAssassins merged 4 commits from upstream-pr/10719 into main 2026-10-26 07:00:42 +00:00
WhiteAssassins commented 2026-10-24 19:13:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by WhiteAssassins on 2026-10-24T19:13:10Z.


What

Add an opt-in --list-verified mode to the offline patch advisor. It enumerates every matching catalog entry that passes the existing title/version, SHA-256 and relinker --verify-patches checks. Each listed entry includes its catalog number, patch path, target hashes and the options needed to convert with that patch. Entries remain in catalog order; invalid or incompatible entries are reported individually and excluded from the verified list.

Without the flag, the advisor's existing recommendation, ambiguity decision and exit statuses are unchanged. The ambiguity message now points to --list-verified. In list mode, at least one verified entry exits 0; no verified entry retains the existing 1 or 2 outcome. The output tells users to choose one file because listed entries are not combined. Listing does not download anything or modify the input. This is a small follow-up to #8900 and the broader catalog discussion #8893.

Tested

  • CachyOS Linux, Python 3.14.8: all 28 patch-advisor unit tests pass. New cases cover multiple and single verified entries, a patch path containing a space, conversion options, individual catalog and relinker errors, hash and byte mismatches, and zero-match exit statuses.
  • CachyOS Linux: the registered synthetic-ELF integration script passed with a locally built native relinker. It verifies that the default mode remains ambiguous for two valid entries and points to the list flag, list mode returns both with a one-file warning, an invalid TOML entry does not hide a valid entry, an incompatible byte patch is excluded, and the input ELF remains unchanged.
  • python3 tools/check_test_registration.py --scripts: passed.
  • python3 tools/check_conventions.py --base origin/main: passed.
  • git diff --check origin/main...HEAD: passed.
  • python3 tools/pr_overlap.py --branch feat/patch-advisor-list-verified: no code overlap reported. Several comparisons involving docs/user/USAGE.md were inconclusive because those PRs conflict with main.
  • No game or GPU test; this changes an offline Python tool and its synthetic tests.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file (n/a: no unimplemented paths in this Python tool)
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source (n/a: no new third-party code)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4998333936 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10719). Originally posted by [WhiteAssassins](https://github.com/WhiteAssassins) on 2026-10-24T19:13:10Z. --- ### What Add an opt-in `--list-verified` mode to the offline patch advisor. It enumerates every matching catalog entry that passes the existing title/version, SHA-256 and `relinker --verify-patches` checks. Each listed entry includes its catalog number, patch path, target hashes and the options needed to convert with that patch. Entries remain in catalog order; invalid or incompatible entries are reported individually and excluded from the verified list. Without the flag, the advisor's existing recommendation, ambiguity decision and exit statuses are unchanged. The ambiguity message now points to `--list-verified`. In list mode, at least one verified entry exits `0`; no verified entry retains the existing `1` or `2` outcome. The output tells users to choose one file because listed entries are not combined. Listing does not download anything or modify the input. This is a small follow-up to #8900 and the broader [catalog discussion #8893](https://github.com/boykopovar/AnyPS5/discussions/8893). ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - CachyOS Linux, Python 3.14.8: all 28 patch-advisor unit tests pass. New cases cover multiple and single verified entries, a patch path containing a space, conversion options, individual catalog and relinker errors, hash and byte mismatches, and zero-match exit statuses. - CachyOS Linux: the registered synthetic-ELF integration script passed with a locally built native relinker. It verifies that the default mode remains ambiguous for two valid entries and points to the list flag, list mode returns both with a one-file warning, an invalid TOML entry does not hide a valid entry, an incompatible byte patch is excluded, and the input ELF remains unchanged. - `python3 tools/check_test_registration.py --scripts`: passed. - `python3 tools/check_conventions.py --base origin/main`: passed. - `git diff --check origin/main...HEAD`: passed. - `python3 tools/pr_overlap.py --branch feat/patch-advisor-list-verified`: no code overlap reported. Several comparisons involving `docs/user/USAGE.md` were inconclusive because those PRs conflict with `main`. - No game or GPU test; this changes an offline Python tool and its synthetic tests. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file (n/a: no unimplemented paths in this Python tool) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source (n/a: no new third-party code) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-24 19:23:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T19:23:00Z.

Review: APPROVED


Reviewed at exact head decf5429c56b4a8f46cb7a011c86c6f4d60d755b. The opt-in listing keeps the existing recommendation/ambiguity behavior intact by default, verifies each catalog entry independently, reports only entries passing metadata, target hash and relinker checks, preserves catalog order, and does not modify the input. The CLI unit tests cover multiple/single/no matches, malformed and incompatible entries, hashes, spaced paths and conversion arguments. The registered synthetic-ELF integration test now exercises these cases against the native relinker and checks the input remains unchanged.

I ran python3 -m unittest tools.tests.test_suggest_patches -v (28 passed), python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main...HEAD (both passed). Hosted Linux, Windows, macOS arm64, macOS x86_64 and ASAN relinker jobs all pass, and the PR is mergeable. Product jobs are skipped by repository policy; the PR reports its local synthetic integration run.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5639596268 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10719#pullrequestreview-5639596268). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T19:23:00Z. **Review:** APPROVED --- Reviewed at exact head `decf5429c56b4a8f46cb7a011c86c6f4d60d755b`. The opt-in listing keeps the existing recommendation/ambiguity behavior intact by default, verifies each catalog entry independently, reports only entries passing metadata, target hash and relinker checks, preserves catalog order, and does not modify the input. The CLI unit tests cover multiple/single/no matches, malformed and incompatible entries, hashes, spaced paths and conversion arguments. The registered synthetic-ELF integration test now exercises these cases against the native relinker and checks the input remains unchanged. I ran `python3 -m unittest tools.tests.test_suggest_patches -v` (28 passed), `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main...HEAD` (both passed). Hosted Linux, Windows, macOS arm64, macOS x86_64 and ASAN relinker jobs all pass, and the PR is mergeable. Product jobs are skipped by repository policy; the PR reports its local synthetic integration run.
MarcZX10 commented 2026-10-24 19:37:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T19:37:10Z.

Review: APPROVED


Re-reviewed exact head dbe74bf422e953f24c4fe9af824e5e7b7b49adfc. The latest commit only clarifies the ambiguous-match and --list-verified messages, updates their unit/integration assertions, and documents the option; behavior remains unchanged. I ran python3 -m unittest tools.tests.test_suggest_patches (24/24 passed), diff-check and conventions (pass). Hosted relinker Linux, Windows, macOS x86_64/arm64 and ASan jobs pass; product jobs are skipped by policy.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5639658283 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10719#pullrequestreview-5639658283). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T19:37:10Z. **Review:** APPROVED --- Re-reviewed exact head `dbe74bf422e953f24c4fe9af824e5e7b7b49adfc`. The latest commit only clarifies the ambiguous-match and `--list-verified` messages, updates their unit/integration assertions, and documents the option; behavior remains unchanged. I ran `python3 -m unittest tools.tests.test_suggest_patches` (24/24 passed), diff-check and conventions (pass). Hosted relinker Linux, Windows, macOS x86_64/arm64 and ASan jobs pass; product jobs are skipped by policy.
MarcZX10 commented 2026-10-24 20:20:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T20:20:45Z.

Review: APPROVED


Reviewed the complete diff at dbe74bf422. The opt-in listing preserves the existing default recommendation/ambiguity behavior, reports each independently rejected catalog entry, and prints verified patch paths, hashes and conversion options without implying the entries are combined. The tests cover zero/one/multiple matches, invalid/incompatible entries, paths with spaces, CLI integration and input immutability. The author reports 28 unit tests and the synthetic-ELF integration passing locally; hosted eligibility, conventions, labels and the full relinker matrix/ASAN passed. Product Linux/Windows jobs were skipped by workflow policy.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5639804115 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10719#pullrequestreview-5639804115). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-24T20:20:45Z. **Review:** APPROVED --- Reviewed the complete diff at dbe74bf422e953f24c4fe9af824e5e7b7b49adfc. The opt-in listing preserves the existing default recommendation/ambiguity behavior, reports each independently rejected catalog entry, and prints verified patch paths, hashes and conversion options without implying the entries are combined. The tests cover zero/one/multiple matches, invalid/incompatible entries, paths with spaces, CLI integration and input immutability. The author reports 28 unit tests and the synthetic-ELF integration passing locally; hosted eligibility, conventions, labels and the full relinker matrix/ASAN passed. Product Linux/Windows jobs were skipped by workflow policy.
THEMANnt commented 2026-10-25 00:01:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-25T00:01:02Z.

Review: APPROVED


Reviewed dbe74bf422e953f24c4fe9af824e5e7b7b49adfc against 2fade7ef4e5732580db9cc18832a2e4d6f7da489. No actionable findings in this focused review.

Source review: Inspected the complete patch, verification pipeline, documentation and changed relinker integration test. Listing consumes only entries that already pass metadata, target hashes and relinker verification; it retains catalog order and explicitly requires choosing one patch. The default single-match recommendation, multiple-match ambiguity and no-match/error statuses remain separate. Extracted conversion options preserve quoting and module/executable arguments.

Validation: Windows Python 3.11: tools/tests/test_suggest_patches.py -v, 28 passed, 0 skipped; baseline 24 passed. Baseline production with changed tests gave four expected unsupported-option SystemExit errors and one expected changed-guidance assertion failure. Conventions, whitespace and script registration passed. Effective hosted relinker matrix and ASan succeeded; full-product jobs were skipped.

Scope: Local unit tests substitute relinker responses. The changed real-relinker integration script was inspected, not run locally; no game playback or full application build was performed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5640676840 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10719#pullrequestreview-5640676840). Originally posted by [THEMANnt](https://github.com/THEMANnt) on 2026-10-25T00:01:02Z. **Review:** APPROVED --- Reviewed `dbe74bf422e953f24c4fe9af824e5e7b7b49adfc` against `2fade7ef4e5732580db9cc18832a2e4d6f7da489`. No actionable findings in this focused review. **Source review:** Inspected the complete patch, verification pipeline, documentation and changed relinker integration test. Listing consumes only entries that already pass metadata, target hashes and relinker verification; it retains catalog order and explicitly requires choosing one patch. The default single-match recommendation, multiple-match ambiguity and no-match/error statuses remain separate. Extracted conversion options preserve quoting and module/executable arguments. **Validation:** Windows Python 3.11: `tools/tests/test_suggest_patches.py -v`, 28 passed, 0 skipped; baseline 24 passed. Baseline production with changed tests gave four expected unsupported-option SystemExit errors and one expected changed-guidance assertion failure. Conventions, whitespace and script registration passed. Effective hosted relinker matrix and ASan succeeded; full-product jobs were skipped. **Scope:** Local unit tests substitute relinker responses. The changed real-relinker integration script was inspected, not run locally; no game playback or full application build was performed.
MarcZX10 commented 2026-10-25 00:11:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T00:11:22Z.

Review: APPROVED


The opt-in mode keeps the existing recommendation path intact and lists only entries that pass the same metadata, target hash and relinker verification checks. It preserves catalog order, emits conversion options per entry, warns that patches are not combined, and does not modify the input; the tests also cover per-entry rejection and unchanged default ambiguity behavior. I ran python3 -m unittest tools.tests.test_suggest_patches (28 passed), the conventions checker, git diff --check, and python3 tools/check_test_registration.py --scripts; all passed. The relinker integration script needs a built native executable that is not present in this checkout, so I could not reproduce that part locally; the PR reports it passing.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5640717089 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10719#pullrequestreview-5640717089). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T00:11:22Z. **Review:** APPROVED --- The opt-in mode keeps the existing recommendation path intact and lists only entries that pass the same metadata, target hash and relinker verification checks. It preserves catalog order, emits conversion options per entry, warns that patches are not combined, and does not modify the input; the tests also cover per-entry rejection and unchanged default ambiguity behavior. I ran `python3 -m unittest tools.tests.test_suggest_patches` (28 passed), the conventions checker, `git diff --check`, and `python3 tools/check_test_registration.py --scripts`; all passed. The relinker integration script needs a built native executable that is not present in this checkout, so I could not reproduce that part locally; the PR reports it passing.
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
boykopovar/AnyPS5!10719
No description provided.