Repository navigation
Description
Problem or Motivation
The implement job runs the task groups of a Staged plan without a deterministic check that the plan's premise still holds. The step model can report a false premise with a plan-request of kind premise (_return_premise in src/devops_cli/roadmap/implement_run.py:582), but that relies on the model to notice the defect, after a model call.
The plan of PR #3374 (for #3368) is an example. It passed check_proposal and opened as a draft, so the plan check that #3393 adds would accept it. Its premise is false: it adds a title guard that _delivery_title already runs (#3319). The implement job would duplicate the guard, or stop only if the step model noticed the defect.
#3393 re-runs the plan check before the job starts a step. It does not check the base for the behavior that the plan adds.
Proposed Solution & Architectural Design
- Before a behavior group starts, the implement job checks the plan's premise against the branch it will change: when a task adds a guard or a check that the base already runs, stop the item with the evidence and write nothing.
- Reuse the premise check of the stage job rather than build a second; extract the check that a claimed missing check is absent into a shared function.
- Add a test in
tests/roadmap/test_roadmap_implement_job.pyfor a plan that adds a guard that the base already runs, and one for a plan whose premise is true.
Target Subsystem
src/devops_cli/roadmap/implement.py, src/devops_cli/roadmap/implement_run.py
Existing Tool Considered
The stage premise check (#3176) exists in src/devops_cli/roadmap/stage_probe.py. This change extracts and reuses it instead of building a second check. Cost: about 6,000 tokens to extract and test, about 1,000 tokens to keep, and about 2 hours elapsed. The change deletes no internal code.
Source: PR #3374
Proposed design
Problem statement
The implement job runs a plan without a deterministic check that the plan's premise still holds. A step model can report a false premise, but only after a model call. A plan can add a guard that the base already runs. The job then duplicates the guard or stops only when the model notices.
Acceptance criteria
Requirement: Shared premise check
The stage job and the implement job SHALL call one shared function that reports whether a cited identifier has a definition at a commit.
Scenario: Both jobs use the shared function
- WHEN The stage job probes a cited identifier and the implement job checks a task at the same commit
- THEN Both jobs get the same definition lines from one function in
src/devops_cli/roadmap/premise.py.
Requirement: False premise
The job SHALL return the item to New with the evidence when a behavior group task adds a guard that the branch tip defines.
Scenario: A task adds a guard that the base already runs
- WHEN A behavior group task says to add
_delivery_titleand the branch tip defines_delivery_title - THEN The job runs no group step, writes no group file, makes no group commit, and comments the definition line.
Requirement: True premise
When the shared check finds no definition for a guard that a behavior group task adds, the job SHALL run the group.
Scenario: A task adds a guard that the base lacks
- WHEN A behavior group task says to add a guard name that the branch tip does not define
- THEN The job runs the group and commits the file that the group writes.
Requirement: Behavior groups only
The job SHALL run the premise check only for a behavior group.
Scenario: A non-behavior group adds a defined name
- WHEN A group whose kind is not behavior has a task that says to add a name that the branch tip defines
- THEN The job does not return the item to New and runs the group.
Requirement: Premise tests
The implement job test module SHALL hold one test for a false premise and one test for a true premise.
Scenario: The two premise tests run
- WHEN The test suite runs
tests/roadmap/test_roadmap_implement_job.py - THEN One test asserts the return to New with evidence and one test asserts the group runs.
Existing Tool Considered
No alternatives check has run. The stage premise check (#3176) in src/devops_cli/roadmap/stage_probe.py covers cited paths and identifiers at a commit. It lacks a decision that a task adds a guard that the base already runs. The change extracts and reuses it. Cost: about 6,000 tokens to extract and test, about 1,000 tokens to keep, and about 2 hours elapsed. The change deletes no internal code.
Key questions
- What does the job do when the deterministic check finds a false premise?: It returns the item to New with the evidence, as the existing premise path does. It does not block the item. (best practice) [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md:139, src/devops_cli/roadmap/implement_run.py:582]
- Chosen: Return to New. CONTEXT.md and the failure table record that a false premise returns the item to New.
- Rejected: Block the item. It conflicts with the recorded premise outcome and adds a retry wait.
- Which commit does the check read?: The worktree HEAD before the group starts. That is the branch tip that the group will change. (best practice) [sources: src/devops_cli/roadmap/implement_run.py, src/devops_cli/roadmap/implement.py]
- Chosen: Current worktree HEAD. It includes the staged plan and the work of earlier groups.
- Rejected: Default branch only. It misses a duplicate that an earlier group adds.
- Where does the shared check live?: In a new module
src/devops_cli/roadmap/premise.py. The stage probe and the implement job import it. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/implement_run.py:582]- Chosen: New module. It avoids a private import from
stage_probe.pyand keeps one check. - Rejected: Private import from stage_probe. It couples the implement job to the stage probe internals.
- Rejected: Duplicate check. It creates two checks to keep in step.
- Chosen: New module. It avoids a private import from
- How does the job detect a task that adds a guard the base already runs?: It reads a task line for an add verb and a backticked identifier. The line must also name a guard or a check. The shared function then looks for definitions at the branch tip. A definition makes the premise false. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/step_files.py]
- Chosen: Deterministic text rule. It needs no model call and is testable offline.
- Rejected: Model call. It repeats the defect that the issue fixes.
- Rejected: Whole-text grep. It reports names that the task does not add.
- Which groups does the check cover?: Only a group whose kind is behavior. A group that is not behavior does not add product guards. (best practice) [sources: src/devops_cli/roadmap/step_files.py, src/devops_cli/roadmap/implement_run.py]
- Chosen: Behavior groups only. The issue names behavior groups and other groups add no product guard.
- Rejected: Every group. It can return an item for a docs or test task.
- Which tests cover the change?: Add two tests to
tests/roadmap/test_roadmap_implement_job.py. One test uses a plan that adds a guard the base already runs. One test uses a plan whose premise is true. (best practice) [sources: tests/roadmap/test_roadmap_implement_job.py]- Chosen: Extend the implement job test module. It already holds the job stop tests and the fakes.
- Rejected: New test module. It would mirror one helper and split the job cases.
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.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It prevents the implement job from adding a guard the base already runs, but the stage job should catch most false premises first.It stops wasted model calls and duplicate guards in the implement job, but the stage job already filters most cases.Extract one shared function, wire it into the implement job, and add two tests; the candidate estimates about 2 hours.Both extract the 'claimed missing check is absent' check into a shared function; #3416 applies it in the stage job while the candidate applies it in the implement job.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
feat/3417-the-implement-job-re-checks-a, draft pull request #3438. 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 points. They stop no draft, and a person judges them:
otherat group 1: The plan moves thegit grepcall out of_Run.identifierintopremise.py. The grep then bypasses_Run.git, so it is not counted against the command budget. It also bypasses thestage_probe.git_resultspy intest_roadmap_stage_probe.py. The plan does not change that test file, so the verify command is likely to fail. Evidence: "Move_definition_patternand the definition branch of_Run.identifierofsrc/devops_cli/roadmap/stage_probe.pyinto the new module, and call it from_Run.identifierso the stage probe keeps its behavior and its messages"The plan run made 3 model request(s), and used 233289 input tokens and 11715 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 plan of #3417 to read the group kind
docs(openspec): plan #3417 Check the premise of a behavior group (#3438)
3 remaining items
devops-cli-service commentedon Nov 5, 2026
Stopped at group 2.
Failure class:
limit_reached.Action taken: none.
Action left:
raise_limit: raise the limit that the run went over.pytest on base: tests/roadmap/test_premise.pyReason:
Last message of the agent (a claim that no check verified): Now the imports and the
guard_nameshelper.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-161718-1942 ended: succeeded.
Image digest: sha256:b538e97e8c41f0ab07e396ade33cfe3e9f9f1ecd881a5b27b7e32e2c81e8ac7d
The last lines of its log:
fix(roadmap): the plan check refuses two tasks that state the same wo…
feat(roadmap): check the premise of a behavior group before its step (#…
docs(openspec): archive the change of #3417
fix(roadmap): name an added guard only when its identifier follows th…
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
fix(roadmap): Refuse a member that the staged class lacks (#6005)