Skip to content

Restrict Sphinx missing-reference fallback to known type aliases - #8

Closed
Adam Corrao (AdamCorrao) with Copilot wants to merge 1 commit into
mainfrom
copilot/update-sphinx-fallback-restriction
Closed

Adam Corrao (AdamCorrao) with Copilot wants to merge 1 commit into
mainfrom
copilot/update-sphinx-fallback-restriction

Conversation

Copilot AI commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

This narrows the docs missing-reference workaround so it only applies to the known RefinementParameter alias-resolution gap, instead of retrying every unresolved Python class reference as py:obj. The goal is to keep the alias link fix while preserving nitpicky warnings for genuine unresolved class refs.

  • Scope the fallback to explicit alias targets

    • add a small allowlist for:
      • RefinementParameter
      • powderline.schema.RefinementParameter
    • only retry unresolved py:class references for those targets
    • leave all other unresolved class references untouched so Sphinx still warns normally
  • Document the intended behavior

    • update the fallback comment/docstring in docs/conf.py to state that this is an intentionally narrow alias-as-data workaround, not a general missing-reference recovery path
  • Keep the docs-warning cleanup aligned

    • update docs/known_issues.md to describe the restricted fallback accurately
    • add focused coverage for the fallback contract:
      • known alias targets retry as py:obj
      • non-allowlisted / wrong-role refs return None

Example of the narrowed behavior:

_TYPE_ALIAS_OBJ_FALLBACK_TARGETS = {
    "RefinementParameter",
    "powderline.schema.RefinementParameter",
}

if (
    node.get("refdomain") != "py"
    or node.get("reftype") != "class"
    or node.get("reftarget") not in _TYPE_ALIAS_OBJ_FALLBACK_TARGETS
):
    return None

Copilot AI changed the title [WIP] Update Sphinx fallback for known RefinementParameter alias Restrict Sphinx missing-reference fallback to known type aliases Sep 22, 2026
@AdamCorrao
Adam Corrao (AdamCorrao) deleted the copilot/update-sphinx-fallback-restriction branch September 22, 2026 21:11
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