Skip to content

Handle ambiguous public bindings in documentation QA - #41

Merged
ChrisRackauckas merged 1 commit into
mainfrom
agent/handle-ambiguous-doc-bindings
Jul 30, 2026
Merged

ChrisRackauckas merged 1 commit into
mainfrom
agent/handle-ambiguous-doc-bindings

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

This PR should be ignored until reviewed by @ChrisRackauckas.

Summary

  • use the public Docs.hasdoc API for binding-aware documentation checks on Julia 1.11+
  • retain a public @doc-based fallback for Julia 1.10
  • treat a public binding without a unique owner as undocumented instead of throwing
  • classify failed binding-owner resolution as a public re-export finding
  • add a regression with two modules exporting the same constant and a third module re-exporting the ambiguous name
  • bump SciMLTesting to 2.6.2

Root cause

Julia 1.12 reports equal constants imported from multiple modules as an ambiguous binding. run_api_docs constructed the non-public Base.Docs.Binding directly, so the ambiguity escaped as Constant binding was imported from multiple modules before the documentation assertion ran. public_reexports separately caught the same owner-resolution error and treated the package as the owner, which hid the ambiguous re-export.

An automated git bisect from current main identified c42bff4 (Add run_api_docs: shared public-API documentation QA check) as the first SciMLTesting commit exposing the exception.

Behavior

The ambiguity is not accepted as documented: without a unique binding owner, SciMLTesting cannot determine which defining docstring is authoritative. run_api_docs now records the name in the normal undocumented-name failure with no test error. The re-export audit also reports that name, so the fix does not merely suppress the exception.

Validation

  • Julia 1.10.11: Pkg.test() — 340/340 passed
  • Julia 1.12.6: Pkg.test() — 355/355 passed
  • Julia 1.13.0-rc1: Pkg.test() — 355/355 passed
  • Runic 1.7.0: whole repository --check passed
  • git diff --check passed

Process

Reproduced the failure from exact clean origin/main (9da2f8a), compared Julia 1.10/1.11/1.12 binding behavior, bisected the SciMLTesting history, implemented the conservative audit behavior and regression, then ran the package test matrix and formatter locally before committing.

Co-Authored-By: Chris Rackauckas <[email protected]>

Copy link
Copy Markdown
Member Author

Investigation/implementation scratchpad for 9f131a4:

  1. Reproduced on exact clean origin/main (9da2f8a) with two modules exporting the same equal constant and a third using/exporting both.
  2. Confirmed Julia 1.10/1.11 select one owner, while Julia 1.12 raises Constant binding was imported from multiple modules during binding lookup.
  3. Automated bisect result: first exposing commit is c42bff4 (Add run_api_docs: shared public-API documentation QA check).
  4. Replaced direct use of non-public Base.Docs.Binding with public Docs.hasdoc on Julia 1.11+ and the public @doc path on 1.10.
  5. Kept the audit conservative: ambiguous documentation lookup becomes an ordinary undocumented-name failure, while ambiguous owner lookup becomes a public_reexports finding.
  6. Added regression coverage and ran locally:
    • Julia 1.10.11: 340/340
    • Julia 1.12.6: 355/355
    • Julia 1.13.0-rc1: 355/355
    • whole-repository Runic 1.7.0 --check: pass
    • git diff --check: pass

Copy link
Copy Markdown
Member Author

Terminal CI for 9f131a4 is green: 12/12 checks passed.

  • tests: Julia current, LTS, and pre on Ubuntu, macOS, and Windows — 9/9 passed
  • Runic — passed
  • downgrade Core — passed
  • typos — passed

No branch-related CI failure required a follow-up change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants