Repository navigation
Description
Problem
On 2026-11-09 the stage job of the roadmap Service stages no item. Prometheus gives, for the 24 hours up to 01:16 UTC: staged 0, failed 83, skipped 863. Before, staged was 40 on 2026-11-02, 38 on 2026-11-03, 17 on 2026-11-04, 8 on 2026-11-05 and 0 on the two days after. The model of the stage slot is deepseek-v4.1-flash-1017.
The Service log shows 25 rounds in 24 hours with the text "the stage job failed for N item(s)" for dan-petty/devops-cli. 15 of the 25 rounds hold a StructuredOutputValidationError ("1", "3", "8" or "9 schema violation(s)"). In the 25 rounds, 89 item failures name 42 distinct items. The same items fail again at each retry: #3243 and #3258 (both 5 times), #3389 and #3395 (5 times), #3069, #3076, #3258 and #4028 (4 times each). The circuit breaker then suspends the row, so the job spends its rounds on items that fail in the same way.
Cause: the model sends a reply of placeholders, and the gates refuse it right. About half of the RoadmapStageError failures show one pattern. The reply holds the text x or placeholder in why, existing_tool, feasibility, the task of group 1 and the path in changes. Each such reply fails 6 gates at once: placeholder text, text of 1 character, a task of one word, a verify command that is x, a path with no file, and no spec delta. The same reply is sent again in the second try. The pattern starts at 02:11 UTC on 2026-11-08, before the gates that were added that day (#4157, #4159, #4164, #4166, #4168, #4170), so a new gate did not cause it. The gates content (#3200 and #3367) and form refuse a reply that has no plan in it. Their refusals are right.
Gate refusals, from devops_cli_roadmap_stage_gate_refusals_total (the series exists since about 23:15 UTC on 2026-11-08, after the rollout of #4176, so the 24 hour and the 7 day windows give the same numbers: about 106 refused replies in 2 hours): content 22.7, spec-delta 19.5, paths 15.6, trace 13.5, form 12.1, citation 9.1, criteria 7.9, constants 3.0, eval-replay 2.8. The gates content, form, paths and spec-delta together are 66 percent, and a placeholder reply trips each of them.
Two other, smaller causes show in the log:
- Real plans that a gate refuses. From 18:53 UTC on 2026-11-08, after fix(roadmap): refuse feasibility claims the run did not make #4170, the log shows the refusal "The Feasibility section states that ... was read, but the run did not read it" for fix(tests): a logfire console span leaks into stdout of a later test #3532, fix(ci): devcontainer image build fails on a feature download #3612, fix(pr): Require a replay score in stage-change PRs #3398 and fix(roadmap): Return the item when a cited class field now exists #3406. fix(ci): devcontainer image build fails on a feature download #3612 has a long, specific plan (the saved plan file of the Service is 131 KB), and the gate
citationrefused it becausesrc/devops_cli/templates/devcontainer.json.j2does not hold the cited text. That refusal is right: the model cites a line that it did not read. The model does not meet the gate, and the gate is not wrong. - Schema violations. The
StructuredOutputValidationErrorhas no text of the violations in the log, so the log shows no field. The Service keeps no refused reply (feat(roadmap): keep the gated stage plan as a file #4167 keeps only a plan that passed the gates).
Evidence that the cause is not the poor input: #3612, #3069 and #3243 are all items that the job refused, and #3069 and #3243 have since closed by merged pull requests (#4185 and #4190). The issue bodies are 9 to 17 KB, as large as the bodies of items that the job stages.
Evidence for the model: the sample in #3566 on 2026-11-05 shows the same fault: "One of the two probe runs gave a plan with the placeholder x in every text field", and that run offered no tool in its second request because the messages reached the window. The ConfigMap now sets context_window: 256000 for the slot analysis, so the window may not be the cause today. This is not verified.
Expected
The stage job stages most of the items that it takes in a round, and a reply of placeholders does not use up the retry of the item.
Acceptance criteria
- The Service logs, for each refused reply, the size of the request in tokens, the number of the request in the plan run, and whether a tool was offered.
kubectl -n devops logs deploy/roadmap-service | grep "stage reply refused"prints these three values for a refused reply. It prints nothing today. - A refused reply is kept under the data directory of the Service, with the key of the item, for 7 days, as the gated plan is (feat(roadmap): keep the gated stage plan as a file #4167).
kubectl -n devops exec deploy/roadmap-service -- ls /home/devops/.data/roadmap/stage/dan-petty/devops-clilists a file for a refused reply. It lists only the file of a plan that passed the gates today (3612.json). - A reply in which every text of the plan is a placeholder ends the plan run at once and counts as the result
degenerate, not a second try that sends the same request.uv run devops roadmap eval stage --model deepseek-v4.1-flash-1017reports the number of such replies, and it reports 0 for the golden cases. Today the report has no such count. sum by (result) (increase(devops_cli_roadmap_stage_total[24h]))showsstagedabove 0 for each 24 hours in which an item is Ready and has a plan that passes the gates. Today the sum isstaged0,failed83.- The cause of the placeholder reply is found and named in this issue: window, toolset, the output tool of the structured reply, or the model. The fix removes it. If it is the model, the stage slot names another model, as the owner decision of 2026-11-07 (feat(k8s): the Service uses one model for every chat slot #3874) allows ("undo it when most steps work most of the time").
Scope of the delivery (pull request #4260)
The pull request delivers these criteria:
- 1, the log fields. The line is
stage reply refused: item=#<n> request=<n> input_tokens=<n> tools_offered=<bool> result=<refused|degenerate>. - 2, the kept refused reply, with one change. The file is
roadmap/stage/<owner>/<repo>/<n>.refused.json. It holds the first and the second refused reply with their problems. The staging of the item deletes it. The 7-day age limit is removed from the criterion: its premise is false, because the plan file of feat(roadmap): keep the gated stage plan as a file #4167 has no age limit either (it goes when the item is staged or its input changes). The refused file has a size bound instead. - 3, the
degenerateresult for a reply that is a placeholder in every text, in the stage metric and in the line "how the cases ended" ofdevops roadmap eval stage.
Criteria 4 and 5 are not delivered here. #4205 holds them, and merged changes removed the causes: the gateway answered behind a fallback model (#4216), the reference reason could be null (#4215), the reply was cut at 4096 output tokens (#4224), the window estimate dropped the tools too early (#4238), and tool calls were joined (#4243). The check of criterion 4 needs a day of Service data after the rollout. If staged stays 0 then, a person reopens #4205 with the kept refused replies as evidence.
A schema violation (StructuredOutputValidationError) is not a refused reply. The reply does not reach the gates, so it is out of this delivery.
Existing tool considered
- pydantic-ai output validators with
ModelRetry(the library already in use) cover a retry of an invalid reply. They do not tell why the reply is empty. devops roadmap eval stage --model <group>(the replay) measures the rate of such replies on the golden cases. The step needs the count of acceptance criterion 3.- The metrics of feat(telemetry): step seconds and a gate counter for the stage row #4066 and feat(telemetry): send stage step seconds and gate refusal counts #4176 (
devops_cli_roadmap_stage_gate_refusals_total,devops_cli_roadmap_step_seconds) show which gate refuses, and they do not show the cause of a refused reply.devops_cli_roadmap_step_secondsreturned no series in Prometheus on 2026-11-09 for either row, so the step times are not verified. - No tool is built here: the first step is to log and keep what the job refuses.
Cost
Tokens to build: about 150,000 for the log fields, the kept reply and the degenerate result with tests. Tokens to keep: low, the reply file has an age limit. Tokens to fix: unknown until the cause is known; one eval run with deepseek-v4.1-flash-1017 costs about 0.002 USD a call (README, item 19 of the Roadmap service). Elapsed time: about 3 hours to build, plus one day of Service data to read.
Related
#3566 (cloud baseline of the stage eval; the sample that shows the placeholder reply), #3394 and #3395 (placeholder checks in the plan; #3395 fails in the stage job today), #3387 (an item whose plan fails the check), #3037 (the planner cannot read code), #4167 (the plan file), #4176 (the metrics), #3478 (devops roadmap repair, set back items that a placeholder reply stalled), #4060 (class-based retry).
Proposed design
Problem statement
The stage job stages no item because the model often sends a reply of placeholders, and the gates refuse it. The Service does not log the request size, the request number or tool availability for a refused reply. It also keeps no refused reply, so the cause cannot be read. This change adds those records and ends an all-placeholder run at once as degenerate. A follow-up issue uses the records to remove the cause.
Acceptance criteria
Requirement: Refused reply log fields
The stage job SHALL log one stage reply refused record for each refused model reply, with the request token count, the request number in the plan run, and whether a tool was offered.
Scenario: A refused reply is logged
- WHEN The stage job refuses a model reply for an item.
- THEN The log holds one
stage reply refusedrecord with the item key, the request token count, the request number and the tool-offered flag.
Requirement: Kept refused reply
The stage job SHALL save each refused model reply under the Service data directory at the stage record path of its item, and SHALL remove the file after 7 days.
Scenario: A refused reply is kept for 7 days
- WHEN The stage job refuses a model reply for an item.
- THEN The stage record directory holds the reply file, and the cleanup removes it when the file is older than 7 days.
Requirement: Degenerate reply ends the run
The stage job SHALL end a plan run at once with the result degenerate when the reply is a placeholder in every plan text field, and SHALL NOT send the same request again.
Scenario: An all-placeholder reply is not retried
- WHEN The model replies to a stage request with
xorplaceholderinwhy,existing_tool,feasibility, the first task and achangespath. - THEN The plan run ends after one model call with the result
degenerate, and the retry path is not used.
Requirement: Eval degenerate count
The stage eval command SHALL report the number of degenerate replies for the model under test, and SHALL report zero for the golden cases.
Scenario: Golden cases report zero
- WHEN
uv run devops roadmap eval stage --model deepseek-v4.1-flash-1017runs on the golden cases. - THEN The report holds a
degeneratecount of 0.
Requirement: Separate degenerate metric
The stage metric SHALL count a degenerate reply under result="degenerate" and SHALL keep staged separate from failed.
Scenario: A degenerate reply is counted
- WHEN A stage run ends with a degenerate reply.
- THEN
devops_cli_roadmap_stage_total{result="degenerate"}increases by 1, anddevops_cli_roadmap_stage_total{result="staged"}does not change.
Existing Tool Considered
No alternatives check has run. pydantic-ai output validators with ModelRetry are already in use. They retry an invalid reply but record no request size, request number or tool availability. They also detect no all-placeholder reply. The project builds these fields, the kept reply and the degenerate result itself.
The written cost is about 150,000 tokens to build and test. The cost to keep is low, because the reply file has a 7-day age limit. The cost to fix is unknown until the cause is known. The elapsed time is about 3 hours, plus one day of Service data to read.
Key questions
- Where should the stage job keep a refused reply, and for how long?: Keep it in the existing stage record directory under the Service data directory, keyed by item, with the same 7-day age limit as the gated plan. (best practice) [sources: src/devops_cli/roadmap/stage/stage_plan_record.py, src/devops_cli/roadmap/stage/stage.py]
- Chosen: Reuse the stage record directory with a 7-day age limit. It matches the gated plan record (feat(roadmap): keep the gated stage plan as a file #4167), and one cleanup path serves both files.
- Rejected: Write to a new directory with no age limit. It adds a second retention rule and can grow without bound.
- Rejected: Log the reply and keep no file. The log has no full reply, so the cause cannot be read.
- How should the stage job detect an all-placeholder reply before the gates?: Reuse the existing placeholder and minimum-length checks in
stage_validate.py. Treat the reply as degenerate when the placeholder checks fail in every plan text field. (best practice) [sources: src/devops_cli/roadmap/stage/stage_validate.py, tests/roadmap/stage/test_roadmap_stage_gates.py]- Chosen: Reuse the existing placeholder checks. One rule set keeps the gates and the degenerate result aligned.
- Rejected: Add a second keyword list. Two lists drift and give different results.
- Rejected: Let the gates run and count their refusals. The run still retries and spends the item.
- Should a degenerate reply use the existing retry or end the run?: End the plan run after the first degenerate reply with the result
degenerate. Do not send the same request again. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, tests/roadmap/stage/test_roadmap_stage_retry.py]- Chosen: End at once with
degenerate. The body shows the same reply returns on the second try, so a retry cannot help. - Rejected: Use the existing retry. It spends the retry and the item fails again.
- Rejected: Treat it as
failed. The metric then hides a distinct model fault.
- Chosen: End at once with
- What fields should a refused reply log?: Log the item key, the request token count, the request number, the tool-offered flag and the result on one
stage reply refusedline. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/ai/client/structured.py]- Chosen: One structured log line with the fields. The acceptance check can grep one line, and the fields answer the window and toolset questions.
- Rejected: Metrics only. Metrics cannot hold the request number or the item key at low cardinality.
- Rejected: The full reply in the log. The reply is large and can hold secrets; the file is the record.
- Should
degeneratebe a new result in the stage metric and the eval report?: Adddegenerateas a distinct result in both the stage metric and the eval report. Keepfailedfor gate and schema refusals. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stage/stage_eval_run.py]- Chosen: Add a distinct
degenerateresult. It separates this model fault from other failures and meets the metric and eval criteria. - Rejected: Count it as
failed. It hides the placeholder rate and gives no count for the eval. - Rejected: Count it as
skipped. The item was not skipped; the model replied.
- Chosen: Add a distinct
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 9, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.The stage job produced zero staged items for several days, so the core function of the roadmap Service is down.Users depend on the stage job to move items forward; zero output blocks the entire roadmap pipeline.Multiple causes are identified (model prompt, retry logic, logging), but each is a targeted change in the stage slot and its retry path.Both concern placeholder text in the stage job, but #3478 stops the system from accepting placeholders as valid results, while this candidate stops the model from producing them and prevents the retry loop from exhausting all rounds.devops-cli-service commentedon Nov 9, 2026
Status set to Ready at 87e9bd7 (see proposed design in issue body).
Moved to new items: #4205.
fix(k8s): name Sonnet in the analysis slot of the template (#4210)
devops-cli-service commentedon Nov 9, 2026
Released in v0.103.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.103.0
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 21:49 UTC