Skip to content

fix(pr): the plan form names Closes and hides the Plans order #3662

Closed

Description

@dan-petty

Problem

devops pr create refuses a plan body that follows the text of CONTRIBUTING.md, and its message names the wrong line.

CONTRIBUTING.md section 4 says that a plan pull request has "the line Plans #<issue> in place of Closes, then the Change: line". A delivery body has its text above Closes. So a reader puts the text above Plans. plan_body_problems in src/devops_cli/roadmap/pull_form.py reads the text only between the Plans line and the Change: line, so it finds no text.

Evidence on origin/main at f6d57ec, from uv run devops pr create --dry-run with the title docs(openspec): plan #3039 the verifier reads the repository:

  • Text, then Plans #3039, then Change: gives: The text above Closes has 0 characters. Write at least 20: what the change does, and why. The body has text, and a plan body has no Closes line.
  • Plans #3039, then text, then Change: passes.

The docstring of plan_body_problems has the same gap. It says that the Plans line stands where a delivery has Closes.

Expected

The form, its document and its message agree on one order. The refusal of a plan body names the Plans line and states where the text goes.

Acceptance criteria

  • A test: a plan body with its text above Plans gets a message that names the Plans line, or the form accepts that order.
  • CONTRIBUTING.md section 4 and the docstring of plan_body_problems state the order that the form enforces.

Existing tool considered

None applies. The change is to the form text and its document. This is an existing check of this repository.

Related

Related: #3314, #3598, #3215

Source: #3598

Proposed design

Problem statement

devops pr create refuses a plan body that follows CONTRIBUTING.md section 4. The document says that the Plans line takes the place of Closes, so a reader puts the text above Plans. The function plan_body_problems reads the text only between Plans and Change:, and its short-text message names Closes. The form, the document and the message must state one order: the text, then Plans #<issue>, then the Change: line.

Acceptance criteria

Requirement: Plan body text above Plans

plan_body_problems SHALL accept a plan body whose text is above the Plans line.

Scenario: Text above Plans

  • WHEN A plan body holds the text, then Plans #<issue>, then the Change: line of the active folder of the same issue.
  • THEN plan_body_problems(body, issue) returns an empty list.

Requirement: Short plan body names Plans

The refusal of a plan body with too little text MUST name the Plans line and the minimum of 20 characters.

Scenario: Text below Plans

  • WHEN A plan body holds fewer than 20 characters above Plans, and its text sits between Plans and Change:.
  • THEN The message names Plans, says that the text goes above it, and gives the minimum of 20 characters.

Requirement: Delivery message keeps Closes

The refusal of a delivery body with too little text SHALL still name the Closes line.

Scenario: Short delivery body

  • WHEN A delivery body holds fewer than 20 characters above Closes.
  • THEN The message names Closes and holds no Plans.

Requirement: The document states one order

CONTRIBUTING.md section 4 and the docstring of plan_body_problems SHALL state that the text goes above the Plans line.

Scenario: The two texts

  • WHEN A test reads section 4 of CONTRIBUTING.md and the docstring of plan_body_problems.
  • THEN Both state that the text goes above Plans, then the Change: line, and neither places the text between the two lines.

Requirement: The staged plan body passes the form

The body that the stage job writes for a draft plan pull request MUST pass plan_body_problems for its issue.

Scenario: A staged plan body

  • WHEN The stage job builds the body of the draft plan pull request for an issue.
  • THEN plan_body_problems(body, issue) returns an empty list.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this need: the rule is the order of a plan body in CONTRIBUTING.md section 4 of this repository. The change edits plan_body_problems in src/devops_cli/roadmap/pull_form.py, adds one field to one message and adds tests. It builds no new code. The edit is about 30 lines, and it needs under an hour.

