Skip to content

A bare :NNN continuation citation is invisible to check_doc_citations.py, so the second half of a pair is never checked #1459

Closed

Description

@FlorentinDUBOIS

What happens

CITATION requires a path (.github/scripts/check_doc_citations.py):

CITATION = re.compile(
    rf"(?P<path>{PATH}):(?P<spans>{SPAN}(?:[,/][ \t]*(?:\n[ \t]*)?{SPAN})*)"
)

So the very natural idiom of naming the file once and then continuing with bare line numbers produces citations that no rule in the script can see — not rule 1 (resolves/non-blank), not rule 2 (drift), not rule 3, not rule 4. They are not reported as unresolvable; they are never extracted in the first place.

Three of them exist today, all inside the guarded surface (doc/** and **/LIFECYCLE.md):

doc/rate-limit-design.md:151          `lib/src/tcp.rs:183` and `:305`
doc/testing.md:599                    `h2_correctness_tests.rs:3604` and `:3708`
lib/src/protocol/mux/LIFECYCLE.md:311 `router.rs:394` and `:574`

In each, the first half is checked on every CI run and the second half has never been checked at all.

Why it matters

The two halves name sibling sites in the same function, so they rot together — but only one of them can ever be caught. The result is worse than an unchecked citation: a reader sees the guarded half land correctly and reasonably infers the unguarded half is equally maintained.

This is confirmed, not hypothetical. While rebasing #1442, LIFECYCLE.md:311's guarded half was correctly re-anchored router.rs:394 → :442, and the bare `:574` was left untouched. At the rebased tree :574 reads socket_ref, inside a register_socket call; the real second context.link_stream(stream_id, token); site is at :622. The gate was green throughout. It was found by hand, and only because someone was already auditing that hunk.

Relationship to the other two gaps

Three distinct ways a citation escapes, all in the same identity/extraction path:

Fixing #1457 does not help here, and vice versa.

Suggested direction

Two options, and the second is probably better:

  1. Extract bare spans with an inherited path. Track the most recent resolved path within a paragraph and attach it to a following bare `:NNN`. This matches how a reader parses the prose, but it is a heuristic — paragraph scope is not well defined, and a bare :NNN that means something else (a port, a status code, :status) would be mis-extracted. Note doc/testing.md:599 already contains the token `:status` one sentence later, so the false-positive surface is real.

  2. Reject the form. Add a rule that fails on a bare `:NNN` inside the guarded surface and requires the path to be repeated. Three sites exist, so the migration is small and one-time. This trades a little prose repetition for a citation that is checkable at all — and the repository has consistently preferred that trade, most recently in check_doc_citations.py ignores .md:NNN targets, and all six in the tree are wrong #1444, which replaced a line range with an anchor precisely to leave the brittle form behind.

Whichever is chosen, the three existing sites should be repaired in the same changeset; LIFECYCLE.md:311 is already handled on fix/http-retry-stale-upstream.

Activity

  1. added 2 commits that reference this issue on Sep 23, 2026
    2e0f36d
    012ffb5
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions