Skip to content

Promote the Comment-Added Prose Gate to Main - #1669

Merged
ptr727 merged 2 commits into
mainfrom
develop
Sep 18, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Promotes develop to main. Two commits: 498f4a6, the comment-added prose gate from #1662, and c14323a, the codecov action bump from #1660 whose content main already holds from #1661.

What promotes

comment-added joins prose_lint.py's DEFAULT_RULES. It reports a prose comment line a change adds, scoped by the diff that every other rule is already scoped by, and stands down with a note on stderr when run without --diff. Its overrides are the comments pull request label in CI, a non-empty PROSE_ALLOW_COMMENTS at a commit, and --allow-comments by hand. #1662 carries the rule's full description, its exemptions, the 317-case suite and the mutation checks behind it.

What this promotion changes for the fleet

GOVERNANCE.md has a downstream pre-commit hook fetch prose_lint.py fresh from this repository's main rather than from a pin, so this merge, not #1662's, is what starts refusing a downstream commit that adds a comment line. The refusal is legible and names PROSE_ALLOW_COMMENTS as the remedy at a commit, which is the leg that reaches a hook. The CI leg's remedy, the comments label, exists on this repository alone so far, because repo-config/labels.json declaring a label does not create it and repo-config/configure.sh apply has not been run across the fleet. #1662 parked that sequencing for this promotion rather than deciding it there.

Review coverage

Every line promoted here was reviewed where it landed. #1662 took three Copilot rounds at full file coverage with all three threads answered and resolved, and #1660 is a Dependabot group bump whose identical content is already on main as 664ff95.

🤖 Generated with Claude Code

