Skip to content

Nothing checks the repo paths and self-links named in Python source #84

Description

@lesnik512

Follow-up to #82, which made the offline gate check absolute self-links in Markdown.

The gap #82 left

#82's own motivating example is still unchecked. Its text says:

a URL in a docstring rendered on PyPI has no checkout to be relative to, which is precisely how the faststream-concurrent-aiokafka instance arose. So the gate still needs to cover what remains.

The --remap fix covers what remains in Markdown. The gate's input glob is unchanged at '**/*.md', so nothing in .py is scanned — including the instance that motivated the issue.

Widening the glob would not reach it either. The URL is split across two adjacent string literals:

"https://github.com/modern-python/faststream-concurrent-aiokafka/blob/main/docs/adr/"
"0003-control-signals-not-honoured.md."

A text-level checker sees a directory that exists and a filename fragment that is not a link, so it would report green while the interesting half goes unverified. This is the one that is user-visible on the package page.

It is wider than that one URL

Every repo's AGENTS.md already states the limitation as a known fact:

A relative link to an ADR is checked — CI runs lychee --offline over every .md — but a path named in a docstring or a comment is not.

Measured across all non-archived repos at HEAD, by extracting docs/adr/NNNN-*.md from tracked *.py and testing each against the working tree:

Repo References
compose2pod 5
db-retry 1
faststream-concurrent-aiokafka 1
modern-di 1
modern-di-arq 1
modern-di-starlette 1
modern-di-typer 1
.github 2

13 ADR paths named in Python source across 8 repos, all resolving today, none checked by anything. Plus the one absolute URL above. Nothing is broken right now — which is exactly the position #82 described before the planning/ migration broke seven links at once.

These are load-bearing: INVARIANT: docstrings cite the ADR that explains why the invariant exists, so a renamed or pruned ADR silently strips the rationale from the test that depends on it.

Options, none costed yet

  1. Widen the glob to '**/*.py'. Cheapest, and lychee extracts bare URLs from plain text. Catches nothing today: the only .py URL is the split one, and bare docs/adr/... paths in prose are not links lychee resolves. Close to vacuous on its own.
  2. Join the split literal, then widen the glob. Makes the PyPI-visible URL checkable by (1). Small, targeted, and fixes the specific instance The offline link gate never checks absolute self-links #82 cared about.
  3. A test per repo asserting cited ADR paths exist. Covers all 13 and the URL, in the repos' own idiom (semvertag/tests/_descriptor_gate.py is the precedent for a config-shape test). Cost: a test copied into 8 repos, which is the machinery The offline link gate never checks absolute self-links #82 avoided needing.
  4. Accept and document. The AGENTS.md sentence already says it; make that the settled answer and close this.

(1) and (2) compose. (3) is the only one that covers the bare-path references.

Scope

The 8 repos above, or fewer depending on which option wins. Deciding the option is the work here; the edit is small either way.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions