Repository navigation
Ban Issue References in Comments, Docstrings, and Instruction Text - #1694
Conversation
The existing comment rule bans historic narrative and cross-project references without ever naming the instance, so a citation read as rigor rather than as the thing the rule forbids, and nothing detected one. The tree then taught the opposite of the rule at scale, which no rule text competes with until the tree changes. Three parts, and none of them works alone. The rule now names an issue, a pull request, and a commit as what the ban covers, with the surfaces it reaches and the reasons it exists, a reference being a second lookup for a reader who is holding the file, a lookup that a private repository can make impossible, and a rationale block that grows one citation per round. The prose gate carries a new default rule reading the pattern-detectable half, a reference in a comment, in a Python docstring, and in instruction text. And every reference the tree already held on those surfaces is replaced by the constraint it stood for, or dropped where the reference was the whole of its value. A README, a tracker, a history, and a plan keep their references, as do a commit message and a pull request body. A string literal is not read, since a test builds the numbers it asserts against.
Thirteen findings, each on text this change wrote. The gate: a reference bound of five digits rather than six, so a hex color is not a reference, with both bounds stated as the choices they are. A Markdown link destination is blanked before the scan, so an anchor to a heading that opens on a number is not read. A docstring is sliced at its own columns rather than taken as whole lines, so a statement sharing the closing quote line stays code. A documentation comment is read like any other, so a C# block no longer escapes what the PowerShell block beside it carries. And instruction text is anchored to the Skills roots rather than to any directory named for them. The rule text: it now names every document the gate reads rather than describing them as the repository root, states the real reason a commit is out of the gate's reach, and carves out the one record whose subject is the revision itself. The GOVERNANCE stub no longer states an allowlist stricter than the rule it points at. The tests: a case that could not fail, one naming a behavior the pattern does not have, and a fence rationale covering more than the exemption does. The coupling case now reads every entry rather than skipping the one that carries a directory, which is what caught the rule text above.
The second local pass found two defects in the gate and a set of claims around it that were not true. A reference written with no space after a hash marker was invisible, because the marker and the reference's own hash are the same character and the body arrives with it stripped. A comment now carries its own text as written alongside that body, so both spellings are read, and the space is what tells a reference from a number. `ast` reports a column as a UTF-8 byte offset. Sliced on the string, one non-ASCII character before a docstring's closing quote pulled the code beside it into the span and reported a string literal, and one before the opening quote cut the reference out. The slice is taken on the bytes. A URI fragment is a number after a hash and is not a reference, on every surface, so a URI is blanked before the scan. A reference definition's label is read where only its destination is blanked. The bound comment no longer claims that five digits escapes the hex-color shape, since three and four do not. The dedupe states the per-line rule it implements rather than the narrower one it did not. And the rule's own description, the skill, and `scripts/README.md` now say a code or config comment, since a Markdown comment is read only where the document itself is instruction text. Four test defects with them: a case that passed because the marker consumed its fixture's hash rather than because code is unread, a vacuous PowerShell half of the documentation-comment case, an inert identity map, and a one-directional coupling check satisfiable by a mention anywhere in the section. That last one is now a two-way comparison against the enumeration, which is what caught the surfaces sentence in the round before this.
The third local pass found that reading a comment as written had introduced a false positive, and that four claims around it were still not true. The parser takes the first hash on a line whatever the language does with it, so a URI fragment in a YAML value, a shell parameter expansion, and a trailing comment each reach this rule as a comment whose written spelling carries a hash the body does not. Seven such lines were reported as references. The written spelling is now read only where the marker opens the line, which is the one position every language the gate knows agrees opens a comment, and which is why `comment-added` reads that position alone. A reference hugging a marker mid-line is the bound this leaves, and the rule text still covers it. The stand-down note is deleted rather than corrected. A scan always carries a root, so the narrowing it announced never happened and the note claimed the rule had stood down where it had not. The module's own inventory of what it enforces now lists the rule, the description says a code or config comment as the skill and the script reference already did, and a README under a Skills root is rule text by its root rather than narrative, which the surfaces sentence had it both ways on. Two in the scrub with them. The quota comment said seven pull requests carried no Copilot activity where the evidence is six following one that carried a refusal. And four docstrings naming a pull request in words rather than in the gate's shape are the half of the ban no pattern reads.
The scan takes the first hash on a line whatever the language does with it, so a YAML scalar carrying two of them, a `sed` expression delimited by them, a `.gitattributes` pattern and a shell word all arrive at this rule as comments. Guarding only the written spelling left the body of that same guess reportable, and four such lines were read as references. The guard moves to the comment. A comment is read where its marker opens its line and nowhere else, which is the one position every language the gate knows agrees on, and which is the bound `comment-added` already carries for this reason. A trailing comment is out of scope with it, stated in the rule text and in the script reference beside the paragraph that states the same bound for the sibling rule. The bound cost nothing measured. Reading the whole tree at the merge base both ways reports the same 125 findings, so no reference the scrub removed sat in a comment this no longer reads. A block comment now carries its written spelling too, bounded by its closing delimiter rather than running to end of line, which closes the one opener in the syntax table that ends in a hash and so swallowed the reference's own.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new issue-ref gate can still scan some wrapped trailing block-comment continuation lines due to how leading is tracked, and the docs/tests currently overstate the “trailing comments are out of scope” bound.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (5)
What changed in this PR
This PR strengthens the repository-wide ban on naming issues/PRs/commits in comments, Python docstrings, and instruction documents by (1) adding explicit rule text, (2) introducing a new default prose-gate rule (issue-ref) to detect the pattern-detectable cases, and (3) scrubbing existing references from the covered surfaces across code, tests, and docs.
Changes:
- Add
issue-refas a new default prose-lint rule that scans leading comments, Python docstrings, and instruction-text Markdown (with exclusions for quoted/fenced content and link destinations). - Update docs/rules/skills text to state the ban explicitly and remove existing issue/PR references on the covered surfaces.
- Add unit tests for the new rule and update many existing comments/docstrings to remove historical references.
| File | Description |
|---|---|
| STANDUP.md | Removes issue references from onboarding guidance. |
| spec/validate.py | Rewords comments to remove issue references. |
| spec/audit.py | Rewords docstrings/comments to remove issue references. |
| scripts/tests/test_tooling_encoding.py | Rewords comment to remove issue reference. |
| scripts/tests/test_spec_validate.py | Removes issue references from comments/docstrings in tests. |
| scripts/tests/test_release_guards.py | Removes issue references from comments/docstrings in tests. |
| scripts/tests/test_prose_lint.py | Adds issue-ref rule tests and removes issue references in existing text. |
| scripts/tests/test_pr_review.py | Removes PR/issue references from comments/docstrings in tests. |
| scripts/tests/test_handoff.py | Rewords docstrings to remove issue references. |
| scripts/tests/test_canonical_review.py | Rewords docstring to remove issue references. |
| scripts/README.md | Documents the new issue-ref rule and its intended scope. |
| scripts/pr_review.py | Removes issue/PR references from explanatory comments/docstrings. |
| scripts/handoff.py | Removes issue reference from comments. |
| scripts/canonical_review.py | Removes issue references from module documentation text. |
| scripts/build_dist.py | Removes issue reference from comments. |
| OPERATIONS.md | Updates local runbook to include --check issue-ref. |
| host-setup/windows/install-tools.ps1 | Removes issue reference from comments. |
| host-setup/linux/install-tools.sh | Rewords comment to remove issue reference. |
| GOVERNANCE.md | Adds a “References” stub and updates prose to reflect the new ban. |
| catalog/snippets/workflows/test-pull-request.yml | Removes issue reference from workflow snippet comment. |
| AUDIT.md | Removes issue references from audit text. |
| .github/workflows/validate-task.yml | Removes issue reference from workflow comment. |
| .github/skills/session-handoff/SKILL.md | Generated copy updated to remove issue reference and placeholder to #N. |
| .github/skills/pr-review-conduct/SKILL.md | Generated copy updated to remove issue reference. |
| .github/skills/comment-and-doc-style/SKILL.md | Generated copy updated to add the new references-ban section. |
| .github/skills/agent-conduct/SKILL.md | Generated copy updated to remove issue reference and placeholder to #N. |
| .github/actions/repo-gate/repo_gate.py | Rewords audit-reference table entry to avoid issue reference. |
| .github/actions/prose-gate/prose_lint.py | Implements new issue-ref rule and supporting helpers. |
| .github/actions/prose-gate/action.yml | Removes issue reference from action comment. |
| .claude-plugin/fleet-skills/skills/session-handoff/SKILL.md | Generated plugin distribution updated to match source. |
| .claude-plugin/fleet-skills/skills/pr-review-conduct/SKILL.md | Generated plugin distribution updated to match source. |
| .claude-plugin/fleet-skills/skills/comment-and-doc-style/SKILL.md | Generated plugin distribution updated to match source. |
| .claude-plugin/fleet-skills/skills/agent-conduct/SKILL.md | Generated plugin distribution updated to match source. |
| .claude-plugin/fleet-skills/.source-digests/session-handoff | Updates digest for regenerated plugin content. |
| .claude-plugin/fleet-skills/.source-digests/pr-review-conduct | Updates digest for regenerated plugin content. |
| .claude-plugin/fleet-skills/.source-digests/comment-and-doc-style | Updates digest for regenerated plugin content. |
| .claude-plugin/fleet-skills/.source-digests/agent-conduct | Updates digest for regenerated plugin content. |
| .agents/skills/session-handoff/SKILL.md | Source skill updated to remove issue reference and placeholder to #N. |
| .agents/skills/pr-review-conduct/SKILL.md | Source skill updated to remove issue reference. |
| .agents/skills/comment-and-doc-style/SKILL.md | Source skill updated to add the new references-ban section. |
| .agents/skills/agent-conduct/SKILL.md | Source skill updated to remove issue reference and placeholder to #N. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Five review threads and one finding the last local pass left, and four of them are the same defect on four surfaces. "A trailing comment is out of scope" is inexact. A block comment that wraps is read from its second line on, because the parser tracks an open block rather than where it opened, so a continuation line reads as leading whatever preceded the opener. The finding such a comment produces is wanted, it being a real comment carrying a real reference, so the bound is what has to say so. Every surface stating it now does, this rule's three and `comment-added`'s three, which have carried the same inexactness longer and are swept here rather than left to disagree with their neighbours. A test pins it, and another pins the block opener that swallows the reference's own hash, which shipped in the round before this with nothing covering it: reverting those two lines left every case green. The rule's stated cost list gains the hash-delimited expression a leading comment can quote, a `sed` script and a pattern file's own commented-out entry being its two shapes. And the `eol-coverage` row reads "count not recorded" rather than asserting the audit did not reach that category, which nothing in the tree supports.
The previous round answered five review threads by adding an exception clause to a bound stated on six surfaces, and a pass over it found six new defects in the clause itself. The clause is false for a documentation block comment, which the same paragraph excludes eight lines later, it is false under the Markdown bound in both directions, and on two surfaces it landed between a sentence and the "that" or "That" naming it, so each pronoun bound to the exception rather than to what it was written for. So the clause comes out rather than getting a seventh wording. Where this rule states its own bound it now states what it reads, a comment whose marker opens its line, which needs no exception because a continuation line of an open block comment opens its own line like any other. Every surface belonging to `comment-added` goes back to its merge-base bytes, the whole docstring region restored rather than the one paragraph, since the edit had also re-indented three others from four spaces to seven and `inspect.getdoc` rendered them ragged. That rule's own claim carries the same inexactness this round found, longer than this branch has existed, and it is filed rather than fixed here. One correction stands rather than reverts. `comment_syntax_including_docs` said skipping a documentation marker read the C# block and not the PowerShell one, which is backwards: the marker is declared for C# and not for PowerShell, so the C# block is the one that went unread.
Three wordings of one sentence, three defects. "A trailing comment is out of scope" was inexact for a wrapped block comment. The exception clause that answered it was false for a documentation block comment and for Markdown in both directions. And the positive form that replaced the clause mispredicts the same wrapped block, whose only marker sits mid-line and opens nothing, and a trailing HTML comment in instruction text, which is read because the document is read whole rather than through the comment parser. Which comment the gate reaches is a parser fact that differs by language. `issue_ref_findings` states it, having the parser in view, and the rule text and the script reference now point there rather than carrying a fourth attempt. What the gate does not reach stays unlicensed either way, since the rule binds a reader rather than a scan, and that sentence was already there. The test docstring names the continuation branch it pins rather than "that branch", which had no antecedent in the file that used it.
The previous round said the rule text would stop restating the gate's reach and then restated it in the script reference anyway, in a fourth wording that was wrong the same way the third was: a continuation line of an open block comment has no marker of its own, so "where the parser reports its marker as opening its line" describes nothing the parser reports. It also pointed the carried skill at a Python symbol that exists only in this repository, which no carrier can resolve, and justified itself with a count of failed attempts that no reader of either file can check and that the same section deprecates four paragraphs above. All three come out. Neither surface describes the reach now, and the rule they carry is unchanged: whatever a gate does not reach is unlicensed all the same, because the rule binds a reader rather than a scan. `issue_ref_findings` keeps the description, and two of its own clauses were wrong. Instruction text is read outside its fenced blocks rather than whole, and a Python file that does not tokenize yields no comment, so a reference in one of its comments goes unread. Every clause of that docstring is now checked against a fixture: a fenced reference, a trailing HTML comment in instruction text and in narrative Markdown, an untokenizable file and its tokenizing twin, a wrapped block's continuation line, and a trailing documentation comment. The test docstring says a non-empty continuation line, an empty one being reported not at all rather than reported as leading.
|
Nine local adversarial passes have run against this branch and five rounds of edits answered them. The five review threads above are resolved. What follows is what the last pass raised, open and unfixed, because the loop measurably stopped converging and continuing it was costing more than it returned. The measurement. Every round of edits on one paragraph produced new findings at about the rate it removed them: 13, 22, 7, 5, then 6 new defects from the round that fixed 5, then 9, then 7. Four of the last five rounds found defects only in text the round before had written. Every prose statement describing what the scanner reaches drew a finding; every deletion of one drew none. The final round deletes rather than describes, and the seven below are what a pass over that deletion found. Open, in
Open, in the rule text and the script reference:
Open, in the tests:
Filed separately rather than fixed here: None of the above changes what the gate does. Every one is a claim about it. |
The sentence distributed a true claim about one of three surfaces over all three. A comment's reach is a parser fact that differs by language, and a Python docstring is one language whose reach `ast.parse` decides, while instruction text is Markdown whose reach `fenced_lines` decides. Neither is a per-language parser fact. The clause is deleted rather than corrected, since five wordings of a reach claim in this section were each wrong in their own way and the sentence beside it already carries the rule: whatever a gate does not reach is unlicensed all the same, the rule binding a reader rather than a scan. This is the one open claim in content other repositories carry. The rest sit in the scanner, the script reference and the tests, all hub-only, recorded on the pull request.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The new issue-ref gate is implemented with targeted fixtures, integrated into the default ruleset, and the governed surfaces are scrubbed to match the updated contract text.
Review effort: Lite
Findings: None
|
Coverage for the current head, proved rather than read off the digest, since round 3's body carries no counts and
So no file among the 41 went unreviewed at a head carrying its current content, and the one file whose content moved after the full-coverage round is the file round 3 read. Merge Gate: review on head yes, coverage as above, 5 threads all resolved, 0 suppressed, no refusal, 8/8 checks, mergeable CLEAN. Merging to |
Promotes the reference ban from `develop` to `main`. The delta is one squash commit, `9ff38fe`, and `git diff --stat origin/main origin/develop` is 41 files, 759 insertions, 167 deletions. ## What it carries Issue and pull request references were pervasive in this repository's code, comments and docstrings, and the rule that already forbade them named the category without naming the instance. Three parts, and none of them works alone. **The rule.** `comment-and-doc-style` gains an "Issue, pull request, and commit references" section. No comment, no docstring and no instruction document names an issue, a pull request or a commit. A tracker, a history, a plan and a README outside the Skills trees keep their references, as do a commit message and a pull request body. Three reasons, in the order that decides them: a reference is a second lookup for a reader already holding the file, the lookup can be impossible where a repository is private, and a rationale block that takes one more citation per round is how a file comes to teach a house style the rules forbid. One record keeps a revision, a disproved-claims entry, whose subject is the revision itself. `GOVERNANCE.md` "Documentation Style Conventions" gains a `### References` stub pointing at it. **The gate.** A new default `issue-ref` prose rule reads the pattern-detectable half: a reference in a comment whose marker opens its line, in a Python docstring, and in instruction text. Not read, each for a stated reason: a commit, because a short SHA is the shape of a blob id, a version fragment and a fixture hash; a string literal, because a test builds the numbers it asserts against; a trailing line comment, because which mid-line marker opens a comment differs by language; a Markdown comment outside instruction text, because a README is narrative. A URI and a Markdown link destination are blanked before the scan. **The scrub.** Every reference the tree held on those surfaces, replaced by the constraint it stood for or dropped where the reference was the whole of its value. The tree reads zero under every default rule. ## Review record The feature pull request ran three Copilot rounds and ten local adversarial passes. Round 2 stated `reviewed=41 changed=41 findings=0`, round 3 approved the final head, and all five threads were answered and resolved. Ten local passes found 13, 22, 7, 5, 6, 9, 7, 0 and 0. Six items remain open and are recorded on #1694. Each is a claim *about* the gate rather than its behavior, and all six are hub-only: two clauses of `issue_ref_findings`' docstring, two sentences in `scripts/README.md`, and two test docstrings. The one open item in content other repositories carry was deleted before the merge. ## Why it carries the `comments` label The scrub edits comment lines and `git diff --unified=0` counts a modified line as an added one, so `comment-added` reports them. The fleet's own caller also stands that rule down for a promotion of `develop` into the default branch, whose diff was reviewed where it landed. Fixes #1689


