Skip to content

fix(roadmap): loosen the caps that turn a stage refusal into a loss - #4869

Merged
dan-petty merged 4 commits into
mainfrom
fix/4802-loosen-stage-caps
Nov 12, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/4802-loosen-stage-caps

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Three strict caps turned each refusal of the stage job into a loss: one return of a refused reply, a 6 hour wait for a refused plan, and a row stop after 3 failed rounds. The owner allowed the loosening of the roadmap caps as the first step toward 80% success of each job.

  • The setting roadmap.stage.gate_returns (default 3, was 1) sets the returns of a reply that the stage checks refuse.
  • RETRY_AFTER gives plan_defect 1 hour, not 6.
  • The setting service.max_failed_rounds (default 6, was 3) sets the failed rounds before a row is suspended.
  • The stage eval dry run, the docs, the alert text and the specs follow.

Each planner call keeps its own limits. The item wait stays longer than the stage interval, and the row retry time stays shorter than the for of the suspension alert.

Closes #4802

Change: openspec/changes/archive/2026-11-11-4802-loosen-the-caps-that-turn-a/

A refused stage reply now goes back to the planner up to
roadmap.stage.gate_returns times (default 3, was 1). A refused plan
(plan_defect) waits 1 hour, not 6. A row is suspended after
service.max_failed_rounds failed rounds in a row (default 6, was 3).
The owner can tune the two settings live in the ConfigMap.

Refs #4802
@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 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Evidence for the values

Measured on 2026-11-11 from the Service logs and metrics and from the refused-reply files (repository dan-petty/devops-cli, 7 days):

