Repository navigation
Description
What happened
34 of 37 plans had defects. An implement agent that finds a wrong path or a wrong premise today can only stop. Rule 2 of AGENTS.md says to return an infeasible item with evidence, but no step exists for a plan that is wrong but fixable.
What should happen
- A step can raise a
plan amendment: it states the defect, the evidence and the corrected text. A bounded set of amendments (wrong path, a missing task, a group that exceeds its budget, a wrong verify command) is applied in the same pull request, with the change recorded in the change folder'stasks.md. A premise failure returns the item (rule 2). A change of scope waits for a person with a question on the issue (G2). - A group that exceeds its token budget is re-split by the existing split step and continues.
Acceptance criteria
- A replay with a wrong test path in the plan ends in a delivered pull request that has the corrected path in its
tasks.md. - A replay with a false premise returns the item with the evidence and no code.
- The amendment appears in the PR comment with the evidence.
- An amendment never changes a spec requirement or an acceptance criterion without a person.
Related: tracker for this set (filed with it), #2908 (issue workflow), #2867 (draft PR evaluator), #3005 (task kind), #3010 to #3015 (plan gates), #2919 (stuck-item metrics), #2953 (Ollama parser).
Proposed design
Problem statement
The implement agent can only stop when it finds a defect in the plan. Thirty-four of thirty-seven plans had defects. A step that amends a bounded defect in the plan is missing. The agent needs a way to fix a wrong path, a missing task, a budget-exceeding group, or a wrong verify command in the same pull request, while still returning the item on a false premise and waiting for a person on a scope change.
Acceptance criteria
Requirement: Bounded plan amendment
The implement agent SHALL apply a bounded plan amendment in the same pull request when it detects a wrong path, a missing task, a group that exceeds its budget, or a wrong verify command.
Scenario: Wrong test path in plan
- WHEN A replay plan contains a test path that does not exist in the repository
- THEN The delivered pull request contains the corrected path in its tasks.md
Requirement: Amendment recorded in tasks.md
The implement agent SHALL record each applied amendment in the change folder's tasks.md with the defect, the evidence, and the corrected text.
Scenario: Amendment entry in tasks.md
- WHEN The implement agent applies a bounded amendment
- THEN The tasks.md of the change folder contains an entry that states the defect, the evidence, and the corrected text
Requirement: Amendment in PR comment
The implement agent SHALL post the amendment and its evidence as a comment on the pull request.
Scenario: PR comment with amendment
- WHEN The implement agent applies a bounded amendment
- THEN The pull request has a comment that contains the amendment text and its evidence
Requirement: Premise failure returns item
The implement agent SHALL return the item to New with the evidence and no code when it detects a false premise.
Scenario: False premise replay
- WHEN A replay plan contains a premise that is false against the real system
- THEN The item is returned to New with the evidence and no code is committed
Requirement: Amendment scope boundary
A plan amendment SHALL NOT change a spec requirement or an acceptance criterion without a person's approval.
Scenario: Scope change blocked
- WHEN The implement agent detects a defect that requires changing a spec requirement or an acceptance criterion
- THEN The agent posts a question on the issue and does not apply the change
Requirement: Budget-exceeding group re-split
The implement agent SHALL re-split a group that exceeds its token budget using the existing split step and continue with the new groups.
Scenario: Group exceeds budget
- WHEN A task group's inputs exceed the token budget
- THEN The existing split step re-splits the group and the implement agent continues with the new groups
Existing Tool Considered
No check has run. No open, maintained tool or library covers the need of adding a plan-amendment step to the implement agent's workflow. The project builds its own code. The cost is the tokens to build, keep, and fix the amendment step, its classification rules, its tasks.md recording, its PR comment, and its replay tests, and the elapsed time to integrate it into the existing implement job.
Key questions
- What is the bounded set of amendments that the agent may apply without a person?: The bounded set is: a wrong path, a missing task, a group that exceeds its budget, and a wrong verify command. A premise failure returns the item. A scope change waits for a person. [sources: AGENTS.md]
- How does the agent classify a defect as bounded, a premise failure, or a scope change?: The agent classifies at the point of detection. If the defect is in the bounded set, it amends. If the fundamental assumption is false, it returns the item per rule 2. If the fix requires changing a spec requirement or acceptance criterion, it posts a question on the issue and waits for a person. (best practice) [sources: AGENTS.md, CONTEXT.md]
- Chosen: Classify inline at the point of detection. Chosen. The agent already reads the plan and the repository. It can judge the defect type without a separate step. This keeps the step count low and the logic local.
- Rejected: A separate classification step before the amendment. Rejected. It adds a step and a token cost for every defect, and the classification is simple enough to do inline.
- Rejected: Always amend and escalate only on failure. Rejected. It risks applying a scope change before a person approves it, which violates the acceptance criterion.
- Where in the step sequence does the amendment run?: The amendment is raised within the step that detects the defect. The step's agent amends the plan and continues, or escalates to a return or a question. No separate step type is added. (best practice) [sources: CONTEXT.md]
- Chosen: Amend within the detecting step. Chosen. The step already holds the plan, the repository, and the defect. Amending in place avoids a round-trip and keeps the token budget of the step.
- Rejected: A new step type that runs between task group steps. Rejected. It adds a step and a token cost, and the defect is already known to the detecting step.
- Rejected: A post-step after all task groups. Rejected. The defect blocks the current step. Waiting until all groups finish delays the fix and wastes tokens on groups that depend on the corrected plan.
- What format does the amendment entry in tasks.md use?: A new section titled 'Amendments' in tasks.md. Each entry states the defect, the evidence, and the corrected text. The entry is appended when the amendment is applied. (best practice) [sources: CONTEXT.md, AGENTS.md]
- Chosen: A new 'Amendments' section in tasks.md. Chosen. The body says the change is recorded in tasks.md. A dedicated section keeps the amendment history separate from the task checklist and is easy to parse.
- Rejected: Inline annotations on the affected task line. Rejected. It mixes the amendment record with the task state and makes the checklist harder to read.
- Rejected: A separate amendments file in the change folder. Rejected. The body names tasks.md as the record. A separate file adds a path to maintain and a file to read.
- Does the amendment step require a dependency on another issue?: No. The implement agent, the split step, and the change folder structure already exist. The amendment is a new behavior within the existing implement job. [sources: CONTEXT.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 1, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It fixes the top failure mode in the pipeline but is one step among many in the tracker, so it is high but not blocking.34 of 37 plans had defects and the implement agent can only stop today; this prevents lost work on fixable plans.It needs a bounded amendment set, a tasks.md record, a PR comment, and a gate that blocks scope changes, all within the existing step loop.Both add a repair path during the implement step, but #3053 retries after an execution failure while the candidate amends the plan text for a wrong path, missing task, or wrong verify command.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at d5dc921 (see proposed design in issue body).
devops-cli-service commentedon Nov 2, 2026
Staged: branch
feat/3057-the-implement-agent-can-amend-the, draft pull request #3184. 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:
The plan run made 8 model request(s), and used 225055 input tokens and 4759 output tokens. The tool calls, in order:
list_files({"directory":"src/devops_cli/roadmap"})search_code({"text":"split"})read_file({"path":"src/devops_cli/roadmap/implement_step.py"})list_files({"directory":"tests/roadmap"})file_symbols({"path":"src/devops_cli/roadmap/implement_step.py"})read_spec({"capability":"roadmap-implement-step"})search_code({"text":"split"})read_spec({"capability":"roadmap-implement-job"})search_code({"text":"def split"})file_symbols({"path":"src/devops_cli/roadmap/stage.py"})read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":340,"end_line":420})read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":486,"end_line":570})read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":1140,"end_line":1190})read_file({"end_line":810,"path":"src/devops_cli/roadmap/stage.py","start_line":719})read_file({"end_line":330,"path":"src/devops_cli/roadmap/implement_step.py","start_line":130})docs(openspec): fix the plan of #3057 to the real step, job and split…
docs(openspec): point the plan of #3057 at the stage.py lines after #…
docs(openspec): state the final group sizes of the plan of #3057
docs(openspec): plan #3057 let the implement job amend its plan (#3184)
feat(roadmap): the implement agent can amend a defective plan
feat(roadmap): the implement agent can amend a defective plan
devops-cli-service commentedon Nov 3, 2026
Released in v0.52.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.52.0
devops-cli-service commentedon Nov 3, 2026
Live since 2026-11-03 18:24 UTC