Skip to content

fix(roadmap): the job owns the ticks and the strays of a step #3488

Closed

Description

@dan-petty

Problem

A step fails when the model does not tick a task, also when its last exit checks pass. All the work of the step is then lost. A fix step also keeps stray files. This hurts the implement job, which spends the tokens again.

Not-ticked stops in the window 2026-11-03T15:05Z to 2026-11-04T15:05Z, with 8.49M input tokens in the stopped groups:

_attempt reads _unticked_failure only when failure is None (implement_step.py:1415), so the last exit checks passed in all 3 stops. #2116 and #3106 have no Verification: line, so those checks ran no plan command. Each stop spent 3 fix rounds, but roadmap_implement_step.md:25 says one more turn. _restore_tasks already rewrites tasks.md, so the job can write the ticks.

Strays: _remove_strays returns at once for a fix step (implement_step.py:1079). The #3394 fix row names test_issue_reproduction.py in uv run ruff check, and its log shows git reset and git rm --cached on that file. The function lists git ls-files --others, and that list excludes a file in the index. The agent ran git add . on #2462, #2554 and #2636. The job's _stage (implement_step.py:1102) also stages files before a repair round.

Expected

The job ticks a group when its exit checks and verification commands pass. A plan rule states what happens to a group with no verification command. The fix step removes strays as a group step does: a new file outside src/, tests/, docs/ and openspec/ goes. A stray that the agent staged goes too.

The job tick follows the test-form check of #3451, which keeps a task unticked when the test form is wrong. The plan-conformance scenario of #3049 reads unticked tasks, so it must read the ticks of the job.

The archive is not part of this issue. #3358 owns the rule for plan paths under openspec/.

Acceptance criteria

  • A test: a group with passing checks and no tick from the model is ticked by the job and pushed.
  • A test: a group with no verification command and a passing exit check follows the stated rule.
  • A test: a task that the form check of fix(roadmap): the implement job checks the test form that a task names #3451 refuses stays unticked when that check exists.
  • A test on roadmap_implement_step.md: the prompt no longer asks for ticks or says one more turn.
  • A test: a stray file in a fix step is removed.
  • A test: a stray file that the agent staged is removed, in a group step and in a fix step.
  • A test: a new test file under tests/ stays in a fix step.

Existing tool considered

Project code covers the need: _restore_tasks, _ticked_lines, _unticked_failure, _remove_strays and stray_files (implement_strays.py:38). Git covers the list of staged files: git diff --cached --name-only --diff-filter=A.

Related

Related: #3053, #3098, #3049, #3358, #3451

Proposed design

Problem statement

A step stops when the model does not tick a task, even when its last exit checks pass. The stop loses all the work of the step and spends the tokens again. A fix step also keeps stray files, including files that the agent staged. The job must write the ticks and remove the strays.

Acceptance criteria

Requirement: Job ticks a passing group

The job SHALL tick every task in a group whose exit checks and verification commands pass, even when the model wrote no tick.

Scenario: A passing group with no model tick

  • WHEN The step runs a group whose exit checks and verification commands pass, and tasks.md has no tick for the group.
  • THEN The job writes the ticks to tasks.md, stages the file, and the push contains the ticked tasks.

Requirement: Group with no verification command

The job SHALL tick a group that has no verification command when its exit checks pass, and the plan rule SHALL state this behavior.

Scenario: A group with no verification command

  • WHEN The step runs a group with no Verification: line, and its exit checks pass.
  • THEN The job ticks the group and pushes the tick, and the plan rule states that a group with no verification command is ticked when its exit checks pass.

Requirement: Test-form check refuses a task

The job SHALL NOT tick a task that the test-form check of #3451 refuses.

Scenario: A refused task in a passing group

Requirement: Prompt owns no ticks

The implement-step prompt SHALL NOT ask the model to tick tasks and SHALL NOT say one more turn.

Scenario: Prompt text

  • WHEN A test reads roadmap_implement_step.md.
  • THEN The text contains no request to tick tasks and no one more turn.

Requirement: Fix step removes a stray

A fix step SHALL remove a stray file that a group step removes.

Scenario: A stray file in a fix step

  • WHEN A fix step leaves a new file outside src/, tests/, docs/ and openspec/.
  • THEN The step deletes the file before it stages the commit.

Requirement: Staged stray is removed

A group step and a fix step SHALL remove a stray file that the agent staged.

Scenario: A staged stray file

  • WHEN The agent stages a new file outside the allowed directories with git add.
  • THEN The step unstages and deletes the file in both a group step and a fix step.

Requirement: New test file stays

A fix step SHALL keep a new test file under tests/.

Scenario: A new test file in a fix step

  • WHEN A fix step creates a new file under tests/.
  • THEN The step keeps the file and stages it.

Requirement: Plan-conformance reads job ticks

The plan-conformance scenario SHALL read the ticks that the job writes.

Scenario: Plan-conformance scenario text

  • WHEN A test reads the plan-conformance scenario of the roadmap-implement-step spec.
  • THEN The scenario refers to the ticks of the job, not to unticked tasks or the model's ticks.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers the tick and stray rules: they are specific to this repository's implement step. Project code covers the need: _restore_tasks, _ticked_lines, _unticked_failure, _remove_strays and stray_files in implement_strays.py:38. Git covers the list of staged files with git diff --cached --name-only --diff-filter=A. The change extends these functions and builds no new tool.

Key questions

  • What happens to a group with no verification command?: The job ticks the group when its exit checks pass. No plan command exists to fail. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:1415, openspec/changes/archive/2026-10-30-2804-step-keeps-existing-tests/proposal.md:36]
    • Chosen: Tick when the exit checks pass. Keeps the work, and the exit checks still run.
    • Rejected: Leave the group unticked and stop. Loses the work and does not fix the stop.
    • Rejected: Refuse the plan at staging. A staging rule is outside this issue and does not fix a delivered plan.
  • Which checks gate the job's tick?: The tick runs after the head, no-change, format, verification, ruff and mypy checks pass. It also respects the test-form check when it exists. (best practice) [sources: openspec/changes/archive/2026-10-30-2804-step-keeps-existing-tests/proposal.md:36, src/devops_cli/roadmap/implement_step.py:1415]
    • Chosen: After all exit checks and verification pass. The tick records work that the step already judged.
    • Rejected: After verification only. Ignores the format and static checks.
    • Rejected: Before the checks. Ticks work that may fail.
  • How does the tick respect the test-form check of fix(roadmap): the implement job checks the test form that a task names #3451?: The tick calls the test-form check when it is present. A refused task stays unticked. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:1415]
  • Which files does a fix step remove as strays?: A new file outside src/, tests/, docs/ and openspec/ is a stray. A new file under those directories stays. (best practice) [sources: src/devops_cli/roadmap/implement_strays.py:38, src/devops_cli/roadmap/implement_step.py:1093]
  • How does the step remove a stray that the agent staged?: The step lists staged new files with git diff --cached --name-only --diff-filter=A. It unstages each stray with git rm --cached --force and deletes the file. (best practice) [sources: src/devops_cli/roadmap/implement_strays.py:38]
    • Chosen: git rm --cached --force then delete. Removes the index entry and the file in one path.
    • Rejected: git reset then delete. Also works, but uses two commands and is less direct.
    • Rejected: git rm --force. Touches the working tree and can fail on a modified file.
  • What does the prompt say about ticks and the extra turn?: The prompt no longer asks for ticks and no longer says one more turn. The job owns the ticks. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:1415]
    • Chosen: Remove both. Matches the job-owned tick and the 3 fix rounds.
    • Rejected: Keep the tick request. The model would still fail to tick.
    • Rejected: Keep one more turn. Contradicts the job-owned tick and the fix rounds.
  • What does the plan-conformance scenario read?: The scenario reads the ticks that the job writes. It does not read unticked tasks or the model's ticks. (best practice) [sources: openspec/specs/roadmap-implement-step/spec.md:468]
    • Chosen: Read the job's ticks. The job is the writer of the ticks.
    • Rejected: Read unticked tasks. The job's ticks would hide the unticked tasks.
    • Rejected: Read the model's ticks. The model no longer writes them.

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 body reports 8.49M input tokens lost in one day from repeated step failures.
    • Value: High. Prevents loss of completed work and repeated token waste for every implement step.
    • Effort: Medium. Changes span implement_step.py, implement_strays.py, the prompt file, and multiple new tests.
    • Related: fix(roadmap): an implement step that finished its work but left a task unticked loses the work #2721, which asks for a different change. Both address the job managing task ticks, but the candidate also requires stray removal in fix steps and staged-file cleanup.
  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 336731c (see proposed design in issue body).

  6. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 5, 2026
  7. added 2 commits that reference this issue on Nov 5, 2026
    46a9247
    074c43e
  8. removed
    status/in-progress
    owner/agent
    on Nov 5, 2026
  9. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-05 13:27 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