Skip to content

fix(pr): pr describe refuses the Closes line of the scaffold #5398

Done

Description

@dan-petty

Problem Description

The proposal scaffold of src/devops_cli/openspec/scaffold.py (line 68) puts the comment State the problem or motivation. Closes #{issue}. in the section Why. So an author writes Closes #<issue>. in that section. devops pr describe <issue> --summary <text> then refuses the proposal with the message The text of the proposal holds a closing keyword for an issue. Give the text with --why. and builds no body. 151 of the 263 archived proposals of 2026-11-10 to 2026-11-13 hold Closes #. The implement job (_why in src/devops_cli/roadmap/implement/implement_run.py) uses the title of the item in place of such a text.

Reproduction Steps

  1. Archive a change whose proposal.md section Why ends with Closes #5345., as the scaffold asks.
  2. Run uv run devops pr describe 5345 --summary "drop the fixed gateway URL of the review dry run".

Expected vs Actual Behavior

  • Expected: the scaffold and pr describe agree. The scaffold does not ask for a closing keyword in the proposal, or pr describe removes the closing sentence that names the delivered issue (the body adds Closes #<issue> itself).
  • Actual: pr describe exits 1 with the message above, and the author must write the text again with --why.

Environment Diagnostics

origin/main at release 0.127.0.

Logs, Traces, or Terminal Output

✗ The text of the proposal holds a closing keyword for an issue. Give the text with --why.

Proposed Fix

Remove Closes #{issue}. from the scaffold comment of the section Why, or let pr describe drop a closing sentence that names the delivered issue only. Keep the refusal for a closing keyword that names another issue.

Alternatives check of 2026-11-22: none.
Tool: none found.
Reason: Searches for a tool that detects or strips GitHub closing keywords and for a proposal-to-PR-body generator returned only unrelated MDN documentation; the need is a change to this repository's own scaffold and pr describe filter.

Lacks:

  • No external tool reads this repository's proposal scaffold
  • No tool drops a closing keyword naming the delivered issue
  • No tool keeps the refusal for another issue's keyword

Proposed design

Problem statement

Fix the scaffold and the refusal together. The scaffold asks the author to put Closes #{issue}. in Why. pr describe refuses that text and builds no body. Remove the closing keyword from the scaffold comment. Drop only a closing keyword that names the delivered issue. Keep the refusal for a closing keyword that names another issue.

Acceptance criteria

Requirement: Scaffold Why comment has no closing keyword

The proposal scaffold SHALL NOT ask the author for a closing keyword in the Why section.

Scenario: Scaffold proposal text

  • WHEN a test calls scaffold_proposal(5345)
  • THEN the test asserts that the Why comment does not contain Closes #5345

Requirement: Delivered issue closing keyword is dropped

devops pr describe SHALL drop a closing keyword that names the delivered issue and keep the rest of the Why text.

Scenario: Why holds a closing clause

  • WHEN a test runs devops pr describe 5434 --summary "set the pod overhead of RuntimeClass gvisor" on a proposal whose Why holds This change sets the overhead and closes #5434.
  • THEN the command exits 0, and the body holds This change sets the overhead. and one Closes #5434

Requirement: Another issue closing keyword is refused

devops pr describe MUST refuse a proposal whose Why holds a closing keyword for an issue other than the delivered issue.

Scenario: Why closes another issue

  • WHEN a test runs devops pr describe 5345 --summary "drop the fixed gateway URL of the review dry run" on a proposal whose Why holds Closes #9999.
  • THEN the command exits 1 and prints The text of the proposal holds a closing keyword for an issue. Give the text with --why.

Existing Tool Considered

The alternatives block in the issue body (2026-11-17) gives verdict none and names no tool; its comment lists the lacks. No open, maintained tool covers this need. The fix changes existing code: about 10k tokens to write and test, and 1 hour. It adds no component to keep.

Key questions

  • Which parts of the repository must change?: Change both scaffold_proposal and the pr describe filter. Remove Closes #{issue}. from the Why comment. Drop only a closing keyword that names the delivered issue. Keep the refusal for another issue. (best practice) [sources: src/devops_cli/openspec/scaffold.py:68, tests/commands/test_pr_describe.py]
    • Rejected: scaffold only. Archived proposals and manual text still make pr describe fail.
    • Rejected: pr describe only. The scaffold keeps asking for a closing keyword.
    • Chosen: both. The scaffold and the command agree, and existing proposal text is accepted.
  • How does pr describe identify the closing keyword to drop?: Reuse the existing closing-keyword detection in src/devops_cli/roadmap/stage/stage_change.py. Compare the issue number in the keyword with the delivered issue. Drop the keyword only on a match. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, tests/commands/test_pr_describe.py]
    • Chosen: reuse closing_keyword_in. It already detects closing keywords in the repository.
    • Rejected: new regex in pr describe. It duplicates the existing detection and can disagree.
    • Rejected: strip every closing keyword. It removes the refusal that protects another issue.
  • Does the pull request body add the closing line for the delivered issue?: Yes. build_body in src/devops_cli/roadmap/pull_form.py adds the closing line for the delivered issue. The filter must not add a second one. [sources: src/devops_cli/roadmap/pull_form.py, tests/commands/test_pr_describe.py]
  • Does the implement job need a change?: No. _why in src/devops_cli/roadmap/implement/implement_run.py already uses the item title when the Why text holds a closing keyword. The fix leaves it. [sources: src/devops_cli/roadmap/implement/implement_run.py:1634]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 13, 2026
  4. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    Another occurrence on 2026-11-13, for #5434 (pull request #5530). The archived proposal of 5434-set-the-pod-overhead-of-runtimeclass says "This change sets the measured overhead and closes #5434." in the section Why. The closing keyword names the delivered issue only.

    $ uv run devops pr describe 5434 --summary "set the pod overhead of RuntimeClass gvisor"
    ✗ The text of the proposal holds a closing keyword for an issue. Give the text with --why.
    

    The body of #5530 was written by hand in place of --why.

  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Searches for an open tool or library that parses or strips GitHub issue closing keywords (for example, to drop a Closes #N sentence from proposal text) returned no relevant project; the results were unrelated pages. The need is a fix to this repository's own scaffold text in src/devops_cli/openspec/scaffold.py and to the refusal logic of its own pr describe command, which no external tool or library covers.

    Tool: none found

    Lacks:

    • A tool that drops only a closing sentence naming the delivered issue while keeping the refusal for a closing keyword that names another issue
    • Agreement between the project's proposal scaffold comment in the Why section and pr describe
    • Detection of GitHub closing keywords in a Python CLI

    Searches run:

    • detect "closes #" keyword in markdown text python package, results: 5
    • library parse GitHub issue closing keywords from text, results: 5
    • GitHub closing keywords regex fix commit message issue references, results: 5
    • npm package remove issue closing keyword from pull request description, results: 5
    • github-issue-parser npm, results: 5
    • PyPI github issue keyword parser library, results: 5
    • github closing keyword detector tool, results: 5
    • issue reference parser closing keywords python, results: 5
    • semantic-release issue-parser closing keywords, results: 5
    • github issue closer bot closing keywords automation, results: 5

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

  6. added
    status/ready
    and removed
    status/new
    on Nov 17, 2026
  7. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 2620fae (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    Live since 2026-11-25 07:43 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