Skip to content

fix(roadmap): the plan reader reports each bad plan with no crash #3482

Closed

Description

@dan-petty

Problem

read_change raises a raw pydantic ValidationError for many plans, and devops roadmap plan-check then ends in a traceback with no problem list. openspec/specs/roadmap-plan-check/spec.md:123 says that the command reports the file and goes on.

  • src/devops_cli/roadmap/plan_read.py:372 calls _group before the try at :379.
  • A run over the 59 change folders at origin/main gives 24 read, 24 ValidationError and 11 PlanReadError. Of the 53 items that were Planned at 2026-11-04T15:06Z, 21 give ValidationError and 7 give PlanReadError.
  • In the window 2026-11-03T15:05Z to 2026-11-04T15:05Z, plan-check on PR 3322 and PR 3329 gives rc 1 and a pydantic error in stderr.

Today the crash reaches only the command (plan_check.py:437 is the only caller). The round is at risk when #3393 merges, because its design names only PlanReadError and GitOperationError. So this issue must merge before #3393.

The skip_specs line has more effect. openspec validate --strict --json gives rc 0 and one INFO issue: skip_specs is set in .openspec.yaml: change declares no spec-level behavior changes, zero deltas accepted. stage_validate.py counts every issue as a problem, and _settle (stage.py:906-908) returns _Refused on it. So the stage job refuses each skip_specs plan. This is inferred from a read of the code, and nobody ran the job. It fits #3368: Service commit 0eb6f3a has no skip_specs, and correction commit 5c28a20 adds it. 14 of the 59 folders set skip_specs, and #3429 would leave them out too.

The reader also judges too little. _task reads task.verification[0] (plan_read.py:273), and _group keeps the verify of the first task only, but the step runs every span of every task (step_files.py:84). So plan-check accepts the helm template span of #2441. verification_problem refuses 16 of 193 spans, in 3 folders (#2441, #2610, #3187).

Expected

The reader returns a problem for each form that it cannot read. validate_change exempts only the skip_specs message. Other INFO issues stay problems, because one can be a delta that openspec archive refuses. The reader judges each span of each task with verification_problem.

