Skip to content

Promote the Scoped Reference Ban and the Configuration-Block Exemption to Main - #1721

Merged
ptr727 merged 1 commit into
mainfrom
develop
Sep 21, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Promotes one change to main: the prose gate's configuration-block exemption, its link-spelling detection, and the reference rule those two serve.

Closes #1710
Closes #1711
Closes #1715

What lands

The configuration-block exemption. SNIPPET bounded a value at one whitespace-free token, so a YAML tag value, a quoted value carrying a space, and a key-value line with a trailing comment each read as prose and drew a finding telling the author to capitalize a key a reader pastes. A wider shape now reads a key, a separator, a space, and the rest of the line, accepting = beside :, and it exempts two or more adjacent configuration lines rather than one line, because the wider shape is also the shape of a marker comment and a marker comment is one line. The run is the configuration lines themselves rather than the comment block holding them, since a usage block opens on prose and exempting the block would stop both comment rules reading it. Three costs are stated rather than left to be found. Measured over this repository the exemption reaches six lines in three files, all usage or invocation lines, no prose among them.

The link spelling. The gate blanks a URI and a link destination before the bare-form scan, which is why a fragment and an anchor to a heading opening on a number go unreported, and it is also why every URL spelling of a real reference passed. In instruction text the gate now reads an inline link destination, a reference definition, and a bare URL for one forge's issue and pull paths, on the bare host and its www alias. One line naming one reference reports once however many spellings it carries, the key being the digits both patterns capture.

The rule. The ban is stated whole and unqualified, as it was before, with two carve-outs beside it: in a code or workflow comment, a URL naming an issue or a pull request on a public repository other than this one; and the revision record the section already carried. Whatever neither affirmatively permits is banned, and no list of banned cases follows.

The design decision worth reviewing

That last absence is deliberate and cost the most to reach. The rescope was first written as an enumeration of cases, and every review round's fix left a different case uncovered or contradicted: another project's commit, a private sibling's tracker, a public same-owner sibling's tracker banned by no sentence and permitted by no sentence, and finally a closure list that re-banned the section's own revision record, which .github/copilot-instructions.md relies on in five live Proved against fields its own contract requires. Stating only what is permitted, over a closed surface list, leaves nothing to enumerate and so nothing to leave out.

Verification

Twelve local adversarial passes on the strongest available tier before the pull request, then two Copilot rounds and one CodeRabbit round on it, every finding disposed of. The gate code was verified clean by direct measurement in the last eight local passes; almost every finding after the third was in the rule prose, which is what the design decision above answers.

The feature pull request merged with merge=CLEAN, 8/8 checks, review on head from both reviewers, zero unresolved threads and zero suppressed findings. Its coverage statement was carried, and the bound it carries on was checked rather than accepted: the changed-file sets at the covering round and at the merged head are identical, eight files each.

Filed rather than fixed

🤖 Generated with Claude Code

