Skip to content

issue-ref reads the bare reference shape only, so a Markdown link naming a pull request passes the gate #1711

Closed

Description

@ptr727

The rule says no instruction document names an issue or a pull request, and that whatever the gate does not reach is unlicensed all the same. The gate reads (?<!#)#[0-9]{2,5}(?!\w) and blanks URIs and Markdown link destinations before the scan, so every link form of the same reference passes.

Probe

A committed CODESTYLE.md, scanned with the gate at main:

Line Reported
landed in #4242 yes
fixed upstream in acme/widget#4242 yes
the [pull request][pr-a], defined as https://github.com/acme/widget/pull/4242 no
the [pull request](https://github.com/acme/widget/pull/4242) no
see https://github.com/acme/widget/issues/4242 for the history no

Two findings, both on the bare shapes.

Why this is worth closing rather than leaving to the reader

The blanking was added for a real reason, so a URI fragment and an anchor to a heading that opens on a number are not read as references. Permitting a link whose destination is a pull request is a side effect of that rather than something the change reasoned about, and the destination is as pattern-detectable as the bare form: /(pull|issues)/[0-9]+ under a known forge host.

The shape matters because it is the one an author reaches for when the gate rejects the bare form. Sweeping ESPHome-Config to zero under the default rules, an agent rewrote three bare references into reference-style links with words as the link text. The gate went green on all three, and all three still named a pull request or an issue in a document the rule enumerates. A gate that reports the plain spelling and passes the evasive one trains the evasion.

Scope to consider

Reading a link destination and a bare URI for /(pull|issues)/[0-9]+, in instruction text only, leaves the fragment and anchor cases the blanking exists for untouched: neither carries that path. A short SHA stays out for the reason already recorded, that its shape is shared with a blob id and a fixture hash.

Worth stating either way, since it decides whether an author can rely on the gate: a reference the gate does not reach is still banned, and the rule already says so.

Activity

  1. ptr727 commented on Sep 20, 2026

    @ptr727
    OwnerAuthor

    Reproduced at main (4f0418b), and accepted for the gate rather than left to the prose rule.

    Reproduction

    A committed CODESTYLE.md carrying all five spellings of one reference:

    2 violation(s) across 1 file(s)
      issue-ref        2
    CODESTYLE.md:3: issue-ref: issue or pull request reference '#4242'
    CODESTYLE.md:5: issue-ref: issue or pull request reference '#4242'
    

    The two bare shapes report. The reference-style link, the inline link, and the bare URL all pass, exactly as filed.

    Why it is being closed rather than left as documentation

    The rule already says a reference the gate does not reach is banned all the same, so nothing about the policy changes here. What changes is that the gate currently reports the plain spelling and passes the evasive one, which is the worst available arrangement: it is a gradient pointing at the rewrite. This issue records an agent following that gradient, rewriting three bare references into reference-style links with words as the link text and taking the gate green on all three, with all three still naming a pull request in a document the rule enumerates.

    Scope

    Read a link destination and a bare URI for /(pull|issues)/[0-9]+ under a forge host, in instruction text only.

    That leaves the cases the existing blanking was added for untouched, since neither a URI fragment nor an anchor to a heading opening on a number carries that path. A short SHA stays out for the reason already on record, that its shape is shared with a blob id, a version fragment, and a fixture hash.

    Sequencing

    Landing in the same pull request as #1710, being the same rule family and the same file, and sequenced after the pull request currently in review.

  2. ptr727 commented on Sep 20, 2026

    @ptr727
    OwnerAuthor

    Scope confirmed and coupled to #1715, which arrived after the direction above and sharpens it.

    The detection stays instruction text only, as recorded. #1715 measured eleven upstream citations in a live ESPHome /config tree, all of them URLs in YAML comments, and landing this detection uniformly would turn every one into a CI failure. That is the outcome to avoid, and the scope above already avoids it.

    One thing #1715 adds that changes the rule this gate serves: the ban is re-scoped on whose tracker rather than on which file. An own-repository reference stays banned in code and instruction text alike, since the constraint could have been written down. Another project's tracker is a source citation, permitted in code beside the datasheet and wiki links the rule already allows, and still banned in instruction text.

    So what this issue asks for is unchanged in scope and gains a reason: in instruction text a forge URL is a citation standing in for a constraint the document should state, which is precisely where reading the destination is worth the code.

    Landing in one pull request with #1710 and #1715, since the three touch the same rule text and the same gate, and this one and #1715 are two halves of one question.

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