Repository navigation
Description
Problem
The trace gate of the stage job refuses a Feasibility sentence that is true. It compares a whole code span with the paths that the run read, and it takes the word read inside a quoted line of code as a claim that the run read a file.
The stage prompt asks a plan to cite a line as path:line:text and a symbol as path:def name (the citation rule of #3422). _uncalled_path in src/devops_cli/roadmap/stage/stage_change.py tests span not in trace.paths. A span in one of these forms is never in trace.paths, which holds the bare path, so the gate refuses every citation of a file that the run did read.
Evidence: the Service logs of 2026-11-09 (job failures of the stage job, Loki, 7 days). Of 25 "was read, but the run did not read it" sentences from 15:00Z on, 14 name a citation span. Examples, word for word:
- fix(pr): the plan form names Closes and hides the Plans order #3662: "The Feasibility section states that
src/devops_cli/roadmap/pull_form.py:283:def plan_body_problems(body: str, issue: int) -> list[str]:was read, but the run did not read it." - feat(roadmap): onboard writes labels.yml and clear-status.yml from --from #3742: "The Feasibility section states that
src/devops_cli/roadmap/stores/github_store.py:def repository_filewas read, but the run did not read it." - feat(roadmap): allow-list builder for planner read-only commands #4004: "The Feasibility section states that
src/devops_cli/config/constants.py:308: (("ai", "read"), 60.0, True, False),was read, but the run did not read it." The wordreadhere is part of the quoted line. - fix(ci): devcontainer image build fails on a feature download #3612: "The Feasibility section states that
devcontainer.jsonwas read, but the run did not read it." The run read.devcontainer/devcontainer.json.
The trace gate counted 15.3 refusals in the last 6 hours, the most of any gate.
Expected
- The gate judges the path of a
path:line:textorpath:def namecitation, and the path of a span with a leading./. - A claim that names a file by its name, or by the end of its path, is true when the run read a path that ends with it.
- A code span that is no name of a toolbox tool does not make a claim of a read. The word
readinside a quoted line is not a verb of the plan. - A claim of a path that the run did not read is still refused. The refusal names the path, not the whole citation.
Acceptance criteria
-
uv run devops ci test tests/roadmap/stage/test_roadmap_stage_trace_spans.pypasses. It fails on the base: a citation of a read path is refused, and a quoted line with the wordreadis refused. - A claim of an unread path in any of these forms is still refused (same test file).
-
uv run devops roadmap eval stage --replaykeeps its result: every gate refuses what it must refuse, and 5 of 5 good plans pass.
Existing tool considered
No library judges a sentence of a plan. The change reuses _CITED_PATH and _CODE_SPAN of the same module and adds no parser. Cost: about 25 000 tokens to build, 3 000 to keep, and 1 hour.
Proposed design
Problem statement
The trace gate of the stage job refuses true Feasibility sentences. _uncalled_path in src/devops_cli/roadmap/stage/stage_change.py compares a whole code span with trace.paths. A path:line:text or path:def name citation never matches, because trace.paths holds bare paths. The gate also reads the word read inside a quoted line of code as a claim that the run read a file. A file named by its short name, or with a leading ./, is refused too. The result is the most refusals of any gate.
Acceptance criteria
Requirement: Line citation names its path
The trace gate SHALL judge the path of a path:line:text citation and not the whole span.
Scenario: Citation of a read file with a line
- WHEN a Feasibility sentence says that
src/a.py:12:def f() -> int:was read and the trace holdssrc/a.py - THEN
_trace_problemsreturns no problem
Requirement: Symbol citation names its path
The trace gate SHALL judge the path of a path:def name or path:class name citation.
Scenario: Citation of a read file with a symbol
- WHEN a Feasibility sentence says that
src/a.py:def repository_filewas read and the trace holdssrc/a.py - THEN
_trace_problemsreturns no problem
Requirement: Leading dot slash is ignored
The trace gate SHALL remove a leading ./ from a cited path before it compares the path.
Scenario: Span with a leading dot slash
- WHEN a sentence says that
./src/a.pywas read and the trace holdssrc/a.py - THEN
_trace_problemsreturns no problem
Requirement: A short name matches the end of a read path
The trace gate SHALL treat a file named by its name or by the end of its path as read when the run read a path that ends with it at a path boundary.
Scenario: Name of a file under a hidden folder
- WHEN a sentence says that
devcontainer.jsonwas read and the trace holds.devcontainer/devcontainer.json - THEN
_trace_problemsreturns no problem, and a name such asontainer.jsonthat ends no path at a boundary is still refused
Requirement: Read inside a quoted line is no claim
The trace gate MUST NOT take the word read inside a code span as the verb of a claim.
Scenario: Quoted line with the word read
- WHEN a sentence quotes
src/a.py:308: (("ai", "read"), 60.0, True, False),and holds no other read verb outside code spans - THEN
_trace_problemsreturns no problem
Requirement: An unread path is still refused by its path
The trace gate SHALL refuse a claim that a path was read when the run did not read it, and the refusal SHALL name the path and not the whole citation.
Scenario: Unread path in each form
- WHEN a sentence claims a read of
src/b.py, ofsrc/b.py:3:x = 1or ofsrc/b.py:def g, and the trace holds no such path - THEN
_trace_problemsreturns one problem that namessrc/b.pyin each case
Requirement: The replay keeps its result
The replay of the stage gates SHALL keep its result after the change.
Scenario: Replay of the golden set
- WHEN
uv run devops roadmap eval stage --replayruns - THEN every gate refuses what it must refuse and 5 of 5 good plans pass
Existing Tool Considered
No open, maintained library judges a sentence of a plan against a run trace. The change reuses _CITED_PATH, _LINE_CITATION, _SYMBOL_CITATION and _CODE_SPAN of the same module and adds no parser. Cost of own code: about 25 000 tokens to build, 3 000 to keep, and 1 hour.
Key questions
- Why does the gate refuse a citation of a read file?:
_uncalled_pathtestsspan not in trace.paths. The span of a citation holds the line or the symbol, so it never equals a bare path. The word search forreadruns on the whole sentence, so a quoted line adds a false verb. [sources: src/devops_cli/roadmap/stage/stage_change.py] - How does the gate get the path of a citation?: Match each span with
_LINE_CITATIONand_SYMBOL_CITATIONfirst, and take thepathgroup. Remove a leading./. A span with no citation form is the path itself. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]- Chosen: Reuse the existing citation patterns. The module already defines them for the citation gate of fix(roadmap): the plan check fails a citation of a line that moved #3422, so both gates read one form.
- Rejected: Split the span at the first colon. It breaks on a path with a colon-free name that is not a citation, and it is a second parser.
- How does the gate decide that a short name was read?: A claimed path is read when it equals a trace path or when a trace path ends with
/and the claimed path. The match is at a path boundary, soontainer.jsondoes not match. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]- Chosen: Boundary suffix match. It accepts
devcontainer.jsonfor.devcontainer/devcontainer.jsonand refuses a partial name. - Rejected: Plain string suffix match. It accepts a partial file name, which is a false claim.
- Chosen: Boundary suffix match. It accepts
- How does the gate avoid the false verb inside a quoted line?: Search for the read word in the sentence with each code span removed, except a span that is the name of a toolbox tool. A code span that is no tool name makes no read claim. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py]
- Chosen: Blank the code spans before the verb search. It keeps the verb in prose and drops the verb in quoted code, with no new pattern.
- Rejected: Add
readto a list of excluded words. It fixes one word and fails forranandreadsin other quoted lines.
- Does the plan record keep the paths that the new check compares?:
PlanFacts.ofkeeps the paths that appear in a line ofproposal.feasibility, matched by code span. After the change the check compares the extracted path, so the record must keep a trace path that the extracted path matches by the same rule, or a recheck of a kept plan can differ from the first check. The change must keep the two rules equal. [sources: src/devops_cli/roadmap/stage/stage_plan_record.py:57, openspec/changes/archive/2026-11-09-4281-a-kept-plan-fails-the-trace/design.md]
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 gate is the top refusal source at 15.3 refusals in 6 hours and blocks valid plans.It unblocks every valid plan that cites a read file by path.The body states about 1 hour and 25 000 tokens, reusing existing regexes in the same module.Both fix bugs in the trace gate comparison logic, but #4257 fixes reading only the last run while the candidate fixes comparing a full citation span to a bare path.devops-cli-service commentedon Nov 10, 2026
Status set to Ready at 6c1a629 (see proposed design in issue body).
fix(roadmap): the trace gate judges the path of a citation
fix(roadmap): the trace gate judges the path of a citation (#4299)
devops-cli-service commentedon Nov 10, 2026
Released in v0.103.3: https://github.com/dan-petty/devops-cli/releases/tag/v0.103.3
devops-cli-service commentedon Nov 10, 2026
Live since 2026-11-10 01:54 UTC