feat(tools): fail import audits on strict provider mismatches #5430

Merged
Prophet069 merged 1 commit from upstream-pr/5430 into main 2026-10-14 12:08:32 +00:00
Prophet069 commented 2026-10-13 19:34:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Prophet069 on 2026-10-13T19:34:23Z.


What

Add --strict-providers to the existing import auditor. A named import whose NID is available only from another library currently appears in the mismatch report but does not make an otherwise complete audit fail. The opt-in flag makes that existing mismatch classification return exit code 1, while leaving the default Linux-friendly policy, shared libc provider exception, title-module handling, JSON report and missing-library failures unchanged.

This replaces our separate local guest-registry preflight proposal rather than adding another auditor. It is a read-only package check, not an implementation of a guest export or proof that every dynamic lookup succeeds. Related #4916 audits dependencies with no imported functions; it does not implement strict provider checking. The two features are independent, with no prerequisite PR. No equivalent open PR was found in the targeted check.

Tested

Windows 10 Pro 22H2 x64 (build 19045), Python 3.14: all 50 existing and new import_audit tests passed in 6.747 seconds. Four new policy cases cover a NID supplied by the wrong existing provider (default succeeds, strict fails), the matching provider, the existing shared-libc exception, and a missing provider file. The tests exercise CLI status, classification and JSON output using tiny synthetic PE/ELF fixtures; they do not merely check that a runtime export exists. No emulator or DS2 startup was run. No speed improvement is claimed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One branch per topic
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent success stub
  • No notes, investigation files, images or game dumps added
  • New third-party code: none
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (package validation only)
  • GPUs tested: n/a (Python audit policy)
  • AI-assisted: yes; prepared with Codex; the submitting author is responsible for every line
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4848447079 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5430). Originally posted by [Prophet069](https://github.com/Prophet069) on 2026-10-13T19:34:23Z. --- ### What Add `--strict-providers` to the existing import auditor. A named import whose NID is available only from another library currently appears in the mismatch report but does not make an otherwise complete audit fail. The opt-in flag makes that existing mismatch classification return exit code 1, while leaving the default Linux-friendly policy, shared libc provider exception, title-module handling, JSON report and missing-library failures unchanged. This replaces our separate local guest-registry preflight proposal rather than adding another auditor. It is a read-only package check, not an implementation of a guest export or proof that every dynamic lookup succeeds. Related #4916 audits dependencies with no imported functions; it does not implement strict provider checking. The two features are independent, with no prerequisite PR. No equivalent open PR was found in the targeted check. ### Tested Windows 10 Pro 22H2 x64 (build 19045), Python 3.14: all 50 existing and new import_audit tests passed in 6.747 seconds. Four new policy cases cover a NID supplied by the wrong existing provider (default succeeds, strict fails), the matching provider, the existing shared-libc exception, and a missing provider file. The tests exercise CLI status, classification and JSON output using tiny synthetic PE/ELF fixtures; they do not merely check that a runtime export exists. No emulator or DS2 startup was run. No speed improvement is claimed. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One branch per topic - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent success stub - [x] No notes, investigation files, images or game dumps added - [x] New third-party code: none - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none (package validation only) - [x] GPUs tested: n/a (Python audit policy) - [x] AI-assisted: yes; prepared with Codex; the submitting author is responsible for every line
adriadam10 commented 2026-10-14 11:42:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T11:42:17Z.


Checked --strict-providers against library_mismatch (it already excludes the shared libc provider), built and ran ctest on the PR merged onto main (31 tests green), and confirmed import_audit fails without the import_audit.py change. Default behaviour is unchanged; merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6167520817 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5430#issuecomment-6167520817). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T11:42:17Z. --- Checked `--strict-providers` against `library_mismatch` (it already excludes the shared libc provider), built and ran ctest on the PR merged onto main (31 tests green), and confirmed `import_audit` fails without the `import_audit.py` change. Default behaviour is unchanged; merging.
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!5430
No description provided.