Skip to content

feat(roadmap): the stage job refuses a task path that no group lists #3446

Not planned

Description

@dan-petty

Problem or Motivation

A task group names the files it reads, changes and creates in reads, changes and creates. It also names paths in the code spans of its task text. path_problems in src/devops_cli/roadmap/stage_paths.py checks each task path against the files of the staged commit and against the creates of the groups. It does not check that the path is in the group's own reads, changes or creates.

A task can therefore name a file that exists but that the group does not list. The rendered Impact omits the file, the implement step does not pack it, and every gate accepts the plan. This is the same gap that #3411 closes for What Changes, on the text of the tasks.

The plan of PR #3436 for #3411 is the case. Group 3 changes only tests/roadmap/test_roadmap_stage_eval_run.py, but its task adds a golden case (four fixture files) and updates tests/roadmap/test_roadmap_stage_eval_cases.py. The task names no fixture path in a code span, so path_problems sees no path to check. The group lists omit the files the task creates, and the verification would fail on the count test.

Proposed Solution & Architectural Design

In check_proposal, read each path in a code span of a group's task text with the shared code-span path rule, and refuse a path that the group lists in neither reads, changes nor creates. Accept a path under the change folder and the living spec folder, because the stage job writes the change and openspec archive writes the living spec. Accept a folder that holds a created path.

Add the message to RoadmapMessages in src/devops_cli/lang/en/messages.py and a case to tests/roadmap/test_roadmap_stage_content.py. The check reads the reply alone, and check_proposal holds the staged tree, so it makes no git call.

Target Subsystem

src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py

Existing Tool Considered

path_problems already reads the code spans of the tasks, so the change extends that rule rather than builds a new parser. The cost is about 2k tokens to build, keep and fix, and 30 minutes.

Source: #3436

Dependencies

Proposed design

Problem statement

A task group can name a file in its task text that the group lists in no reads, changes or creates field. The stage job then renders an Impact that omits the file and packs no file for the implement step. The change makes the stage proposal check refuse that task path.

Acceptance criteria

Requirement: Unlisted task path is refused

The stage proposal check SHALL refuse a path in a group's task code span when the group lists the path in neither reads, changes nor creates.

Scenario: Task names an existing file that the group omits

  • WHEN A group names tests/roadmap/test_roadmap_stage_eval_cases.py in a task code span, and the same group lists that path in no group field.
  • THEN check_proposal returns a problem that names the group and tests/roadmap/test_roadmap_stage_eval_cases.py.

Requirement: Listed task path is accepted

The check SHALL accept a path in a group's task code span when the same group lists the path in reads, changes or creates.

Scenario: Task names a file that the group changes

  • WHEN A group names tests/roadmap/test_roadmap_stage_content.py in a task code span and lists the same path in changes.
  • THEN check_proposal returns no problem for that path.

Requirement: Write-folder task path is accepted

The check SHALL accept a task code-span path under openspec/changes/ or openspec/specs/ even when the group lists the path in no group field.

Scenario: Task names a change file and a living spec file

  • WHEN A group names openspec/changes/3446-the-stage-job-refuses-a-task-path/tasks.md and openspec/specs/roadmap-stage/spec.md in task code spans.
  • THEN check_proposal returns no problem for either path.

Requirement: Folder of a created path is accepted

The check SHALL accept a task code-span folder when the same group lists a path under that folder in creates.

Scenario: Task names the folder of a created test

  • WHEN A group lists tests/roadmap/test_new_case.py in creates and names tests/roadmap/ in a task code span.
  • THEN check_proposal returns no problem for tests/roadmap/.

Requirement: Refusal uses a roadmap message

The new refusal SHALL use a message field in RoadmapMessages in src/devops_cli/lang/en/messages.py.

Scenario: Unlisted task path produces the catalog message

  • WHEN A group names an unlisted path in a task code span.
  • THEN The returned problem is the RoadmapMessages text with the group and the path filled in.

Requirement: Held tree is used with no git call

The check SHALL use the staged tree that check_proposal holds and SHALL make no git call.

