Skip to content

fix(pr): the body limit counts the Closes and Change lines #6633

Closed

Description

@dan-petty

Problem

The body rule of a delivery pull request has two meanings:

  • CONTRIBUTING.md line 181 says that the body has "at most 1,000 characters before the trailers" and ends with Closes #<issue> and the Change: line. The message form_body_long (src/devops_cli/lang/en/messages.py line 1699) says "The body has {length} characters before its trailers" and "Shorten the text above Closes".
  • body_form_problems (src/devops_cli/roadmap/pull_form.py line 259) measures the lines up to and including the Change: line. It counts the Closes line, the empty lines and the Change: line, about 120 characters for a typical change folder.

Thus a body whose text above Closes has 990 characters passes the rule as the document gives it, but devops pr ready reports "The body has 1107 characters before its trailers" and blocks the merge. On 2026-11-21 this happened on PR #6625 and PR #6629: the agents measured the text before Closes and got 974 and 891 characters. The #6450 delivery met the same difference.

Expected

One meaning in the code, the message and the document. Either the code measures only the text above the Closes line, which is what the document and the message say, or the document and the message say that the limit includes the Closes and Change: lines. The plan check (plan_check.py line 279) measures the whole body; the same text must name that too.

Acceptance criteria

  • Test first: a body whose measured part is just over the limit by the chosen meaning is refused, and the message names the part that it measured. The test fails on the base.
  • CONTRIBUTING.md, the message and the docstring of body_form_problems give the same meaning.

Dependencies

None.

Source

Source: #6629

Alternatives check of 2026-11-21: none.
Tool: none found.
Reason: Searches found only generic PR guidance and PR-creation actions; no open tool implements this repository's 1,000-character delivery body rule or the split between body text and its Closes/Change trailers, so the fix stays in the existing checker.

Lacks:

  • No checker for a 1,000-character delivery body limit
  • No split of body text from Closes and Change trailers
  • No agreement between code, message and CONTRIBUTING.md

Proposed design

Problem statement

The delivery body check counts the Closes and Change: lines in the 1,000-character limit. CONTRIBUTING.md and the form_body_long message say that the limit covers only the text above Closes. The plan body check counts its whole body too. Thus a body that the document allows is refused, and the merge waits. The fix gives one measured part for delivery and plan bodies.

Acceptance criteria

Requirement: Delivery limit measures text above Closes

The delivery body form check SHALL measure only the text above the Closes line, with its trailing blank lines removed, against the 1,000-character limit.

Scenario: A delivery body at the limit above Closes

  • WHEN A delivery body holds 1,000 characters above its Closes line and its Closes and Change: lines add 120 characters
  • THEN body_form_problems returns no form_body_long problem

Requirement: An over-limit body names the measured text

The delivery body form check SHALL refuse a body whose text above Closes is over 1,000 characters and SHALL name that text as the measured part.

Scenario: A delivery body over the limit above Closes

  • WHEN A delivery body holds 1,001 characters above its Closes line and its Closes and Change: lines add 120 characters
  • THEN body_form_problems returns form_body_long with length 1001, and the text of form_body_long names the text above Closes

Requirement: Plan limit measures text above Plans

The plan body form check SHALL measure only the text above the Plans line against the same 1,000-character limit.

Scenario: A plan body at the limit above Plans

  • WHEN A plan body holds 1,000 characters above its Plans line and its Plans and Change: lines add 120 characters
  • THEN the plan body form check returns no body-length problem

Requirement: The docstring names the measured text

The docstring of body_form_problems MUST state that the limit measures only the text above the Closes line.

Scenario: The docstring of the body check

  • WHEN The test reads body_form_problems.__doc__
  • THEN the docstring names the text above Closes as the only measured part

Existing Tool Considered

The alternatives check in the issue body (2026-11-21) gives the verdict none, with no tool. The proposal adds no new component: it edits the existing delivery body checker in src/devops_cli/roadmap/pull_form.py, the plan body check and their tests. It builds no new code, so it has no build cost.