Issue and pull request references were pervasive in this repository's code, comments and docstrings, and the rule that already forbade them named the category without ever naming the instance. Three parts, and none of them works alone.
The rule
comment-and-doc-stylegains an "Issue, pull request, and commit references" section. No comment, no docstring and no instruction document names an issue, a pull request or a commit. The surfaces are code and workflow comments, a docstring, a documentation comment, the Skills trees, and the ten rule documents the gate enumerates. A tracker, a history, a plan and a README outside those trees keep their references, as do a commit message and a pull request body.Three reasons, in the order that decides them. A reference is a second lookup for a reader who is already holding the file. The lookup can be impossible, since a repository may be private and content carried into a public one then names something its reader cannot open. And a rationale block that takes one more citation per round is how a file comes to teach a house style the rules forbid.
One record keeps a revision: a disproved-claims entry names the revision its proof was read against, since a proof is true of one tree at one revision. That is the record's own load-bearing field rather than a citation beside a claim.
GOVERNANCE.md"Documentation Style Conventions" gains a### Referencesstub pointing at it, matching its sibling subsections.The gate
A new default
issue-refrule reads the pattern-detectable half: a reference in a comment whose marker opens its line, in a Python docstring, and in instruction text.Deliberately not read, each with a reason rather than an omission:
seddelimiter and a shell expansion all arrive as comments.comment-addedcarries this same bound for this same reason. Reading the whole tree at the merge base both ways reports the same 125 findings, so the bound lost nothing measured.A URI and, in Markdown, a link destination are blanked before the scan, so a fragment and an anchor to a heading that opens on a number are not references. A documentation comment is read like any other, unlike in
comment-added, since a reference in one is the same defect.The scrub
Every reference the tree held on those surfaces, replaced by the constraint it stood for or dropped where the reference was the whole of its value. The whole tree now reads zero under every default rule.
Why this carries the
commentslabelThe scrub edits comment lines, and
git diff --unified=0counts a modified line as an added one, socomment-addedreports 79 of them. That is the rule working rather than a defect, and the label is its documented answer.Review state
Five local adversarial passes ran against this branch, and four rounds of edits answered them. The passes found 13, 22, 7 and 5; the fifth found 4, which are open and listed below rather than fixed, and will be taken in this pull request's first fix round.
prose_lint.pyblock-commentraw: the change closes a PowerShell<#N ...#>opener whose marker swallows the reference's own#, and no test covers it. Reverting the two lines leaves every case green.extracted_comments' continuation branch hardcodesleading. The finding such a comment produces is wanted; the claim about the bound is what needs narrowing, in the three files that now state it and incomment-added's own text, which has said it longer.repo_gate.py'seol-coveragerow says "not reached there" of the 1,047-finding audit, which is a negative claim nothing in the tree supports.Two findings were declined with evidence.
pr_review.py's coverage paragraph keeps three measurements whose citations the scrub removed, which is what this issue asks for, and a quantitative claim owes honesty rather than a citation. And a rewritten test docstring reported as self-contradictory now matchespr_review.py's own docstring word for word.Closes on promotion: #1689