…ock (#1720)

Closes three prose-gate issues that were decided but unbuilt: #1710,
#1711 and #1715. They land together because #1711 without #1715's
surface split is the uniform error #1715 exists to prevent, and all
three touch the same rule text and the same gate.

## The configuration-block exemption, #1710

`SNIPPET` bounded a value at one whitespace-free token, so three real
shapes split on a space and read as prose: a YAML tag value, a quoted
value carrying a space, and a key-value line with a trailing comment.
Each drew a finding telling the author to capitalize a key a reader
pastes, and the issue records two of the only available remedies being
taken in one downstream sweep, one of which changed the value a reader
copies.

`CONFIG_LINE` now reads a key, a separator, a space, and the rest of the
line, accepting `=` beside `:`. The exemption applies to two or more
**adjacent configuration lines** rather than to one line, because the
wider shape is also the shape of a marker comment and a marker comment
is one line. The run is the configuration lines themselves rather than
the comment block holding them: a usage block opens on prose, and
exempting the whole block would stop both comment rules reading that
prose. A block's own non-key-value lines need no membership of their
own, since a PEP 723 opener draws a finding only because the line under
it reads as a continuation of it.

Three costs are written down rather than left to be found: a solitary
line in the wider shape still reports, a run of two or more marker
comments is exempt, and the wrap cost the narrow shape already carried
reaches one shape further. Measured over this repository the exemption
reaches six lines in three files, two usage blocks and one invocation
block, no prose line among them.

## The link spelling, #1711

The gate blanks a URI and a link destination before the bare-form scan,
which is why a fragment and an anchor to a heading opening on a number
are not read as references, and it is also why every URL spelling of a
real reference passed. In instruction text the gate now reads an inline
link destination, a reference definition, and a bare URL for one forge's
issue and pull paths, on the bare host and that host's `www` alias
rather than any subdomain. One line naming one reference reports once
however many spellings of it that line carries, the key being the digits
both patterns capture.

The issue records why this is worth closing rather than leaving to the
reader: a gate that reports the plain spelling and passes the link
points the author at respelling the reference, and a downstream sweep
took three bare references green as reference-style links naming the
same pull request.

## The rule's scope, #1715

The rule was scoped on which file, and its own three reasons are not
scoped that way. Applied to a code file that scoping deletes source
citations, because there the reference is not a second lookup: it is the
citation for the line under it, doing the same job as the datasheet link
beside it, and the rule's own remedy has nothing to rewrite when the
referenced thing is live status somewhere else.

The rule now states the ban whole and unqualified, as it did before, and
carries two carve-outs beside it. The first: **in a code or workflow
comment, a URL naming an issue or a pull request on a public repository
other than this one is a source citation and is permitted.** The second
is the revision record the section already carried, now named rather
than left as an unclaimed exception. Whatever neither carve-out
affirmatively permits is banned by the sentence above them, and **no
list of banned cases follows, deliberately.**

That absence is the change's main design decision. An enumerated form
was written first and reviewed repeatedly, and each round's fix left a
different case uncovered or contradicted: another project's commit, a
private sibling's tracker, a public same-owner sibling's tracker banned
by no sentence and permitted by no sentence, and finally a five-item
closure list that re-banned the section's own revision record, which
`.github/copilot-instructions.md` relies on in five live `Proved
against` fields its own contract requires. Stating only what is
permitted, over a closed surface list, leaves nothing to enumerate and
so nothing to leave out.

## Verification

Ten local adversarial review passes on the strongest available tier, 48
findings, all disposed of. The gate code was verified clean by direct
measurement in the last six of them, and every finding after the third
was in the rule prose, which is what the design decision above is a
response to. The final pass enumerated the case matrix across target
repository, visibility, surface, spelling and kind, reported every case
decided and decided as the rationale intends, and raised nothing that
was a false claim, an undecided case, or a contradiction.

Local gate set green: `ruff format --check`, `ruff check`, `mypy`, 371
unit tests, whole-tree `prose_lint.py`, `repo_gate.py --check eol`,
`--check eol-coverage`, `--check sha-pin`, `build_dist.py --check`,
`spec/validate.py`, and Docker markdownlint, cspell and
editorconfig-checker.

Behaviour was measured against the base implementation rather than
reasoned about. Every probe case from all three issues behaves as the
issues asked, and a whole-tree run against the base gate reports the
same findings as the head gate, so nothing else in the tree moved.

## Filed rather than fixed

Two gaps found during review, each a behavioural change with a design
question inside it rather than a correction to what landed:

- #1717, the widened shape requires a space after the separator, so the
unspaced `key=value` an environment file writes is not exempt. The space
is load-bearing: without it a bare URI reads as a key and a value.
- #1719, the gate reads no URL outside instruction text, so a URL naming
this repository's own tracker in a code comment is banned and
unreported. Measured to predate this change. Closing it needs the gate
to know which repository it is running in, which it currently does not.

## This pull request needs the `comments` label

The change adds comment lines to `prose_lint.py`, so `comment-added`
fails the gate without it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Clarified when issue, pull request, and commit references are
permitted, including public repository URLs used as source citations and
revision records.
- Expanded guidance for reference detection, supported URL formats, and
configuration-style comment blocks.

- **Bug Fixes**
- Improved detection and deduplication of issue and pull request
references in instructional text.
- Reduced false positives for adjacent configuration comment blocks
while continuing to flag single-line and prose comments.

- **Tests**
- Added coverage for reference links, configuration formats, metadata
blocks, and comment-wrapping behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 21, 2026 00:59
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 229d4cb2-dbba-48e9-b73d-37d30c7683b8

📥 Commits

Reviewing files that changed from the base of the PR and between 90161ce and 8f1f751.

⛔ Files ignored due to path filters (3)
  • .claude-plugin/fleet-skills/.source-digests/comment-and-doc-style is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/comment-and-doc-style/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .github/skills/comment-and-doc-style/SKILL.md is excluded by !.github/skills/**
📒 Files selected for processing (5)
  • .agents/skills/comment-and-doc-style/SKILL.md
  • .github/actions/prose-gate/prose_lint.py
  • GOVERNANCE.md
  • scripts/README.md
  • scripts/tests/test_prose_lint.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ptr727

ptr727 commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes are internally consistent across implementation, tests, and the canonical rule/documentation surfaces, with no correctness issues found in the updated gate logic.

Review effort: Lite
Findings: None

What changed in this PR

This PR promotes the prose gate updates that (1) broaden the configuration-snippet exemption to cover realistic “key + separator + rest-of-line” shapes when they appear as adjacent configuration runs, and (2) teaches issue-ref to also detect issue/PR references spelled as GitHub URLs inside instruction text (including link destinations and reference definitions), with the corresponding rule/documentation updates.

Changes:

  • Extend comment-wrap/comment-case to exempt runs of adjacent configuration-like comment lines using a widened config-line recognizer.
  • Extend issue-ref to detect GitHub issue/PR URL spellings in instruction Markdown (inline destinations, reference definitions, and bare URLs), deduplicated per-line by captured reference number.
  • Update prose-gate tests and documentation/rule text to reflect the new behavior and stated costs.
File Description
scripts/​tests/​test_prose_lint.py Adds/updates unit tests covering widened config-run exemption behavior and URL-form issue-ref detection/deduping.
scripts/​README.md Updates prose-gate documentation to describe the widened config-run exemption and instruction-text URL detection for issue-ref.
GOVERNANCE.md Promotes the scoped carve-outs and clarified reference-ban rule text that the gate behavior supports.
.github/​skills/​comment-and-doc-style/​SKILL.md Updates the generated Copilot skill copy to reflect the promoted reference rule (generated content).
.github/​actions/​prose-gate/​prose_lint.py Implements config-run detection/exemption and instruction-text GitHub URL matching/deduping for issue-ref.
.claude-plugin/​fleet-skills/​skills/​comment-and-doc-style/​SKILL.md Updates the generated Claude skill copy to match the promoted reference rule (generated content).
.claude-plugin/​fleet-skills/​.source-digests/​comment-and-doc-style Updates the source digest for the generated Claude skill distribution.
.agents/​skills/​comment-and-doc-style/​SKILL.md Updates the canonical skill source for the promoted reference rule text and carve-outs.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ptr727
ptr727 merged commit c5cdaca into main Sep 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

2 participants