Repository navigation
Description
Problem or Motivation
#1803 sets the shape of a pull request body: what the change does and why, in at most 1,000 characters before the trailers (CONTRIBUTING.md section 4). The squash merge makes the body the commit message on main. Today a reviewer is the only check. The 188 squash commits on main from 2026-10-25 to 2026-10-28 have a body of 1,287 characters at the median before the trailers, and 119 of them are longer than 1,000. Agents write most of these bodies, and agents run devops pr check-readiness before devops pr ready, so a warning there reaches the writer at the right time.
Proposed Solution & Architectural Design
- The readiness verdict (
src/devops_cli/github/merge_readiness.py, refactor(github): pr check-readiness reads one merge-readiness verdict from github/, and the item rules are public predicates in roadmap/ #2442) adds a WARNING advisory when the body, with the trailer lines removed (Closes,Change:,Fail-to-pass:,Co-authored-by:,Signed-off-by:), is longer than 1,000 characters. The advisory names the length, the limit andCONTRIBUTING.mdsection 4. - An advisory never changes an exit code (
AdvisoryLevel), so the check blocks nothing. A person still decides. - The limit is one constant beside the rule's reader.
CONTRIBUTING.mdsection 4 then says thatdevops pr check-readinesswarns on a longer body, in place of "A reviewer checks the length of the body".
Target Subsystem
devops pr check-readiness (github/merge_readiness.py, commands/pr.py), CONTRIBUTING.md.
Existing Tool Considered
No open tool checks the length of a pull request body. The Semantic PR title action checks only the title, commitlint checks commits (the squash merge discards the branch commits), and markdownlint checks line lengths, not a total. Cost of building: about 20 lines in the verdict module and one table test, about 40k tokens to build and 5k a year to keep, and under one hour of elapsed time. The advisory uses the verdict's existing advisory path, so it adds no new mechanism.
Acceptance criteria
- A body of 1,000 characters before the trailers gives no advisory, and one of 1,001 gives one WARNING advisory that names 1,001, 1,000 and
CONTRIBUTING.md. - Trailer lines do not count.
- The exit code of
devops pr check-readinessis the same with and without the advisory. CONTRIBUTING.mdsection 4 names the advisory.
Source: #1803
Proposed design
Problem statement
The pull request body becomes the commit message on main after a squash merge. CONTRIBUTING.md section 4 limits it to 1,000 characters before trailers, but only a reviewer enforces this today. Of 188 recent squash commits, 119 exceed the limit. A WARNING advisory in devops pr check-readiness reaches the writer, often an agent, at the right time without blocking the merge.
Acceptance criteria
Requirement: Body length advisory threshold
The readiness verdict SHALL add no advisory when the body, with trailer lines removed, is at most 1,000 characters.
Scenario: Body at the limit
- WHEN The body before trailers is exactly 1,000 characters
- THEN No advisory is present in the verdict
Requirement: Body length advisory trigger
The readiness verdict SHALL add one WARNING advisory when the body, with trailer lines removed, is longer than 1,000 characters.
Scenario: Body over the limit
- WHEN The body before trailers is 1,001 characters
- THEN One WARNING advisory names 1,001, 1,000, and CONTRIBUTING.md section 4
Requirement: Trailer exclusion
Trailer lines (Closes, Change:, Fail-to-pass:, Co-authored-by:, Signed-off-by:) SHALL NOT count toward the body length.
Scenario: Trailer lines stripped
- WHEN The body contains trailer lines and the remaining text is 1,000 characters
- THEN No advisory is present in the verdict
Requirement: Advisory does not block
A body-length WARNING advisory SHALL NOT change the exit code of devops pr check-readiness.
Scenario: Exit code unchanged
- WHEN The verdict contains a body-length WARNING advisory and no blockers
- THEN The exit code is the same as when no advisory is present
Requirement: Documentation update
CONTRIBUTING.md section 4 SHALL state that devops pr check-readiness warns on a body longer than 1,000 characters.
Scenario: Documentation names the advisory
- WHEN A reader reads CONTRIBUTING.md section 4
- THEN The text names the advisory from devops pr check-readiness in place of 'A reviewer checks the length of the body'
Existing Tool Considered
No check has run. No open tool checks the length of a pull request body. The Semantic PR title action checks only the title, commitlint checks commits (the squash merge discards branch commits), and markdownlint checks line lengths, not a total. Cost of building: about 20 lines in the verdict module and one table test, about 40k tokens to build and 5k a year to keep, and under one hour of elapsed time. The advisory uses the verdict's existing advisory path, so it adds no new mechanism.
Key questions
- Where does the PR body come from in the readiness assessment?: The pr_data dict passed to assess_merge_readiness holds the body under the "body" key. The function already receives pr_data for every other check. [sources: src/devops_cli/github/merge_readiness.py]
- How to identify and strip trailer lines from the body?: Remove lines that start with Closes, Change:, Fail-to-pass:, Co-authored-by:, or Signed-off-by:. This is a closed set of five prefixes named in the issue body. (best practice) [sources: CONTRIBUTING.md]
- Chosen: Strip by a closed list of five known prefixes. The body names the exact set. A closed list is the project's standard for a closed domain (CONTRIBUTING.md section 1, Closed Lists and Standard Parsers).
- Rejected: Use a generic trailer parser. Overkill for five known prefixes. Adds a dependency for a fixed set.
- Where to place the 1,000-character limit constant?: In merge_readiness.py, beside the function that reads the body. The body says 'The limit is one constant beside the rule's reader.' (best practice) [sources: src/devops_cli/github/merge_readiness.py]
- Chosen: In merge_readiness.py beside the rule's reader. The issue body specifies this placement. One module reads it, so it stays local per the naming rules in CONTRIBUTING.md section 5.
- Rejected: In config/constants.py. The body says 'beside the rule's reader,' not in config. No second package imports it.
- Does a WARNING advisory change the exit code of devops pr check-readiness?: No. The AdvisoryLevel docstring states 'no advisory changes an exit code.' Advisories are separate from blockers in the MergeReadiness dataclass. [sources: src/devops_cli/github/merge_readiness.py:68]
- What text does the advisory carry?: The advisory names the actual body length, the limit (1,000), and CONTRIBUTING.md section 4. This gives the writer the number to fix and the rule to follow. (best practice) [sources: CONTRIBUTING.md]
- Chosen: Name the length, the limit, and CONTRIBUTING.md section 4. The issue body specifies this. It is actionable: the writer sees how much to cut and where the rule lives.
- Rejected: Name only the length. Less actionable. The writer must find the limit and the rule on their own.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 29, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The candidate adds a new WARNING advisory to an existing command.It is a quality guard for agents and humans, not a blocker or a defect fix.It helps writers meet the 1,000-character limit before a human review.The body states about 20 lines and one table test using the existing advisory path.Both work in the merge-readiness verdict module, but #2442 refactors the verdict structure while the candidate adds a new body-length advisory rule.devops-cli-service commentedon Oct 30, 2026
Status set to Ready at 07fb4c2 (see proposed design in issue body).
devops-cli-service commentedon Nov 1, 2026
Staged: branch
feat/2585-check-readiness-warns-when-a-pull, draft pull request #3004. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
These paths of the plan are no file on the default branch, and no group creates them:
tests/test_merge_readiness.py. A person checks that the plan names them right.docs(openspec): plan #2585 warn on PR body over 1000 chars (#3004)
docs(openspec): fix plan #2585 real test paths and spec delta (#3083)
devops-cli-service commentedon Nov 3, 2026
Released in v0.52.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.52.0
devops-cli-service commentedon Nov 3, 2026
Live since 2026-11-03 18:24 UTC