Skip to content

fix(roadmap): Stage a long plan body and a null optional text - #6351

Merged
dan-petty merged 6 commits into
mainfrom
fix/6319-stage-reply-schema-limits
Nov 19, 2026
Merged

dan-petty merged 6 commits into
mainfrom
fix/6319-stage-reply-schema-limits

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

The plan reply schema refused a pull_request_body over 800 characters and a null security, so the stage job failed items with the class parser on a plan with no defect (#3915, #4012, #4129). The schema now holds no length limit on the body. When the body text is longer than its room in the plan form (pull_form.plan_body_room), the stage job asks the model once for a shorter text with the existing body rewrite (BodyReply) and builds the draft body from it. The job keeps that text for each long text of the item, and a closing keyword in it stops the item. The proposal keeps the full text, and the plan reader does not cut why at 800 characters. A null security and a null reference kind read as the empty default; a value of another type still goes back to the model once. The stage planner prompt does not change.

Closes #6319

Change: openspec/changes/archive/2026-11-19-6319-stage-reply-schema-limits/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 19, 2026
@dan-petty

dan-petty commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner Author

Test record

Head edf9ef38b, rebased on origin/main at 5e6822d05.

  • uv run devops ci test on tests/roadmap/stage/ (110 files), test_roadmap_pull_form.py, test_roadmap_pull_retry.py, test_roadmap_plan_read.py, test_roadmap_plan_check.py, implement/test_roadmap_implement_body_retry.py, steps/test_roadmap_step_open.py, commands/test_pr_describe.py, test_roadmap_limit_classes.py: 3440 passed, 1 skipped.
  • After the rebase onto 5e6822d05 (which merged fix(roadmap): Tell the stage planner what counts as source code #6335 and changed the stage prompt): the changed test files and test_roadmap_stage_kind.py: 524 passed.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: all rows pass.
  • uv run mypy on the 5 changed source files: no issues.
  • uv run devops docs generate --check: up to date.

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main:

errored on base: tests.roadmap.stage.test_roadmap_stage_plan (collection failure)
errored on base: tests.roadmap.test_roadmap_pull_form (collection failure)
failed on base: tests.roadmap.stage.test_roadmap_stage_prompt_rules::test_a_body_over_the_limit_of_the_prompt_passes_the_schema (pydantic_core._pydantic_core.ValidationError: 1 validation error for StageProposal)
failed on base: tests.roadmap.stage.test_roadmap_stage_prompt_rules::test_the_body_of_the_plan_fits_the_body_limit_of_the_contributing_guide (AttributeError: 'str' object has no attribute 'pull_request_body')
failed on base: tests.roadmap.stage.test_roadmap_stage_plan_check::test_the_check_before_the_push_refuses_the_plan_of_5407_as_the_ci_check_did (AttributeError: 'str' object has no attribute 'pull_request_body')
failed on base: tests.roadmap.stage.test_roadmap_stage_plan_check::test_the_check_before_the_push_judges_no_open_dependency (AttributeError: 'str' object has no attribute 'pull_request_body')
4 failed on base (4 failed and 153 passed in 4 files; 2 errored).

The two collection failures on base come from the new names BODY_TASK and plan_body_room. With a temporary alias for BODY_TASK on the unfixed code, the new stage tests failed for the right reason: the three body tests with ValidationError of the 800 cap, the null security test with no staged item, and the null kind test with ValidationError. test_a_number_as_security_goes_back_to_the_model_once_with_the_field passed on base: the return-once path already exists, and the test holds it.

Notes

  • The stage planner prompt roadmap_stage_change.md does not change, so no live stage eval is necessary. It still asks for at most 800 characters, and a test holds that a body of that length fits the plan form with the longest number and slug, so a body that keeps to the prompt gets no rewrite turn.
  • No live step is necessary.

Checks that this change does not touch

Service Image, Runner Image and MCP Server Image fail on the Trivy scan: CVE-2026-97054 (HIGH) in the Go stdlib v1.27.3 of the pinned gh v2.103.3 binary. This change touches no image file, and these jobs are not required checks. Filed as #6352.

…eyword

The stage job keeps the shorter text of each long body text of the item, so
a reply with the same text makes no second rewrite call. A closing keyword in
the shorter text stops the item, as a closing keyword in the reply does. The
plan reader gives the whole `why` as the body text of a read plan, because
the reply schema holds no limit on its length now. Step 4 of the stage page
tells the rewrite turn.
@dan-petty
dan-petty force-pushed the fix/6319-stage-reply-schema-limits branch from edf9ef3 to a92e3d4 Compare November 19, 2026 03:11
@dan-petty

Copy link
Copy Markdown
Owner Author

Review findings of head edf9ef3: how this push handles them

Head of this push: a92e3d453 (fix commit 1dcb5bfbf, then the archive commit as the last commit).

  1. docs/roadmap/stage.md step 4 does not tell the rewrite turn (minor). Confirmed: step 4 told only that a body that breaks the plan form goes back to the model. Fixed: step 4 now tells that the reply schema holds no limit on the body text, that a text over its room gets a shorter text from one turn of the body rewrite (BodyReply of pull_retry), that the proposal keeps the full text, that the job keeps the shorter text of each long text, that a closing keyword in the shorter text stops the item, and that a refused shorter text goes back to the planner.
  2. _READ_BODY_CHARS = 800 of plan_read.py cuts why (minor). Confirmed: git log -S shows that the cut came with the schema cap (feat(roadmap): add the plan-check command #3425, then fix(roadmap): write and read the kind of each plan task group #5262), and this change removes that cap. Fixed at the cause: read_change and file_facts give the whole why as pull_request_body, and the constant goes. A read plan with a long why now gets the shorter text from the rewrite turn of _plan_body, as a model reply does. The round-trip contract read_change(render_change(p)) == file_facts(p) stays, because both sides changed together. Test first: test_a_read_plan_keeps_a_long_why_as_its_body_text.
  3. The shorter text skips the closing-keyword check (minor). Confirmed: closing_keyword_in ran only on the reply text before the rewrite. Fixed: _stop_on_closing_keyword checks the reply text and then the shorter text that the draft body uses, so a closing keyword in either stops the item with stage_closing. Test first: test_a_shorter_text_with_a_closing_keyword_stops_the_item (on the old head the item went back to the planner and was staged).
  4. Each _settle of the same long body makes a new rewrite call (minor). Confirmed: _plan_body called self._ask(BodyReply, ...) on each settle. Fixed: _Planner._shorter keeps the shorter text of each long text of the item in hand (cleared in _start_item), so a reply with the same text makes no second model call. Test first: test_the_same_long_body_gets_one_rewrite_turn (a failed openspec validate sends back a reply with the same 1200-character body; the model gets 3 requests, and only the second is a rewrite).

Spec and plan: the change folder and the main spec roadmap-stage/replies get the requirement "The shorter text of a long body is asked once and checked" with the two scenarios above. The proposal and the tasks (group 3) of the change tell the fixes. openspec validate --strict passes on the change and on all specs.

Test record

  • uv run devops ci test src/devops_cli/roadmap/stage/stage.py src/devops_cli/roadmap/plan_read.py: 1809 passed, 1 skipped.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: all pass.
  • uv run mypy src/devops_cli/roadmap/stage/stage.py src/devops_cli/roadmap/plan_read.py: no issues.
  • The rebase on origin/main (29e3a0370) touched no file of this change.

uv run devops ci fail-to-pass --base edf9ef38b

failed on base: tests.roadmap.stage.test_roadmap_stage_plan::test_the_same_long_body_gets_one_rewrite_turn (ValueError: not enough values to unpack (expected 1, got 0))
failed on base: tests.roadmap.stage.test_roadmap_stage_plan::test_a_shorter_text_with_a_closing_keyword_stops_the_item (ValueError: not enough values to unpack (expected 1, got 0))
failed on base: tests.roadmap.test_roadmap_plan_read::test_a_read_plan_keeps_a_long_why_as_its_body_text (AssertionError: assert 'The job keep...eps each fact' == 'The job keep... of the plan.')
3 failed on base (3 failed and 297 passed in tests/roadmap/stage/test_roadmap_stage_plan.py, tests/roadmap/test_roadmap_plan_read.py; 0 errored).

@dan-petty
dan-petty marked this pull request as ready for review November 19, 2026 05:07
@dan-petty
dan-petty merged commit 053aabc into main Nov 19, 2026
25 checks passed
@dan-petty
dan-petty deleted the fix/6319-stage-reply-schema-limits branch November 19, 2026 11:12
dan-petty-release Bot added a commit that referenced this pull request Nov 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.179.5](v0.179.4...v0.179.5)
(2026-11-19)


### Bug Fixes

* **ai:** bound the number of prewarm model label values
([#6391](#6391))
([e3fa4f1](e3fa4f1))
* **ci:** count a changed test that errors on base as proof
([#6379](#6379))
([6881b4c](6881b4c))
* **deps:** update Helm release argo-cd to v10.18.2
([#6398](#6398))
([2604ace](2604ace))
* **infra:** Fix the offline separator of a comma limit
([#6387](#6387))
([98493e4](98493e4))
* **roadmap:** Name the cause of a stopped verification run
([#6333](#6333))
([bbf308d](bbf308d))
* **roadmap:** Stage a long plan body and a null optional text
([#6351](#6351))
([053aabc](053aabc))
* **telemetry:** Keep the age metrics' reads across pods
([#6326](#6326))
([ad0ee60](ad0ee60))


### Code Refactoring

* **ai:** rank the benchmark with numpy and pytrec-eval
([#6388](#6388))
([051217e](051217e))

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): A schema limit of the plan reply never fails a stage item

1 participant