Key questions

  • Which part of a delivery body does the 1,000-character limit measure?: Only the text above the Closes line. The Closes and Change: lines are trailers and do not count. (best practice) [sources: CONTRIBUTING.md:181, src/devops_cli/lang/en/messages.py:1699, src/devops_cli/roadmap/pull_form.py:259]
    • Chosen: Measure only the text above Closes. CONTRIBUTING.md says at most 1,000 characters before the trailers and the message says Shorten the text above Closes``.
    • Rejected: Include the Closes and Change: lines in the limit. It contradicts the document and the message, and it refuses a body that they allow.
  • Does the plan body form check use the same measured part?: Yes. It measures only the text above the Plans line against the same 1,000-character limit, so the Plans and Change: lines do not count. (best practice) [sources: src/devops_cli/roadmap/plan_check.py:279, src/devops_cli/roadmap/pull_form.py:259, CONTRIBUTING.md:181]
    • Chosen: Measure only the text above Plans. It gives one meaning for delivery and plan bodies and keeps the trailer text out of the limit.
    • Rejected: Keep the whole-body measure and name the difference in the text. It gives two meanings for one limit, and the document gives no such difference.
  • Do CONTRIBUTING.md and the form_body_long message need an edit?: No. Both already state the chosen meaning. CONTRIBUTING.md says at most 1,000 characters before the trailers, and the message says The body has {length} characters before its trailers and Shorten the text above Closes``. The fix changes the code to agree with them. [sources: CONTRIBUTING.md:181, src/devops_cli/lang/en/messages.py:1699]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    scope/pr
    priority/p1-high
    on Nov 21, 2026
  4. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

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

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (5)

    Searches run:

    • tool to check pull request body length limit and trailers before merge, results: 5
    • open source pull request body validator conventional commits closes trailer GitHub action, results: 5
    • GitHub Action validate PR description character count limit linter, results: 5
    • danger js pull request body length rule plugin, results: 5
    • prlint pull request description lint rules body length, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  8. added
    owner/service
    and removed
    owner/service
    on Nov 21, 2026
  9. 9 remaining items

  10. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failed check: pytest on base: tests/roadmap/stage/test_roadmap_stage_plan.py, tests/roadmap/steps/test_roadmap_step_open.py, tests/roadmap/test_roadmap_plan_check.py, tests/r.

    Failure class: test.
    Action taken: none.
    Action left: repair: give the failure to a fix step.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 14405712/54823 pytest on base: tests/roadmap/stage/test_roadmap_stage_plan.py, tests/roadmap/steps/test_roadmap_step_open.py, tests/roadmap/test_roadmap_plan_check.py, tests/r

    Reason:

    The tests of tests/roadmap/stage/test_roadmap_stage_plan.py, tests/roadmap/steps/test_roadmap_step_open.py, tests/roadmap/test_roadmap_plan_check.py, tests/roadmap/test_roadmap_pull_form.py could not run on the base commit. Pytest exited with status 1.
    /app/.venv/bin/python: No module named pytest
    

    Last message of the agent (a claim that no check verified): I finished group 1 and ticked tasks 1.1 and 1.2. What I changed - src/devops_cli/roadmap/pull_form.py: added measured_body_text(body, line) — the text above the first <line> # line, trailing blank lines removed, the whole body when there is no such line. _text_problems now takes line= and measures len(text.rstrip()); body_problems passes line="Closes", plan_body_problems passes line="Plans", and open_body_problems measures measured_body_text(body, "Closes"). The docstrings of body_problems, open_body_problems and _text_problems state the measured part. - src/devops_cli/lang/en/messages.py: form_body_long names the measured line through {line} and keeps the phrase Shorten the text above … that tests/commands/test_pr_describe.py reads (that file is not in the group's Changes); plan_check_body_long names the text above Plans. - tests/roadmap/test_roadmap_pull_form.py: added test_a_body_over_the_limit_above_closes_is_refused (1,001 above Closes + 120 chars of trailers → form_body_long with 1001, naming Closes), test_a_body_at_the_limit_above_closes_has_no_problem (1,000 → no problem) and a docstring test; both new body tests failed on the base (The body has 1121 characters before its trailers). Updated the plan-text test to expect Plans. - tests/roadmap/steps/test_roadmap_step_open.py: added a draft-body test for open_body_problems at and over the limit above Closes. Plan defect that forced extra edits. T

    The job discarded this work. The diff is cut to 20000 characters. Read it before you retry:

    diff --git a/openspec/changes/6633-the-body-limit-counts-the-closes/tasks.md b/openspec/changes/6633-the-body-limit-counts-the-closes/tasks.md
    index 2ec825756..ed4b25a33 100644
    --- a/openspec/changes/6633-the-body-limit-counts-the-closes/tasks.md
    +++ b/openspec/changes/6633-the-body-limit-counts-the-closes/tasks.md
    @@ -5,9 +5,9 @@
     Kind: behavior. Reads: `CONTRIBUTING.md`, `src/devops_cli/roadmap/steps/open.py`, `tests/roadmap/steps/test_roadmap_step_open.py`, `tests/ai/agent_audit/test_filing.py`, `tests/commands/test_pr_describe.py`, `tests/invariants/test_workflow_contracts.py`, `tests/lang/test_language_catalogs.py`, `tests/roadmap/implement/test_roadmap_implement_body_retry.py`, `tests/roadmap/implement/test_roadmap_implement_job.py`, `tests/roadmap/refine/test_roadmap_refine_placeholder.py`, `tests/roadmap/stage/test_roadmap_stage_module_test_order.py`, `tests/roadmap/stage/test_roadmap_stage_title.py`, `tests/roadmap/test_roadmap_pull_form.py`, `tests/roadmap/test_roadmap_retitle.py`, `tests/roadmap/implement/test_roadmap_implement_amend.py`, `tests/roadmap/implement/test_roadmap_implement_project_steps.py`, `tests/roadmap/refine/test_roadmap_refine_tracker.py`, `tests/roadmap/stage/test_roadmap_stage_paths.py`, `tests/roadmap/stage/test_roadmap_stage_trace_subject.py`, `tests/roadmap/test_roadmap_retitle_type.py`. Changes: `src/devops_cli/roadmap/pull_form.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/test_roadmap_pull_form.py`, `tests/roadmap/steps/test_roadmap_step_open.py`.
     Adds: `measured_body_text`
     
    -- [ ] 1.1 Write `test_a_body_over_the_limit_above_closes_is_refused` in `tests/roadmap/test_roadmap_pull_form.py` first: a text of 1,001 characters above `Closes`, then the `Closes` and `Change:` lines that add 120 characters, gives `form_body_long` with length 1001, and the text of the problem names `Closes`. Add `test_a_body_at_the_limit_above_closes_has_no_problem` with a text of 1,000 characters, which gets no problem. Both fail on the base, which reports the whole body
    +- [x] 1.1 Write `test_a_body_over_the_limit_above_closes_is_refused` in `tests/roadmap/test_roadmap_pull_form.py` first: a text of 1,001 characters above `Closes`, then the `Closes` and `Change:` lines that add 120 characters, gives `form_body_long` with length 1001, and the text of the problem names `Closes`. Add `test_a_body_at_the_limit_above_closes_has_no_problem` with a text of 1,000 characters, which gets no problem. Both fail on the base, which reports the whole body
       - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_pull_form.py` fails on the base
    -- [ ] 1.2 In `src/devops_cli/roadmap/pull_form.py` add `measured_body_text`, which returns the text above the first line that starts with `<line> #`, with its trailing blank lines removed, and the whole body when there is no such line. Give `_text_problems` a keyword `line` and measure `len(text.rstrip())` there; pass `line="Closes"` from `body_problems` and `line="Plans"` from `plan_body_problems`. Measure `measured_body_text(body, "Closes")` in `open_body_problems`. In `src/devops_cli/lang/en/messages.py` change `form_body_long` to "The text above `{line}` has {length} characters. The limit is {limit}. Shorten it." and pass the line at each call. State in the docstrings of `body_problems`, `open_body_problems` and `_text_problems` that the limit measures the text above the trailer line, with its trailing blank lines removed. Update `test_a_body_over_the_limit_before_its_trailers_is_refused`, `test_a_plan_text_over_the_limit_is_refused_and_not_cut` and the test of `tests/roadmap/steps/test_roadmap_step_open.py` that asserts the old measure
    +- [x] 1.2 In `src/devops_cli/roadmap/pull_form.py` add `measured_body_text`, which returns the text above the first line that starts with `<line> #`, with its trailing blank lines removed, and the whole body when there is no such line. Give `_text_problems` a keyword `line` and measure `len(text.rstrip())` there; pass `line="Closes"` from `body_problems` and `line="Plans"` from `plan_body_problems`. Measure `measured_body_text(body, "Closes")` in `open_body_problems`. In `src/devops_cli/lang/en/messages.py` change `form_body_long` to "The text above `{line}` has {length} characters. The limit is {limit}. Shorten it." and pass the line at each call. State in the docstrings of `body_problems`, `open_body_problems` and `_text_problems` that the limit measures the text above the trailer line, with its trailing blank lines removed. Update `test_a_body_over_the_limit_before_its_trailers_is_refused`, `test_a_plan_text_over_the_limit_is_refused_and_not_cut` and the test of `tests/roadmap/steps/test_roadmap_step_open.py` that asserts the old measure
       - Verification: `$ uv run devops ci test tests/roadmap/test_roadmap_pull_form.py` passes
     
     ## 2. Give the plan text the whole body limit
    diff --git a/src/devops_cli/lang/en/messages.py b/src/devops_cli/lang/en/messages.py
    index 2058d8934..98e187300 100644
    --- a/src/devops_cli/lang/en/messages.py
    +++ b/src/devops_cli/lang/en/messages.py
    @@ -1709,8 +1709,8 @@ class PRMessages:
             "change does, and why."
         )
         form_body_long: str = (
    -        "The body has {length} characters before its trailers. The limit is {limit}. Shorten the "
    -        "text above `Closes`."
    +        "The text above `{line}` has {length} characters. The limit is {limit}. Shorten the text "
    +        "above `{line}`."
         )
         form_trailer_long: str = (
             "The lines after `Change:` have {length} characters. The limit is {limit}. Keep only the "
    @@ -5682,7 +5682,9 @@ class RoadmapMessages:
             "The body holds the closing keyword `{keyword}` before an issue reference. A plan pull "
             "request closes no issue."
         )
    -    plan_check_body_long: str = "The body has {length} characters, and the limit is {limit}."
    +    plan_check_body_long: str = (
    +        "The text above `Plans` has {length} characters, and the limit is {limit}."
    +    )
         plan_check_check_missing: str = "The pull request has no check `{name}`."
         plan_check_check_failed: str = (
             "The check `{name}` has the state `{state}`, and it needs `success`."
    diff --git a/src/devops_cli/roadmap/plan_check.py b/src/devops_cli/roadmap/plan_check.py
    index e5da35524..3139fa1bb 100644
    --- a/src/devops_cli/roadmap/plan_check.py
    +++ b/src/devops_cli/roadmap/plan_check.py
    @@ -56,7 +56,12 @@ from devops_cli.roadmap.plan_read import (
         specs_at,
         tree_files,
     )
    -from devops_cli.roadmap.pull_form import BODY_MAX_CHARS, SUMMARY_MAX_CHARS, summary_length
    +from devops_cli.roadmap.pull_form import (
    +    BODY_MAX_CHARS,
    +    SUMMARY_MAX_CHARS,
    +    measured_body_text,
    +    summary_length,
    +)
     from devops_cli.roadmap.request_plan import planned_session_read
     from devops_cli.roadmap.stage.stage_change import (
         STAGING_TYPE,
    @@ -275,7 +280,7 @@ def title_body_problems(title: str, body: str, *, number: int) -> list[PlanProbl
                     "body", "body-closing", texts.plan_check_body_closes.format(keyword=keyword)
                 )
             )
    -    measured = len(body)
    +    measured = len(measured_body_text(body, "Plans"))
         if measured > BODY_MAX_CHARS:
             problems.append(
                 PlanProblem(
    diff --git a/src/devops_cli/roadmap/pull_form.py b/src/devops_cli/roadmap/pull_form.py
    index d760b7cb5..313cfd055 100644
    --- a/src/devops_cli/roadmap/pull_form.py
    +++ b/src/devops_cli/roadmap/pull_form.py
    @@ -245,10 +245,10 @@ def open_body_problems(body: str, *, issue: int | None, plan: bool) -> list[str]
         text for each problem, and none when the body is right.
     
         A plan body has the whole form of `plan_body_problems`. A delivery body closes the delivered
    -    `issue` in one line `Closes #<issue>` and no other issue, and the text up to its trailers has
    -    at most `BODY_MAX_CHARS` characters: the whole body when it has no `Change:` line. A draft that
    -    the implement job writes before its final body has no `Change:` line yet, so a delivery body
    -    needs none here: `body_problems` holds the whole form at ready."""
    +    `issue` in one line `Closes #<issue>` and no other issue, and the limit of `BODY_MAX_CHARS`
    +    characters measures the text above the line `Closes`, with its trailing blank lines removed.
    +    A draft that the implement job writes before its final body has no `Change:` line yet, so a
    +    delivery body needs none here: `body_problems` holds the whole form at ready."""
         texts = MESSAGES.pr
         if plan:
             return plan_body_problems(body, issue) if issue is not None else []
    @@ -256,10 +256,11 @@ def open_body_problems(body: str, *, issue: int | None, plan: bool) -> list[str]
         problems, closes, _ = _closing_problems(body, lines)
         if closes is not None and issue is not None and closes != issue:
             problems.append(texts.form_closes_other.format(closes=closes, issue=issue))
    -    _, _, change_at = _change_problems(lines)
    -    measured = "\n".join(lines if change_at is None else lines[: change_at + 1])
    +    measured = measured_body_text(body, "Closes")
         if len(measured) > BODY_MAX_CHARS:
    -        problems.append(texts.form_body_long.format(length=len(measured), limit=BODY_MAX_CHARS))
    +        problems.append(
    +            texts.form_body_long.format(line="Closes", length=len(measured), limit=BODY_MAX_CHARS)
    +        )
         return problems
     
     
    @@ -297,9 +298,10 @@ def body_problems(body: str) -> list[str]:
     
         The body is the text of what the change does and why, then the line `Closes #<issue>` for the
         one issue it closes, then the line `Change:` with the folder of the change in a code span, then,
    -    when given, the attribution lines. The text, the `Closes` line and the `Change:` line have at
    -    most `BODY_MAX_CHARS` characters. The text is no placeholder and keeps nothing of the pull
    -    request template."""
    +    when given, the attribution lines. The limit of `BODY_MAX_CHARS` characters measures the text
    +    above the line `Closes`, with its trailing blank lines removed: the `Closes` line, the
    +    `Change:` line and the attribution lines do not count. The text is no placeholder and keeps
    +    nothing of the pull request template."""
         texts = MESSAGES.pr
         lines = body.strip().splitlines()
         problems: list[str] = []
    @@ -312,9 +314,7 @@ def body_problems(body: str) -> list[str]:
             if closes_at > change_at:
                 problems.append(texts.form_order)
             else:
    -            problems += _text_problems(
    -                "\n".join(lines[:closes_at]), "\n".join(lines[: change_at + 1])
    -            )
    +            problems += _text_problems("\n".join(lines[:closes_at]), line="Closes")
                 problems += _trailer_problems("\n".join(lines[change_at + 1 :]))
         if _TEMPLATE_COMMENT in body:
             problems.append(texts.form_template_text)
    @@ -350,7 +350,7 @@ def plan_body_problems(body: str, issue: int) -> list[str]:
             else:
                 problems += _text_problems(
                     "\n".join(lines[:plans_at]),
    -                "\n".join(lines[: change_at + 1]),
    +                line="Plans",
                     short_message=texts.form_plan_body_short,
                 )
                 problems += _trailer_problems("\n".join(lines[change_at + 1 :]))
    @@ -361,10 +361,22 @@ def plan_body_problems(body: str, issue: int) -> list[str]:
         return problems
     
     
    -def _text_problems(text: str, measured: str, *, short_message: str | None = None) -> list[str]:
    -    """The problems of the text above `Closes` or `Plans`, and of the length of `measured`: the
    -    body up to the `Change:` line. `short_message` names the line that the text goes above. A text
    -    that ends with `...` is cut, and the caller writes the whole text."""
    +def measured_body_text(body: str, line: str) -> str:
    +    """The text of `body` above its first line that starts with `<line> #`, with its trailing blank
    +    lines removed, and the whole body when it has no such line: the part that the limit of
    +    `BODY_MAX_CHARS` characters measures (#6633)."""
    +    lines = body.splitlines()
    +    for index, text in enumerate(lines):
    +        if text.startswith(f"{line} #"):
    +            return "\n".join(lines[:index]).rstrip()
    +    return body.rstrip()
    +
    +
    +def _text_problems(text: str, *, line: str, short_message: str | None = None) -> list[str]:
    +    """The problems of the text above the line `line`, `Closes` or `Plans`, and of its length: the
    +    limit of `BODY_MAX_CHARS` characters measures that text, with its trailing blank lines
    +    removed. `short_message` names the line that the text goes above. A text that ends with `...`
    +    is cut, and the caller writes the whole text."""
         texts = MESSAGES.pr
         problems = []
         if _ATTRIBUTION.search(text):
    @@ -377,8 +389,9 @@ def _text_problems(text: str, measured: str, *, short_message: str | None = None
                     length=len(text.strip()), minimum=_BODY_TEXT_MIN_CHARS
                 )
             )
    -    if len(measured) > BODY_MAX_CHARS:
    -        problems.append(texts.form_body_long.format(length=len(measured), limit=BODY_MAX_CHARS))
    +    length = len(text.rstrip())
    +    if length > BODY_MAX_CHARS:
    +        problems.append(texts.form_body_long.format(line=line, length=length, limit=BODY_MAX_CHARS))
         if text.rstrip().endswith(_CUT_MARKS):
             problems.append(texts.form_body_cut)
         return problems
    @@ -447,9 +460,10 @@ def build_plan_body(*, why: str, issue: int, change: str) -> str:
     
     def plan_body_room(issue: int, change: str) -> int:
         """The most characters of a one-line `why` that `build_plan_body` takes for `issue` and the
    -    folder `change` (#6319): `BODY_MAX_CHARS` less the `Plans` line and the `Change:` line. A
    -    caller measures a text against it and asks for a shorter text, so nothing is cut."""
    -    return BODY_MAX_CHARS - len(_plan_lines(issue, change))
    +    folder `change` (#6319): the whole limit of `BODY_MAX_CHARS` characters, which measures the text
    +    above the line `Plans` and leaves the `Plans` and `Change:` lines out. A caller measures a text
    +    against it and asks for a shorter text, so nothing is cut."""
    +    return BODY_MAX_CHARS
     
     
     def _plan_lines(issue: int, change: str) -> str:
    diff --git a/tests/roadmap/stage/test_roadmap_stage_plan.py b/tests/roadmap/stage/test_roadmap_stage_plan.py
    index 97e3c5f30..3e2caed70 100644
    --- a/tests/roadmap/stage/test_roadmap_stage_plan.py
    +++ b/tests/roadmap/stage/test_roadmap_stage_plan.py
    @@ -36,6 +36,7 @@ from devops_cli.git.worktree_add import issue_holder, read_remote_heads
     from devops_cli.github.rate_limiter import get_github_rate_limiter
     from devops_cli.lang import MESSAGES
     from devops_cli.openspec.tool import isolated_openspec
    +from devops_cli.roadmap.pull_form import measured_body_text
     from devops_cli.roadmap.pull_retry import BODY_TASK, BodyReply
     from devops_cli.roadmap.stage.stage import (
         LeftOut,
    @@ -1304,9 +1305,10 @@ def _text(length: int) -> str:
     
     
     def _room(item: int) -> int:
    -    """The characters that the plan form leaves for the text of the body of item `item`: 1000,
    -    less the `Plans` line and the `Change:` line of the change folder."""
    -    return 1000 - len(f"\n\nPlans #{item}\n\nChange: `openspec/changes/{CHANGE}/`")
    +    """The characters that the plan form leaves for the text of the body of item `item`: the whole
    +    limit of 1000, because the `Plans` line and the `Change:` line of the change folder do not
    +    count (#6633)."""
    +    return 1000
     
     
     @pytest.mark.usefixtures("openspec")
    @@ -1345,7 +1347,7 @@ def test_a_body_that_fills_its_room_gets_no_rewrite(
         (change,) = plan.ready
         assert len(model_fake.calls) == 1
         assert change.body.startswith(f"{text}\n\nPlans #{item}\n")
    -    assert len(change.body) == 1000
    +    assert len(measured_body_text(change.body, "Plans")) == 1000
     
     
     @pytest.mark.usefixtures("openspec")
    diff --git a/tests/roadmap/steps/test_roadmap_step_open.py b/tests/roadmap/steps/test_roadmap_step_open.py
    index d87af3212..a5b87c056 100644
    --- a/tests/roadmap/steps/test_roadmap_step_open.py
    +++ b/tests/roadmap/steps/test_roadmap_step_open.py
    @@ -691,3 +691,16 @@ def test_a_body_that_breaks_the_keyword_rule_is_refused(
             open_or_update(request)
     
         assert [r for r in github_api.requested if r.startswith("POST")] == []
    +
    +
    +def test_a_draft_body_over_the_limit_above_closes_is_refused() -> None:
    +    """A draft body has no `Change:` line yet, and the limit measures the text above `Closes`, so
    +    the `Closes` line does not count (#6633)."""
    +    from devops_cli.roadmap.pull_form import BODY_MAX_CHARS, open_body_problems
    +
    +    at_limit = f"{'a' * BODY_MAX_CHARS}\n\nCloses #5020"
    +    over_limit = f"{'a' * (BODY_MAX_CHARS + 1)}\n\nCloses #5020"
    +
    +    assert open_body_problems(at_limit, issue=5020, plan=False) == []
    +    problems = open_body_problems(over_limit, issue=5020, plan=False)
    +    assert [f"has {BODY_MAX_CHARS + 1} characters" in problem for problem in problems] == [True]
    diff --git a/tests/roadmap/test_roadmap_plan_check.py b/tests/roadmap/test_roadmap_plan_check.py
    index 6ca3e058d..051f9350f 100644
    --- a/tests/roadmap/test_roadmap_plan_check.py
    +++ b/tests/roadmap/test_roadmap_plan_check.py
    @@ -507,7 +507,7 @@ def test_a_long_title_is_reported(stage_repo: StageRepo) -> None:
     
     def test_a_long_body_is_reported(stage_repo: StageRepo) -> None:
         sha = _push(stage_repo, _change())
    -    body = f"{BODY}\n\n{'text ' * 200}"
    +    body = f"{'text ' * 201}\n\n{BODY}"
     
         result = _run(stage_repo, _facts(stage_repo, sha=sha, body=body))
     
    diff --git a/tests/roadmap/test_roadmap_pull_form.py b/tests/roadmap/test_roadmap_pull_form.py
    index b037b479c..598307002 100644
    --- a/tests/roadmap/test_roadmap_pull_form.py
    +++ b/tests/roadmap/test_roadmap_pull_form.py
    @@ -24,6 +24,7 @@ from devops_cli.roadmap.pull_form import (
         build_plan_body,
         build_title,
         is_placeholder,
    +    measured_body_text,
         plan_body_problems,
         plan_body_room,
         summary_length,
    @@ -255,6 +256,38 @@ def test_a_body_over_the_limit_before_its_trailers_is_refused() -> None:
         assert [f"The limit is {BODY_MAX_CHARS}" in p for p in problems] == [True]
     
     
    +def _body_above_closes(text: str) -> str:
    +    """A delivery body whose text above `Closes` is `text`, and whose `Closes` and `Change:` lines
    +    add 120 characters (#6633)."""
    +    change = f"openspec/changes/3198-{'a' * 71}"
    +    body = f"{text}\n\nCloses #3198\n\nChange: `{change}/`"
    +    assert len(body) - len(text) == 120
    +    return body
    +
    +
    +def test_a_body_over_the_limit_above_closes_is_refused() -> None:
    +    """The limit measures the text above `Closes`: the `Closes` and `Change:` lines add 120
    +    characters, and they do not count (#6633)."""
    +    problems = body_problems(_body_above_closes("a" * (BODY_MAX_CHARS + 1)))
    +
    +    (problem,) = problems
    +    assert f"has {BODY_MAX_CHARS + 1} characters" in problem
    +    assert "Closes" in problem
    +
    +
    +def test_a_body_at_the_limit_above_closes_has_no_problem() -> None:
    +    assert body_problems(_body_above_closes("a" * BODY_MAX_CHARS)) == []
    +
    +
    +def test_the_docstring_of_the_body_check_names_the_text_above_closes() -> None:
    +    documented = body_problems.__doc__ or ""
    +
    +    assert ("above the line `Closes`" in documented, "trailing blank lines" in documented) == (
    +        True,
    +        True,
    +    )
    +
    +
     def test_the_trailers_do_not_count_toward_the_limit_of_the_body() -> None:
         body = f"{GOOD_BODY}\n\n" + "\n".join(ATTRIBUTION)
         assert len(body) > len(GOOD_BODY)
    @@ -449,18 +482,19 @@ def test_a_plan_text_that_closes_an_issue_is_refused() -> None:
     
     
     def test_a_plan_text_over_the_limit_is_refused_and_not_cut() -> None:
    -    with pytest.raises(ValidationError, match="Shorten the text above `Closes`"):
    +    with pytest.raises(ValidationError, match="Shorten the text above `Plans`"):
             build_plan_body(why="A reason that is long. " * 50, issue=3215, change=PLAN_CHANGE)
     
     
     def test_the_room_of_a_plan_text_is_the_text_that_the_plan_form_t

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

  11. added
    status/blocked
    and removed
    status/in-progress
    on Nov 21, 2026
  12. dan-petty commented on Nov 21, 2026

    @dan-petty
    OwnerAuthor

    implement: retry

  13. added
    status/ready
    and removed
    owner/service
    status/blocked
    on Nov 21, 2026
  14. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Cleared the stop at group 1 by the rule retry: a person commented implement: retry. The item is Ready again, and the Service takes it in the next round.

  15. removed
    status/ready
    on Nov 22, 2026
  16. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-22 02:54 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/p1-highscope/prsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions