Skip to content

fix(roadmap): plan-recheck rewrites unmarked verification commands #3967

Closed

Description

@dan-petty

Problem Description

The plan recheck rewrite appends a duplicate verification line instead of rewriting an existing line that lacks the command marker.

Pull request #3912 (#3596) established that verification commands in tasks.md must start with $ . Any code span without $ is treated as prose.

In src/devops_cli/roadmap/plan_rewrite.py, _verification checks group.verification_commands. When an existing plan contains verification commands without the $ prefix (such as - Verification: uv run devops ci ... passes), group.verification_commands returns an empty tuple.

Because group.verification_commands is empty, _verification does not skip the group. Instead, it generates a new command from Changes: and inserts a second Verification: line below task 0. The original unmarked line remains. The resulting task has two verification lines, and later tasks still have unmarked commands.

Reproduction Steps

  1. Create a tasks.md where tasks have - Verification: uv run devops ci test tests/... fails on the base without the $ mark.
  2. Run devops roadmap plan-recheck --confirm on the change.
  3. Inspect tasks.md.
  4. Observe that task 1 now has two Verification: lines, and subsequent tasks remain unmarked.

Expected vs Actual Behavior

Expected: plan_rewrite.py inspects existing Verification: lines. If a line holds a code span without $ , it updates that line to prepend $ .
Actual: plan_rewrite.py appends a second Verification: line and leaves the other tasks unmarked.

Proposed Solution

In src/devops_cli/roadmap/plan_rewrite.py, add a rewrite rule for existing Verification: lines:
Scan lines of the group for - Verification: and check code spans. If the command code span lacks $ , rewrite the span to prepend $ .

Target Subsystem

Roadmap Automation & Planning

Proposed design

Problem statement

The plan recheck appends a duplicate Verification: line when tasks.md holds a verification command without the $ marker. The rewrite must mark the existing command in place. It must not add a second line or leave later tasks unmarked.

Acceptance criteria

Requirement: Mark existing verification commands

The plan rewrite SHALL prepend $ to the code span of each existing Verification: line that lacks the marker.

Scenario: Unmarked verification line is rewritten

  • WHEN A task group has - Verification: uv run devops ci test tests/test_x.py passes.
  • THEN devops roadmap plan-recheck --confirm writes - Verification: $ uv run devops ci test tests/test_x.py passes and adds no second Verification: line.

Requirement: Mark all unmarked verification lines

The rewrite MUST mark every existing Verification: line without $ in all task groups of the change.

Scenario: Several unmarked lines are rewritten

  • WHEN tasks.md has two task groups, and each group has a Verification: line without $ .
  • THEN devops roadmap plan-recheck --confirm prepends $ to both code spans and leaves no unmarked Verification: line.

Requirement: Keep marked verification commands

The rewrite SHALL leave an existing Verification: line that already starts its code span with $ unchanged.

Scenario: Marked verification line is not changed

  • WHEN A task group has - Verification: $ uv run devops ci test tests/test_x.py passes.
  • THEN The rewrite leaves the code span and the surrounding text on that line unchanged.

Requirement: Do not duplicate a verification line

The rewrite MUST NOT add a generated Verification: line to a task group that has an existing Verification: line after the marking pass.

Scenario: Existing line prevents a generated duplicate

  • WHEN A task group has one Verification: line without $ and a Changes: line that names a test file.
  • THEN The rewritten task group has exactly one Verification: line.

Requirement: Change only verification code spans

The rewrite SHALL change only the command code span on an existing Verification: line when it adds the $ marker.

Scenario: Other code spans stay unchanged

  • WHEN A task group has a non-verification code span without $ and a Verification: line without $ .
  • THEN The rewrite marks only the command code span and leaves the non-verification code span as it was.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this repository-specific rewrite of tasks.md. The change edits existing code in src/devops_cli/roadmap/plan_rewrite.py; it adds no dependency. The cost is one small edit to _verification and its tests.

Key questions

  • What marks a verification command in tasks.md?: A code span on a Verification: line that starts with $ . [sources: src/devops_cli/roadmap/plan_rewrite.py]
  • How should the rewrite handle an existing Verification: line without the $ marker?: Rewrite the line in place before _verification checks group.verification_commands. Prepend $ to the command code span. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py:138, src/devops_cli/roadmap/plan_rewrite.py:172]
    • Chosen: Rewrite the existing line in place. It fixes the root cause and prevents a duplicate line.
    • Rejected: Skip groups that have any Verification: line. It leaves the command unmarked, so Plan Check still fails.
    • Rejected: Keep appending a generated line. It creates two lines and leaves later tasks unmarked.
  • How should _verification avoid a duplicate after the marking pass?: Skip a group when its lines contain an existing Verification: line, not only when group.verification_commands is non-empty. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py:138]
    • Chosen: Check the group lines for Verification:. It catches a line that the marking pass just fixed.
    • Rejected: Keep checking group.verification_commands. The parsed group still holds the old empty tuple, so a duplicate line is added.
    • Rejected: Track marked groups separately. It adds state that the line check gives for free.
  • Which code span on an unmarked Verification: line should get the $ marker?: The first code span on the line, which holds the command. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py]
    • Chosen: Mark the first code span. The verification template puts the command in the first code span.
    • Rejected: Mark every code span. It can mark a path or an example that is not the command.
    • Rejected: Mark the last code span. It can miss the command when the line has more than one span.
  • Should the rewrite preserve the rest of an existing Verification: line?: Yes. Change only the command code span and keep the surrounding prose. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py]
    • Chosen: Edit only the command code span. It keeps the group-specific wording and makes the smallest change.
    • Rejected: Regenerate the whole line. It loses the original wording and can change a person's text.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-09: none.
Tool: none found.

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    on Nov 7, 2026
  2. added
    status/new
    value/medium
    effort/medium
    on Nov 7, 2026
  3. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

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

    • Priority: P2-Medium. The bug corrupts rewritten plans with duplicate Verification lines and leaves other tasks unmarked.
    • Value: Medium. The fix makes plan-recheck rewrite existing verification commands correctly for roadmap users.
    • Effort: Medium. The fix needs a scan of Verification lines, code-span updates and tests.
    • Related: feat(roadmap): rewrite a merged plan and leave out one with no way forward #3556, which asks for a different change. Both items concern plan-recheck rewriting of plans, but #3556 adds the rewrite and the candidate fixes unmarked Verification lines.
  4. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Pull request #3951 shows this defect. The pull request contains tasks.md with verification commands that lack the $ prefix. The CI job Plan Check failed with:

    The group 'Add the Loki ruler rule and its Alertmanager path' has the kind other, and it has neither verify nor process. Give it the command or the steps that prove it.
    

    Because plan_rewrite.py skips groups that already contain a Verification: line, devops roadmap plan-recheck --confirm could not repair the plan. Adding the $ prefix to each verification command code span in PR #3951 resolved the failure and made all CI checks pass.

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

    @devops-cli-service
    Contributor

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

  7. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Searches for a tool that rewrites or normalizes code spans in Markdown files returned only generic Markdown and shell-style documentation, with no open tool or library that inspects Verification: lines in this repository's tasks.md and prepends $ . The need is a repository-specific rewrite inside src/devops_cli/roadmap/plan_rewrite.py, and none of the project ADRs names or rejects such a tool.

    Tool: none found

    Lacks:

    • No tool parses - Verification: lines in the project's tasks.md format
    • No tool prepends the $ marker to the command code span of an existing verification line
    • No tool prevents the duplicate Verification: line generated from Changes:
    • No tool marks unmarked verification lines across all task groups of a change

    Searches run:

    • python library normalize markdown inline code spans in file, results: 5
    • tool that rewrites markdown task lists verification command code spans, results: 5
    • markdownlint rule shell command prompt prefix in code span, results: 5

    Sources:

    Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.

  8. added
    owner/agent
    on Nov 17, 2026
  9. removed
    status/ready
    owner/agent
    on Nov 17, 2026
  10. devops-cli-service commented on Nov 17, 2026

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

    @devops-cli-service
    Contributor

    Live since 2026-11-17 06:41 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/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions