Repository navigation
Description
Problem or Motivation
The evidence of a staged plan goes stale between refine and stage. The plan of PR #3400 (for #3394) cites _plan_texts at src/devops_cli/roadmap/stage_change.py:534, and the two fields at :381 and :383. At the plan base main cbc3efc, _plan_texts is at line 551 and the fields at lines 398 and 400. The plan copied the numbers from the refine record, which read a different commit.
A reader who opens a cited line finds another function or another field. The ## Feasibility section is the proof that the premise holds, so a line that moved makes the proof false even when the premise is true. This plan passed every check, and only a reading of the diff found it. The stale citation is also in the issue's refine block, so the defect repeats in each plan that cites a line that the refine step read.
Proposed Solution & Architectural Design
- In
check_proposalofsrc/devops_cli/roadmap/stage_change.py, scanfeasibility,whyandwhat_changesfor a citation of the formpath:line:text. Read the staged tree at that line and refuse the plan when the line does not holdtext, or when the path or the line is absent. The problem names the field and the cited path. - Prefer a symbol citation (
path:def name) where a line is not needed, and let the check resolve the symbol in the staged tree. A symbol citation stays true when the code moves. - Add a test in
tests/roadmap/test_roadmap_stage_content.pythat refuses a citation of a line that holds other text and accepts a citation of the line that holds the quoted text.
Target Subsystem
src/devops_cli/roadmap/stage_change.py (check_proposal, content_problems), tests/roadmap/test_roadmap_stage_content.py.
Existing Tool Considered
No open, maintained tool covers this repository-specific proof rule. The change extends the existing check_proposal text scan and adopts no new dependency. It builds about 4k tokens to implement, about 1k tokens per year to keep and fix, and about half a working day of elapsed time. It deletes no internal code.
Source: PR #3400 review
Proposed design
Problem statement
A staged plan cites path:line:text from a refine record that read another commit. The cited line holds another function or field, so the feasibility proof is false while the premise is true. check_proposal checks no citation, so the plan passes every check. The change resolves each citation against the staged tree, refuses a stale one, and prefers a symbol citation that survives a move.
Acceptance criteria
Requirement: Refuse a stale line citation
The plan check SHALL refuse a path:line:text citation when the cited line of the staged file does not hold the cited text.
Scenario: The line holds another text
- WHEN
feasibilityholdssrc/sample.py:4:def f():and line 4 of the stagedsrc/sample.pyholdsdef g():. - THEN
check_proposalreturns a problem that namesfeasibilityandsrc/sample.py.
Requirement: Accept a true line citation
The plan check SHALL accept a path:line:text citation when the cited line of the staged file holds the cited text.
Scenario: The line holds the cited text
- WHEN
feasibilityholdssrc/sample.py:4:def f():and line 4 of the stagedsrc/sample.pyholdsdef f():. - THEN
check_proposalreturns no problem that namessrc/sample.py.
Requirement: Refuse a citation of an absent line
The plan check MUST refuse a citation when the staged reader returns no such path or the file holds no such line.
Scenario: The line number is past the end of the file
- WHEN
feasibilityholdssrc/sample.py:99:def f():and the staged reader returns the 10 lines ofsrc/sample.py. - THEN
check_proposalreturns a problem that namesfeasibilityandsrc/sample.py.
Requirement: Resolve a symbol citation
The plan check SHALL accept a path:def name or path:class name citation when the staged file defines the symbol at any line.
Scenario: The definition moved
- WHEN
feasibilityholdssrc/sample.py:def fand the stagedsrc/sample.pydefinesdef f(at line 7. - THEN
check_proposalreturns no problem that namessrc/sample.py.
Requirement: Refuse an absent symbol
The plan check MUST refuse a symbol citation when the staged file holds no definition of the symbol.
Scenario: The file defines another symbol
- WHEN
feasibilityholdssrc/sample.py:def fand the stagedsrc/sample.pydefines onlydef g(. - THEN
check_proposalreturns a problem that namesfeasibilityandsrc/sample.py.
Requirement: Scan the three evidence fields
The plan check SHALL scan feasibility, why and each what_changes line for citations.
Scenario: A stale citation sits in what_changes
- WHEN a line of
what_changesholds a citation of a line that holds other text. - THEN
check_proposalreturns a problem that nameswhat_changesand the cited path.
Requirement: Judge no citation without file text
The plan check SHALL judge no citation when it holds no text of the staged files.
Scenario: The replay passes no file text
- WHEN
check_proposalruns with noread_textcallable and the plan holds a stale citation. - THEN
check_proposalreturns no problem for that citation.
Requirement: Compare with collapsed white space
The plan check SHALL compare the cited text with the staged line after it collapses white space in both.
Scenario: The spacing differs
- WHEN
feasibilityholdssrc/sample.py:4:def f():and line 4 holdsdef f():. - THEN
check_proposalreturns no problem that namessrc/sample.py.
Requirement: The prompt prefers a symbol citation
The stage prompt MUST tell the planner to cite a symbol instead of a line number when a line is not needed.
Scenario: The prompt states the symbol form
- WHEN a test reads
src/devops_cli/ai/tasks/roadmap_stage_change.md. - THEN the text holds the
path:def nameform and the instruction to prefer it.
Existing Tool Considered
No check has run. No open, maintained tool covers a repository-specific proof rule that reads a line of the staged tree. The change extends the existing check_proposal text scan and adopts no dependency. It builds about 4k tokens to implement, about 1k tokens per year to keep and fix, and about half a working day of elapsed time.
Key questions
- Which function holds the citation rule,
check_proposalorcontent_problems?: The rule goes incheck_proposal, as a helper that it calls with the staged file text.check_proposalholds the staged tree.content_problemsholds no tree, and the replay calls it with no file text. (best practice) [sources: tests/roadmap/test_roadmap_stage_content.py, src/devops_cli/roadmap/stage_change.py, docs/ROADMAP_WORKFLOW.md]- Chosen: Put the rule in
check_proposal. It holds the staged tree, and the replay can call it without file text. - Rejected: Put the rule in
content_problems. It has no staged tree, and the replay calls it with no file text, so it would refuse good recorded plans. - Rejected: Add a gate in
stage_verify.py. It runs after the plan is written, so a stale citation would already be in the change folder.
- Chosen: Put the rule in
- How does the check read the text of a cited line?:
check_proposalgets an optionalread_textcallable, and it defaults toNone. The stage job passes a reader of the staged commit. A test passes a dict lookup. The replay passes none, so the rule judges nothing. (best practice) [sources: tests/roadmap/test_roadmap_stage_content.py, src/devops_cli/roadmap/stage_paths.py, docs/ROADMAP_WORKFLOW.md]- Chosen: An optional
read_textcallable oncheck_proposal. It reads only the cited paths, keeps the tests offline, and defaults to no judgement. - Rejected: Extend
StagedTreewith a text map. The tree is built from paths before the reply is parsed, so the caller must parse the citations twice. - Rejected: Read the file inside the check. The check would read the working tree, which is not the staged commit, and tests would need files on disk.
- Chosen: An optional
- What citation form does the check accept, and how does it compare the text?: A citation is
path:line:text, and the path holds a dotted file name. The check accepts it when the collapsed line holds the collapsed text, after it strips backticks and one trailing period. A text of fewer than 3 characters is refused. Apath:def nameorpath:class namecitation resolves a definition at any line. (best practice) [sources: tests/roadmap/test_roadmap_stage_content.py, src/devops_cli/roadmap/stage_change.py]- Chosen: Substring of the collapsed line. A citation of a fragment, such as
def _plan_texts, holds, and trailing punctuation does not refuse it. - Rejected: Exact equality of the whole line. A citation of a fragment is refused, and a plan cites a fragment when the line is long.
- Rejected: AST symbol lookup. It needs a parser for every language of a cited file.
- Chosen: Substring of the collapsed line. A citation of a fragment, such as
- Does a citation of an absent path or line fail the plan?: The check refuses a citation when the staged reader returns no line for it: the path is absent or the line number is past the end. It does this only when it holds file text. Without text, it judges nothing. (best practice) [sources: docs/ROADMAP_WORKFLOW.md, tests/roadmap/test_roadmap_stage_content.py]
- Chosen: Refuse only when the check holds file text. The stage job refuses a false proof, and the replay keeps its no-code rule.
- Rejected: Refuse always. The replay's thinned tree holds no text, so it would refuse good recorded plans.
- Rejected: Report a warning only. The plan ships a false proof, which is the defect.
- Which plan fields does the rule scan?: The rule scans
feasibility,whyand each line ofwhat_changes. These are the evidence fields that the issue names. The other fields keep their current rules. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_content.py]- Chosen: The three named fields. They are the evidence fields that the issue names.
- Rejected: Every text of
_plan_texts. It also scanspull_request_bodyand task texts, where a colon is not evidence. - Rejected:
feasibilityonly. It misseswhyandwhat_changes, which the issue names.
- Does the stage prompt ask for a symbol citation?: Add a rule to the stage prompt that prefers
path:def nameto a line number when a line is not needed. A test intests/roadmap/test_roadmap_stage_prompt_rules.pyreads the prompt text. The check still resolves a symbol, so a moved definition keeps the citation true. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/test_roadmap_stage_prompt_rules.py, docs/ROADMAP_WORKFLOW.md]- Chosen: Prompt rule and check. The model writes a symbol citation, and the check still refuses a stale line.
- Rejected: Check only. The model keeps writing line numbers, and the check refuses a good plan after a move.
- Rejected: Symbol citations only. A line number is the right evidence when no symbol names the code.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 4, 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 stale citation makes the feasibility proof false but does not block delivery or expose a security risk.It corrects a false proof in the plan gate, improving trust in staged plans.The change touches one function and adds one test, about half a working day.Both extend check_proposal to verify plan claims against the staged source, but 3407 verifies class-level factual claims while the candidate verifies that a cited line number still holds the quoted text.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 89682e4 (see proposed design in issue body).
devops-cli-service commentedon Nov 4, 2026
Staged: branch
fix/3422-the-plan-check-fails-a-citation, draft pull request #3439. 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:
A model review of the plan found these open findings. The stage keeps this pull request a draft with the label
plan/needs-fixuntil a later round clears them:false_premiseat feasibility, line 2: The plan calls line 551 stale and says the probe shows line 556. The issue says line 551 is the true line at the plan base. No probe in the input shows line 556. Evidence: "At the plan basemaincbc3efc,_plan_textsis at line 551 and the fields at lines 398 and 400."false_premiseat feasibility line 3 and decisions (StagedTree reader): The plan saysStagedTree.readkeeps the checkout and that acallersmethod reads it. Instage_paths.pythe visiblereadonly lists files and builds a tree from paths, and__init__stores no checkout. The plan quotes a change folder that is not in the input. Group 2 builds on a checkout that the tree does not hold. Evidence: "return cls(path for path in listing.split("\0") if path)"spec_delta_wrongat specs, requirementCompare a citation with collapsed white space: The scenario is named "The spacing differs", but the cited text and the staged line are identical. No test can assert white space collapse from it. The issue's version usesdef f():in the citation. Evidence: "feasibilityholdssrc/sample.py:4:def f():and line 4 holdsdef f():."The plan run made 3 model request(s), and used 226032 input tokens and 18061 output tokens. The model made no tool call.
The stage job read the open pull requests and their files in 1 GraphQL request(s).
docs(openspec): fix the #3422 plan false premise and stale citation
docs(openspec): plan #3422 Refuse a plan citation of a moved line (#3439
devops-cli-service commentedon Nov 5, 2026
Stopped at group 3.
Failure class:
refused_tool.Action taken: none.
Action left:
wait: wait for a person.pytest on base: tests/roadmap/test_roadmap_stage_content.pyReason:
Last message of the agent (a claim that no check verified): none.
The job discarded this work. Read it before you retry:
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 ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.devops-cli-service commentedon Nov 5, 2026
The runner Job devops-cli-runner-20261105-170201-254c ended: succeeded.
Image digest: sha256:b8d75df68e94e9d4ee61e9e75dc0752cde409ccc66489f9dd6d459a82818109e
The last lines of its log:
fix(roadmap): refuse a plan citation that the staged file does not hold
devops-cli-service commentedon Nov 6, 2026
Released in v0.66.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.66.0
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 06:16 UTC