dependabot Bot and others added 2 commits September 17, 2026 12:28
…roup (#1660)

Bumps the actions-deps group with 1 update:
[codecov/codecov-action](https://github.com/codecov/codecov-action).

Updates `codecov/codecov-action` from 7.0.0 to 7.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/codecov/codecov-action/releases">codecov/codecov-action's
releases</a>.</em></p>
<blockquote>
<h2>v7.1.0</h2>
<h2>What's Changed</h2>
<ul>
<li>chore(release): 7.1.0 by <a
href="https://github.com/thomasrockhu-codecov"><code>@​thomasrockhu-codecov</code></a>
in <a
href="https://redirect.github.com/codecov/codecov-action/pull/1971">codecov/codecov-action#1971</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/codecov/codecov-action/compare/v7.0.0...v7.1.0">https://github.com/codecov/codecov-action/compare/v7.0.0...v7.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/codecov/codecov-action/commit/0b35c9ecc4f0529d0eb674914510c22f85b196b4"><code>0b35c9e</code></a>
chore(release): 7.1.0 (<a
href="https://redirect.github.com/codecov/codecov-action/issues/1971">#1971</a>)</li>
<li>See full diff in <a
href="https://github.com/codecov/codecov-action/compare/fb8b3582c8e4def4969c97caa2f19720cb33a72f...0b35c9ecc4f0529d0eb674914510c22f85b196b4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov/codecov-action&package-manager=github_actions&previous-version=7.0.0&new-version=7.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Is Wanted (#1662)

Implements #1631 decision item 2: a `prose_lint` check that fails a diff
adding a comment line in code or config, overridable by a pull request
label. The measurement behind it put 117 of 1437 bot findings (8%),
including every #1630-class loop, on agent-written comment text, and the
two weeks it covered showed the rules were broken with the rule already
in context, so only removing the surface or gating it mechanically
changes anything.

## What the rule is

`comment-added` joins `DEFAULT_RULES`. It reports every prose comment
line a file holds, one finding per line, and the diff scope `main`
already applies to every rule is what narrows that to the comment lines
in a change. That is deliberate reuse rather than a second scoping path,
and the rule infers nothing beyond it.

`git diff --unified=0` counts a modified line as an added one, so
editing the code on a line carrying a trailing comment, re-indenting a
commented block, and rewording a comment each report that comment.
**That is the rule's cost rather than a defect in it**, it is asserted
in a test rather than left to be discovered, and it is stated wherever
the rule is stated. The history matters before anyone proposes fixing
it: an earlier shape on this branch read the file at the diff's base to
tell an authored comment from a touched one, and the rename,
duplicate-body and prose-filter cases that opened took four adversarial
review passes and ~64 findings to close, each round's fixes writing the
next round's. The precision was not worth it, because a comment worth
keeping takes the same label as a comment worth writing.

Without `--diff` every comment in the tree is in scope, so the rule
stands down and says so on stderr, next to the `dead-path` shallow-clone
stand-down that already works this way. A whole-tree run therefore still
reports zero.

Out of scope, each for a reason the code states: a docstring, since it
is not a comment line; a `.py` that does not tokenize, since the
hash-anchored fallback would read a `#` inside a docstring as a comment;
Markdown, whose prose is the document rather than a comment on one; a
version pin, including the bare form the fleet writes its hub pins in;
and a tool directive, judged by its argument rather than its name alone,
so `# nosec B404` is exempt while `# nosec The value is read once.` is
not.

## The overrides, and the promotion

In CI the composite action takes an `allow-comments` input and passes
`--allow-comments` only when it is exactly `true`, so a misspelled
input, an empty one, and a label expression that matched nothing all
fail closed. `validate-task.yml` sets it from two things: the `comments`
label, now declared in `repo-config/labels.json` and created on this
repository, and the pull request targeting the default branch. The
second is the promotion case: a `develop -> main` pull request diffs
against main's tip, so its scope is every line promoted since the last
one, all of it reviewed where it landed. Measured against `origin/main`
while it was hours behind `develop`, the rule reported 28 such lines; a
real promotion carries a release of them.

Locally a non-empty `PROSE_ALLOW_COMMENTS` stands the rule down. The
gate reads it directly rather than taking a flag from each caller, which
is what reaches the two downstream hook snippets that run this file
straight from the hub, one of them a single command string with nowhere
to put a flag. The composite action `unset`s it, so a runner's
environment cannot decide a pull request, and the finding message names
the commit rather than CI as that remedy's place.

## Verification

- 317 cases in `scripts/tests/test_prose_lint.py`, 21 of them new: the
rule, its exemptions, all three stand-downs and their notes, the
accepted false positive, the bare version pin, the
directive-opening-a-sentence case, and the label path driven end to end
through the action's own script body against a real repository, labeled
and unlabeled.
- Mutation-checked rather than assumed. Deleting the whole
`PROSE_ALLOW_COMMENTS` stand-down, deleting the action's `unset`,
dropping the label from the finding message, removing the per-line
de-duplication, and reverting the suffix-case match each fail a named
case.
- The full `OPERATIONS.md` "Local Verification" block, green: ruff,
mypy, 1494 tests, `build_dist.py --check`, `repo_gate.py`, both prose
invocations, `spec/validate.py`, all seven Docker linters.
- Six local adversarial review passes. Five of them produced the design
this one ships instead.
- This pull request is its own acceptance test. Its commits were refused
locally until `PROSE_ALLOW_COMMENTS` was set, and it carries the
`comments` label for the same reason.

## Stale claims fixed along the way

Four surfaces said CI re-checks the whole tree, which is what made the
hook's wider scope affordable. CI has no such run: its only whole-tree
`prose_lint.py` invocation is `--check charset-unknown --summary` under
`continue-on-error`. `GOVERNANCE.md`, `.husky/pre-commit` and
`scripts/README.md` in two places are corrected, along with an
`OPERATIONS.md` heading that promised CI parity its own paragraph exists
to deny, and a `repo-config/README.md` label taxonomy whose closing
sentence covered every label but the new one.

## Before this promotes to main

`GOVERNANCE.md` says downstream hooks fetch `prose_lint.py` fresh from
the hub's `main`, never pinned. So the promotion, not this merge, is
what makes every downstream repository's pre-commit hook start refusing
a commit that adds a comment line, before `configure.sh apply` has put
the `comments` label on those repositories. The finding names
`PROSE_ALLOW_COMMENTS` so the refusal is legible and has an escape, but
it fires per commit rather than per pull request. That sequencing is a
decision for the promotion rather than for this pull request.

Three findings from the review passes are pre-existing behavior this
rule sharpens rather than introduces, filed as #1657, #1658 and #1659.
The last is worth reading: `NOT_PROSE` is searched unanchored, so a
comment that merely names `prettier`, `Copyright` or `eslint` is exempt
from every prose rule, which in a refusing rule is a bypass the
comment's own author controls.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 18, 2026 00:39
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 032b24a5-4d42-4c41-bd0e-89edec13ffb7


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.

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.

🟡 Changes recommended

.github/actions/prose-gate/prose_lint.py contains an updated function whose docstring is now inaccurate relative to its new return type.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Promotes develop changes to main, primarily landing the new comment-added prose gate rule (and its CI/label override wiring) plus the already-reviewed Codecov action SHA bump.

Changes:

  • Add comment-added to the prose gate default rules, including stand-down modes (--allow-comments, PROSE_ALLOW_COMMENTS, and PR label / promotion logic in CI).
  • Add/extend test coverage to validate rule behavior, exemptions, and the end-to-end override path from workflow → action input → gate.
  • Update documentation and fleet guidance to reflect the new gate behavior and rollout implications.
File summaries
File Description
scripts/tests/test_prose_lint.py Adds extensive unit + end-to-end tests for comment-added and CI/action wiring.
scripts/README.md Documents the new rule, its scope/overrides, and clarifies CI vs local coverage.
repo-config/README.md Documents comments as a gate-affecting label (not just descriptive).
repo-config/labels.json Declares the new comments label in the fleet label set.
OPERATIONS.md Updates local verification guidance to reflect the new gate behavior and scopes.
GOVERNANCE.md Adjusts hook/CI scope wording to match the PR-diff gate behavior.
docs/fleet-map.md Updates references to the renamed OPERATIONS section title.
catalog/snippets/pre-commit/README.md Updates hook-vs-PR gate scope wording.
catalog/snippets/husky/pre-commit Updates hook-vs-PR gate scope wording.
.husky/pre-commit Updates hook-vs-PR gate scope wording.
.github/workflows/validate-task.yml Wires the comments label / promotion logic into prose-gate via allow-comments.
.github/skills/drive-pr/SKILL.md Updates guidance to apply comments label when comment lines are added/edited.
.github/skills/comment-and-doc-style/SKILL.md Documents the new comment-added rule and its escapes.
.github/actions/prose-gate/prose_lint.py Implements comment-added, its parsing model, exemptions, and stand-down behavior.
.github/actions/prose-gate/action.yml Adds allow-comments input, passes --allow-comments, and clears PROSE_ALLOW_COMMENTS.
.claude-plugin/fleet-skills/skills/drive-pr/SKILL.md Regenerated fleet-skill copy reflecting comments label guidance.
.claude-plugin/fleet-skills/skills/comment-and-doc-style/SKILL.md Regenerated fleet-skill copy reflecting comment-added documentation.
.claude-plugin/fleet-skills/.source-digests/drive-pr Updates source digest for regenerated skill distribution.
.claude-plugin/fleet-skills/.source-digests/comment-and-doc-style Updates source digest for regenerated skill distribution.
.agents/skills/drive-pr/SKILL.md Updates authored skill source with comments label guidance.
.agents/skills/comment-and-doc-style/SKILL.md Updates authored skill source documenting comment-added and overrides.
Review details
  • Files reviewed: 21/21 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants