Skip to content

feat(roadmap): allow bounded path additions in implement plan-request #4099

Closed

Description

@dan-petty

Problem or Motivation

The implement runner stops a step when it modifies a path outside the plan (_outside_plan_failure, #3824). An agent can send a plan-request to amend the plan. In src/devops_cli/roadmap/implement/implement_amend.py, _judge_path permits only path renames where the basename matches. If an implementation needs an existing omitted file, such as a constants module or a test fixture, the agent cannot request adding that path to the group. The step stops with FailureClass.OUTSIDE_PLAN and requires human intervention.

Proposed Solution & Architectural Design

Support bounded path addition in implement_amend.py:

  1. Add add_path as an allowed kind in PlanRequest.
  2. In _judge_path, accept an add_path request when the target path exists in tree.files and does not sit under openspec/.
  3. Add the validated path to the group header Changes: or Reads: line in tasks.md.
  4. Append an amendment bullet to the ## Amendments section of tasks.md.
  5. Cover valid and invalid path addition requests with unit tests in tests/roadmap/implement/test_implement_amend.py.

Target Subsystem

AI & Agentic Review Pipeline

Existing Tool Considered

This enhancement extends the existing PlanRequest parser and validator in src/devops_cli/roadmap/implement/implement_amend.py. Cost: 6,000 tokens and 0.25 elapsed days.

Proposed design

Problem statement

An implement step stops with FailureClass.OUTSIDE_PLAN when it modifies a path that the plan does not list. The agent can send a plan-request to amend the plan. _judge_path in src/devops_cli/roadmap/implement/implement_amend.py permits only a rename whose basename matches. The agent cannot add an omitted existing file, such as a constants module or a test fixture, to the group. A person must then intervene.

Acceptance criteria

Requirement: Plan request accepts add_path

PlanRequest SHALL accept kind add_path with new set to a repository path and header set to Changes or Reads.

Scenario: Parse an add_path request

  • WHEN a step message ends with a plan-request fence whose JSON sets kind to add_path, group to 1, new to src/app/constants.py and header to Reads
  • THEN parse_request returns a PlanRequest whose kind is add_path and whose header is Reads

Requirement: Added path exists in the tree

The judge MUST refuse an add_path request when new is not in tree.files.

Scenario: Refuse an absent path

  • WHEN new is src/app/missing.py and tree.files does not hold that path
  • THEN judge returns Refused with the message implement_amend_refused_path_status

Requirement: Added path is outside openspec

The judge MUST refuse an add_path request when new sits under openspec/.

Scenario: Refuse a path under openspec

  • WHEN new is openspec/changes/4099-bounded-path/tasks.md
  • THEN judge returns Refused with the message implement_amend_refused_path_status

Requirement: Added path joins the named header line

The judge MUST append the backticked new path to the Changes: or Reads: line that header names, and MUST leave every other line of the group unchanged.

Scenario: Append a path to the Reads line

  • WHEN group 1 has a Reads: line that lists src/app/a.py and the request sets header to Reads and new to src/app/constants.py
  • THEN the Reads: line lists src/app/a.py and src/app/constants.py, separated by ,

Requirement: Header line must exist

The judge MUST refuse an add_path request when the group has no line for the header that the request names.

Scenario: Refuse a missing header line

  • WHEN group 1 has no Reads: line and the request sets header to Reads
  • THEN judge returns Refused

Requirement: Refuse a path that the group already holds

The judge MUST refuse an add_path request when the group text already holds new in a code span.

Scenario: Refuse a duplicate path

  • WHEN group 1 lists src/app/constants.py and the request adds that path again
  • THEN judge returns Refused

Requirement: Refuse a rename form on add_path

The judge MUST refuse an add_path request that sets old, because a rename stays a path request.

Scenario: Refuse old on add_path

  • WHEN the request sets kind to add_path and old to src/app/a.py
  • THEN judge returns Refused

Requirement: Record the addition as an amendment

The judge MUST append one bullet for an applied add_path request to the ## Amendments section of tasks.md.

Scenario: Append the amendment bullet

  • WHEN the judge applies an add_path request for src/app/constants.py in group 1
  • THEN tasks.md holds one bullet under ## Amendments that names group 1, add_path and src/app/constants.py

Requirement: Cover the new kind with unit tests

The change MUST add unit tests in tests/roadmap/implement/test_roadmap_implement_amend.py for each accepted and each refused add_path case.

Scenario: Run the amendment tests

  • WHEN the test suite runs tests/roadmap/implement/test_roadmap_implement_amend.py
  • THEN the suite passes and covers one accepted case and every refused case

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers the plan-request format of this repository, because that format is specific to src/devops_cli/roadmap/implement/implement_amend.py. The change extends the existing PlanRequest parser and validator in that file. The written cost to build, keep and fix this code until it matches a tool is 6,000 tokens and 0.25 elapsed days.

Key questions

  • Which header line receives an added path?: The request names the line in a new optional header field with the values Changes and Reads. The judge refuses the request when the field is absent. The judge appends the backticked path after a , separator. (best practice) [sources: src/devops_cli/roadmap/implement/implement_amend.py:32, src/devops_cli/roadmap/implement/implement_amend.py:142]
    • Chosen: Explicit header field. The agent knows whether it writes or reads the file, and the write set of the step stays small.
    • Rejected: Always append to Changes:. It widens the write set of a step that only reads the file.
    • Rejected: Infer the line from the header lines present. A group with both lines has no rule that tells a read from a write.
  • Which bounds apply to an added path?: The path MUST exist in tree.files. The path MUST NOT sit under openspec/. The path MUST NOT already appear in a code span of the group. (best practice) [sources: src/devops_cli/roadmap/implement/implement_amend.py:142, src/devops_cli/roadmap/implement/implement_step.py:1347]
    • Chosen: Existing file outside openspec/. tree.files proves that the file exists, and openspec/ holds the plan that the archive step rewrites.
    • Rejected: Any existing file. A path under openspec/ is plan text, not code that a step may change.
    • Rejected: Any path. A path that does not exist makes the step fail later, with no clear reason.
  • How does the judge apply an add_path request?: A new _judge_add_path function holds the rule, and a case "add_path" branch of the match in judge calls it. _judge_path keeps the rename rule. The new function appends the path to the named header line and returns an Amendment with kind add_path, an empty old and the path in new. (best practice) [sources: src/devops_cli/roadmap/implement/implement_amend.py:142, src/devops_cli/roadmap/implement/implement_amend.py:271]
    • Chosen: New _judge_add_path function. _judge_path replaces a code span, and an addition inserts a new one, so the two rules differ.
    • Rejected: Add a branch to _judge_path. It mixes two rules in one function and obscures the rename checks.
  • Which refusal message does a refused add_path request use?: The judge reuses implement_amend_refused_path_status for an absent path, a path under openspec/, a duplicate path and a missing header line. The change adds no message text. (best practice) [sources: src/devops_cli/roadmap/implement/implement_amend.py:142]
    • Chosen: Reuse implement_amend_refused_path_status. The text already states that the path is not in the plan, and the change adds no message file.
    • Rejected: Add a new message text. It gives a sharper reason, but it adds a message entry for one refusal.
  • Which test file holds the unit tests?: tests/roadmap/implement/test_roadmap_implement_amend.py holds the tests of PlanRequest and judge. The body names tests/roadmap/implement/test_implement_amend.py, which does not exist. [sources: tests/roadmap/implement/test_roadmap_implement_amend.py]
  • What does the amendment bullet show for an addition?: The bullet records kind add_path and the added path in the change text, with no old path. The log then tells an addition from a rename. (best practice) [sources: src/devops_cli/roadmap/implement/implement_amend.py]
    • Chosen: kind add_path, new path only. The bullet names the kind, so a reader tells an addition from a rename.
    • Rejected: kind path, empty old path. The log cannot tell an addition from a rename.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 8, 2026
  2. dan-petty commented on Nov 8, 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. Removes a human-intervention stop for a common agent case but does not block the pipeline.
    • Value: Medium. Reduces unnecessary human intervention when an agent needs an existing file omitted from the plan.
    • Effort: Medium. Extends an existing parser with one new kind, adds validation, updates tasks.md, and writes unit tests in one file.
    • Related: feat(roadmap): the implement agent can amend the plan when the plan is wrong #3057, which asks for a different change. Both extend the bounded amendment system in implement_amend.py, but #3057 delivered the initial set of amendment kinds while this candidate adds a new add_path kind for existing omitted files.
  3. added
    priority/p2-medium
    on Nov 8, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Searches for a tool that validates or amends an implementation plan's path list found nothing usable; the only relevant project, OpenSpec, is the spec and change-proposal layer the repository already uses (ADR 0010) and offers no plan-request parser or judge for per-step path additions. The need is a repo-specific extension of the PlanRequest parser and _judge_path in src/devops_cli/roadmap/implement/implement_amend.py, which no external tool covers.

    Tool: none found

    Lacks:

    • No tool parses a step's plan-request fence and validates an add_path kind against the repository tree.
    • No tool refuses additions under openspec/ or paths absent from tree.files.
    • No tool appends an added path to a group's Changes: or Reads: line in tasks.md and records an amendment bullet.
    • OpenSpec manages change proposals and spec deltas, not per-step write/read path sets or the OUTSIDE_PLAN failure class.

    Tools considered:

    Searches run:

    • open source library validate plan request changes to task plan JSON schema, results: 5
    • tool to amend an agent implementation plan file allow adding files, results: 5
    • openspec tasks.md plan request amend agent file additions, results: 5
    • python library enforcing allowed file paths per agent task write set, results: 5
    • OpenSpec spec-driven development change proposal tool, results: 5

    Sources:

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

  7. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Scope from the progress-aware caps plan (2026-11-11)

    The tracker #4843 folds its scope-change item into this item as child 10. The planned item and this item change the same code: implement_amend.judge refuses every request of kind scope today, and _judge_path allows only a rename. One change covers both: a bounded path addition, through the fixable check of #4847. Where this comment and the body differ, this comment is the scope; the openspec/ exclusion of the body stays.

    Problem

    implement_amend.judge refuses every request of kind scope, so the step stops and waits for a person. 3 scope-change stops in 7 days (#3446, #3320, #3574): in 3 of 3 the agent named the missing files with evidence, and one plan amend that adds them to the group fixes it; 0 of 3 are fixable by an implement repair round.

    Solution

    Before the scope refusal, run the fixable check (point implement.scope_fixable, #4847). Deterministic: amendable when each added path exists in the tree or is a new test file and the request adds at most 5 paths; a protected path (workflows, security policy, secret files, release files) is never class. Jev (Noul: yes/no with a probability) 'fixable'. Fixable -> apply the amendment to the group changes in tasks.md (## Amendments), the bounded amendment of #3057, and run the group again. 1 amend per group, 2 per item. Not fixable -> stop with the reason as today.

    Cost to build: about 0.8M tokens, half a day.

    Acceptance criteria

    • Replay tests of the 3 sampled requests: each adds its paths and the group runs again.
    • A test: a request that adds a workflow file refuses with class never.
    • A test: a sixth path refuses.
    • A test: a second scope request in the same group stops.

    Dependencies

    #4847.

  8. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 16, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 16, 2026
  10. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-16 06:35 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/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions