Skip to content

prose_lint's sentence-length Check Skips Code Comments Although the 25-Word Cap Covers Them #2430

Closed

Description

@ptr727

The comment-and-doc-style Skill's "Sentence structure" section applies the 25-word cap to agent-authored prose. prose_lint.py's sentence-length check, though, only reads .md files (if "sentence-length" in rules and path.suffix == ".md"). So a code or workflow comment sentence over the cap passes --check sentence-length --diff <base>. The first thing to measure it is a PR reviewer.

Repro on hub main (62f0b33), in a scratch repository whose working tree holds the two files below, staged:

printf '#!/bin/bash\n# This sentence in a shell comment runs on well past the twenty-five word cap that the house style sets for every sentence an agent writes in any file.\necho ok\n' > demo.sh
printf 'This sentence in a Markdown file runs on well past the twenty-five word cap that the house style sets for every sentence an agent writes in any file.\n' > demo.md
git add demo.sh demo.md
python3 <hub>/.github/actions/prose-gate/prose_lint.py --allow-comments --check sentence-length --diff HEAD -- .
# demo.md:1: sentence-length: 28 words in one sentence -> sentences of 25 words or fewer
# exit 1, and nothing for demo.sh, whose comment holds the same 28-word sentence

Seen downstream on ptr727/HomeAutomation-Config. Five comment sentences of 26 to 62 words passed the local strict review's --check sentence-length run. Copilot then raised them on a develop -> main promotion PR, which cost a feature -> develop fix PR and another promotion round.

Possible fix: run sentence_length_findings over the comment text that comment-added and comment-wrap already extract, scoped to changed lines like the Markdown case. Alternatively, if the cap is meant to cover Markdown only, say so in the Skill and in GOVERNANCE.md "Documentation Style Conventions", so a reviewer has no rule to cite against a comment.

Activity

  1. ptr727 commented on Oct 10, 2026

    @ptr727
    OwnerAuthor

    Recurred on #2742: a 27-word workflow comment line in .github/workflows/merge-bot-task.yml passed prose_lint.py --diff ... --check sentence-length locally and in CI. Two local strict-review passes missed it too, before the reviewer was told to count comment sentences by hand. Copilot caught it on promotion #2743, and fixing it took a separate feature PR (#2744) and a second promotion round. The cost of this gap is one extra feature -> develop -> promotion cycle per instance.

  2. added a commit that references this issue on Oct 11, 2026
    8729928
  3. added a commit that references this issue on Oct 11, 2026
    50b6bc3
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