Skip to content

feat(roadmap): rewrite a merged plan and leave out one with no way forward #3556

Closed

Description

@dan-petty

Problem

#3492 adds devops roadmap plan-recheck. It reports each merged plan with one result and writes nothing. Figures are from 2026-11-05 on origin/main, with the reader of #3545 applied: 24 of 52 live folders have no Verification: line, 29 of 52 fail the plan reader, and the report shows rewrite for no folder. A plan with no Verification: line fails the reader, so it shows as new-plan.

The report cannot act. No command rewrites a plan, and no rule takes a plan with no way forward out of the queue. #3492 left both out, as its issue allows, because #3393 must merge first.

Expected

  • A mechanical rewrite adds a Verification: line to a group, changes a sample path to a bare name, and adds a design.md stub. A person reviews the result. plan-recheck --confirm writes it; without --confirm the command writes nothing.
  • plan-recheck applies the rewrite in memory and calls a plan rewrite only when the rewritten plan then passes the reader, check_proposal and openspec validate.
  • A plan with no way forward uses the left-out reason of fix(roadmap): the implement job refuses a plan that fails the plan check #3393 (not plan/needs-fix, which belongs to a plan pull request, stage_verify.py:56). devops roadmap explain names its first problem.

Acceptance criteria

  • A test compares the groups before and after a rewrite, and each new line passes read_verification.
  • A test: an item with no way forward leaves the queue, and devops roadmap explain names its first problem.
  • A test: a plan that the in-memory rewrite fixes shows as rewrite, and one that it does not fix shows as new-plan.

Existing tool considered

The project code read_change, parse_task_groups, read_verification, plan_recheck.recheck_plans and implement_amend.py (#3361). No outside tool rewrites an OpenSpec plan.

Dependencies

Related

Related: #3492, #3393, #3482

Proposed design

Problem statement

The plan-recheck report cannot act on a merged plan. This change adds a mechanical rewrite that adds a Verification: line, changes a sample path to a bare name, and adds a design.md stub. It reports rewrite only when the rewritten plan passes the reader and gates. It writes only with --confirm. It also leaves out a plan with no way forward with the reason from #3393, and devops roadmap explain names its first problem.

Acceptance criteria

Requirement: Rewrite preserves task groups

The mechanical rewrite SHALL preserve every task group and SHALL change only the lines that the rewrite rules name.

Scenario: Group comparison

  • WHEN A test parses a merged plan before and after the rewrite.
  • THEN Each task group has the same identity and order, and only the verification, sample-path and design-stub lines differ.

Requirement: Missing verification line

The mechanical rewrite SHALL add one Verification: line to each task group that has none.

Scenario: Group with no verification

  • WHEN A task group in a merged plan has no Verification: line.
  • THEN The rewritten group has one Verification: line, and read_verification accepts that line.

Requirement: Sample path to bare name

The mechanical rewrite SHALL change a sample path that a task group names to a bare name.

Scenario: Sample path with a directory

  • WHEN A task group names a sample path that contains a directory.
  • THEN The rewritten group names the same sample as a bare name and passes read_verification.

Requirement: Design stub

The mechanical rewrite SHALL add a design.md stub when a merged change folder has no design.md.

Scenario: Change folder without design

  • WHEN A merged plan has a change folder with no design.md.
  • THEN The rewrite creates design.md with the stub, and read_change accepts the folder.

Requirement: Dry run writes nothing

plan-recheck MUST write no file when --confirm is absent.

Scenario: Run without confirm

  • WHEN A user runs plan-recheck without --confirm on a merged plan that the rewrite changes.
  • THEN The command writes no file and reports the plan as rewrite.

Requirement: Confirm writes rewrite

plan-recheck --confirm SHALL write the rewritten plan.

Scenario: Run with confirm

  • WHEN A user runs plan-recheck --confirm on a merged plan that the rewrite changes.
  • THEN The command writes the rewritten plan and reports the plan as rewrite.

Requirement: Rewrite classification passes gates

plan-recheck SHALL report a plan as rewrite only when the in-memory rewritten plan passes read_change, check_proposal and openspec validate.

Scenario: Rewrite passes gates

  • WHEN The in-memory rewrite makes a merged plan pass read_change, check_proposal and openspec validate.
  • THEN The report shows the plan as rewrite.

Requirement: Rewrite classification fails gates

plan-recheck SHALL report a plan as new-plan when the in-memory rewritten plan does not pass all three gates.

Scenario: Rewrite fails a gate

  • WHEN The in-memory rewrite leaves a merged plan failing read_change, check_proposal or openspec validate.
  • THEN The report shows the plan as new-plan.

Requirement: No way forward leaves queue

A merged plan with no way forward SHALL leave the queue with the left-out reason from #3393 and MUST NOT use plan/needs-fix.

Scenario: Plan has no way forward

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers the need, and no outside tool rewrites an OpenSpec plan. The project builds the rewrite with its own code and reuses read_change, parse_task_groups, read_verification, plan_recheck.recheck_plans and implement_amend.py. The written cost is about 250k tokens to build, about 30k tokens per month to keep and fix, and about 2 days elapsed.

Key questions

  • Which parser should the rewrite use to find and change task groups?: Use parse_task_groups and re-parse after each change. Do not use a free-form line replacement. (best practice) [sources: src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/implement_amend.py, src/devops_cli/roadmap/implement_step.py]
    • Chosen: Parsed task groups. The project already reads groups with parse_task_groups, and a re-parse gives a before-and-after comparison.
    • Rejected: Line regex. It cannot keep group identity or prove that only the named lines changed.
    • Rejected: Model rewrite. The change is mechanical, and a model adds cost and nondeterminism.
  • When may the report call a plan rewrite?: Only after the in-memory rewrite passes read_change, check_proposal and openspec validate. (best practice) [sources: docs/roadmap/plan-recheck.md:14, src/devops_cli/roadmap/plan_check.py, src/devops_cli/roadmap/plan_recheck.py]
    • Chosen: Run all gates after the rewrite. The report names a result that a person can act on, so the rewritten plan must pass the same gates.
    • Rejected: Check syntax only. A plan can parse and still fail the stage gates.
    • Rejected: Report on an attempted rewrite. It would call a plan fixed when it is not.
  • Which reason should mark a plan with no way forward?: Use the left-out reason that fix(roadmap): the implement job refuses a plan that fails the plan check #3393 defines. Do not use plan/needs-fix, which belongs to a plan pull request. (best practice) [sources: src/devops_cli/roadmap/stage_verify.py:56, src/devops_cli/roadmap/plan_recheck.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3492, #3393

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 5, 2026
  2. dan-petty commented on Nov 5, 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/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It fills an action gap in an existing report but does not block a crash or a security issue.
    • Value: Medium. It makes the existing plan-recheck report actionable for the 24 folders missing a Verification line.
    • Effort: Medium. It needs a mechanical rewrite, a --confirm gate, an in-memory validation chain, and a leave-out reason with tests.
    • Related: feat(roadmap): one pass re-checks each merged plan against main #3492, which asks for a different change. Both work on the plan-recheck flow; #3492 delivers the report, the candidate adds the rewrite action and the leave-out rule.
  3. added
    priority/p2-medium
    on Nov 5, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 6, 2026
  5. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 6, 2026
  6. removed
    status/in-review
    on Nov 6, 2026
  7. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor
  8. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 19:47 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/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions