Repository navigation
Description
Problem
The stage job leaves out an item whose branch is on origin. After PR #3323 opened a draft plan with placeholder text for #3307, devops roadmap explain 3307 reports: Stage job: no. Issue 3307 is held by a pushed branch: origin/feat/3307-the-plan-check-names-a-caller. The stage job therefore cannot replace its own bad plan; a person must edit or close the draft. The plan gate refuses placeholder text now (#3367), but a plan that fails any later gate, or a plan whose files main changed, has the same dead end.
Proposed change
- In the held-item rule of
src/devops_cli/roadmap/stage.py, treat a branch as held only when its draft plan pull request passescheck_proposaland has no review thread. When the only pull request is a draft whose plan fails the checks, stage the item again on the same branch and update the draft. - Keep a branch that holds commits beyond the plan, or any pull request with a review thread or a passing plan, held with the current reason.
- Add cases in
tests/roadmap/test_roadmap_stage_selection.pyfor both outcomes.
Acceptance criteria
- A test asserts that a held item whose draft plan fails
check_proposalis staged again on its branch. - A test asserts that a held item with a passing plan, with a review thread, or with a commit beyond the plan is still left out, with its current reason.
- The stage report names the draft pull request that the job replaced.
Source: #3323
Alternatives check of 2026-11-06: none.
Tool: none found.
Proposed design
Problem statement
The stage job leaves an item out when its branch is on origin, even when the draft plan on that branch fails check_proposal. A person must then edit or close the draft by hand. The change stages such an item again on the same branch, updates its draft, and keeps the other holds.
Acceptance criteria
Requirement: Re-stage a failing draft plan
The stage job SHALL stage an item again on its branch when the only pull request is a draft whose plan fails check_proposal and the pull request has no unresolved review thread.
Scenario: Draft plan fails the check
- WHEN The item has one draft pull request on origin, its change files fail
check_proposal, and its review threads are all resolved. - THEN The selection marks the item as due and returns the draft pull request as the one to update.
Requirement: Update the same draft pull request
The stage job MUST push the new plan to the branch of the draft pull request and update that draft, and it MUST open no second pull request.
Scenario: One draft after re-staging
- WHEN The stage job re-stages an item that has one draft pull request.
- THEN The branch head holds the new plan commit and the repository has one open pull request for the branch.
Requirement: Hold a passing draft plan
The stage job MUST leave an item out when its draft plan passes check_proposal and has no unresolved review thread.
Scenario: Draft plan passes the check
- WHEN The item has one draft pull request on origin, its change files pass
check_proposal, and its review threads are all resolved. - THEN The selection leaves the item out with the current reason that names the pushed branch.
Requirement: Hold a draft with a review thread
The stage job MUST leave an item out when its draft pull request has an unresolved review thread.
Scenario: Unresolved review thread
- WHEN The item has one draft pull request and one of its review threads is unresolved.
- THEN The selection leaves the item out with the current reason.
Requirement: Hold a branch with a commit beyond the plan
The stage job MUST leave an item out when its branch changes a path outside the item's change folder openspec/changes/<issue>-<slug>/.
Scenario: Commit beyond the plan
- WHEN The branch of the draft pull request changes a path outside the item's change folder.
- THEN The selection leaves the item out with the current reason.
Requirement: Report the replaced draft
The stage report MUST name the draft pull request that the job replaced.
Scenario: Report names the replaced draft
- WHEN The stage job re-stages an item on its draft pull request.
- THEN The comment of the staged item holds the number of the replaced draft pull request.
Requirement: Bound the re-stages of a failing plan
The stage job MUST record one re-stage of a failing draft plan in the job record and MUST hold the item after that, with a reason that names the failed check_proposal.
Scenario: Second failing plan
- WHEN The job record shows that the stage job already re-staged the draft plan once, and the new plan fails
check_proposalagain. - THEN The selection leaves the item out and the reason names the failed
check_proposal.
Existing Tool Considered
No open, maintained tool covers the need. The alternatives check of 2026-11-06 found none. gidgethub is the GitHub transport that the repository already uses. It reads draft state, check runs and review threads. It holds no rule to re-stage an item or to update its draft pull request. The rule stays in src/devops_cli/roadmap/stage/stage.py. The cost is about 80 lines of code and 5 test cases: about 20k tokens to build, keep and fix, and about one day of elapsed time.
Key questions
- Which file holds the held-item rule?: The held-item rule is in
src/devops_cli/roadmap/stage/stage.py, the stage package. The body's pathsrc/devops_cli/roadmap/stage.pyis not in that package. [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stage/stage_change.py] - Which test module holds the new cases?: Add the cases to
tests/roadmap/stage/test_roadmap_stage_selection.py. The body's directory is wrong; the stage tests live intests/roadmap/stage/. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_gates.py, tests/roadmap/stage/test_roadmap_stage_request.py, tests/roadmap/stage/test_roadmap_stage_plan.py]- Chosen: New module
tests/roadmap/stage/test_roadmap_stage_selection.py. The body names a selection test module, and only its directory is wrong. - Rejected: Extend
tests/roadmap/stage/test_roadmap_stage_gates.py. That module tests the plan gates, not the selection of an item. - Rejected: Extend
tests/roadmap/stage/test_roadmap_stage_request.py. That module tests the stage request, not the held-item rule.
- Chosen: New module
- How does the stage job learn that the draft plan fails
check_proposal?: The stage job reads the draft's change files from the branch through gidgethub and runscheck_proposalon them. This is the same check that it runs on a reply. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:314, src/devops_cli/roadmap/stage/stage_change.py, docs/adr/0004-ci-is-the-authoritative-gate.md]- Chosen: Run
check_proposalon the branch's change files. The same check judges the plan text, so the selection and the reply gate agree. - Rejected: Read the check runs of the draft pull request. The plan check is a gate of the stage job, not a required check of ADR 0004.
- Chosen: Run
- How does the stage job detect a review thread?: The stage job reads the pull request's review threads. It holds the item when one thread is unresolved and not outdated. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py]
- Chosen: GraphQL
reviewThreadswithisResolvedandisOutdated. One query gives each thread with its resolved state, and gidgethub carries it. - Rejected: REST issue comments. Comments do not carry the resolved state of a thread.
- Rejected: The review decision of the pull request. A draft pull request has no review decision until a person submits a review.
- Chosen: GraphQL
- What counts as a commit beyond the plan?: A changed path outside the item's change folder
openspec/changes/<issue>-<slug>/counts as a commit beyond the plan. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/stage/stage.py]- Chosen: A changed path outside the change folder. The change folder is the plan, so any other path is work beyond it.
- Rejected: Any commit after the plan commit. The stage job amends the plan on the same branch, so a later commit is often the plan.
- Rejected: Any commit whose message is not the stage job's. Commit messages are not a reliable mark of the plan.
- Does re-staging change the Status of the item?: No. A staged item keeps Status Ready until a person merges the plan. Re-staging writes no label. [sources: CONTEXT.md]
- What does the stage report say for each hold and for a re-stage?: The three holds keep the current reason text. A re-stage names the draft pull request that the job replaced. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, CONTEXT.md]
- Chosen: Keep the current reason and name the replaced draft. The issue asks for the current reason on the three holds and for the name of the replaced draft.
- Rejected: Add a new reason for each cause. New reason texts break the current report and add no information.
- How does the stage job bound the re-stages of a plan that keeps failing?: The stage job records one re-stage in the job record of the issue. It holds the item after that, with a reason that names the failed
check_proposal. (best practice) [sources: docs/adr/0001-github-is-the-roadmap-source.md, CONTEXT.md, src/devops_cli/roadmap/stage/stage.py]- Chosen: Bound the re-stages with the job record. An unbounded rule calls the model on every stage round and spends tokens with no result.
- Rejected: Re-stage on every round. A plan that always fails then spends the model budget every 61 minutes.
- Rejected: Hold the item at once. That keeps the dead end that the issue removes.
- How does the stage job update the draft pull request?: The stage job pushes the new plan commit to the branch. It updates the body of the same draft pull request. (best practice) [sources: CONTEXT.md]
- Chosen: Push to the branch and update the same draft. The issue asks for the same branch and the draft update, and one pull request keeps the record.
- Rejected: Close the draft and open a new one. That leaves two records and loses the review threads.
- Rejected: Open a new branch. That makes a second branch for one item, and the held-item rule then sees two.
- How does the test reach the rule with no network?: The selection function takes the branch's changed paths, the
check_proposalresult and the unresolved thread count as inputs. A test passes them as data. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_gates.py, src/devops_cli/roadmap/stage/stage.py]- Chosen: Pass the three inputs as function arguments. A test needs no GitHub client and no network.
- Rejected: Record GitHub responses as fixtures. A fixture of the transport tests gidgethub, not the rule.
- Rejected: Call the GitHub API from the test. The tests run offline in CI.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 3, 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 removes a manual dead end in the stage pipeline but a person can still intervene.It saves a manual edit or close step for every failed draft plan.It changes the held-item rule in stage.py and adds two test cases.Both change the stage job's behaviour when a plan fails a check, but #3010 adds a gate and the candidate changes what happens after any gate fails.devops-cli-service commentedon Nov 3, 2026
Refine cannot set this item to Ready at 7d07054 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
dan-petty commentedon Nov 3, 2026
PR #3335 is a second case of this dead end. The stage job opened it for #3321 at 2026-11-03T04:37:55Z in commit 837e157, before the placeholder gate #3367 merged at 2026-11-03T18:52:45Z. Every text of the plan was the placeholder
x, and the branchfeat/3321-the-plan-check-refuses-a-selfis on origin.devops roadmap explain 3321leaves the item out because that branch holds it. The plan now holds a real plan in edc0d0b, but the stage job still cannot replace a bad plan on its own branch. This issue records that the job must read the plan check before it treats the branch as held.devops-cli-service commentedon Nov 4, 2026
Refine cannot set this item to Ready at 46fc42e until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
[-]feat(roadmap): the stage job replaces a plan whose draft pull request fails the plan check[/-][+]feat(roadmap): Stage items whose draft plan fails the check[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 75 characters, and the limit is 60. The type and the scope stay.
feat(roadmap): the stage job replaces a plan whose draft pull request fails the plan checkfeat(roadmap): Stage items whose draft plan fails the checkdevops-cli-service commentedon Nov 6, 2026
Alternatives check: none
Tool: none found
Lacks:
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.
21 remaining items
docs(openspec): archive the change (#3387)
devops-cli-service commentedon Nov 15, 2026
Stopped at scoped checks.
Failure class:
ci_infra.Action taken: none.
Action left:
retry: run the item again.pytest on base: tests/roadmap/stage/test_roadmap_stage_held.pypytest on base: tests/roadmap/stage/test_roadmap_stage_held_read.pypytest on base: tests/roadmap/stage/test_roadmap_stage_selection.pypytest on base: tests/roadmap/stage/test_roadmap_stage_restage.pyReason:
Last message of the agent (a claim that no check verified): none.
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.The job kept the commits that passed on the branch
feat/3387-stage-items-whose-draft-plan-failson origin. The last isa8cc009dc9ac3ec8ace8e276787b9244329b76b3. The pull request stays a draft. The next run continues from it, runs no group that is ticked, and runs the scoped checks again.devops-cli-service commentedon Nov 15, 2026
The runner Job devops-cli-implement-devops-cli-3387-ac7f4f ended: succeeded.
Image digest: sha256:6a0bd6cf95b1b397f71a246f2853dcb18289ff989bee86ccf941ec8ec8cc260f
The last lines of its log:
devops-cli-service commentedon Nov 15, 2026
Cleared the stop at scoped checks by the rule
digest: the runner image changed since the stop, from sha256:6a0bd6cf95b1b397f71a246f2853dcb18289ff989bee86ccf941ec8ec8cc260f to sha256:b01ebd966cee683d79c5ca22c2962adc72b66fa71031450aafb0f96f4fe640eb, and the classci_infraof the stop is one that a new attempt can fix. The item is Planned again, and the Service takes it in the next round. The Service clears at most 1 for each class and 3 for each item by digest. A stop of another class, a new stop on this image, and a stop over a limit wait for a commentimplement: retry.devops-cli-service commentedon Nov 15, 2026
Released in v0.153.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.153.0
devops-cli-service commentedon Nov 15, 2026
Live since 2026-11-15 13:55 UTC