Repository navigation
Description
Problem or Motivation
The title and the body of a pull request are free text today, and they break the project form often. devops pr create takes --title and --body and checks neither. CONTRIBUTING.md sets the form: a Conventional Commit title with a summary of at most 60 characters and a scope that .github/labels.yml declares; a body of at most 1,000 characters that ends with Closes #<issue> and the Change: line. In one session of agent work, the first drafts of several titles had a summary over 60 characters, and a body put the attribution lines before Closes. The Service cuts text with textwrap.shorten(..., placeholder="...") (staging_title, delivery_title, and the "why" in implement_run.py). A cut title or body reads as broken, and a model that writes x or placeholder for the body gets a pull request with that text (#3167, #3174, #3175).
Proposed Solution & Architectural Design
- Add
devops pr describe. It reads the change folder (openspec/changes/<issue>-<slug>/or its archive) and the issue, and it takes a summary of at most 60 characters from the caller. It prints the title and the body, built by code: type and scope from the issue title, the "why" from the proposal,Closes #<issue>, theChange:line, and the attribution lines when given. - It refuses, and does not cut: a summary over 60 characters, a scope without a label, a body over 1,000 characters (the caller shortens the "why"), a missing
ClosesorChange:line, and placeholder text. devops pr createcalls the same check on--titleand--body, and refuses a pull request that breaks the form. It keeps opening a draft.- The stage and implement jobs call the same functions, so the Service and a person get the same title and body. The jobs stop cutting with
...and instead send the refusal back to the model once, as they do for a plan. - The check reuses the existing limit
CONST_ROADMAP_IMPLEMENT_BODY_MAX_CHARSand the label list, and one module holds the rules.
Open questions for the refine step: whether the Semantic PR title workflow and the pull request template can read the same rule list, so the rule has one source; and whether check-readiness (see #2585) should call the body check.
Target Subsystem
src/devops_cli/commands/pr.py, a new module for the form, src/devops_cli/roadmap/stage_change.py (staging_title, delivery_title), src/devops_cli/roadmap/implement_run.py.
Existing Tool Considered
commitlint and the Semantic PR title action check a title, and GitHub's template guides a body. None builds a body from the change folder, checks the 1,000-character limit, or runs offline in the jobs. The project already holds the title rules in its own code. Cost to build: about 100k tokens and 5 hours. To keep: one module of rules and its tests. The cost of today's approach is a rework round for each pull request with a broken form.
Related: #2585 (check-readiness warns when a body passes 1,000 characters), #3188.
Proposed design
Problem statement
The pull request title and body are free text today. devops pr create checks neither. The stage and implement jobs cut text with ..., and a model can write placeholder text. The change adds one form module, a devops pr describe command, and the same check in devops pr create and the jobs.
Acceptance criteria
Requirement: Describe builds the title and body
devops pr describe SHALL build the pull request title and body from the change folder and the issue.
Scenario: Describe a change
- WHEN the caller runs
devops pr describe --summaryfor a change folder or its archive and an issue - THEN the command prints a title with the issue type and declared scope, and a body with the why,
Closes #, and theChange:line
Requirement: Describe refuses a long summary
devops pr describe SHALL refuse a summary longer than 60 characters without cutting it.
Scenario: Summary over 60 characters
- WHEN the caller gives a summary of 61 characters
- THEN the command exits with a non-zero status, names the 60-character limit, and prints no title or body
Requirement: Describe refuses an undeclared scope
devops pr describe SHALL refuse a title scope that .github/labels.yml does not declare.
Scenario: Undeclared scope
- WHEN the issue title has a scope with no
scope/label - THEN the command exits with a non-zero status and names the missing label
Requirement: Describe places attribution before Closes
devops pr describe SHALL place each attribution line before Closes # when the caller gives one.
Scenario: Attribution line
- WHEN the caller gives an attribution line
- THEN the printed body holds that line before
Closes #
Requirement: Form check refuses a long body
The shared form check SHALL refuse a body longer than CONST_ROADMAP_IMPLEMENT_BODY_MAX_CHARS without cutting it.
Scenario: Body over the limit
- WHEN the body has more characters than
CONST_ROADMAP_IMPLEMENT_BODY_MAX_CHARS - THEN the check returns a refusal that names the limit, and the body is unchanged
Requirement: Form check requires the closing and change lines
The shared form check SHALL require the body to end with Closes # and the Change: line.
Scenario: Missing trailer
- WHEN the body has no
Closes #line or noChange:line - THEN the check returns a refusal that names each missing line
Requirement: Form check refuses placeholder text
The shared form check SHALL refuse placeholder text in the title or body.
Scenario: Placeholder body
- WHEN the body is
xorplaceholder, or still holds an angle-bracket field from the template - THEN the check returns a refusal and the caller prints no title or body
Requirement: Create checks the title and body
devops pr create SHALL call the shared form check on --title and --body and SHALL refuse a pull request that breaks the form.
Scenario: Create with a broken title
- WHEN the caller runs
devops pr createwith a summary over 60 characters - THEN the command exits with a non-zero status, sends no create request, and opens no pull request
Requirement: Create keeps the draft behavior
devops pr create SHALL keep opening a draft when the title and body pass the form check.
Scenario: Create with a valid title and body
- WHEN the caller runs
devops pr createwith a valid title and body - THEN the command sends the create request with
draft=true
Requirement: Jobs use the shared form and refuse instead of cutting
The stage and implement jobs SHALL call the shared form functions and SHALL NOT cut a title or body with ....
Scenario: Job gets a title that breaks the form
- WHEN the stage or implement job builds a title or body that fails the form check
- THEN the job sends the refusal to the model one time and does not update the pull request with a cut text
Requirement: One module holds the rules
One module SHALL hold the title and body rules, and it SHALL reuse CONST_ROADMAP_IMPLEMENT_BODY_MAX_CHARS and the labels file.
Scenario: Rules from one module
- WHEN
devops pr describe,devops pr create, the stage job, and the implement job check a title or body - THEN they call the same functions in
src/devops_cli/github/pr_form.py, and no caller holds a second copy of the 60-character or 1,000-character limit
Existing Tool Considered
No alternatives check has run. commitlint and the Semantic PR title action check a title. GitHub's template guides a body. None builds a body from the change folder, checks the 1,000-character limit, or runs offline in the jobs. Written cost to build: about 100k tokens and 5 hours. To keep: one module of rules and its tests.
Key questions
- Should the new form module reuse
CONST_ROADMAP_IMPLEMENT_BODY_MAX_CHARSfor the 1,000-character body limit?: Yes. ReuseCONST_ROADMAP_IMPLEMENT_BODY_MAX_CHARS(1,000) for the body limit. It measures the same pull request body that the implement job writes. A second constant would put the same number in two places. (best practice) [sources: src/devops_cli/config/constants.py:3079, src/devops_cli/roadmap/implement_run.py:60, CONTRIBUTING.md]- Chosen: Reuse
CONST_ROADMAP_IMPLEMENT_BODY_MAX_CHARS. One constant holds the 1,000-character limit for the pull request body. - Rejected: Add a new body-limit constant. The same 1,000-character rule would have two values that can drift.
- Chosen: Reuse
- Can the
Semantic PR titleworkflow and the pull request template read the same rule list as the form module?: No for the template, and not directly for the workflow. The template is human guidance. The workflowscopesinput is a literal list. Keep.github/labels.ymlas the scope source, have the form module read it, and add a test that the workflowscopeslist equals thescope/*labels. (best practice) [sources: CONTRIBUTING.md, .github/labels.yml, .github/pull_request_template.md]- Chosen: Keep
.github/labels.ymlas the scope source and test the workflow list. GitHub Actions and Markdown cannot import the Python module. The test keeps the lists equal. - Rejected: Make the workflow and template read the form module. The workflow runs in GitHub Actions and the template is Markdown. Neither can import Python code offline.
- Rejected: Leave the lists duplicated with no test. A scope added to one list and not the other would pass one check and fail another.
- Chosen: Keep
- Should
devops pr check-readinesscall the shared body check?: Yes, when feat(pr): check-readiness warns when a pull request body passes 1,000 characters #2585 lands. The check should call the shared body check so the 1,000-character rule has one implementation. This issue does not add the call. feat(pr): check-readiness warns when a pull request body passes 1,000 characters #2585 owns the advisory and its tests. (best practice) [sources: src/devops_cli/commands/pr.py, openspec/changes/2585-check-readiness-warns-when-a-pull/proposal.md]- Chosen: Let feat(pr): check-readiness warns when a pull request body passes 1,000 characters #2585 call the shared body check. The advisory stays in its own item and reuses one rule.
- Rejected: Add the check-readiness call in this issue. It overlaps feat(pr): check-readiness warns when a pull request body passes 1,000 characters #2585 and expands this item.
- Rejected: Duplicate the body rule in check-readiness. Two copies of the 1,000-character rule can drift.
- Where should the shared title and body rules live?: Put them in
src/devops_cli/github/pr_form.py. The CLI and the roadmap jobs can import that module. The command module stays a thin CLI layer. (best practice) [sources: src/devops_cli/commands/pr.py, src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/implement_run.py]- Chosen:
src/devops_cli/github/pr_form.py. A pull request form is a GitHub concern. Both the CLI and the roadmap jobs can import it. - Rejected:
src/devops_cli/commands/pr.py. The roadmap jobs should not import a command module. - Rejected:
src/devops_cli/roadmap/stage_change.py. That module is stage-specific and holds the plan schema.
- Chosen:
- What placeholder text does the shared form check refuse?: Refuse a title or body whose non-whitespace text is empty,
x,placeholder,todo,tbd,n/a, or.... Refuse text that still holds an angle-bracket field from.github/pull_request_template.md. (best practice) [sources: .github/pull_request_template.md, CONTRIBUTING.md]- Chosen: Refuse the listed placeholder texts and template fields. The check stops the known empty and template text.
- Rejected: Refuse only empty text. A body of
xorplaceholderwould pass. - Rejected: Refuse any short body. A short but valid body would be refused.
- Which command line does
devops pr describetake?:devops pr describe --summary [--attribution ...]. It reads the change folder for `` and the issue, and prints the title and body. (best practice) [sources: src/devops_cli/commands/pr.py, CONTRIBUTING.md]- Chosen: Use
--summaryand repeatable--attribution. The caller gives the summary and the optional attribution lines. - Rejected: Read the summary from the issue title. The issue title can have a long summary and no caller control.
- Rejected: Put the attribution after
Closes. The body form puts attribution beforeCloses.
- Chosen: Use
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(pr)scope of the title gives the scope.It prevents rework rounds for broken PR forms but does not block a release or fix a defect.It removes a recurring source of broken pull requests and saves a rework round per affected PR.It adds a new command, a shared rules module, and changes to pr create, stage, and implement jobs.Both check PR body length, but #2585 adds a warning to check-readiness while the candidate builds a new pr describe command and validation for pr create and the stage and implement jobs.