Repository navigation
Description
Problem or Motivation
The stage job accepts a claim about a prior pull request or plan without reading that pull request. #3410 is the evidence. Its body says "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." Pull request #3378 holds no move group. Its plan adds the move-prefix check to src/devops_cli/roadmap/stage_move.py, and its tests use the literal as a case. The refine job published the claim in the proposed design. The plan of #3435 repeated it in Feasibility. The stage review made no tool call and did not catch it. A plan can therefore open a draft on a premise that the named pull request contradicts.
Proposed Solution & Architectural Design
- The stage verification pass reads the files of a pull request or plan that the issue or a plan line names, at the merge commit of that pull request.
- The pass reports a claim that the files do not support as an open finding with the path and the quoted text, so the plan returns to the planner.
- When the body of an issue makes the claim, the stage job returns the item with the evidence and plans nothing.
- Add a test with the fix(roadmap): the stage gate proves a negative search verify #3410 claim: the claim names a literal and a move, and the recorded docs(openspec): plan #3372 Check every module of a moved prefix #3378 plan holds no move group.
Target Subsystem
src/devops_cli/ai/tasks/roadmap_stage_verify.md, src/devops_cli/roadmap/stage_verify.py, src/devops_cli/roadmap/stage.py
Existing Tool Considered
The stage probe (src/devops_cli/roadmap/stage_probe.py) already reads a commit with git cat-file, git grep and git log. This change extends that read to the files of a named pull request and adds no new tool. The cost is about 5,000 tokens to build and test and about 1 hour elapsed.
Alternatives check of 2026-11-07: none.
Tool: none found.
Proposed design
Problem statement
The stage verification pass accepts a claim about a prior pull request without reading that pull request. #3410 is the evidence: its body says that the plan of #3372 in pull request #3378 chose ! git grep -n -F devops_cli.roadmap.stage src/ tests/ as the whole-prefix check of a move of the stage* modules, and the recorded #3378 plan at merge commit 6c15a64a614941629669a181e3220ae8bc7e27d0 holds no move group: it adds the move-prefix check to src/devops_cli/roadmap/stage_move.py, and its test uses the literal as a case. A plan can therefore open a draft on a premise that the named pull request contradicts. This change reads the changed files of each named pull request at its merge commit, adds them to the verification input, and reports a claim that those files do not support as a false_premise finding that returns the plan to the planner. The return of the item when its body states a false premise waits for #5701, because #3478 removed the premise_failed reply key from StageProposal.
Acceptance criteria
Requirement: Named pull request files at the merge commit
The stage verification input SHALL hold the changed files of each pull request that the issue body or the plan names, read at that pull request's merge commit.
Scenario: A named pull request is read at its merge commit
- WHEN The issue body names
pull request #3378, and the pull request read returns merge commitabc123. - THEN The verification input holds a
pull_requestsentry for3378with the commitabc123and a path-to-text map of the files that the pull request changed.
Requirement: Only a named pull request number is read
The stage job SHALL read a pull request number only when the phrase pull request # or PR # names it, in the issue body or in the plan texts.
Scenario: A bare issue reference is not read
- WHEN The issue body holds
#3410with no phrase before it and also holdspull request #3378. - THEN The verification input holds an entry for
3378and no entry for3410.
Requirement: A pull request that cannot be read leaves the plan running
The stage job MUST record a named pull request that it cannot read at a merge commit as no entry in the verification input, and SHALL go on with the plan.
Scenario: A named pull request has no merge commit
- WHEN The issue body names
pull request #3378, and the pull request read reports that it is not merged. - THEN The verification input holds no
pull_requestsentry for3378, the pass still runs, and the plan is not stopped by the read.
Requirement: A pull request quote is evidence
The verification pass MUST treat a quote from a named pull request file as a text of its input, so that a false_premise finding with that quote is open.
Scenario: A false-premise finding quotes a pull request file
- WHEN The verifier returns a
false_premisefinding of severitymajorwhosequoteis a line of a file that the docs(openspec): plan #3372 Check every module of a moved prefix #3378 pull request changed. - THEN The finding is open, and the repair rounds return the plan to the planner.
Requirement: Bounded pull request read
The verification input SHALL read no more than CONST_ROADMAP_STAGE_VERIFY_MAX_FILES files from a named pull request and SHALL cut each file to CONST_ROADMAP_STAGE_VERIFY_FILE_MAX_TOKENS tokens.
Scenario: A large pull request is bounded
- WHEN A named pull request changes more files than the maximum, and each file is longer than the token limit.
- THEN The input holds at most the maximum number of files, and each held file is cut to the token limit.
Requirement: The prompt names the pull request files
The stage verification prompt SHALL name the pull_requests key and SHALL tell the model to check a claim against those files.
Scenario: The verification prompt is loaded
- WHEN The stage verification task loads
src/devops_cli/ai/tasks/roadmap_stage_verify.md. - THEN The prompt names
pull_requests, its merge commit and its path-to-text map.
Requirement: Regression case for #3410
The test suite MUST hold the #3410 claim, the literal ! git grep -n -F devops_cli.roadmap.stage src/ tests/, and the recorded #3378 plan at merge commit 6c15a64a614941629669a181e3220ae8bc7e27d0, which holds no move group.
Scenario: The #3410 claim is checked
- WHEN The test builds the verification input for the fix(roadmap): the stage gate proves a negative search verify #3410 issue body with the recorded docs(openspec): plan #3372 Check every module of a moved prefix #3378 plan and its files, and a
false_premisefinding quotes the literal from a file that the docs(openspec): plan #3372 Check every module of a moved prefix #3378 pull request changed. - THEN The input holds the docs(openspec): plan #3372 Check every module of a moved prefix #3378 file with the literal, the recorded docs(openspec): plan #3372 Check every module of a moved prefix #3378 plan holds no move group, and the finding is open.
Existing Tool Considered
gidgethub, the GitHub client of the project's session (docs/adr/0006-github-session-requests-go-through-gidgethub.md), covers the authenticated REST read of a pull request and its merge commit, and the git wrapper of src/devops_cli/roadmap/clone_git.py covers the read of a commit's tree. Neither gives the changed-file path-to-text map at the merge commit, the file and token bound, or the false_premise finding; the alternatives check of 2026-11-07 found no tool that does, and cli/cli (pull request metadata and diff, not the merge-commit tree) and guardrails-ai (schema checks on model output, no repository evidence) lack the same parts. The change adds that integration in-repo and no new dependency. The written cost is about 5,000 tokens to build, keep and fix the code and about 1 hour elapsed.
Key questions
- Which paths hold the stage verification pass and the stage job?:
src/devops_cli/roadmap/stage/stage_verify.pyholds the verification pass, andsrc/devops_cli/roadmap/stage/stage.pyholds the stage job. The body'ssrc/devops_cli/roadmap/stage_verify.pyandsrc/devops_cli/roadmap/stage.pyname no file. [sources: src/devops_cli/roadmap/stage/stage_verify.py, src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stage/stage_change.py:685] - Does the docs(openspec): plan #3372 Check every module of a moved prefix #3378 plan at its merge commit hold a move group?: No. The recorded plan of docs(openspec): plan #3372 Check every module of a moved prefix #3378 at merge commit
6c15a64a614941629669a181e3220ae8bc7e27d0is the archived changeopenspec/changes/archive/2026-11-04-3372-the-stage-plan-of-a-module/: it addsmove_prefix_problemstosrc/devops_cli/roadmap/stage_move.pyand its test uses the literal! git grep -n -F devops_cli.roadmap.stage src/ tests/as a case. The eval fixturetests/fixtures/roadmap_eval/stage/3372-the-stage-plan-of-a-module/plan.json, which the same case file labels pull 3378, is the recorded first plan that the pass scored and does hold a move group, so the regression case reads the archived plan and not that fixture. [sources: openspec/changes/archive/2026-11-04-3372-the-stage-plan-of-a-module/proposal.md:11, openspec/changes/archive/2026-11-04-3372-the-stage-plan-of-a-module/tasks.md:9, tests/roadmap/stage/test_roadmap_stage_move_prefix.py:102, tests/fixtures/roadmap_eval/stage/3372-the-stage-plan-of-a-module/case.json:6, tests/fixtures/roadmap_eval/stage/3372-the-stage-plan-of-a-module/plan.json:21] - How does the stage job obtain the files of a named pull request at its merge commit?: Read the pull request with the GitHub session client (
StageGitHub) for itsmerge_commit_sha, one GET through gidgethub. Fetch that commit fromorigininto the stage clone, then read the diff of the merge commit against its first parent and the text of each kept path at that commit with the git wrapper the stage probe already uses (git fetch, thengit show <sha>:<path>orcheckout_at). No per-file GitHub request is sent. (best practice) [sources: docs/adr/0006-github-session-requests-go-through-gidgethub.md, src/devops_cli/roadmap/stage/stage_github.py:59, src/devops_cli/github/client.py:235, src/devops_cli/roadmap/clone_git.py:39, src/devops_cli/roadmap/clone_git.py:64, ARCHITECTURE.md:207, src/devops_cli/roadmap/stage/stage_probe.py:156]- Chosen: GitHub metadata and git read. One API request gives the exact merge commit, the fetch follows the stage job's own rule that it plans on the commit it fetched from origin, and the local read reuses the bounded, read-only git read of the probe.
- Rejected: GitHub changed-files and contents endpoints only. It needs one request for each kept file, each paced and charged on the identity's quota ledger, and the contents answer is cut and encoded.
- Rejected: Local merge ref only. The ref can be absent and does not name the merge commit for every merge method.
- Which files of the named pull request does the verification input hold?: Hold the files that the pull request changed at its merge commit, with the OpenSpec change folder and the paths that the claim names first.
CONST_ROADMAP_STAGE_VERIFY_MAX_FILESbounds the list, andCONST_ROADMAP_STAGE_VERIFY_FILE_MAX_TOKENSbounds each file. (best practice) [sources: src/devops_cli/config/constants.py:3519, src/devops_cli/config/constants.py:3520, src/devops_cli/roadmap/stage/stage_verify.py:405]- Chosen: Changed files with priority. It gives evidence for the claim and stays inside the file and token budget.
- Rejected: Every file at the merge commit. It exceeds the file and token budget.
- Rejected: Only the paths in the claim. A plan file that the claim does not cite can contradict the claim.
- How does the verifier receive the named pull request files and check a quote?: Add a
pull_requestskey toVerificationInput.payload. Each entry holds the number, the merge commit and a map of path to text.request_textsyields those texts, so thecontainscheck accepts a quote from a pull request file as evidence. (best practice) [sources: src/devops_cli/roadmap/stage/stage_verify.py:473, src/devops_cli/roadmap/stage/stage_verify.py:502, src/devops_cli/roadmap/stage/stage_verify.py:516, src/devops_cli/ai/tasks/roadmap_stage_verify.md:32]- Chosen: Separate
pull_requestskey. It keeps repository files and pull request files apart and keeps a path exact. - Rejected: Merge into
fileswith a prefix. A path can collide and the model cannot tell a repository file from a pull request file. - Rejected: Send only the pull request paths. No quoted text shows the contradiction.
- Chosen: Separate
- Which finding type and return path does an unsupported pull request claim use?: Use
false_premisewith severityblockerormajor. The locator names the plan'sfeasibilitysection (partproposal) or the text of the issue (partissue);problemnames the pull request path and the claim;quoteis the exact line of the pull request file. The open rules (OPEN_TYPES,OPEN_SEVERITIES,holds,contains) then return the plan to the planner. (best practice) [sources: src/devops_cli/roadmap/stage/stage_verify.py:88, src/devops_cli/roadmap/stage/stage_verify.py:104, src/devops_cli/roadmap/stage/stage_verify.py:147, openspec/specs/roadmap-stage/verification/spec.md:38]- Chosen:
false_premise. It is already an open type with a quote check, and an open finding returns the plan. - Rejected: New defect type. It changes the nine-type schema and the golden set.
- Rejected:
other. It names no premise and hides the defect class from the repair round.
- Chosen:
- How does the job find the pull request numbers in the issue body and the plan?: Match the phrases
pull request #andPR #only, without case, in the issue body and the plan texts. Read each number once, in first-seen order. Do not read a bare#. (best practice) [sources: tests/fixtures/roadmap_eval/stage/3410-a-plan-that-states-a-wrong-constant/issue.txt, src/devops_cli/roadmap/stage/stage_verify.py:473]- Chosen: Explicit phrases only. The fix(roadmap): the stage gate proves a negative search verify #3410 body holds
pull request #3378and bare#3410and#3435, so the phrase avoids reads of unrelated issue numbers and keeps the input bounded. - Rejected: Every
#. Issue references and cross-links cause unrelated reads. - Rejected: Let the model choose the numbers. The input is built before the model call and must be testable.
- Chosen: Explicit phrases only. The fix(roadmap): the stage gate proves a negative search verify #3410 body holds
- Does this change return the item when the issue body states a false premise?: No. The item feat(roadmap): Return a stage item when the body states a false premise #5701 delivers that path. fix(roadmap): a placeholder reply of a model moves no item #3478 removed
premise_failedfromStageProposal, andsrc/devops_cli/roadmap/stage/stage_change.py:685holds no such key, so a body-claim return needs a reply field and a return path that this change does not add. This change reports the finding and returns the plan to the planner. (best practice) [sources: openspec/changes/archive/2026-11-04-3478-a-placeholder-reply-of-a-model/design.md:5, src/devops_cli/roadmap/stage/stage_change.py:685]- Rejected: Return the item in this change. It adds a second return path and a second reply field to this change.
- Chosen: Defer the return to feat(roadmap): Return a stage item when the body states a false premise #5701. It keeps this change in one pull request and lets feat(roadmap): Return a stage item when the body states a false premise #5701 build the return path.
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.
A plan can open a draft on a false premise, but other gates still exist in the pipeline.Prevents plans built on false claims about prior PRs, reducing rework and bad drafts.The body estimates about 5,000 tokens and 1 hour elapsed.Both verify claims in a stage plan, but #3407 checks a claim about a class against the staged source while the candidate checks a claim about a prior PR against that PR's files at its merge commit.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at d478e5f (see proposed design in issue body).
[-]fix(roadmap): the plan checks a claim about a prior pull request against its files[/-][+]fix(roadmap): Read named pull request files to verify claims[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 68 characters, and the limit is 60. The type and the scope stay.
fix(roadmap): the plan checks a claim about a prior pull request against its filesfix(roadmap): Read named pull request files to verify claimsdevops-cli-service commentedon Nov 7, 2026
Alternatives check: none
Reason: The searches surfaced no open, maintained tool or library that reads a named pull request's files at its merge commit and checks a stage plan's claim against the quoted text. The closest general-purpose options, the GitHub CLI (pull request metadata/diff, not the merge-commit tree) and guardrails-ai (schema/validator checks on model output, not repository evidence), do not cover that need, and the issue itself says the change extends the existing in-repo stage probe and adds no new tool.
Tool: none found
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-07. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 14, 2026
Returned to New: the design's third requirement cannot be built on main. It asks the planner to reply
premise_failed, but #3478 removed that key fromStageProposal:src/devops_cli/roadmap/stage/stage_change.py:678says "The reply has no key to report a false premise: an issue that cannot be built as written is said infeasibility(#3478)", andsrc/devops_cli/ai/tasks/roadmap_stage_change.mdstates the same. Building requirement 3 would reverse #3478, which is outside this issue, and would need the item's body-claim path redesigned (the planner states the false premise infeasibility, and the job keeps the plan or returns it by another rule).Buildable remainder: requirements 1, 2, 4, 5 and 6 read the named pull request files at the merge commit into the verification input, allow a
false_premisefinding to quote one, bound the read, namepull_requestsin the verify prompt, and add the #3410 regression. A refine round should split the body-claim rule into its own item, or decide how it replaces the removed reply key.devops-cli-service commentedon Nov 14, 2026
Status set to Ready at 9f9fa49 (see proposed design in issue body).
Moved to new items: #5701.
dan-petty commentedon Nov 17, 2026
Issue 3447 is held by the branch origin/fix/3447-verify-named-pull-request-files with a commit by Daniel Petty. devops repos worktrees add refuses it.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 19bfec3 (see proposed design in issue body).
devops-cli-service commentedon Nov 17, 2026
Released in v0.171.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.171.0
devops-cli-service commentedon Nov 17, 2026
Live since 2026-11-17 09:25 UTC