Skip to content

fix(roadmap): a refused kept plan uses no stage gate return - #4983

Merged
dan-petty merged 2 commits into
mainfrom
fix/4950-kept-plan-uses-no-gate-return
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4950-kept-plan-uses-no-gate-return

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

On a hit the stage job gates the kept plan again on the current commit (#4064). Its citations can point at moved lines, so newer gates refuse it, and that refusal used one of the roadmap.stage.gate_returns returns. An item with a kept plan so got one planner run less than an item without one.

_Planner._gated now gates the kept plan before the return loop. When the checks refuse it, the planner gets a new first reply with the kept plan and its problem, and that reply has all the returns (4 planner runs at the default). The stage gate returns: line counts only the returns after that reply. The stop check of #4900 runs before the new first reply. The ceiling of 13 planner calls does not change: the kept plan makes no call.

Closes #4950

Change: openspec/changes/archive/2026-11-12-4950-kept-plan-uses-no-gate-return/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results for #4950 (local, host load about 55, so no full devops ci):

  • uv run devops ci fail-to-pass --base origin/main: 2 failed on base, all pass on the change.
    • test_a_kept_plan_that_the_gates_refuse_uses_no_gate_return: base assert ((), 1, 3) == ((), 1, 4) (3 planner asks, now 1 + 3).
    • test_the_new_first_reply_after_a_refused_kept_plan_gets_the_plan_and_its_problem: base logged returns=1 result=passed for a new first reply that passed; now no line.
    • test_a_refused_kept_plan_starts_no_planner_run_once_the_service_stops passes on base and on the change: it guards the drain stop of fix(roadmap): bound the stage gate returns and start no return in a drain #4900 on the new path.
  • Covering tests: tests/roadmap/stage/test_roadmap_stage_plan_record.py, test_roadmap_stage_plan_record_facts.py, test_roadmap_stage_repair_return.py, test_roadmap_stage_refused_reply.py: 76 passed. test_roadmap_stage_plan.py, test_roadmap_stage_verification.py and the facts file: 205 passed.
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-tree: all pass.
  • uv run mypy on stage.py and the two test files: no error in stage.py or in the new test code. The errors that mypy shows are in tests/support/ and in the _plan helper of the test file (line 113), and the same errors are on main.
  • uv run devops roadmap eval stage --replay: the same output on base and change: 58 cases, 5 good; paths 53/53, kind 25/25, criteria 0/0, content 3/3, prompt_keys 1/1 caught; good plans that every gate accepts: 5 of 5; "every gate refuses what it must refuse". The replay runs the recorded plans through the gates and does not use the return loop, so no difference is expected.

Live evidence (Loki, namespace devops, 2026-11-12, 0.116.1): #1858 logged the kept plan refused at 05:29:44Z (request=1 input_tokens=0), three refused planner replies, and stage gate returns: ... returns=3 result=refused at 05:52:37Z.

This is Service code: it waits for the owner "safe and vetted" call before merge.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 08:51
@dan-petty
dan-petty enabled auto-merge (squash) November 12, 2026 12:40
A kept plan made no model request, and its citations can point at lines that moved. Its refusal now uses no return of roadmap.stage.gate_returns: the planner gets a new first reply with the kept plan and its problem, and then all the returns. No new first reply starts after the Service stops.
@dan-petty
dan-petty force-pushed the fix/4950-kept-plan-uses-no-gate-return branch from 1754cd3 to 85ca5b3 Compare November 12, 2026 12:50
@dan-petty

Copy link
Copy Markdown
Owner Author

Rebase onto main at b734eb3 (new head 85ca5b3). The rebase changed these items:

  • OpenSpec. refactor(openspec): split big capabilities into nested ones #4981 split openspec/specs/roadmap-stage/spec.md into nested capabilities and deleted the flat file. The delta of this change now is specs/roadmap-stage/plan-cache/spec.md, because the two ADDED requirements describe the kept plan file and its use, and that is the module of roadmap-stage/plan-cache. The proposal names roadmap-stage/plan-cache. I removed the old archive commit and ran uv run devops openspec archive 4950-kept-plan-uses-no-gate-return again. The archive appended the two requirements to openspec/specs/roadmap-stage/plan-cache/spec.md. The archive is the last commit.
  • _Planner._returned. feat(roadmap): log one result line for each roadmap job attempt #4966 added self._returns += 1 for the result line of the job attempt. The loop keeps that count and sends outcome.returned(request). _gated adds no count for a refused kept plan, so the result line gives gate_returns=R, not R+1.
  • Test. feat(roadmap): keep the stage gate problems as a list with a code #5022 added gates= and codes= to the stage gate returns line. test_a_kept_plan_that_the_gates_refuse_uses_no_gate_return now expects gates=paths:1 codes=stage_problem_path:1. _gated does not observe the findings of the kept plan in devops_cli_roadmap_stage_gate_problems: the kept plan is no model reply, and the new first reply is reply 0.

Results on the rebased tree:

  • uv run pytest -q -p no:cacheprovider tests/roadmap/stage/test_roadmap_stage_plan_record.py tests/roadmap/stage/test_roadmap_stage_plan_record_facts.py tests/roadmap/test_job_result.py tests/roadmap/stage/test_roadmap_stage_repair_return.py tests/roadmap/stage/test_roadmap_stage_findings.py tests/roadmap/stage/test_roadmap_stage_refused_reply.py: 163 passed.
  • uv run mypy src/devops_cli/roadmap/stage/stage.py: no issues.
  • uv run devops openspec check: passed.
  • uv run devops ci docs: all documentation files are up to date.

@dan-petty
dan-petty merged commit b8adbca into main Nov 12, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/4950-kept-plan-uses-no-gate-return branch November 12, 2026 13:11
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.119.0](v0.118.0...v0.119.0)
(2026-11-12)


