Skip to content

fix(roadmap): the plan check refuses two tasks that state the same work #3456

Closed

Description

@dan-petty

Problem or Motivation

The plan of #3417 (pull request #3438) has two tasks that state the same work. Task 3.1 adds a paragraph to docs/roadmap/implement.md that says the job checks the premise of a behavior group at the branch tip. Task 3.2 adds the same paragraph to the same page and then runs uv run devops docs generate --sync-readme. Every check accepted the plan, and a person had to find the duplicate in review.

A step runs one task group with a model and a token budget. A duplicate task can make the model repeat an edit, spend the group on no change, or stop the group when the second edit writes no file. The plan check tests the form, the paths, the criteria and the content of a plan, and it does not compare two tasks.

Proposed Solution & Architectural Design

  • In check_proposal in src/devops_cli/roadmap/stage_change.py, compare the normalized text of the tasks of each group, and of the tasks of the plan. Refuse two tasks whose text is the same, and name both task numbers and the group.
  • Compare the task text only. Two tasks can share a verification command and stay different tasks, so do not refuse a repeated Verification: line.
  • Add the message to src/devops_cli/lang/en/messages.py and a test to tests/roadmap/test_roadmap_stage_content.py for a duplicate in one group and one across two groups.

Target Subsystem

src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_content.py

Existing Tool Considered

TaskGroup.tasks in src/devops_cli/roadmap/step_files.py already holds the parsed task text, so the check compares fields that a parser gives it and adds no parser. The cost is about 500 tokens to build and test and about 15 minutes elapsed.

Source: #3438

Proposed design

Problem statement

The stage plan check accepts two tasks that state the same work. A duplicate task can make the implement step repeat an edit, spend the group budget, or stop when the second edit writes no file. The check must refuse duplicate task text and name both task numbers and the group.

Acceptance criteria

Requirement: Duplicate task in one group

check_proposal SHALL refuse two tasks in one group whose normalized work text is the same and SHALL name both task numbers and the group.

Scenario: Duplicate task in one group

  • WHEN group 2 has task 2.1 and task 2.3 with the same normalized work text
  • THEN check_proposal returns a problem that names task 2.1, task 2.3 and group 2

Requirement: Duplicate task across groups

check_proposal SHALL refuse two tasks in different groups whose normalized work text is the same and SHALL name both task numbers and both groups.

Scenario: Duplicate task across two groups

  • WHEN group 2 task 2.1 and group 4 task 4.2 have the same normalized work text
  • THEN check_proposal returns a problem that names task 2.1, task 4.2, group 2 and group 4

Requirement: Shared verification does not make a duplicate

The duplicate check MUST compare task work text only and MUST NOT refuse tasks solely because they share a Verification: line.

Scenario: Two tasks share a verification command

  • WHEN group 3 task 3.1 and task 3.2 have different work text and the same Verification: command
  • THEN check_proposal returns no duplicate-task problem for task 3.1 and task 3.2

Requirement: Documentation command does not hide a duplicate

The duplicate check MUST ignore the fixed uv run devops docs generate --sync-readme suffix when it compares a documentation task with another task.

Scenario: A documentation task repeats an implementation task

  • WHEN an other group 3 has task 3.1 add a paragraph and task 3.2 add the same paragraph with the docs command
  • THEN check_proposal returns a duplicate-task problem that names task 3.1 and task 3.2

Requirement: Duplicate task message is catalogued

The duplicate-task problem text MUST come from src/devops_cli/lang/en/messages.py.

Scenario: The message names both tasks and groups

  • WHEN the check formats the duplicate-task message for task 2.1, task 4.2, group 2 and group 4
  • THEN the formatted message contains both task numbers and both group numbers

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers this need. The change builds no parser: it compares the task fields that StageGroup already holds and that _task_texts renders, with the existing TaskGroup.tasks parser in src/devops_cli/roadmap/step_files.py as the reference for task numbering. The written cost is about 500 tokens to build and test and about 15 minutes elapsed.

