Repository navigation
Description
Problem or Motivation
The stage gate checks the form and the paths of a verify command, but it never checks whether the command can pass on the tree that the plan produces. So a plan can give a negative search that proves nothing, or one that fails forever after the change.
The plan of #3372 in pull request #3378 chose ! git grep -n -F devops_cli.roadmap.stage src/ tests/ as the whole-prefix check for a move of the stage* modules. The literal matches from devops_cli.roadmap.stage import on the staged tree. After the move it also matches every new path under devops_cli.roadmap.stage/, such as devops_cli.roadmap.stage.ready. A negative search passes only on exit 1, so this command can never pass on the tree that the plan produces, while the plan's own spec says it must.
The planner has the search_code and references tools, so it can test the literal on the staged commit. The prompt asks it for a ! git grep line but not for the evidence that the line fails before the change and passes after it. The stage gate cannot catch the fault, because form_problems reads the shape of the command and path_problems reads only the paths.
Proposed Solution & Architectural Design
- The stage job runs the literal of each negative-search
verifyon the staged tree withgit grep, and gives the hit count tocheck_proposalas a recorded input, in the same way thatprobescarries the premise probe. The replay reads the count from the stage eval case, so it runs no git. check_proposalrefuses a negative-search literal with no hit on the staged tree: a search that finds nothing already passes before the change and proves nothing.check_proposalrefuses a negative-search literal whose only hits are on paths that the plan creates: the search can never pass on the produced tree.- The stage prompt asks the planner to run
search_codewith the literal and to quote the hit count infeasibility. - A stage eval case holds the plan of docs(openspec): plan #3372 Check every module of a moved prefix #3378 and asserts the two refusals and the accepted literal
devops_cli.roadmap.stage_.
Target Subsystem
src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_form.py, src/devops_cli/ai/tasks/roadmap_stage_change.md
Existing Tool Considered
git grep and the existing search_code and references stage tools cover the search need. No new scanner is needed. The cost is about 10k tokens and 1 hour to build, and nothing to keep.
Proposed design
Problem statement
The stage gate checks the form and the paths of a verify command. It does not check whether a negative search can pass on the tree that the plan produces. A plan can give a search that proves nothing before the change, or a search that fails forever after the change. This issue makes the stage job record git grep evidence and makes check_proposal refuse both faults.
Acceptance criteria
Requirement: Negative-search evidence is recorded
The stage job SHALL run the literal of each negative-search verify command on the staged tree with git grep and record the matching paths and hit count.
Scenario: A negative search has staged hits
- WHEN A plan gives a negative-search
verifycommand and its literal matches files on the staged tree. - THEN The stage job records each matching path and the hit count and passes the record to
check_proposal.
Requirement: A negative search with no staged hit is refused
check_proposal MUST refuse a negative-search literal when the recorded evidence holds no matching path.
Scenario: The literal finds nothing before the change
- WHEN The recorded evidence for a negative-search literal holds no matching path.
- THEN
check_proposalreturns a problem that says the search already passes before the change and proves nothing.
Requirement: A negative search that a created module keeps is refused
check_proposal MUST refuse a negative-search literal when the plan creates a source path whose import path contains the literal.
Scenario: A created module matches the literal
- WHEN A group creates a source path under
src/devops_cli/whose import path contains the negative-search literal. - THEN
check_proposalreturns a problem that says the search can never pass on the produced tree.
Requirement: A negative search with a surviving hit is accepted
check_proposal MUST accept a negative-search literal when the staged tree has a hit and no created source path has an import path that contains the literal.
Scenario: A staged hit survives the change
- WHEN The recorded evidence holds a matching path and no created source path has an import path that contains the literal.
- THEN
check_proposalreturns no problem for that literal.
Requirement: The stage prompt asks for the search evidence
The stage prompt MUST ask the planner to run search_code with the negative-search literal and quote the hit count in feasibility.
Scenario: The planner reads the prompt
- WHEN The stage job plans an item whose plan gives a negative-search
verifycommand. - THEN The prompt tells the planner to call
search_codewith the literal and to quote the hit count infeasibility.
Requirement: The replay uses recorded evidence
The stage eval replay MUST read the negative-search evidence from the eval case and MUST run no git command.
Scenario: The replay judges a negative search
- WHEN The stage eval replay judges a plan with a negative-search
verifycommand. - THEN The replay reads the evidence from the case and runs no
git grep.
Requirement: The eval case covers the #3378 plan
The stage eval case MUST hold the plan of #3378 and assert the no-hit refusal, the created-module refusal, and the acceptance of devops_cli.roadmap.stage_.
Scenario: The replay runs the #3378 plan
- WHEN The stage eval replay runs the case that holds the plan of docs(openspec): plan #3372 Check every module of a moved prefix #3378.
- THEN The replay reports the two refusals and the acceptance for
devops_cli.roadmap.stage_.
Existing Tool Considered
No alternatives check has run. git grep and the existing search_code and references stage tools cover the search need. They lack a check that the literal has a hit before the change and no hit on a path that the plan creates. The gate code costs about 10k tokens and 1 hour to build, and nothing to keep.
Key questions
- How does the stage job give negative-search evidence to
check_proposalwithout a git call in the replay?: The stage job runsgit grepon the staged tree and records the matching paths and hit count for each negative-search literal. It passes that record tocheck_proposalas a recorded input, and the eval case stores the same record for the replay. (best practice) [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_change.py, docs/ROADMAP_WORKFLOW.md:254]- Chosen: Recorded evidence per literal. It follows the
probesinput and lets the replay run no git. - Rejected: Run
git grepincheck_proposal. The replay calls no git, and the check must judge a recorded plan. - Rejected: Record only the total hit count. A total cannot show whether a hit is on a created path.
- Chosen: Recorded evidence per literal. It follows the
- Where does the stage job run the negative-search literal?: In the planner request, on the checkout at the staged commit, before
check_proposaljudges the reply. The job reuses the premise probe path that already reads the staged commit. (best practice) [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_change.py]- Chosen: In the planner request with the premise probe. It already has the checkout and the staged commit.
- Rejected: In
check_proposal. It has no checkout and the replay must run no git. - Rejected: In
stage_form. The form gate has no tree and no hit evidence.
- How does the gate read the literal and paths of a negative-search command?: It reuses
NEGATIVE_SEARCH_WORDand the command grammar ofimplement_shell_policyto read the literal and the relative paths. A command of another form stays withform_problems. (best practice) [sources: src/devops_cli/roadmap/stage_form.py, src/devops_cli/roadmap/implement_shell_policy.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]- Chosen: Reuse the existing negative-search grammar. One grammar already refuses pipes, redirects and unsupported options.
- Rejected: Add a second
git grepparser. It would drift from the shell policy and fromstage_form. - Rejected: Parse the command in the prompt. The gate needs the literal and paths, not a model answer.
- How does the gate detect a literal that the produced tree will keep?: It maps each created source path under
src/devops_cli/to its import path. It refuses the literal when that import path contains the literal, because the new module or its imports will match after the change. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_form.py]- Chosen: Compare the literal with the import path of each created source file. It catches the docs(openspec): plan #3372 Check every module of a moved prefix #3378 package move without reading file content.
- Rejected: Compare only the total hit count. A count cannot show that a new module will match after the change.
- Rejected: Accept every literal with a staged hit. The bad docs(openspec): plan #3372 Check every module of a moved prefix #3378 literal has a staged hit and still fails after the move.
- What does the stage prompt ask the planner to do with the literal?: It asks the planner to call
search_codewith the literal and to quote the hit count infeasibility. The quote ties the plan to the staged commit. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage.py]- Chosen: Ask for
search_codeand a quoted count. The planner has the tool, and the quote gives the evidence that the gate records. - Rejected: Ask only for a
! git grepline. The line gives no evidence that the search fails before the change and passes after it. - Rejected: Leave the check to the gate only. The planner can correct the plan before the gate refuses it.
- Chosen: Ask for
- How does the eval case prove the gate catches the docs(openspec): plan #3372 Check every module of a moved prefix #3378 fault?: The case holds the plan of docs(openspec): plan #3372 Check every module of a moved prefix #3378 and its recorded
git grepevidence. The replay asserts a refusal for the no-hit literal, a refusal for the literal that a created module keeps, and an acceptance fordevops_cli.roadmap.stage_. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:254, src/devops_cli/roadmap/stage_eval_gates.py, src/devops_cli/roadmap/stage_eval_run.py, openspec/changes/3372-the-stage-plan-of-a-module/tasks.md:18]- Chosen: Replay the docs(openspec): plan #3372 Check every module of a moved prefix #3378 plan with recorded evidence. It reproduces the reported fault offline and checks both refusals and the accepted literal.
- Rejected: Add only a unit test of
check_proposal. It does not show that the recorded plan and the replay judge the real fault. - Rejected: Run
git grepin the replay. The replay calls no git.
- Which existing tool covers the search need?:
git grepand the existingsearch_codeandreferencesstage tools cover the search need. No new scanner is needed. The gate code costs about 10k tokens and 1 hour to build, and nothing to keep. (best practice) [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_form.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]- Chosen:
git grepand the existing stage tools. They already run on the staged commit and give the literal evidence. - Rejected: Add a new scanner. It duplicates the search and adds maintenance.
- Rejected: Ask the model to judge the literal. The gate must give the same answer on each run.
- Chosen:
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
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.
Plans can pass the gate with a verify command that can never succeed, but the impact is limited to negative-search verifies that match their own created paths.Prevents a class of unsatisfiable verify commands from passing the stage gate, reducing wasted implement steps.Requires modifying the stage job to run git grep, adding two refusals to check_proposal, updating the prompt, and adding an eval case; the body estimates about 1 hour.Both add a check to check_proposal that reads the staged source, but #3407 checks design claims about a class while this candidate checks whether a verify literal can pass on the produced tree.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 1643cc7 (see proposed design in issue body).
devops-cli-service commentedon Nov 4, 2026
Staged: branch
fix/3410-the-stage-gate-proves-a-negative, draft pull request #3435. 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:spec_delta_wrongat specs roadmap-stage-eval, requirement "The golden set holds the case of a kept negative search", and group 4: The spec and group 4 say the case accepts the whole module prefix of the moved modules. The issue says the whole prefix is refused and onlydevops_cli.roadmap.stage_is accepted. The scenario contradicts the issue and the created-module requirement. Evidence: "assert the no-hit refusal, the created-module refusal and the acceptance of the whole module prefix of the moved modules."A model review of the plan found these points. They stop no draft, and a person judges them:
otherat group 3 and group 4: The issue asks for a stage eval case that holds the plan of docs(openspec): plan #3372 Check every module of a moved prefix #3378 and its recorded evidence. The plan writes a new pytest file instead. It does not changestage_eval_cases.py, whereStageCaseandCaseFactslive, so the case has no field for the evidence that the replay must read. Evidence: "Read the search evidence of the case in src/devops_cli/roadmap/stage_eval_gates.py and pass it to check_proposal as the search record."The plan run made 2 model request(s), and used 151866 input tokens and 19005 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): correct the case of #3410 negative search
docs(openspec): plan #3410 Refuse a negative search that proves nothi…
devops-cli-service commentedon Nov 4, 2026
Released in v0.55.3: https://github.com/dan-petty/devops-cli/releases/tag/v0.55.3
devops-cli-service commentedon Nov 4, 2026
Live since 2026-11-04 14:17 UTC
test(roadmap): add the plan of #3410 and the same plan without its fi…
test(roadmap): name the group of the case and add the replay task to …
fix(roadmap): keep a plan with a dropped criterion in draft (#3718)
feat(roadmap): the plan check requires a new rule to accept its own p…
fix(roadmap): Read the files of a named pull request (#6144)