Key questions

  • Which order does a plan body take: the text above Plans, or the text between Plans and Change:?: The text goes above the Plans line, then the Plans line, then the Change: line. The form reads the text above Plans. (best practice) [sources: CONTRIBUTING.md:151, src/devops_cli/roadmap/pull_form.py, openspec/changes/archive/2026-11-03-3314-pr-create-refuses-the-body-of-a/design.md:6]
    • Chosen: Text above Plans. The Plans line takes the place of Closes, and a delivery body puts its text above Closes. One order then holds for both forms, and CONTRIBUTING.md section 4 already states it.
    • Rejected: Text between Plans and Change. It contradicts CONTRIBUTING.md section 4 and the docstring, and it puts the text after the line that names the issue, unlike a delivery body.
  • How does the short-text message name the line that the text goes above?: _text_problems takes the name of the line, and the message form_body_short takes an {anchor} field. A plan body then names Plans, and a delivery body names Closes. (best practice) [sources: src/devops_cli/roadmap/pull_form.py, src/devops_cli/lang/en/messages.py]
    • Chosen: One message with an anchor field. The text stays once in lang/en/, and each form names its own line. The module keeps one rule for the two forms.
    • Rejected: A second message for the plan form. It duplicates the same text, and the two copies drift.
  • Must the body that the stage job writes pass the plan form?: Yes. A test checks that the body that the stage job writes for a draft plan pull request passes plan_body_problems for its issue. (best practice) [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_change.py, docs/roadmap/plan-check.md:12]
    • Chosen: Check the staged body against the form. A form change alone can refuse every staged plan body and stop the stage job. The test holds the two in step.
    • Rejected: Leave the staged body unchecked. The stage job then opens a draft pull request that the form refuses, and the defect returns.
  • Which function holds the rule of a plan body, and which caller reads it?: plan_body_problems in src/devops_cli/roadmap/pull_form.py holds the rule. _form_checked in src/devops_cli/commands/pr.py calls it. [sources: src/devops_cli/roadmap/pull_form.py, src/devops_cli/commands/pr.py:1107]
  • Which documents state the order of a plan body?: Section 4 of CONTRIBUTING.md and the docstring of plan_body_problems state the order. [sources: CONTRIBUTING.md:151, src/devops_cli/roadmap/pull_form.py]
  • Which message does a short plan body print now?: It prints form_body_short, which names Closes. _text_problems reads that message for the plan form and the delivery form. [sources: src/devops_cli/roadmap/pull_form.py, src/devops_cli/lang/en/messages.py]
  • Which tests cover the plan form and the pull request form?: tests/roadmap/test_roadmap_pull_form.py covers the functions of the module, and tests/commands/test_pr_form_check.py covers the check of devops pr create. [sources: tests/roadmap/test_roadmap_pull_form.py, tests/commands/test_pr_form_check.py]
  • Which capability requirement does the order belong to?: The capability pull-request-form holds the requirement A plan body has the Plans line and no closing keyword, and the change extends it with the order of the text. [sources: openspec/specs/pull-request-form/spec.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-07: none.
Tool: none found.

Activity

  1. added
    source/agent
    on Nov 5, 2026
  2. added
    type/bug
    scope/pr
    status/new
    value/medium
    effort/low
    on Nov 5, 2026
  3. dan-petty commented on Nov 5, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/pr. The (pr) scope of the title gives the scope.
    • Priority: P2-Medium. The tool rejects valid input that follows the documented format, but a workaround exists by placing text below Plans.
    • Value: Medium. Users who follow CONTRIBUTING.md hit a confusing refusal, but they can reorder the text to pass.
    • Effort: Low. The change is to one validation function, its docstring, and one section of CONTRIBUTING.md.
    • Related: fix(pr): pr create refuses the body of a plan pull request #3314, which asks for a different change. Both fix devops pr create plan body validation, but #3314 fixed recognition of Plans vs Closes while this fixes text position and the error message.
  4. added
    priority/p2-medium
    on Nov 5, 2026
  5. added
    status/ready
    and removed
    status/new
    on Nov 6, 2026
  6. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 662828d (see proposed design in issue body).

  7. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The searches for an open tool that validates the structure of a pull request body returned no provider answer, and the need is repository-internal: the order of the text, the Plans #<issue> line and the Change: line in a plan body, checked by plan_body_problems in src/devops_cli/roadmap/pull_form.py, with CONTRIBUTING.md section 4 and one message to match. No general PR-body or template linter could enforce this repository's own line order, so no tool or library covers it; the issue itself records that no alternative applies.

    Tool: none found

    Lacks:

    • Accepts a plan body whose text sits above the Plans line and still requires the Change: line
    • Names the Plans line, not Closes, in the short-text refusal of a plan body
    • States one order in CONTRIBUTING.md section 4 and in the docstring of plan_body_problems
    • Keeps the staged plan body of the stage job passing the form

    Searches run:

    • tool validates pull request body template closing keyword and plan section, results: 0
    • linter for pull request description structure required sections open source, results: 0
    • danger validate PR body template sections, results: 0

    Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.

  8. added
    status/in-progress
    and removed
    status/ready
    on Nov 14, 2026
  9. added
    status/in-review
    and removed
    status/in-progress
    on Nov 14, 2026
  10. removed
    status/in-review
    on Nov 14, 2026
  11. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 17:02 UTC

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

    effort/lowpriority/p2-mediumscope/prsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions