Repository navigation
Description
Problem or Motivation
When devops roadmap stage plans an issue whose requested code changes have already been merged into origin/main in an earlier pull request, the stage job has no automated check to detect that the functional premise is already delivered.
In issue #4057 (perf(roadmap): cache registry_table in stage eval replay), commit 8476163 (pull request #3981) had already threaded registry_table through PlanUnderTest, _path_gate, replay_case, and replay_all. When devops roadmap stage planned #4057, it discovered in its probe that the code already existed on origin/main. Because the stage pipeline lacks a mechanism to detect that an issue is already merged or functionally resolved, it was forced to contrive a skip_specs: true plan with regression tests only, which then had to go through the full 2-PR service cycle (plan PR waiting for human merge, followed by a separate implement runner job).
Proposed Solution & Architectural Design
- In
src/devops_cli/roadmap/stage/stage_probe.py, detect when the functions, arguments, or fixes cited in the issue body or refine section are already present on the staging base tree (origin/main). - When the functional fix is already merged:
- Provide an automated diagnostic that returns the issue with evidence citing the merged commit (
devops roadmap return <issue> --comment "... already merged in <commit>"), so a maintainer can close it as already resolved or superseded; - If tests are genuinely missing, suggest splitting or re-titling the candidate to test debt (
type/test,priority/p3-low) rather than consuming high-priority service slots.
- Provide an automated diagnostic that returns the issue with evidence citing the merged commit (
Target Subsystem
AI & Agentic Review Pipeline
Existing Tool Considered
git log and ast inspection in stage_probe.py. Checking whether cited symbols and signatures already exist in the staging tree requires approximately 3,000 tokens to implement and test.
Standards Compliance
- I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
- I am willing to submit a pull request implementing this feature with accompanying tests.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Alternatives check of 2026-11-25: in-use.
The repository already uses this tool.
Tool: git/git (https://github.com/git/git), NOASSERTION, last activity 2026-11-24, maintained.
Reason: Searches found no standalone tool for this; git, which the probe already runs, supplies the existence and adding-commit facts, but not the delivered-premise judgement, the reply field, or the stage return path.
Covers:
- Names the commit that last added a cited identifier
- Confirms a cited path or symbol exists at the staging commit
- Finds the commit that added a cited path with --diff-filter=A
Lacks:
- No judgement that a present symbol means the change is delivered
- No plan-reply field or prompt rule recording the premise
- No return-to-New path that quotes the adding commits
- No accounting of the extra reads against the probe command bound
Proposed design
Problem statement
The stage job has no check for an item whose cited change a merged commit already delivered. Issue #4057 showed the cost: the job planned regression tests only, and the plan took a plan pull request and a separate runner job. The stage job must report the merged commit and return the item to New with evidence.
Acceptance criteria
Requirement: Probe reports the commit of a cited identifier
When the staging commit defines an identifier that the issue cites, the premise probe SHALL report the commit that last added its text.
Scenario: A cited identifier already exists
- WHEN The issue cites an identifier that a commit added before the staging commit.
- THEN The probe line for that identifier names the short hash and the date of that commit.
Requirement: Probe reports the commit of a cited path
When the staging commit holds a path that the issue cites, the premise probe SHALL report the commit that added that path.
Scenario: A cited path already exists
- WHEN The issue cites a path that a commit added before the staging commit.
- THEN The probe line for that path names the short hash of the adding commit.
Requirement: Probe states that the premise is already present
The premise probe MUST add one summary line when every path and identifier that the issue cites exists at the staging commit.
Scenario: Every cited item exists
- WHEN Each cited path and each cited identifier exists at the staging commit.
- THEN The probe text holds one line that says the premise is already present and names the cited items.
Requirement: New probe reads stay inside the command bound
The probe MUST count each read of an adding commit against CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS.
Scenario: The bound stops the new reads
- WHEN The issue cites more identifiers than the remaining commands can serve.
- THEN The probe runs no more than the bound and lists each item that it did not probe.
Requirement: The stage reply holds the premise field
The stage plan reply MUST hold a boolean premise_delivered field that defaults to false.
Scenario: A recorded reply omits the field
- WHEN A recorded plan reply holds no
premise_deliveredkey. - THEN The reply parses with
premise_deliveredfalse.
Requirement: The prompt gives the rule of the premise field
The staging prompt SHALL state that the planner sets premise_delivered true only when the probe reports the premise already present.
Scenario: The prompt text is read
- WHEN The staging prompt text is read.
- THEN It holds the field name, the rule that limits it to the probe evidence, and the instruction to quote the premise line.
Requirement: A delivered premise returns the item
When the plan sets premise_delivered true, the stage job MUST return the item to New with a comment that names each adding commit.
Scenario: The plan marks the premise delivered
- WHEN The reply holds
premise_deliveredtrue and the probe found an adding commit. - THEN The job writes no branch and no pull request, and its comment names each adding commit.
Requirement: The return comment offers the test-debt path
The return comment SHALL state that a person may re-title the item as test debt with the type test.
Scenario: The comment of a delivered premise
- WHEN The job returns an item whose premise is already present.
- THEN The comment states the
testtype and that a person sets the title and the labels.
Requirement: A claim without probe evidence is refused
When the plan sets premise_delivered true and the probe found no present cited item, the stage job MUST refuse the reply.
Scenario: The claim has no evidence
- WHEN The reply holds
premise_deliveredtrue and the probe reports no cited item present. - THEN The job refuses the reply with a form problem and returns no item.
Existing Tool Considered
The alternatives check in the issue body records the verdict in-use for git/git (https://github.com/git/git). The block covers the detection. git cat-file, git grep, git log -S and git log --diff-filter=A find a cited path or identifier and its adding commit at the staging commit. The block lacks the delivered-premise judgement, the premise_delivered reply field and the prompt rule. It also lacks the return-to-New path and the accounting of extra reads against the probe command bound. The proposal adds these parts in src/devops_cli/roadmap/stage/stage_probe.py, src/devops_cli/roadmap/stage/stage_models.py, the staging prompt and the stage return path.
Key questions
- Which tool detects that a cited path or identifier already exists at the staging commit?:
git/gitat the staging commit.probe_premisealready runsgit cat-file,git grep,git logandgit ls-tree, anddefinition_linesfinds the definition of each cited identifier. The alternatives check recordsin-useforgit/git. (best practice) [sources: src/devops_cli/roadmap/stage/stage_probe.py, src/devops_cli/roadmap/premise.py]- Chosen: git/git. The probe already runs git at the staging commit, and the alternatives block records it as in-use.
- Rejected: A second probe module. It repeats the checkout and the command budget, and the model reads two texts.
- Rejected: Existing
stage_probe_definedlines only. Those lines name no commit, so the return comment cannot cite the merged commit.
- Where does the probe report an item that already exists?: In
probe_premise, with new fields and lines onProbe. One pass keeps one command bound and one text for the model. (best practice) [sources: src/devops_cli/roadmap/stage/stage_probe.py, src/devops_cli/config/constants.py:3827]- Chosen: Extend
Probeandprobe_premisewith the adding commit of each present item. The probe holds the checkout, the commit and the budget, so a second pass would double the commands. - Rejected: Add a second probe module for merged changes. It repeats the checkout and the budget, and the model reads two texts.
- Rejected: Let the planner read the existing
stage_probe_definedlines only. Those lines name no commit, so the return comment cannot cite the merged commit.
- Chosen: Extend
- How does the stage job learn that the premise is already delivered?: From a boolean
premise_deliveredin the plan reply. The planner sets it from the probe lines, and the job acts only on that field. (best practice) [sources: src/devops_cli/roadmap/stage/stage_models.py, AGENTS.md]- Chosen: A
premise_deliveredboolean in the plan reply. A cited symbol that exists is no proof that the requested change is delivered, so the judgement needs a record. - Rejected: Return the item whenever every cited item exists. An item that asks for tests around existing code cites symbols that exist, so this rule would return a real item.
- Rejected: Comment the evidence and stage the item. The item still takes a plan pull request and a runner job, which is the cost that this item removes.
- Chosen: A
- What does the stage job do when the plan marks the premise delivered?: It returns the item to New with a comment that names each adding commit. It writes no branch and no pull request. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, CONTEXT.md]
- Chosen: Return the item to New with the evidence. This is the existing path for a false premise, and refine reads the evidence of a stage return.
- Rejected: Close the item as not planned. A close is a decision on the record that the maintainer makes after the evidence.
- Rejected: Stage the plan with a comment. It keeps the two-pull-request cycle that this item removes.
- Does the stage job re-title the item as test debt?: No. The return comment states the option, and a person sets the title and the labels. (best practice) [sources: CONTEXT.md, AGENTS.md]
- Chosen: State the option in the return comment. The stage job changes no label that a person set, and the title is a person's edit.
- Rejected: Re-title the item with the type
testandpriority/p3-low. The stage job changes no label that a person set, and intake sets the priority.
- Which commit does the probe name as the adding commit?:
git log -S<name>for an identifier, andgit log --diff-filter=Afor a path. The probe uses the existingnewest_commithelper. (best practice) [sources: src/devops_cli/roadmap/stage/stage_probe.py]- Chosen:
-Sfor an identifier and--diff-filter=Afor a path.-Sfinds the commit that changed the count of the text, and--diff-filter=Afinds the commit that added a path. - Rejected:
--diff-filter=Afor both. It finds the commit that added a file, not the commit that added an identifier to an existing file. - Rejected:
git blameon the definition line. It names the last commit of the line, which may be a later edit, and it reads one file for each hit.
- Chosen:
- Which command bound holds the new reads?:
CONST_ROADMAP_STAGE_PROBE_MAX_COMMANDS, the existing bound of the probe. (best practice) [sources: src/devops_cli/config/constants.py:3827, src/devops_cli/roadmap/stage/stage_probe.py]- Chosen: The existing bound. One probe has one budget, and a second bound would need a second skip message.
- Rejected: A new constant for the merged check. Two bounds for one run give two rules to keep.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 8, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It prevents wasted two-PR service cycles but does not block the pipeline from functioning.It saves maintainer time and service slots by catching already-delivered issues early in staging.The body estimates roughly 3000 tokens of implementation and testing across stage_probe.py and related modules.Both verify claims about prior work in the stage pipeline, but the candidate detects already-merged code on origin/main while #3447 reads named PR files to check specific claims.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at c20f73d (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: in-use
Reason: Searches found no separate maintained tool for "is this issue's premise already merged"; the only tool that covers the detection is git, whose
ls-tree/cat-file/grepalready tell whether a cited path or identifier exists at the staging commit and whoselog -S/log --diff-filter=Agive the adding commit, and the issue itself saysprobe_premisealready runs these. It covers only that detection step: thepremise_deliveredreply field, the prompt rule, the return-to-New comment and the refusal of an unevidenced claim are stage-pipeline code that no external tool supplies.The item already names this tool.
Tool: git/git (https://github.com/git/git)
Covers:
git ls-tree,git cat-file)git grep)git log -S) or added a path (git log --diff-filter=A)Lacks:
premise_deliveredfield on the stage plan reply and its default of falsepremise_deliveredclaim that has no probe evidence, and the test-debt suggestion in the return commentTools considered:
Searches run:
Sources:
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
fix(roadmap): Tell the stage planner what counts as source code (#6335)
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 30, 2026
Triage under #6519 (owner instruction of 2026-11-30), before the hold #6521 closes. This item adds or extends a gate, refusal, screen, cap, limit, retry, result line, shell allowlist, tool catalog or plan-shape rule of the stage, implement or fix-checks job. #6519 found that 263 of about 900 issues in four weeks added such rules and none replaced the engine. Stage now runs on stock Coder (grade 60 on 30 graded attempts), where the agent reads the repository, runs the checks in its loop and has a real shell; implement follows (#6527). The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned; a person may reopen it.