Cap Before After Evidence
Returns of a refused reply 1 3 (roadmap.stage.gate_returns) 66 of about 110 classified failed stage rounds end with "The change fails its checks, also after a second try". In 8 of 10 sampled refused items, the second reply had a shorter problem text and the same or a larger plan (#4028 1595 to 149 characters, #4043 1390 to 305, #2530 1530 to 494, #3398 658 to 119). 2 items made no progress (#4412 new problem, #4472 stale test paths). A refusal names the problems of one module at a time, so a plan with problems in two modules needs a third reply.
Wait of plan_defect 6 hours 1 hour The stage row runs every 37 minutes, so a refused item still skips one round. The return to New after 3 refused plans on one body still limits the attempts. 26 Ready items held a plan_defect failure on 2026-11-11.
Failed rounds before a suspension 3 6 (service.max_failed_rounds) The stage row was suspended 25 times in 7 days (16 with plan_defect), 13 times on 2026-11-09. One failed item fails the whole round. 6 rounds at 37 minutes is about 3.7 hours.

Stage success in the same 7 days: about 20% (39 staged comments against about 156 failed item attempts).

Worst case of one item: 3 to 5 planner calls without a verifier, 7 to 13 with one. A return sends the refused reply and its problem, so it costs less than a new attempt from the first ask.

Checks

  • uv run devops roadmap eval stage --replay --json on origin/main and on this branch: equal reports (58 cases, 82 of 319 defects judged, 5 of 5 good plans pass, 0 failures). The change touches no gate.
  • Changed and affected tests: 618 passed (stage, ledger, service limits, failure, refine wait, config declarations, limit classes, source tree invariants). The alert rule tests (tests/prometheus/test_k8s_monitoring_alerting.py, with promtool) and the stage eval command tests: 115 passed.
  • uv run devops openspec check: passed.

fail-to-pass

uv run devops ci fail-to-pass --base origin/main: exit 0. 25 tests failed on the base and pass on the change (561 others passed on both):

  • roadmap.stage.test_roadmap_stage_apply::test_an_item_whose_plan_names_a_missing_path_after_each_return_gets_no_branch_and_no_draft
  • roadmap.stage.test_roadmap_stage_refused_reply::test_a_gate_refusal_logs_one_line_for_each_refused_reply
  • roadmap.stage.test_roadmap_stage_refused_reply::test_a_plan_that_the_gates_refuse_after_each_return_keeps_each_reply_and_its_problem
  • roadmap.stage.test_roadmap_stage_refused_reply::test_a_reply_that_is_only_in_part_placeholders_goes_back_as_a_refused_reply
  • github.test_service_limits::test_a_row_runs_six_failed_rounds_in_a_row_before_a_suspension_by_default
  • github.test_service_limits::test_the_ledger_takes_its_limit_of_failed_rounds_from_the_setting
  • roadmap.refine.test_roadmap_refine_failure_class::test_the_wait_follows_the_recorded_class[plan_defect-at-1h]
  • roadmap.test_roadmap_failure::test_retry_after_gives_each_class_its_wait
  • roadmap.stage.test_roadmap_stage_repair_return::test_a_revision_that_stays_refused_logs_its_returns_as_refused
  • roadmap.stage.test_roadmap_stage_repair_return::test_a_revision_that_stays_refused_is_kept_with_its_problem_beside_the_earlier_replies
  • roadmap.stage.test_roadmap_stage_repair_return::test_a_refused_revision_gets_three_returns_by_default
  • roadmap.stage.test_roadmap_stage_repair_return::test_a_revision_that_the_gates_refuse_after_each_return_ends_the_item_with_the_problem
  • roadmap.stage.test_roadmap_stage_repair_return::test_the_returns_of_one_round_follow_the_setting_and_no_more
  • roadmap.stage.test_roadmap_stage_repair_return::test_each_refused_revision_logs_one_line
  • security.test_config_declarations::test_the_variables_are_those_before_one_for_each_read_option_that_had_none_and_later_ones
  • roadmap.stage.test_roadmap_stage_eval_run::test_a_plan_that_the_checks_refuse_after_each_return_ends_refused
  • roadmap.test_roadmap_limit_classes::test_every_numeric_limit_of_the_roadmap_jobs_has_a_class
  • roadmap.test_roadmap_limit_classes::test_a_removed_limit_does_not_come_back[CONST_ROADMAP_STAGE_GATE_RETURNS]
  • roadmap.stage.test_roadmap_stage_plan::test_a_summary_with_the_issue_number_goes_back_and_stops_the_item_after_the_last_return
  • roadmap.stage.test_roadmap_stage_plan::test_a_missing_path_after_the_last_return_stops_the_item
  • roadmap.stage.test_roadmap_stage_plan::test_a_failed_validation_after_the_last_return_stops_the_item
  • roadmap.stage.test_roadmap_stage_retry_after::test_a_failed_item_waits_for_the_time_of_its_class[plan_defect]
  • roadmap.stage.test_roadmap_stage_retry_after::test_the_wait_table_in_this_file_is_the_table_of_the_code
  • roadmap.stage.test_roadmap_stage_retry_after::test_explain_gives_the_time_of_the_class_that_the_record_holds
  • roadmap.stage.test_roadmap_stage_retry_after::test_a_refused_plan_waits_one_hour_and_a_reply_that_breaks_the_schema_waits_six

@dan-petty

Copy link
Copy Markdown
Owner Author

Live steps for the owner session (after the merge and the image roll)

No ConfigMap change is necessary: the new settings take their defaults (3 returns, 6 rounds) when the ConfigMap does not name them.

  1. After the Service image rolls, read the effect for about 24 hours:

    • stage gate returns: stage gate returns: log lines, result=passed against result=refused, and the returns= values;
    • suspensions: Loki rounds in a row lines of the Service, and the gauge devops_cli_service_job_suspended;
    • spend: the alert ClaudeSpendDailyHigh and the AI spend dashboard, because a refused item can now get up to 13 planner calls with the verifier.
  2. Expect a short burst after the roll: Ready items whose plan_defect failure is older than 1 hour are selectable again at once, and ledger entries of 3 to 5 failed rounds no longer suspend their row. The stage round still takes at most roadmap.stage.limit items.

  3. To tune live, set these keys in ConfigMap devops-cli-config (devops-cli.yaml). The stage job reads roadmap.stage.gate_returns at each round. The ledger reads service.max_failed_rounds when the Service starts, so restart the Service after a change of that key:

    roadmap:
      stage:
        gate_returns: 3
    service:
      max_failed_rounds: 6

    The variables are DEVOPS_CLI_ROADMAP_STAGE_GATE_RETURNS and DEVOPS_CLI_SERVICE_MAX_FAILED_ROUNDS. The wait of plan_defect stays in code (RETRY_AFTER), as the stage spec says that no setting changes the wait.

@dan-petty
dan-petty force-pushed the fix/4802-loosen-stage-caps branch from ad0e19f to 07d9b0f Compare November 12, 2026 00:23
@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 00:31
@dan-petty

Copy link
Copy Markdown
Owner Author

CI shard 1 found one more test that pinned one return: tests/telemetry/test_roadmap_stage_steps.py::test_gate_refusal_a_plan_that_a_gate_refuses_twice_counts_the_gate_twice counted 2 refusals. The commit test(telemetry): count each refusal of a stage reply after each return makes it count 4 (the first reply and the reply after each of the 3 returns). All checks pass after that push, including the Fail-to-Pass Check.

@dan-petty
dan-petty merged commit 4492fc3 into main Nov 12, 2026
26 checks passed
@dan-petty
dan-petty deleted the fix/4802-loosen-stage-caps branch November 12, 2026 00:44
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.115.0](v0.114.1...v0.115.0)
(2026-11-12)


