Repository navigation
Description
Problem
The trace gate of the stage job compares the Feasibility claims of a plan with the tool calls of only the last agent run. After the one return of a refused reply, the planner makes a second run. The second run often calls no tool, because the plan already holds the facts. A claim that the first run made true is then refused.
Evidence: the live run of the stage job on item #4062 (2026-11-09, model Sonnet) ended with two refusals of the trace gate: "The Feasibility section names the tool read_issue, but the run did not call it." and the same for find_issues. They came with the content and citation refusals, so the plan was returned once.
Where: _Planner._trace_facts in src/devops_cli/roadmap/stage/stage.py returns TraceFacts.of(traces[-1]). ToolboxClient.chat_structured appends a new RunTrace for each planner run and each review run to the one shared list. So after a return, traces[-1] is the run of the return, and the calls of the first run are dropped. The same holds for each repair round of the review (_repaired). I read the code to check the cause; I did not run the model again.
Expected
The facts for a reply are the facts of all planner runs of the item so far (the first run and each return). The runs of the review are not planner runs: a read of the reviewer does not support a claim of the planner.
Acceptance criteria
- A unit test makes a toolbox client that records a
read_issuecall in its first run and no call in its second run, and a plan whose Feasibility saysread_issuereturned the issue. The first reply is refused for another reason, so the planner returns it once. The second reply passes the trace gate. Command:uv run devops ci test tests/roadmap/stage/test_roadmap_stage_gates.py. It fails today: the problem says that the run did not callread_issue. - A unit test records a
read_issuecall in a review run only. A plan that claimsread_issueis still refused. - The golden set of the stage eval still passes. Command:
uv run devops roadmap eval stage --replay.
Existing tool considered
RunTrace.combined and TraceFacts.of exist and cover the join of runs. No new library and no new helper.
Cost
- Tokens to build: low to medium (the planner must tell planner runs from review runs).
- Tokens to keep and to fix: low.
- Elapsed time: about 1 hour.
Related
#4204, #4170 (the trace gate), #3529. The spec requirement "Trace facts of a run" in openspec/specs/roadmap-stage/spec.md says "the facts of the run that wrote each reply".
Proposed design
Problem statement
The trace gate of the stage job reads the tool calls of only the last agent run. After a refused reply, the planner makes a second run that often calls no tool. A Feasibility claim that the first run made true is then refused. The gate must read the facts of all planner runs of the item, and never the runs of the review.
Acceptance criteria
Requirement: Facts of all planner runs
The planner SHALL pass to the trace gate the combined facts of every planner run of the item so far.
Scenario: A first run reads the issue and the second run calls no tool
- WHEN the first run records a
read_issuecall, the first reply is refused for another reason, the second run records no call, and the Feasibility of the second reply saysread_issuereturned the issue - THEN the trace gate finds no problem for the second reply
Requirement: Review runs give no planner facts
The planner SHALL NOT count a call of a review run as a fact that supports a claim of the planner.
Scenario: Only a review run calls read_issue
- WHEN a review run records a
read_issuecall, the planner runs record none, and the plan claimsread_issue - THEN the trace gate refuses the claim and names
read_issue
Requirement: Repair rounds keep the earlier planner facts
The planner SHALL give the gate of each repair round of the review the facts of all planner runs, the repair run included.
Scenario: A repair run calls no tool
- WHEN the first planner run calls
read_issue, a review returns the plan, and the repair run calls no tool and claimsread_issue - THEN the trace gate finds no problem for the repaired reply
Requirement: Golden set stays green
The change MUST keep the replay of the golden set of the stage eval passing.
Scenario: Replay of the golden set
- WHEN
uv run devops roadmap eval stage --replayruns - THEN every case passes as before
Existing Tool Considered
No outside tool covers this. The change is a small fix of the project's own code. RunTrace.combined and TraceFacts.of already join runs and build facts, so no new library and no new helper is needed. Cost: low to medium tokens to build, low to keep, and about 1 hour.
Key questions
- How does the planner tell planner runs from review runs in the shared trace list?: Mark the position in the shared list.
_Plannerrecords each planner run in its own list of traces, or tracks the indexes of the traces that_askappends. The review traces stay out of that list. The gate then callsTraceFacts.of(RunTrace.combined(planner_traces)). (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/agent_run.py]- Chosen: Record the index range of each planner ask. Only
_askruns a planner run. The planner takes the traces that the call appended, so review runs never enter. - Rejected: Add a role field to RunTrace. It changes a shared type that the refine job and the MCP code also use, for a small gain.
- Rejected: Join all traces and drop the review ones by position at read time. Review runs and planner runs interleave after repair rounds, so position alone is fragile.
- Chosen: Record the index range of each planner ask. Only
- Does a helper already join runs and build facts?: Yes.
RunTrace.combinedjoins several traces, andTraceFacts.ofbuilds the facts of one trace. The change only chooses which traces to join. [sources: src/devops_cli/roadmap/agent_run.py, src/devops_cli/roadmap/stage/stage.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 9, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.The bug causes false refusals of valid plans, wasting a round trip and tokens, but the system recovers.It removes false refusals that block valid plans and waste planner tokens on each return.The body states about 1 hour and notes that RunTrace.combined and TraceFacts.of already exist for the join.Both items work on the trace gate in the stage job, but #3266 created the gate while the candidate fixes its scope to read all planner runs.devops-cli-service commentedon Nov 9, 2026
Status set to Ready at d31717d (see proposed design in issue body).
devops-cli-service commentedon Nov 9, 2026
Released in v0.103.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.103.0
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 21:51 UTC