Key questions

  • Where does the duplicate-task check belong?: It belongs in check_proposal in src/devops_cli/roadmap/stage_change.py, as a helper that reads the StageGroup work fields in the order that _task_texts renders them. It adds no parser. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/step_files.py]
    • Chosen: Use the StageGroup work fields. The fields are already validated and ordered, so the check needs no parse.
    • Rejected: Parse the rendered tasks.md. It adds a second parse and can drift from _task_texts.
    • Rejected: Add a new task parser. The repository already holds the task fields and a parser.
  • What text does the duplicate check compare?: It compares the normalized work text of each task: test, implementation and documentation. It excludes the Verification: line, the process check and the fixed uv run devops docs generate --sync-readme suffix. (best practice) [sources: src/devops_cli/roadmap/stage_change.py]
    • Chosen: Work text only. It catches the same paragraph when one task also runs the docs command, and it ignores shared checks.
    • Rejected: Whole rendered task line. The fixed docs command and the Verification: line make equal work look different.
    • Rejected: Only implementation. It misses duplicate test tasks and duplicate documentation tasks.
  • How does the check normalize task text?: It collapses each run of whitespace to one space, strips the ends and casefolds the result before it compares two tasks. (best practice) [sources: src/devops_cli/roadmap/stage_change.py]
    • Chosen: Whitespace and case. The model can change spacing or case without changing the work.
    • Rejected: Exact text. It misses duplicates that differ only in spacing or case.
    • Rejected: Fuzzy matching. It can refuse distinct tasks and adds a dependency.
  • What does the duplicate-task message name?: The message names both task numbers and the group or groups, as in Tasks 2.1 and 2.3 state the same work in group 2. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage_change.py]
    • Chosen: One catalog message with both task numbers and a group phrase. It names both tasks and the group or groups in one place.
    • Rejected: Two messages for one group and two groups. It duplicates text and adds a branch.
    • Rejected: Hard-code the text in stage_change.py. The project keeps user-facing messages in the catalog.
  • Where do the tests go?: They go in tests/roadmap/test_roadmap_stage_content.py: one for a duplicate in one group, one for a duplicate across two groups, and one for a shared Verification: line. (best practice) [sources: tests/roadmap/test_roadmap_stage_content.py, src/devops_cli/roadmap/stage_change.py]
    • Chosen: Add to test_roadmap_stage_content.py. The module already tests the content rules of check_proposal.
    • Rejected: Add a new test module. The rule belongs with the other content rules and needs no new module.
    • Rejected: Test only through the stage job. An offline unit test of check_proposal is faster and isolates the rule.

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 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: P2-Medium. A real gap that let a duplicate task reach review, but it is not blocking and no user is affected.
    • Value: Medium. It removes a class of plan errors that now require a person to catch in review.
    • Effort: Low. A text comparison in one existing function plus one test, estimated at about 15 minutes.
    • Related: fix(roadmap): the plan form gates miss a bare filename task and a repeated word in the title #3255, which asks for a different change. Both add missing validation rules to the plan check gates in stage_change.py, but #3255 catches bare filenames and repeated title words while this candidate catches identical task text.
  3. added
    priority/p2-medium
    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 0e3427f (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    Staged: branch fix/3456-the-plan-check-refuses-two-tasks, draft pull request #3471. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. Refuse two plan tasks that state the same work: 29575 tokens

    The plan run made 3 model request(s), and used 235513 input tokens and 14846 output tokens. The model made no tool call.

    The stage job read the open pull requests and their files in 1 GraphQL request(s).

  7. added a commit that references this issue on Nov 5, 2026
  8. added
    status/planned
    and removed
    status/ready
    on Nov 5, 2026
  9. 2 remaining items

  10. added
    status/in-progress
    on Nov 5, 2026
  11. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failure class: limit_reached.
    Action taken: none.
    Action left: raise_limit: raise the limit that the run went over.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 8097393/26323 -

    Reason:

    LimitReached: The step spent its budget `roadmap.implement.step_token_budget=8000000`.
    Refused commands: uv 2, git 1, grep 1. Other retries: 1.
    

    Last message of the agent (a claim that no check verified): Now the _task_work_texts helper beside _task_texts, and the call in content_problems:

    The job discarded this work. Read it before you retry:

    diff --git a/tests/roadmap/test_roadmap_stage_plan.py b/tests/roadmap/test_roadmap_stage_plan.py
    index aa92109d..6212e54d 100644
    --- a/tests/roadmap/test_roadmap_stage_plan.py
    +++ b/tests/roadmap/test_roadmap_stage_plan.py
    @@ -1673,14 +1673,16 @@ NO_SPEC_PROBLEM = (
     
     
     def _changed(title: str, *paths: str) -> StageGroup:
    -    """A group that changes only `paths`: a behavior group when one is source code, else an other
    -    group that a command proves."""
    +    """A group that changes only `paths` and states its work by `title`, so that two groups of one
    +    plan state different work: a behavior group when one is source code, else an other group that
    +    a command proves."""
         update: dict[str, Any] = {
             "title": title,
             "changes": list(paths),
             "creates": [],
             "creates_lines": {},
             "reads": [],
    +        "implementation": f"Change the files of {title}",
         }
         if not any(path.startswith("src/") for path in paths):
             update |= {"kind": "other", "test": None, "verify": "uv run devops ci docs"}

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

    The job kept 2 work-in-progress commits on the branch fix/3456-the-plan-check-refuses-two-tasks on origin. The last is 14c0a42c8929abc4f5cbe4ad29185ec6cbcccfad. The job discarded only the work after it. The next run continues from it and does the tasks that are not ticked.

  12. added
    status/blocked
    and removed
    status/in-progress
    on Nov 5, 2026
  13. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261105-135842-8856 ended: succeeded.
    Image digest: sha256:b2a52ba0a1f4efc4eebc6f29bd6b564892a59c122078c7bcdb0bc47d8746759a

    The last lines of its log:

    Tool call: shell, started: tail -c 600 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, refused.
    Tool call: shell, started: tail -c 300 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: shell, started: tail -c 300 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: shell, started: tail -c 300 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: shell, started: tail -c 300 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, refused.
    Tool call: shell, started: tail -c 300 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: shell, started: tail -c 300 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: shell, started: tail -c 300 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: grep, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py ...
    Tool call: shell, program uv, ok.
    Tool call: grep, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: read_file, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py
    Tool call: shell, program uv, ok.
    Tool call: shell, started: tail -c 1200 .pydantic-ai-harness/shell/ae7eeb7d71c645068a64235da27e532d/output.log
    Tool call: shell, program tail, ok.
    Tool call: grep, ok.
    Tool call: shell, started: uv run ruff check src/devops_cli/roadmap/stage_change.py src/devops_cli/lang/en/messages.py ...
    Tool call: shell, program uv, ok.
    Failure class limit_reached. Action left: raise_limit.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 34m 2s
    
  14. removed
    owner/service
    on Nov 5, 2026
  15. removed
    status/blocked
    on Nov 6, 2026
  16. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 05:02 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/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