### Features

* **design:** add the design tokens and their build
([#4811](#4811))
([db4b19a](db4b19a))
* **roadmap:** find symbol definitions with tree-sitter
([#4820](#4820))
([3b3fddc](3b3fddc))


### Bug Fixes

* **ai:** the gateway group that answered decides the local label
([#4907](#4907))
([0da637f](0da637f))
* **ci:** replay a changed gate check in fail-to-pass
([#4898](#4898))
([59bfc57](59bfc57))
* **config:** read each config file as YAML 1.2
([#4858](#4858))
([c3130a3](c3130a3))
* **roadmap:** loosen the caps that turn a stage refusal into a loss
([#4869](#4869))
([4492fc3](4492fc3))
* **roadmap:** refine reads a dependency named by title
([#4877](#4877))
([2829f9c](2829f9c))
* **roadmap:** refine sends a judge refusal to an agent round
([#4874](#4874))
([e4fc6a9](e4fc6a9))
* **tests:** refuse test writes under the real home
([#4857](#4857))
([0f6ac1b](0f6ac1b))
* **tests:** the plain-Python helper test keeps PYTHONPATH
([#4914](#4914))
([99c109d](99c109d))


### Performance Improvements

* **ci:** direct pytest runs wait for a gate slot
([#4901](#4901))
([e80db62](e80db62))
* **roadmap:** status lane reads the snapshot, skips idle stops
([#4887](#4887))
([f285cf8](f285cf8))

---
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>
@dan-petty

Copy link
Copy Markdown
Owner Author

Review finding after the merge

The review of this pull request ran after the merge (2026-11-12, 00:44 UTC). A push to fix/4802-loosen-stage-caps cannot change a merged pull request, so the fix is in #4925 (closes #4900).

Severity Finding Verdict What I did
major roadmap.stage.gate_returns has no upper limit, and the return loop has no time guard and no drain guard. Confirmed for the upper limit and the drain guard. Partly confirmed for the time guard: the stage job has no item or round deadline in code, so a time guard has no outer limit to fit yet. #4925 adds le=CONST_ROADMAP_STAGE_GATE_RETURNS_CEILING (3) to the setting and calls raise_if_service_stops before each return. A round in a drain ends with the stop and records no failure for the item. The time guard stays with #4847.

Evidence:

  • RoadmapStageConfig(gate_returns=50) loaded on main at c3130a3.
  • _Planner._returned stopped only at returns >= self._gate_returns. The only stop check of the stage job was before each item.
  • The cut at the end of the 600 s drain refuses GitHub requests only. A return sends model requests.
  • The live ConfigMap sets no gate_returns key, so the ceiling does not fail the load of the Service.
  • The fail-to-pass run of fix(roadmap): bound the stage gate returns and start no return in a drain #4925 fails the two new tests on the base.

Release PR #4875 holds this pull request. #4925 must merge before it for the ceiling to ship in the same release as the setting. A value above 3 now needs a code change; #4851 can raise the ceiling when it adds the progress check.

dan-petty added a commit that referenced this pull request Nov 12, 2026
…rain (#4925)

`roadmap.stage.gate_returns` gets the hard ceiling 3
(`CONST_ROADMAP_STAGE_GATE_RETURNS_CEILING`): the settings load refuses
a
higher value. Each return is one more plan run, so an item makes at most
13 plan runs with a review.

After the Service stops, the stage job starts no return of a refused
reply. A return sends model requests, and the cut at the end of the 600
s
drain stops only GitHub requests, so a return in the drain could run
past
the grace of the pod. The round now ends with the stop and records no
failure for the item.

The default of 3 does not change, and the live ConfigMap does not set
the
setting. This fixes a review finding of #4869.

Closes #4900

Change:
`openspec/changes/archive/2026-11-12-4900-bound-the-stage-gate-returns-and/`
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): loosen the caps that turn a stage refusal into a loss

1 participant