Scenario: Path check runs on a held tree

  • WHEN check_proposal checks a proposal with a staged tree.
  • THEN The path check reads the tree and runs no git command.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library is known to cover this need. The change extends the existing path_problems and code_spans rule in src/devops_cli/roadmap/stage_paths.py; it builds no new parser. The written cost is about 2k tokens to build, keep and fix, and 30 minutes.

Key questions

  • Where should the new rule live?: Extend path_problems in src/devops_cli/roadmap/stage_paths.py. check_proposal already calls it and passes the staged tree. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_change.py]
    • Chosen: Extend path_problems. It already reads the task code spans and receives the StagedTree.
    • Rejected: Add a separate loop in check_proposal. It duplicates the path reading and the problem formatting.
  • Which rule reads paths from the task text?: Use the shared code_spans and StagedTree.paths_in rule in src/devops_cli/roadmap/stage_paths.py. Do not add a new parser. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/step_files.py]
    • Chosen: Shared code-span rule. _named already reads the task code spans, and step_files.code_spans is the one rule.
    • Rejected: New parser. It duplicates the shared rule and adds a second path grammar.
  • Which paths must a group list for a task code-span path?: The same group must list the path in reads, changes or creates. Accept a path under openspec/changes/ or openspec/specs/, and accept a folder that holds a path in the group's creates. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, CONTEXT.md, src/devops_cli/roadmap/stage_change.py]
    • Chosen: Own group's lists plus the two write folders. The implement step packs the files of the group, and the stage job or archive writes those folders.
    • Rejected: Any earlier group's creates. A task must name a file that its own step packs.
    • Rejected: Every group's lists. A later group does not pack the file for this step.
  • Should the check make a git call?: No. check_proposal holds the staged tree, so the check reads the reply and the tree only. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py]
    • Chosen: Use the held StagedTree. The tree is already at the staged commit.
    • Rejected: Run git ls-files in the check. It repeats a read that the caller already made.
  • Should the new refusal use the message catalog?: Yes. Add the message to RoadmapMessages in src/devops_cli/lang/en/messages.py. (best practice) [sources: src/devops_cli/lang/en/messages.py, tests/roadmap/test_roadmap_stage_content.py]
    • Chosen: Message field in RoadmapMessages. The project keeps user-facing text in the catalog.
    • Rejected: Inline string in stage_paths.py. It breaks the message catalog rule.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    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/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. The gap lets invalid plans pass the stage gate, but it is one of several checks and does not block the pipeline.
    • Value: Medium. It catches a specific class of unlisted paths in task text, improving plan correctness.
    • Effort: Low. The body states about 2k tokens and 30 minutes of work, extending an existing code-span rule.
    • Related: feat(roadmap): refuse a what_changes item that names no group path #3411, which asks for a different change. Both validate that a path named in stage output is listed by a group, but #3411 targets the What Changes section and the candidate targets task text code spans.
  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 53cffca (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    Staged: branch feat/3446-the-stage-job-refuses-a-task, draft pull request #3468. 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 a task path that the group lists nowhere: 26752 tokens

    The plan run made 4 model request(s), and used 316716 input tokens and 21533 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 2 commits that reference this issue on Nov 5, 2026
  8. added
    status/planned
    owner/service
    status/in-progress
    and removed
    status/ready
    status/planned
    on Nov 5, 2026
  9. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failure class: plan_defect.
    Action taken: none.
    Action left: wait: wait for a person.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 3905436/29826 -

    Reason:

    The agent asked for a scope change: The group changes only stage_paths.py, messages.py and test_roadmap_stage_content.py. The new refusal also reports a task path of the sample group of three existing test modules and of one golden case plan, so those files must change in the same group: each helper group names a file in a task text and lists it in no field. The planned verification runs one test module and would not see them.. Evidence: With the rule of task 1.2 applied to the three planned files: `uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py` gives 67 failed and 8 passed; `uv run devops ci test tests/roadmap/test_roadmap_stage_form.py` gives 29 failed and 20 passed; `uv run devops ci test tests/roadmap/test_roadmap_stage_plan.py` gives 7 failed and 220 passed; `uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py` gives 5 failed and 31 passed. Every failure holds the new sentence. The causes: `_group` in tests/roadmap/test_roadmap_stage_paths.py names `tests/test_sample.py` in its `test` task and lists it nowhere; `_plan` in tests/roadmap/test_roadmap_stage_form.py and `_changing` in tests/roadmap/test_roadmap_stage_plan.py name `tests/test_sample.py` and `src/devops_cli/sample.py` the same way; the group of tests/fixtures/roadmap_eval/stage/good-2491-a-refused-jwt-exchange-of-the/plan.json names `tests/github/test_github_app_identity.py` in its `test` task and lists it nowhere. Both files of the run were reverted, so the tree is clean and no task is ticked.
    

    Last message of the agent (a claim that no check verified): I found a defect in the plan of group 1. I applied the rule of task 1.2 in stage_paths.py and messages.py to measure it, then reverted both files. The working tree is clean and no task is ticked. The new refusal also reports task paths of existing test helpers and of one golden case, which the group's Changes list omits. Those files then fail: tests/roadmap/test_roadmap_stage_paths.py (67 failed, 8 passed), tests/roadmap/test_roadmap_stage_form.py (29 failed, 20 passed), tests/roadmap/test_roadmap_stage_plan.py (7 failed, 220 passed) and tests/roadmap/test_roadmap_stage_eval_gates.py (5 failed, 31 passed). The planned verification runs only tests/roadmap/test_roadmap_stage_content.py, so it cannot see them. ```plan-request { "kind": "scope", "group": 1, "defect": "The group changes only stage_paths.py, messages.py and test_roadmap_stage_content.py. The new refusal also reports a task path of the sample group of three existing test modules and of one golden case plan, so those files must change in the same group: each helper group names a file in a task text and lists it in no field. The planned verification runs one test module and would not see them.", "evidence": "With the rule of task 1.2 applied to the three planned files: uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py gives 67 failed and 8 passed; `uv run devops ci test tests/roadmap/test_roadmap_stage_form.py` gives 29 failed and 20 passed; `uv run devops ci test tests/roadmap/test_roadm

    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.

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

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261105-134432-1522 ended: succeeded.
    Image digest: sha256:b2a52ba0a1f4efc4eebc6f29bd6b564892a59c122078c7bcdb0bc47d8746759a

    The last lines of its log:

    Tool call: grep, ok.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, refused.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: git grep -n twin_of -- tests ...
    Tool call: shell, program git, refused.
    Tool call: shell, started: git grep -ln path_problems\\|check_proposal -- tests
    Tool call: shell, program git, refused.
    Tool call: grep, ok.
    Tool call: grep, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: git diff src/devops_cli/lang/en/messages.py
    Tool call: shell, program git, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_paths.py
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_eval_gates.py
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_form.py
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_stage_move_prefix.py ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git checkout -- src/devops_cli/roadmap/stage_paths.py src/devops_cli/lang/en/messages.py
    Tool call: shell, program git, ok.
    Tool call: shell, started: git status --porcelain
    Tool call: shell, program git, ok.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, refused.
    Tool call: shell, started: uv run python -c <masked>
    Tool call: shell, program uv, refused.
    Tool call: shell, started: uv run python -c __import__("pathlib").Path(".data/agent/scratch/probe_unlisted.py").unlink()
    Tool call: shell, started: uv run python -c __import__("pathlib").Path(".data/agent/scratch/probe_cases.py").unlink()
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git status --porcelain
    Tool call: shell, program git, ok.
    Failure class plan_defect. Action left: wait.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 12m 15s
    
  12. removed
    owner/service
    on Nov 5, 2026
  13. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

  14. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Triage under #6519 (owner instruction of 2026-11-30). This item adds or extends a hand-written gate, refusal, context block or plan-shape rule of the stage job. #6519 found that 263 of about 900 issues in four weeks added gates and none replaced the engine; stage now runs on stock Coder, where the agent reads the repository itself and runs the OpenSpec checks in its loop. The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned.

  15. removed
    status/blocked
    on Nov 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/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions