Repository navigation
Description
Problem or Motivation
A stage plan can build on a false claim about an internal class and pass every check. The plan of PR #3350 says in its design: "StagedTree holds the file text of the staged commit." StagedTree.read runs git ls-files and keeps paths only (src/devops_cli/roadmap/stage_paths.py:79). The plan passed devops openspec check and the stage checks, and an implementation step would have failed on the text that does not exist.
check_proposal tests the paths, the spec delta, the criteria, the form and the content of a plan. It does not test a claim that a plan makes about a class of the staged source. The verification pass can find it, but it keeps the draft and does not return the plan to the planner.
Proposed Solution & Architectural Design
- Add a rule to
check_proposalinsrc/devops_cli/roadmap/stage_change.py: when a design decision, a rejected alternative or a Feasibility line names an internal class undersrc/, it must quote a code span of that class at the staged commit. - Compare each quoted span with the module text that
git showreads at the staged commit, so a plan cannot quote text that the source does not hold. - Add the problem texts to
src/devops_cli/lang/en/messages.py, and add an offline test intests/roadmap/test_roadmap_stage_plan.pyfor a false claim and a true claim. - Add a golden case whose plan holds the false
StagedTreeclaim, and record the defect with thepathsgate so the replay judges it.
Target Subsystem
SDLC, Git & PR Governance
Existing Tool Considered
No open, maintained tool compares a plan claim about an internal class with the source of a commit. The change extends check_proposal and reuses the git show reader and the standard library ast; it adds no dependency. Cost: about 7,000 output tokens to build and test, about 2,000 tokens for each later fix, and about 1 day elapsed.
Proposed design
Problem statement
A stage plan can make a false claim about an internal class and pass every check. The plan of PR #3350 claimed that StagedTree holds file text, but StagedTree.read keeps paths only. The stage job must reject such a plan and return it to the planner.
Acceptance criteria
Requirement: Reject a class claim with no source quote
check_proposal SHALL return a problem when a design decision, a rejected alternative, or a Feasibility line names an internal class under src/ and gives no code span whose text occurs in that class at the staged commit.
Scenario: False StagedTree claim
- WHEN A plan's design decision names
StagedTreeand quotes no text from theStagedTreeclass at the staged commit. - THEN
check_proposalreturns the class-claim problem for that decision.
Requirement: Accept a class claim with a source quote
check_proposal SHALL accept a plan line that names an internal class under src/ when it also gives a code span whose text occurs in that class at the staged commit.
Scenario: True StagedTree claim
- WHEN A plan's design decision names
StagedTreeand quotesgit ls-filesfrom theStagedTreesource at the staged commit. - THEN
check_proposalreturns no class-claim problem for that decision.
Requirement: Compare quotes at the staged commit
The check MUST read each internal class from the staged commit with git show and compare the quoted span with that text.
Scenario: Quote absent from staged source
- WHEN A plan quotes text that the class source at the staged commit does not hold.
- THEN
check_proposalreturns the class-claim problem.
Requirement: Message in the catalog
The new problem text MUST be a message in src/devops_cli/lang/en/messages.py.
Scenario: Problem text resolves
- WHEN The class-claim rule returns a problem.
- THEN The problem uses the
RoadmapMessagesentry and names the class and the plan section.
Requirement: Replay judges the false claim
The stage replay MUST include a golden case whose plan holds the false StagedTree claim, and the paths gate MUST record the defect.
Scenario: Golden case fails the paths gate
- WHEN The stage replay runs the golden case with the false
StagedTreeclaim. - THEN The replay records the class-claim defect under the
pathsgate.
Existing Tool Considered
No alternatives check has run. No open, maintained tool compares a plan claim about an internal class with the source of a commit. The change extends check_proposal and reuses the git show reader and the standard library ast; it adds no dependency. Cost: about 7,000 output tokens to build and test, about 2,000 tokens for each later fix, and about 1 day elapsed.
Key questions
- Which plan sections must obey the class-claim rule?: The design decisions, the rejected alternatives and the Feasibility lines. The rule does not scan every plan text. (best practice) [sources: src/devops_cli/roadmap/stage_change.py]
- Chosen: Design, rejected alternatives and feasibility. These sections make design claims about source code, and the issue names them.
- Rejected: Every plan text. It would reject ordinary prose and broaden the rule beyond the defect.
- Rejected: Model verification only. The verification pass keeps the draft and does not return the plan.
- How does the check find an internal class under
src/?: It builds an index ofClassDefnodes undersrc/at the staged commit with the standard libraryast. It treats a code span that starts with the class name, such asStagedTreeorStagedTree.read, as a claim about that class. (best practice) [sources: src/devops_cli/roadmap/stage_change.py]- Chosen: AST index. It finds class definitions and their source segments, not a word in a comment or a string.
- Rejected: Regex over source text. It can match a comment, a string or a local name.
- Rejected: Model verification. It is not deterministic and does not return the plan.
- How does the check compare a quoted span with the class source?: It reads the module text at the staged commit with
git show. It normalizes whitespace in the class source and the quote, and it requires the quote to occur in that class's source segment. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py:79, src/devops_cli/roadmap/stage_change.py]- Chosen: Whitespace-normalized substring of the class source. It accepts a quote folded to one line and still rejects text that the class does not hold.
- Rejected: Exact raw substring. A plan line folds whitespace, so a valid multi-line quote would fail.
- Rejected: Compare with the working tree. The plan and the paths are checked at the staged commit.
- Where does the rule run?: In
check_proposal, so the stage job and the replay use the same rule set. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_eval_gates.py, src/devops_cli/roadmap/stage.py]- Chosen:
check_proposal. The stage job and the replay already call it. - Rejected: Only the model verification pass. The pass keeps the draft and does not return the plan.
- Rejected: A new command. It adds a path that no job calls.
- Chosen:
- Where does the problem text live?: Add one
RoadmapMessagesentry insrc/devops_cli/lang/en/messages.pyand format it with the class name and the plan section. (best practice) [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage_change.py]- Chosen: Message catalog. Every plan problem uses the catalog, and tests can assert one text.
- Rejected: Inline string. It breaks the message convention and is harder to test.
- How does the golden case record the defect?: Add the false
StagedTreeplan to the stage eval cases and set thepathsgate to expect the class-claim defect. (best practice) [sources: src/devops_cli/roadmap/stage_eval_cases.py, src/devops_cli/roadmap/stage_eval_gates.py, tests/roadmap/test_roadmap_stage_plan.py]- Chosen: Golden case with
pathsgate. The replay judges the same rule that the stage job uses. - Rejected: Unit test only. The issue asks the replay to judge the defect.
- Rejected: Model verification case. The defect must fail a deterministic gate.
- Chosen: Golden case with
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-06: none.
Tool: none found.
Activity
devops-cli-service commentedon Nov 4, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
(roadmap)scope of the title gives the scope.A false class claim can pass all gates and cause a failed implementation step, but it is a quality gap, not a data-loss or security defect.It closes a gap where a plan can assert a wrong class behaviour and still pass every check.The body estimates about 1 day to add the rule, the comparison logic, messages, tests, and a golden case.Both extend the plan check to validate claims about source code, but #3388 targets constant values in a structured field while the candidate targets class behaviour claims verified against git show output.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at ecfc9b8 (see proposed design in issue body).
[-]fix(roadmap): the stage plan checks a claim about a class against the staged source[/-][+]fix(roadmap): Check a class claim against the staged source[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 69 characters, and the limit is 60. The type and the scope stay.
fix(roadmap): the stage plan checks a claim about a class against the staged sourcefix(roadmap): Check a class claim against the staged sourcedevops-cli-service commentedon Nov 6, 2026
Alternatives check: none
Tool: none found
Lacks:
check_proposal) and reuse thegit showreader, so the stage job and the replay share the rule; a separate docs or lint tool would not be called by those paths.ClassDefnodes undersrc/at the staged commit and match whitespace-normalized quotes against the class source segment, which no general-purpose tool does.pathsgate, which no external tool provides.Searches run:
Sources:
Checked on 2026-11-06. A person decides what this means for the item. The check changes no label and closes no issue.
46 remaining items
docs(openspec): archive the change (#3407)
fix(roadmap): Refuse a class claim that the staged source lacks (#3407)
fix(roadmap): Carry the class sources into the replay case facts (#3407)
fix(roadmap): Add the golden case of the false class claim (#3407)
fix(roadmap): Raise the judged baseline for the new case (#3407)
fix(roadmap): update judged baseline for added case (#3407)
fix(roadmap): state the class-claim rule of the paths gate (#3407)
docs(openspec): archive the change (#3407)
fix(roadmap): record case count in stage eval command test (#3407)
devops-cli-service commentedon Nov 16, 2026
Released in v0.164.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.164.0
devops-cli-service commentedon Nov 16, 2026
Live since 2026-11-16 13:55 UTC