Skip to content

fix(pr): Measure the body above its trailer lines - #6701

Merged
dan-petty merged 2 commits into
mainfrom
fix/6633-the-body-limit-counts-the-closes
Nov 22, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/6633-the-body-limit-counts-the-closes

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

The delivery body limit has two meanings in the code and in the text that a person reads. CONTRIBUTING.md:181:in at most 1,000 characters before the trailers and the message field form_body_long measure the text above Closes, and pull_form measures the Closes line, the empty lines and the Change: line as well, about 120 characters of a typical change folder. A body of 990 characters above Closes is therefore refused at ready, and the merges of #6625 and #6629 waited on that refusal. Issue #6633 asks for one meaning in the code, the message and the document, for the plan body, and for the plan check.

Closes #6633

Change: openspec/changes/archive/2026-11-22-6633-the-body-limit-counts-the-closes/

@devops-cli-service devops-cli-service Bot added type/docs Type docs: a change to the documents scope/openspec OpenSpec changes, specs and their checks labels Nov 21, 2026
@devops-cli-service
devops-cli-service Bot force-pushed the fix/6633-the-body-limit-counts-the-closes branch from 8f6aaef to 7eccdc1 Compare November 21, 2026 23:50
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

@devops-cli-service
devops-cli-service Bot marked this pull request as ready for review November 21, 2026 23:56
@dan-petty
dan-petty force-pushed the fix/6633-the-body-limit-counts-the-closes branch from 7eccdc1 to afe7c2a Compare November 22, 2026 01:36
@dan-petty dan-petty changed the title docs(openspec): plan #6633 Measure the body above its trailer lines fix(pr): Measure the body above its trailer lines Nov 22, 2026
@dan-petty
dan-petty merged commit ad63da9 into main Nov 22, 2026
31 of 32 checks passed
@dan-petty
dan-petty deleted the fix/6633-the-body-limit-counts-the-closes branch November 22, 2026 01:42
dan-petty pushed a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.191.1](v0.191.0...v0.191.1)
(2026-11-22)


### Bug Fixes