### Features

* **repos:** the claim sets In Progress
([#5111](#5111))
([06ef1c6](06ef1c6))
* **roadmap:** a fix-plan step repairs a plan PR with open findings
([#5104](#5104))
([ca5b16d](ca5b16d))
* **roadmap:** extend stage review rounds while open findings drop
([#5090](#5090))
([bacf713](bacf713))
* **roadmap:** re-anchor a stale citation that matches one line
([#5040](#5040))
([16356d8](16356d8))


### Bug Fixes

* **ci:** keep failed test IDs in the service image shard summary
([#5106](#5106))
([88589ef](88589ef))
* **github:** count each page of a paginated GitHub read
([#5070](#5070))
([908e24a](908e24a))
* **github:** keep the metrics permissions out of the runner Job token
([#5064](#5064))
([fb549ff](fb549ff))
* **github:** pace mutations through the clock seam
([#5063](#5063))
([2bd87bc](2bd87bc))
* **k8s:** delete the CoreDNS files that k3s never applies
([#5055](#5055))
([463f601](463f601))
* **monitoring:** tidy LLM stack windows, units and lines
([#5052](#5052))
([375d724](375d724))
* **roadmap:** a refused kept plan uses no stage gate return
([#4983](#4983))
([b8adbca](b8adbca))
* **roadmap:** count a command as removed only when MUST NOT governs it
([#4985](#4985))
([2e6f407](2e6f407))
* **roadmap:** cut prose after a cited stage command
([#4982](#4982))
([a172563](a172563))
* **roadmap:** name every module of a group with no named test
([#5089](#5089))
([27a0e79](27a0e79))
* **roadmap:** stage returns every open review finding to the planner
([#5067](#5067))
([21b116e](21b116e))
* **roadmap:** the alternatives check reads the tools in use
([#5062](#5062))
([8903233](8903233))
* **roadmap:** the constants gate reads 6_500 and no new value
([#5080](#5080))
([8a7b113](8a7b113))
* **roadmap:** the constants gate reads only a stated value
([#5042](#5042))
([cf4733e](cf4733e))
* **telemetry:** read repository traffic as the GitHub App
([#4932](#4932))
([7c42823](7c42823))
* **tests:** close the UDP, DNS and git gaps of the network floor
([#5101](#5101))
([047ee48](047ee48))
* **tests:** repair the bwrap contract suite and gate it
([#5110](#5110))
([9a0659d](9a0659d)),
closes [#4715](#4715)


### Performance Improvements

* **ci:** build the Service image once for its test shards
([#5079](#5079))
([dcf5bd5](dcf5bd5))
* **ci:** run only the required checks on the release PR
([#5057](#5057))
([8174071](8174071))
* **ci:** stop the cache export of pull request image builds
([#5113](#5113))
([ba30820](ba30820))
* **roadmap:** consolidate keeps its vectors in the shared tiers
([#5099](#5099))
([2a8bf1a](2a8bf1a))


### Code Refactoring

* **roadmap:** one Status writer for every job
([#5109](#5109))
([24cfedc](24cfedc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): a refused kept plan uses no stage gate return

1 participant