Sample paths are not part of this item. stage_paths.py:13-14 says that a word with no folder is no path, so a plan can write test_sample.py, and another mark is an escape. The stage prompt tells the planner to use a bare name. The 4 plans with sample paths (#3295, #3318, #3321, #3427) go to the rewrite of #3492.

Acceptance criteria

Existing tool considered

The existing PlanReadError and verification_problem, and pydantic.

Related

Related: #3393, #3429, #3417, #3449, #3321, #3295, #3318, #3427, #3368, #3492

Proposed design

Problem statement

The plan reader raises a raw pydantic ValidationError for many plans. The plan-check command then ends in a traceback and reports no problem list, contrary to the spec. The reader also treats every OpenSpec INFO issue as a problem, including skip_specs. It judges only the first verification span of the first task. The fix converts every bad plan form to PlanReadError, exempts only skip_specs, and checks every verification span.

Acceptance criteria

Requirement: Tree-wide read

read_change SHALL raise only PlanReadError when it reads every change folder in the tree.

Scenario: All change folders

  • WHEN the test runs read_change over each change folder in the tree
  • THEN no exception other than PlanReadError appears

Requirement: Reader normalizes plan errors

read_change SHALL raise PlanReadError with the change folder for every plan that it cannot read, and SHALL NOT let a pydantic ValidationError escape.

Scenario: Bad task group

  • WHEN read_change reads a change folder whose task group fails pydantic validation
  • THEN it raises PlanReadError that names the folder, and no ValidationError escapes

Requirement: Plan check reports a bad plan

devops roadmap plan-check SHALL report a read problem for each unreadable plan and SHALL exit 1 without a traceback.

Scenario: Plan check on #3187 and #3308 forms

Requirement: Read problem for PR 3322 and 3329

devops roadmap plan-check SHALL report a read problem for the plans of PR 3322 and PR 3329.

Scenario: Plan check on the two PR plans

  • WHEN plan-check runs on the recorded plans of PR 3322 and PR 3329
  • THEN each run reports a read problem and exits 1

Requirement: Existing problems remain

devops roadmap plan-check MUST still report the body-length and stage problems of #3350 and the stage problem of #3339.

Scenario: Regression plans

Requirement: Skip specs is exempt

validate_change SHALL report no problem for the skip_specs INFO message and SHALL keep every other OpenSpec INFO issue as a problem.

Scenario: Skip specs and delta INFO

  • WHEN validate_change reads a skip_specs change and a change with a delta INFO issue
  • THEN the first gives no problem and the second gives a problem

Requirement: Every verification span is judged

The plan reader SHALL apply verification_problem to every span of every task, not only the first task's first span.

Scenario: Refused later span

  • WHEN a later task has a verification span that verification_problem refuses
  • THEN the reader reports that span as a problem

Requirement: Stage prompt uses bare sample name

The stage prompt SHALL name a sample test file with a bare name and SHALL NOT present a path as a sample.

Scenario: Prompt sample file

  • WHEN the stage prompt shows a sample test file
  • THEN it uses a bare name such as test_sample.py

Existing Tool Considered

No alternatives check has run. The existing pydantic library covers schema validation but lacks a plan-specific problem list and raises a raw ValidationError. PlanReadError and verification_problem are project code, not external tools. The fix wraps pydantic and reuses verification_problem.

Key questions

  • Where should the reader convert a pydantic ValidationError into a PlanReadError?: At the boundary of read_change, before any validation call that can raise. The command must see only PlanReadError. (best practice) [sources: src/devops_cli/roadmap/plan_read.py:372, src/devops_cli/roadmap/plan_read.py:379, src/devops_cli/roadmap/plan_check.py:437]
    • Chosen: Catch in read_change around parsing and _group. The call at line 372 is outside the try at line 379. A boundary in read_change covers every plan form.
    • Rejected: Catch in plan_check only. The command is the only caller today, but fix(roadmap): the implement job refuses a plan that fails the plan check #3393 will use the reader, and the reader must own its error type.
    • Rejected: Catch only inside _group. A pydantic error can arise outside _group, and the group call itself is outside the try.
  • Should plan_check catch pydantic ValidationError directly?: No. The reader SHALL normalize it, and plan_check SHALL catch only PlanReadError and GitOperationError. (best practice) [sources: src/devops_cli/roadmap/plan_check.py:438, openspec/changes/3393-the-implement-job-refuses-a-plan/design.md:10]
  • Which OpenSpec INFO issues should validate_change exempt?: Only the skip_specs INFO message. All other INFO issues stay problems, because one can be a delta that openspec archive refuses. (best practice) [sources: src/devops_cli/roadmap/stage_validate.py, src/devops_cli/roadmap/stage.py:906-908, openspec/specs/roadmap-plan-check/spec.md:123]
    • Chosen: Exempt only skip_specs. A skip_specs plan is valid, but another INFO issue can make archive refuse the change.
    • Rejected: Exempt all INFO issues. A delta INFO issue can make openspec archive refuse the change.
    • Rejected: Exempt no INFO issue. The stage job refuses each valid skip_specs plan today.
  • Should the reader judge every verification span or only the first?: Every span of every task. step_files.py runs every span, so a later refused span must be a problem. (best practice) [sources: src/devops_cli/roadmap/plan_read.py:273, src/devops_cli/roadmap/step_files.py:84]
    • Chosen: Judge every span of every task. The step runs every span, so the reader must report each refused span.
    • Rejected: Judge the first span of the first task only. It accepts refused spans that the step runs.
  • Does this item handle sample paths in plans?: No. Sample-path parsing and rejection go to feat(roadmap): one pass re-checks each merged plan against main #3492. This item only changes the stage prompt to show a bare sample name. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py:13-14]
  • Does this item depend on fix(roadmap): the implement job refuses a plan that fails the plan check #3393?: No. This item must merge before fix(roadmap): the implement job refuses a plan that fails the plan check #3393, because fix(roadmap): the implement job refuses a plan that fails the plan check #3393 names only PlanReadError and GitOperationError. [sources: openspec/changes/3393-the-implement-job-refuses-a-plan/design.md:10, openspec/changes/3393-the-implement-job-refuses-a-plan/design.md:20]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/high
    effort/medium
    on Nov 4, 2026
  2. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P1-High. The command crashes on 45 percent of plans and must merge before 3393, blocking a dependent item.
    • Value: High. The plan-check command is unusable for 24 of 59 plans because it prints a traceback instead of a problem list.
    • Effort: Medium. The fix touches error handling in the reader, the validate_change exemption, and the verification span loop, plus tests.
    • Related: feat(roadmap): the stage context names the plan reader #3428, which asks for a different change. Both items work on read_change in plan_read.py, but 3428 names the reader in the stage context while this item fixes the reader's crash and span judgment.
  3. added
    priority/p1-high
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

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

  6. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.

    Evidence:

    placeholder

  7. added
    status/new
    and removed
    status/ready
    on Nov 4, 2026
  8. added
    owner/agent
    status/in-review
    and removed
    status/new
    on Nov 4, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 5, 2026
  10. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-05 01:03 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/p1-highscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions