Skip to content

fix(roadmap): an implement step commits an edit outside every numbered group #2779

Closed

Description

@dan-petty

Problem or Motivation

An implement step restores the text of its own group and the checkboxes of other groups in the tasks.md of its change (#2774, #2767). It does not check the lines outside every numbered group. A model can add or change a line before the first ## <n>. heading, and the step commits that line.

Proposed Solution

Compare the text outside all numbered groups with the text before the run, and write it back with the same raw lines as the group restore.

Acceptance Criteria

  • A line that the model adds or changes before the first numbered group does not reach the commit.
  • A tick of a task prints no extra line.

Proposed design

Problem statement

The implement step restores the text of its own task group and the checkboxes of other groups in tasks.md. It does not verify or restore lines that fall outside every numbered group. A model can add or change a line before the first ## . heading, and the step commits that line into the change.

Acceptance criteria

Requirement: Preamble lines are not committed

The implement step SHALL restore the text outside all numbered groups to its value before the step ran.

Scenario: Model adds a line before the first group heading

  • WHEN A model adds or changes a line before the first ## . heading during a step
  • THEN The committed tasks.md contains the original preamble text, not the model's edit

Requirement: Task tick produces no extra line

The implement step SHALL NOT print an extra line when it ticks a task checkbox.

Scenario: Ticking a task checkbox

  • WHEN The step ticks a task checkbox in tasks.md and writes the file back
  • THEN The output contains no extra line beyond the tick itself

Existing Tool Considered

No check has run. This is a fix to the project's own implement-step restore logic. No external tool or library covers this need because it is an internal bug in the step's file-restore function. The cost is the tokens to modify the restore function to capture and write back the preamble, plus the tokens to add a regression test.

Key questions

  • How does the step restore the preamble text?: Capture the raw lines outside all numbered groups before the step runs. After the step, replace the preamble in the modified file with the captured lines, using the same raw-line write-back mechanism that the group restore already uses. (proposed)
    • Chosen: Capture and restore raw preamble lines. The body's proposed solution. Reuses the existing group-restore write-back path. Minimal change.
    • Rejected: Reject the commit if the preamble changed. Would fail the step instead of silently restoring. Loses the model's valid work in the group. Not the behavior the body asks for.

Open questions

  • What constitutes 'text outside all numbered groups' in tasks.md? (missing verified source)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Oct 30, 2026
  2. dan-petty commented on Oct 30, 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: P2-Medium. A model can commit unintended lines, but it requires the model to edit outside groups, so it is not a guaranteed failure.
    • Value: Medium. It prevents incorrect commits of model-added lines, which protects repository integrity.
    • Effort: Low. The fix mirrors the existing group-restore logic and adds one comparison for text outside groups.
    • Related: fix(roadmap): a step that edits the text of its own task loses all its work #2774, which asks for a different change. Both fix the implement step's handling of tasks.md content, but #2774 protects task text within a group while the candidate protects text outside all groups.
  3. added
    priority/p2-medium
    on Oct 30, 2026
  4. devops-cli-service commented on Oct 30, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at d264e6e until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • What constitutes 'text outside all numbered groups' in tasks.md? (missing verified source)
  5. dan-petty commented on Oct 30, 2026

    @dan-petty
    OwnerAuthor

    PR #2792 (#2790) delivers this item, so no further change is needed.

    Evidence at 2e9552f4 on main:

    • _restore_tasks in src/devops_cli/roadmap/implement_step.py writes tasks.md back to its text from before the run. It keeps only the ticks of the step's own group. Every other edit is undone, including a line before the first numbered group.
    • tests/test_roadmap_implement_step_ticks.py, the case outside every group, adds the line The model was here. after # Tasks. The test asserts that the committed file equals the base text.
    • test_the_step_prints_one_line_that_names_the_change_it_restores checks that the restore prints one line, and a tick alone prints none.

    Closing as completed.

  6. removed
    status/new
    on Oct 30, 2026
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/lowpriority/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