Repository navigation
Description
Problem or Motivation
PR #3213 adds src/devops_cli/roadmap/pull_form.py, one module of rules for the title and the body of a pull request, and devops pr describe. devops pr create now refuses a title or body that breaks the form. The stage and implement jobs do not use it yet. They still cut text with textwrap.shorten(..., placeholder="...") in staging_title, delivery_title and the "why" of implement_run.py. A job body can pass 1,000 characters, because implement_pull_body adds Closes and Change: to a "why" that is already cut to 1,000. It also puts Closes first, while the template and the new rules want the text, then Closes, then Change:. So a pull request that the Service opens can break the rules that devops pr create refuses for a person.
Proposed Solution & Architectural Design
- The stage and implement jobs call
build_titleandbuild_bodyfrompull_form, and check the result withtitle_problemsandbody_problems. - When a check refuses the text, the job sends the problems back to the model once, as it does for a refused plan, and stops the item with the class of a refused reply on a second refusal. The job never writes
...into a title or a body. - The implement body changes to the order text,
Closes #N,Change:, then the attribution lines. - Remove the
textwrap.shortencalls for titles and bodies, andSUMMARY_MAX_CHARSis read frompull_formonly. - Add the follow-up of PR feat(pr): build and check the title and body of a pull request #3213 for
devops pr check-readiness: it callsbody_problems(see feat(pr): check-readiness warns when a pull request body passes 1,000 characters #2585).
Open questions for the refine step: whether the implement job's "why" should come from a model-written summary field with a hard bound, as the stage job's summary has; and how the change touches stage_change.py, implement_run.py and messages.py, which the content gate (#3200) also changes.
Target Subsystem
src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/pull_form.py, src/devops_cli/lang/en/messages.py.
Existing Tool Considered
pull_form already holds the rules, and the jobs have the one-retry pattern for refused replies. No other tool builds a title and body under these rules. Cost to build: about 80k tokens and 4 hours. To keep: nothing new, because the rules have one source.
Related: PR #3213 (the rules and devops pr describe), #3198, #3200, #2585.
Alternatives check of 2026-11-05: none.
Tool: none found.
Proposed design
Problem statement
The implement job still cuts the Why with textwrap.shorten and can write a body in the wrong order or over the body limit. The stage job formats its plan body without the plan body check. The claim that staging_title and delivery_title cut text is false at this commit: both already use pull_form. This change builds the implement body and the stage plan body with pull_form and stops on a refusal. A model retry is a separate item.
Acceptance criteria
Requirement: Implement body uses pull_form
The implement job SHALL build the delivery body with build_body and SHALL check it with body_problems before it updates the pull request.
Scenario: Implement body passes
- WHEN The implement job builds a body for issue 42 with a why of 200 characters, the archived change and one attribution line.
- THEN
build_bodyreturns the body andbody_problemsreturns no problem.
Requirement: Delivery body order
The implement job SHALL put the why first, then Closes #, then the Change: line, then the attribution lines.
Scenario: Closes before Change
- WHEN The implement job builds a body for issue 42 with a why and one attribution line.
- THEN The body starts with the why, holds
Closes #42before theChange:line, and ends with the attribution line.
Requirement: No cut why
The implement job MUST NOT call textwrap.shorten on the why, a title or a body.
Scenario: Long why is not cut
- WHEN The archived proposal's Why section is longer than
BODY_MAX_CHARS. - THEN
_whyreturns the issue title and the returned text contains no....
Requirement: Stage plan body uses pull_form
The stage job SHALL build its plan body with build_plan_body and SHALL check it with plan_body_problems before it opens the draft pull request.
Scenario: Plan body passes
- WHEN The stage job builds a plan body for issue 42 with a text of 100 characters and the active change folder.
- THEN
plan_body_problemsreturns no problem and the draft pull request call gets that body.
Requirement: Refused text is not written
The stage and implement jobs MUST stop the item when a title or body check returns a problem and MUST NOT write that text to GitHub.
Scenario: Refused body stops the item
- WHEN A built body returns at least one problem.
- THEN The job records the refused-reply failure class, stops the item, and makes no
update_pullorcreate_draft_pullcall with that body.
Existing Tool Considered
No open, maintained tool covers the need. The alternatives check found only commit and pull request title linters, Commitizen and static GitHub templates. They do not build a title and body with Closes or Plans, Change: and attribution under a character bound. The project uses its own pull_form module. It has plan_body_problems but no build_plan_body and no job integration. Written cost to build and keep: about 80k tokens and 4 hours; keep cost is nothing new because the rules have one source.
Key questions
- Do
staging_titleanddelivery_titlestill cut text withtextwrap.shortenat the staging commit?: No.staging_titleraisesRoadmapStageErrorwhen the summary is overSUMMARY_MAX_CHARS, anddelivery_titlereturns the full summary. This change does not modify either title builder. [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/pull_form.py] - Does
implement_run._whystill calltextwrap.shortenat the staging commit?: Yes._whycallstextwrap.shortenwithCONST_ROADMAP_IMPLEMENT_BODY_MAX_CHARSand the placeholder.... [sources: src/devops_cli/roadmap/implement_run.py] - Does
pull_formalready hold a plan body check?: Yes.plan_body_problemsacceptsPlans #and refuses a closing keyword.pull_formhas nobuild_plan_bodyfunction, so the stage job still formats its plan body instage_change.pull_request_body. [sources: src/devops_cli/roadmap/pull_form.py, src/devops_cli/roadmap/stage_change.py] - Does
stage_change.pyalready readSUMMARY_MAX_CHARSfrompull_form?: Yes. It importsSUMMARY_MAX_CHARSfrompull_formand uses it for the plan title. The change keeps that import and adds no second limit. [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/pull_form.py] - Should the stage job get a separate plan body builder?: Yes. Add
build_plan_bodytopull_formand call it fromstage_change.pull_request_body. The builder usesplan_body_problemsand keeps thePlans #rules in one module. (best practice) [sources: src/devops_cli/roadmap/pull_form.py, src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_pull_form.py]- Chosen: Separate plan builder. It mirrors
build_body, checksplan_body_problems, and keeps the plan rules inpull_form. - Rejected: Relax
body_problemsto acceptPlans. The delivery form must keep refusing a body with noCloses. - Rejected: Keep formatting in
stage_change.py. It leaves two places that build a plan body and one of them can drift.
- Chosen: Separate plan builder. It mirrors
- How should the implement job get its why after the change removes
textwrap.shorten?: Use the archived proposal's Why when it is no longer thanBODY_MAX_CHARSand has no closing keyword. Otherwise use the issue title. Letbuild_bodyrefuse any remaining problem. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/pull_form.py]- Chosen: Archived Why with issue-title fallback. It keeps one source for the rationale and writes no cut text.
- Rejected: Model-written summary field. It duplicates the plan's Why and needs prompt and schema changes.
- Rejected: Keep
textwrap.shorten. It writes...and can still pass the body limit.
- What does a job do when a title or body check refuses the text?: Stop the item with the refused-reply failure class and write no title or body. Do not add a model retry in this item; file the retry as a separate issue. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/pull_form.py]
- Chosen: Stop on refusal and defer retry. The implement job has no free-text model step for the pull request body, and a stop is safe.
- Rejected: Add a model retry now. It needs a new prompt, a new bounded step and new tests.
- Rejected: Write a cut body. It breaks the form that
devops pr createenforces.
- How should the implement body carry the attribution lines?: Pass the existing attribution lines to the
attributionargument ofbuild_body. Do not put them in the why. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/pull_form.py]- Chosen: Pass attribution to
build_body.build_bodyputs the lines afterChange:andbody_problemsrefuses them beforeCloses. - Rejected: Keep attribution in the why. The body check refuses attribution above
Closes. - Rejected: Remove attribution. It loses the provenance of the generated text.
- Chosen: Pass attribution to
- Does this change wait for the content gate in feat(roadmap): refuse a plan with placeholder or cut text #3200?: No. Make minimal edits in
stage_change.py,implement_run.pyandmessages.py. Rebase on feat(roadmap): refuse a plan with placeholder or cut text #3200 if it lands first. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/implement_run.py, src/devops_cli/lang/en/messages.py]- Chosen: Minimal edits and rebase if needed. It keeps the conflict surface small and needs no functional wait.
- Rejected: Wait for feat(roadmap): refuse a plan with placeholder or cut text #3200 as a dependency. The jobs do not need the content gate to work.
- Rejected: Move all texts to new message classes. It expands the conflict surface in
messages.py.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 2, 2026
Finding for the refine step, from fixing the plan pull requests #3150, #3157 and #3158.
pull_form.body_problems(merged in #3213) refuses a correct plan body. A body withPlans #<issue>and theChange:line returns "The body has no lineCloses #<issue>.", because the module has one form, the delivery form. The stage job writes the plan body withPlans #N(stage_change.py,pull_request_body), andtitle_problemsaccepts the plan title (docs(openspec): plan #N <summary>). If the stage job checks its own body withbody_problems, as this issue proposes, every plan body is refused. This issue should add a plan form topull_form(a body withPlans #<issue>in place ofCloses, and the same limit, order and placeholder rules), and a test that the stage job's plan body passes it. The delivery form must keep refusing a body with noCloses.Generated by Claude Code
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.(roadmap)scope of the title gives the scope.Service-opened PRs can break rules that devops pr create enforces for humans, creating inconsistency, but no data loss or security risk.Ensures Service-opened PRs follow the same form rules as human-opened PRs, reducing review friction.Requires changes to three files, adding retry logic for refused text, and removing existing textwrap calls; estimated at 4 hours.Both change text quality in the stage and implement jobs and touch stage_change.py and implement_run.py, but #3200 refuses plans with placeholder text while the candidate makes the jobs construct PR title and body using pull_form rules.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at 4571d5f (see proposed design in issue body).
Moved to new items: #3259.
devops-cli-service commentedon Nov 2, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
fix(roadmap): check the plan title in the stage job (#3360)
1 remaining item
devops-cli-service commentedon Nov 5, 2026
Status set to Ready at d254410 (see proposed design in issue body).
Moved to new items: #3259, #3599.
feat(roadmap): build the job pull request body with pull_form (#3215)
fix(roadmap): name the active change folder when the project has no a…
docs(openspec): archive the change of #3215
chore(main): release 0.74.0 (#3859)
devops-cli-service commentedon Nov 6, 2026
Released in v0.74.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.74.0
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 22:51 UTC