* **pr:** Measure the body above its trailer lines
([#6701](#6701))
([ad63da9](ad63da9))


### Performance Improvements

* **roadmap:** Cut review reads with a snapshot and counts
([#6716](#6716))
([df731a7](df731a7))


### Code Refactoring

* **roadmap:** fix-conflict runs on the phases
([#6709](#6709))
([6e497c2](6e497c2))
* **roadmap:** stage pushes the plan commit on the phases
([#6710](#6710))
([f075f16](f075f16)),
closes [#6704](#6704)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
@dan-petty

Copy link
Copy Markdown
Owner

Advisory post-merge review (automated; a person decides).

Recommendation: merge-after-minor-fixes. The change is correct and its tests prove it, but four minor items need one small follow-up pull request on main.

Findings

  1. Minor. src/devops_cli/commands/pr.py:1380. The text is generated into docs/commands/pr.md:236 and docs/commands/gh.md:1012.

    • Problem: The help text of devops pr create still says "a body of at most 1,000 characters". The code now measures only the text above Closes. Issue fix(pr): the body limit counts the Closes and Change lines #6633 asks for one meaning in the code, the message and the documents. AGENTS.md rule 8 applies.
    • Evidence: sed -n 1378,1381p at head afe7c2a shows "a body of at most 1,000 characters that ends with Closes # and the Change line". grep finds the same text in the two generated documents.
    • Fix: Write "a body whose text above Closes has at most 1,000 characters", then generate docs/commands/*.md again.
  2. Minor. src/devops_cli/roadmap/pull_form.py:55-56.

    • Problem: The comment on BODY_MAX_CHARS still gives the old meaning: "the text, the Closes line and the Change: line". The limit now measures only the text above Closes, or above Plans for a plan body. The diff does not touch this comment.
    • Evidence: sed -n 55,56p at head. Compare measured_body_text at pull_form.py:364-372 and _text_problems at pull_form.py:392.
    • Fix: Change the comment to name the text above Closes or Plans, with its trailing blank lines removed.
  3. Minor. src/devops_cli/roadmap/pull_form.py:259 (open_body_problems) and pull_form.py:367-372 (measured_body_text).

    • Problem: The open step and the ready check do not agree on a body that starts with a blank line. measured_body_text splits the raw body and removes only trailing whitespace. body_problems (pull_form.py:306) splits body.strip(). Thus a leading blank line counts at open, but not at ready. Before the change, both checks used body.strip(). The proposal says "so the open step and the ready check agree" (proposal.md:10).
    • Evidence: A probe at head (src only) with the body "\n" + "a"*1000 + "\n\nCloses #5020": open_body_problems reports "The text above Closes has 1001 characters". body_problems on the same body plus a Change: line reports no problem. The code at pull_form.py:368-371 agrees with this result.
    • Fix: Let measured_body_text split body.strip(), so that both checks measure the same text. Add a test with a leading blank line.
  4. Minor. tests/roadmap/stage/test_roadmap_stage_plan.py:39.

    • Problem: The module imports measured_body_text, a name that the fix adds, at the top level. On the base, the collection of the whole module fails. Thus fail-to-pass gives no result for each test in this module. Also, the new assertion at line 1350 uses the function under test to measure the result.
    • Evidence: The fail-to-pass output says "errored on base: tests.roadmap.stage.test_roadmap_stage_plan (collection failure)". The line from devops_cli.roadmap.pull_form import measured_body_text is at line 39. Line 1350 is assert len(measured_body_text(change.body, "Plans")) == 1000.
    • Fix: Assert on the known text (line 1349 already checks the start of the body), or import the module (from devops_cli.roadmap import pull_form).
  5. Nit. tests/roadmap/test_roadmap_pull_form.py:282-288.

    • Problem: test_the_docstring_of_the_body_check_names_the_text_above_closes asserts the words of the body_problems docstring. It does not assert behavior.
    • Evidence: documented = body_problems.__doc__ or "", then an assertion on two phrases.
    • Fix: Optional. The behavior tests at lines 267-279 already hold the rule.
  6. Nit. src/devops_cli/roadmap/pull_form.py:461-466 (plan_body_room).

    • Problem: The function returns BODY_MAX_CHARS and does not use its parameters issue and change. Its one caller, stage_change.py:3615, still computes the change path. The local room = BODY_MAX_CHARS lines in implement_phases.py:631, implement_run.py:1309 and open_row.py:196 are only aliases.
    • Evidence: sed -n 461,466p at head. grep "plan_body_room(" finds only stage_change.py:3615.
    • Fix: Optional. Remove the unused parameters, or let the callers read BODY_MAX_CHARS.
  7. Nit. openspec/changes/archive/2026-11-22-6633-the-body-limit-counts-the-closes/tasks.md.

    • Problem: The Group 5 criterion names body_form_problems, which does not exist. Task 5.2 repeats task 5.1.
    • Evidence: grep -rn body_form_problems src tests openspec/specs gives no result.
    • Fix: No action on this archive. The plan step must not name a symbol that it did not find.

A refute pass disproved one finding, and this report drops it. The finding said that the plan check now has no limit for text below the Plans line. The spec delta says that the limit measures only the text above Plans, and the delivery form measures only lines[:closes_at] in the same way. Thus this is the design, not a lost test case.

Checks that ran

  • Fidelity: issue fix(pr): the body limit counts the Closes and Change lines #6633 has 2 acceptance criteria, and the PR delivers both. Each of the 10 ticked tasks is done. No file changed outside the plan. The OpenSpec archive and the base specs agree with the deltas.
  • uv sync --locked in the review worktree: exit 0.
  • uv run devops ci test on the 5 changed test files: 402 passed. On 99 test files that use pull_form or the body messages: 3283 passed.
  • uv run devops ci fail-to-pass --base f075f16ce: 9 tests failed on the base and 1 module errored on the base (finding 4). All pass at head.
  • uv run ruff check and ruff format --check on the 11 changed Python files: pass. uv run mypy on the 6 changed src files: no issues.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: all rows pass. The worktree stays clean.
  • Check runs of head afe7c2a: Tests & Coverage, Static Analysis, Plan Check, Fail-to-Pass Check, Semantic PR title, CodeQL, Trivy and zizmor are success. One older Semantic PR title run failed, and a later run passed.
  • Title and body: Conventional Commit title of 48 characters, and the label scope/pr exists. The body has 620 characters above Closes, Closes #6633, then the Change: line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/openspec OpenSpec changes, specs and their checks type/docs Type docs: a change to the documents

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant