Skip to content

fix: the pull request gate stops counting at the first heading #34

Description

@ecv

The gate that enforces our pull request conventions caps the summary at four sentences, but only counts the text above the first heading. Anything written under a heading is uncounted, so a body can pass the gate and still be several times longer than the change it describes. That happened today on a five line change whose opening post ran to four sections.

The three rules the gate counts have never been broken. The one it does not count gets broken. That is the argument for moving the length rule into the counter rather than restating it in prose.

Proposed checks

  1. Allow only a test plan heading in an opening post. Any other heading denies with a message to move it to a comment. This is already what the written rules say, and it kills the pattern that slipped through today.
  2. Cap total body length, not just the summary. Around 200 words across the whole body catches the same miss when someone writes long paragraphs instead of adding headings.
  3. Scale the cap to the size of the change. Roughly sixty words plus half a word per changed line, floored and ceilinged, so a five line change gets a tight budget and a large one gets room. This is the sharpest version and the most fragile: it needs the base branch and the diff, which are not available when editing an existing pull request, so it degrades to the flat cap there.

Ship the first two together. Treat the third as a follow-up, and only if the flat cap still lets bloat through.

Acceptance criteria

  • An opening post carrying a section other than the test plan is denied, and the message names the section
  • An opening post over the length cap is denied, and the message names the count and the cap
  • Denials stay accurate on issue bodies as well as pull request bodies, since the gate covers both
  • A body that meets the bar still passes without new friction, confirmed against a handful of recent well formed examples

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions