Skip to content

docs(usage): list --strict-stubs and --strict-providers in the import audit options - #14368

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
roboterspinne:docs/usage-import-audit-strict-options
Nov 1, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
roboterspinne:docs/usage-import-audit-strict-options

Conversation

@roboterspinne

Copy link
Copy Markdown
Contributor

What

On 26fa121 (line numbers below refer to it) the option table of the import audit in docs/user/USAGE.md:635-641 lists --libs, --modules, --source, --names and --json, but tools/import_audit.py also accepts --strict-stubs and --strict-providers (import_audit.py:1003-1005), and import_audit.py --help prints both. A reader of the table does not learn what either option does; in USAGE.md they appear only in the exit-code sentence at USAGE.md:645. This adds one row for each, written from the code rather than from the help strings: the exit expression at import_audit.py:1051 fails with --strict-stubs only on unique_by_class["stub"], so partial imports do not count, and summarize at import_audit.py:903-915 counts every record, weak imports and the imports of --modules files included; with --strict-providers it fails on library_mismatch, which import_audit.py:825 sets only for an import that names a library and is exported, but not by the library it names, unless it is a module import or libc.prx exports it.

Tested

Windows 11, Python 3.13.9 (no build: documentation only), on 26fa121:

  • python tools/import_audit.py --help lists --strict-stubs ("also fail when a referenced import resolves to a throwing stub") and --strict-providers; on 26fa121 grep -n '^| `--' docs/user/USAGE.md shows the import audit table rows 637-641 for --libs, --modules, --source, --names and --json only, and on this branch rows 640 and 641 for --strict-stubs and --strict-providers between --source and --names.
  • Each statement of the two rows checked against import_audit.py:762-769 (classify), 825 (library_mismatch), 800-808 and 903-915 (weak imports are recorded and counted) and 1051 (exit code).
  • python tools/check_conventions.py --base 26fa1212b8 --head HEAD with this title and description passed.

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
  • 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
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the docs label Nov 1, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed — looks good

The two option descriptions match the exact-head implementation and --help; the documentation-only diff passes conventions and merges cleanly against the current main snapshot.

What I ran

Reviewed #14368 at head 7e896cac7b8eb5fd2fe111cdb2db2785531d9d9b, whose PR base was e6f57307fa7f47165d7fc1bee945abdb2f6816e7. The current main tip used for the merge preview was e67cc818696fd6e6c58ac80adc6550c54aed68e8; the preview was clean. Environment: Linux x86_64, Python 3.11.2; no compiler was invoked.

git diff --check e6f57307fa7f47165d7fc1bee945abdb2f6816e7...refs/review/session-20261101-14368
python3 tools/check_conventions.py --base e6f57307fa7f47165d7fc1bee945abdb2f6816e7 --head refs/review/session-20261101-14368
python3 tools/import_audit.py --help
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14368
python3 tools/pr_overlap.py --base main --branch refs/review/session-20261101-14368 --repo boykopovar/AnyPS5 --jobs 8

The PR changes only docs/user/USAGE.md by two lines. I checked the option descriptions against classify, audit, summarize, and the exit expression in tools/import_audit.py at the reviewed head. The strict-stub count includes weak references and imports read from --modules; partial imports are a separate class. The provider mismatch exception for module imports and libc.prx matches the implementation. The PR's declared overlap note about #12877 is consistent with its current changed-file list, which contains no documentation file.

Results

Check Result
Diff check Passed.
Repository conventions and PR template Passed locally and in hosted CI.
CLI option comparison Passed: --help lists both documented options and matching effects.
Current-main merge preview Passed against e67cc818696fd6e6c58ac80adc6550c54aed68e8.
Hosted intake, eligibility, labels Passed.
Build-dependent jobs Skipped by CI; this documentation-only diff does not change build inputs.
Precheck test-quality heuristic The precheck could not execute its optional helper because tools/pr_test_quality.py is absent from its isolated PR snapshot; no test files changed.
Broad overlap helper Could not complete: its open-PR metadata parser rejected an invalid JSON escape. The PR's own overlap report is author-provided; I did not independently reproduce the full scan.
Runtime tests Not applicable to a documentation-only change.
Unedited selected command output

python3 tools/check_conventions.py ...:

All conventions checks passed.

python3 tools/import_audit.py --help (relevant lines):

  --strict-stubs      also fail when a referenced import resolves to a
                      throwing stub
  --strict-providers  fail when a named import is provided only by another
                      library; retains the existing libc and title-module
                      rules

Precheck's optional heuristic stderr:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14368-7e896cac7b8e/head-7e896cac7b8e-b17cb51d/tools/pr_test_quality.py': [Errno 2] No such file or directory

Overlap-helper output:

pr_overlap: Invalid \uXXXX escape: line 1 column 1292785 (char 1292784)

Findings

Blocking: None.

Non-blocking: The broad overlap helper did not complete, so I relied on the PR's overlap report and checked the directly referenced #12877 file list. No code or test behavior changed in this PR.

Sources

Not verified

No build or tests were run because only user documentation changed. I did not independently repeat the PR's all-open-PR overlap analysis; the local overlap helper failed while parsing unrelated PR metadata.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 docs/user/USAGE.md
PR 5925 docs/user/USAGE.md
PR 6924 docs/user/USAGE.md
PR 7642 docs/user/USAGE.md
PR 9345 docs/user/USAGE.md
PR 9508 docs/user/USAGE.md
PR 10479 docs/user/USAGE.md
PR 10792 docs/user/USAGE.md
PR 10861 docs/user/USAGE.md
PR 12678 docs/user/USAGE.md
PR 12746 docs/user/USAGE.md
PR 12863 docs/user/USAGE.md

@oneandonlydean oneandonlydean self-assigned this Nov 1, 2026
@oneandonlydean
oneandonlydean merged commit f03f724 into boykopovar:main Nov 1, 2026
10 checks passed
@roboterspinne
roboterspinne deleted the docs/usage-import-audit-strict-options branch November 2, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants