Skip to content

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

Closed

Description

@dan-petty

Problem

In the 24 hours to 2026-11-18, 5 of 20 graded stage runs failed with class parser (StructuredOutputValidationError). Three of them come from the schema of the plan reply, not from a bad plan:

The other two (#4075, #4113) come from the kind rule of #6207 and are tracked on #6214.

Expected behavior

  • No length limit in the reply schema fails a stage item. The pull request body still meets the form of devops pr create (1000 characters before the trailers), but the stage builds it so that a long answer does not stop the job, for example by keeping the full text in the proposal and giving the body a summary that the stage writes or shortens with a later model turn. No text is dropped from the plan.
  • A missing or null optional text field reads as its default; a value of the wrong type is returned to the model once with the problem, not a job failure on the first read.
  • A test shows a reply whose body is over the limit and a reply with security: null; both stage the item.

Related

Alternatives check of 2026-11-18: in-use.
The repository already uses this tool.
Tool: pydantic/pydantic (https://github.com/pydantic/pydantic), MIT, last activity 2026-11-18, maintained.
Reason: Searches found no tool for the pull request body summary, but Pydantic, already the project's schema dependency, covers the validation part: dropping max_length and a mode="before" validator map a null optional text to its default.

Covers:

  • Schema field without a hard max_length cap
  • mode="before" validator maps null to default string
  • ValidationError on a wrong-typed value, returned to the model

Lacks:

  • No pull request body summary or shortening
  • No check of the 1000-character pull form limit
  • No store of the full plan text in the change folder

Proposed design

Problem statement

The stage job fails with class parser (StructuredOutputValidationError) when a plan reply breaks a schema limit that is not a plan defect. A pull request body over 800 characters fails #3915 and #4012, and a null security field fails #4129. The stage job must stage both replies and keep the full plan text. It writes a pull request body under the devops pr create limit. It reads a null optional text as its default, and it gives a wrong-typed value back to the model once.

Acceptance criteria

Requirement: No maximum length on the pull request body

The stage reply schema SHALL hold no maximum length on the pull_request_body field.

Scenario: A 1200-character body passes validation

  • WHEN a test builds a StageProposal whose pull_request_body holds 1200 characters
  • THEN constructing the proposal raises no ValidationError.

Requirement: The body meets the pull form and keeps the plan text

The stage MUST write a pull request body of at most 1000 characters before the trailers.

Scenario: A 1200-character body gives a short body

  • WHEN a test renders the pull request body of a change whose pull_request_body holds 1200 characters
  • THEN the body holds at most 1000 characters before the trailers, and the proposal still holds the full 1200-character text.

Requirement: A null optional text reads as its default

The stage reply schema SHALL read a null optional text field as its default empty string.

Scenario: A null security passes validation

  • WHEN a test builds a StageProposal from a reply that holds security: null
  • THEN the proposal holds security == "" and raises no ValidationError.

Requirement: A wrong-typed value returns to the model once

The stage job MUST give a reply with a wrong-typed optional text back to the model once with the problem.

Scenario: A wrong-typed security is retried

  • WHEN a test gives a reply with security: 123 to the stage reply reader
  • THEN the reply read gives a parser failure whose message names security and that the job retries once.

Requirement: A test covers a long body and a null security

The change MUST add a test that stages a reply with a long pull request body and a reply with security: null.

Scenario: Both replies stage in the test

  • WHEN uv run pytest tests/roadmap/stage/test_roadmap_stage_constants.py runs
  • THEN the test parses the reply with a 1200-character body and the reply with security: null, builds their pull request body, and passes.

Existing Tool Considered

Pydantic (https://github.com/pydantic/pydantic, MIT, maintained, last activity 2026-11-18). The alternates check in the issue body gives the verdict in-use: the repository already uses the tool. That block lists what the tool covers and lacks. The stage uses Pydantic for the schema change and for the ValidationError that it gives back to the model. The tool lacks the pull request body summary, the check of the 1000-character pull form limit and the store of the full plan text. The stage builds those parts. Cost to build, keep and fix that code: about 1k tokens and about 1 hour.

Key questions

  • Should the reply schema keep the 800-character cap on pull_request_body?: No. The stage drops the cap from the schema and keeps the full text in the proposal. It writes a body of at most 1000 characters before the trailers. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:130, src/devops_cli/roadmap/pull_form.py:57]
    • Rejected: Keep the 800-character cap. It fails a stage item on a plan that is not bad, and the owner rule of 2026-11-17 forbids a hard character cap.
    • Chosen: Drop the cap and limit the body. The body stays under the pull form limit, and no plan text is lost.
  • How does the stage keep the pull request body under the pull form limit without dropping plan text?: The stage keeps the full text in the proposal. The body render writes a body of at most 1000 characters before the trailers. (best practice) [sources: src/devops_cli/roadmap/pull_form.py, src/devops_cli/roadmap/stage/stage_change.py]
    • Rejected: Truncate the body. It drops text from the plan, which the issue forbids.
    • Rejected: Raise the devops pr create limit. The limit is the form of the command, not a stage setting.
    • Chosen: Keep the full text and limit the body. The body meets the pull form, and the proposal keeps every word.
  • How does the schema read a null optional text and a wrong-typed value?: A field_validator(mode="before") maps a null optional text to the empty string. A wrong type still fails validation, and the stage gives the problem to the model once. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]
    • Chosen: field_validator(mode="before") maps null. It runs before type coercion, and the tool documents the mode.
    • Rejected: Optional[str] = None. The render code expects a string, so a null reaches the change files.
    • Rejected: Catch the error and stop the item. The issue asks for one return to the model, not a stop.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    on Nov 18, 2026
  2. dan-petty commented on Nov 18, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P0-Critical. Five of twenty graded stage runs failed with StructuredOutputValidationError, which is a service job failure.
    • Related: fix(roadmap): a long item title gets short before a job needs it #3486, which asks for a different change. Both address a text-length limit in the roadmap stage that blocks a job, but #3486 covers item titles over 60 chars while the candidate covers the reply body over 800 chars and a type-validation failure.
  3. added
    effort/medium
    value/high
    priority/p0-critical
    on Nov 18, 2026
  4. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.

  5. devops-cli-service commented on Nov 18, 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 (8)

    Tools considered:

    Searches run:

    • pydantic field_validator mode before null default empty string, results: 5
    • python library summarize long text into short pull request body, results: 5
    • pydantic v2 validators before mode documentation, results: 5
    • pydantic github repository, results: 5
    • pydantic, results: 5
    • python text truncation library, results: 5
    • sumy text summarization library python, results: 5
    • pydantic remove max_length string validation error, results: 5

    Sources:

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

    @devops-cli-service
    Contributor

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

  8. added
    owner/service
    and removed
    owner/service
    on Nov 18, 2026
  9. added
    owner/agent
    on Nov 19, 2026
  10. added
    status/in-progress
    and removed
    status/ready
    on Nov 19, 2026
  11. added a commit that references this issue on Nov 19, 2026
  12. added
    status/in-review
    and removed
    status/in-progress
    on Nov 19, 2026
  13. removed
    status/in-review
    owner/agent
    on Nov 19, 2026
  14. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor
  15. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-19 11:42 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/mediumpriority/p0-criticalscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions