Skip to content
5 changes: 3 additions & 2 deletions docs/CLUSTER.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/ERRORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Each exception class declares its `error_code` and `exit_code`. A command that a
|---|---|---|---|---|
| `AIClientError` | `LLM_INFERENCE_ERROR` | `10` | Devops_cli.ai.client.models | Raised when an AI provider request fails with a user-actionable message. |
| `AICredentialsError` | `LLM_INFERENCE_ERROR` | `10` | Devops_cli.ai.client.models | Raised when a provider rejects the request's credentials; retrying cannot help. |
| `AIKeySpendLimitError` | `LLM_INFERENCE_ERROR` | `10` | Devops_cli.ai.client.models | Raised when the provider key behind a request reached its spend limit (#6821). |
| `AgentAuditFilingError` | `AGENT_AUDIT_FILING_FAILED` | `1` | Core | Raised when `devops roadmap intake` does not file one draft of `devops ai agent-audit` (#2346). |
| `AnswerFlagError` | `ONBOARD_ANSWER_DIFFERS` | `2` | Devops_cli.github.onboard.baseline | A flag gives an answer that differs from `.copier-answers.yml` of the repository. |
| `ApplicationSourceError` | `K8S_APPLICATION_SOURCE_ERROR` | `1` | K8s | Raised when a git source of an Argo CD Application cannot be read (#5131). |
Expand Down
1 change: 1 addition & 0 deletions docs/ROADMAP_WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ A stop has a class (`roadmap/failure.py`, #3065). A stop site that knows its cau
| `outside_plan` | `wait` | A fix step changed, added or deleted a path that the plan does not name (a path in a code span of any group, or a file of the change folder). The stop names the paths and holds the discarded diff. A person decides whether the plan changes |
| `git_config` | `wait` | No step gives this class since #3702: the implement job makes its git calls that reach `origin` in a clone or a repository that no agent wrote. A record of an earlier Job can hold it, for a `shallow` file of the clone that was a link |
| `plan_unreadable` | `wait` | The plan reader cannot read back the rendered files of a plan, or reads facts that differ from the proposal (#5214) |
| `spend_limit` | `wait` | A model call got HTTP 401 or 403, and the provider said that its key reached its spend limit (#6821). The error names the spend limit and the person step: raise the spend limit of the key at the provider, or change the key. A Job that stops for it leaves the class in the error line of its log, which the Service reads. Only the error of the project gives the class, and not the raw text of the provider, which a test or a plan can hold |
| `form_check` | `retry` | A refine round wrote a proposal with an empty part that the schema allows: no problem statement, no existing-tool answer, or, for a proposal that fits one pull request, no criterion or a criterion with an empty part. A field that the schema refuses is `parser`. The result line names the failed parts (#6327) |

The Job runs these actions by itself:
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/job-success.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ roadmap job result: job=<job> repo=<owner/repo> item=#<n> result=<result> succes
- `job` is `stage`, `implement`, `refine`, `refine_judge`, `alternatives`, `intake`, `fix_plan`, `fix_checks`, `retitle` or `review`.
- `success` is `true` when the result is the intended result of the job (table below).
- `class` is the failure class of `roadmap/failure.py`, or `none`.
- `infra` is `true` for a class that a cut of the infrastructure gives: `provider`, `ci_infra`, `oom` and `limit_reached`. The ratio of the dashboard counts these attempts as failures and shows their share apart. The job grade leaves them out of `p`.
- `infra` is `true` for a class that a cut of the infrastructure gives: `provider`, `ci_infra`, `oom`, `limit_reached` and `spend_limit`. The ratio of the dashboard counts these attempts as failures and shows their share apart. The job grade leaves them out of `p`.
- `first_pass` is `true` when the attempt succeeded with no fix round (table below, #5168).
- The counts and the names of the job follow, and the devops-cli version ends the line, so a query can compare two images. Every attempt logs `model_calls`, `tokens`, `seconds`, `cost_usd_micros` and `gh_requests` when recorded in its attempt context (#5168).

Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap/stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ An item whose model call fails is skipped and reported. The job still stages the

A reply that the checks refuse goes back to the planner with the refused reply and its problem. This applies to the first reply and to the revision of each repair round. The last check is the plan check (#4725): after `openspec validate`, `staged_problems` of `src/devops_cli/roadmap/plan_check.py` runs the title and body rules, the plan reader, the stage gates and the size of each group on the files that the job writes, with the checkout of the staged commit. These are the functions of `devops roadmap plan-check`. The problem is the line that the command prints for each finding, such as `openspec/changes/<change>/tasks.md: group-no-files: Group 2, ... packs no file. ...`, and its gate and code are `plan-check`. The rules that need the pull request do not run: the check `Semantic PR title`, a base spec that moved after the plan commit, and an open issue that the plan depends on, which holds the merge and is no fault of the plan. A kept plan that the checks refuse is no first reply and uses no return (see [The kept plan](#the-kept-plan)). The setting `roadmap.stage.gate_returns` (variable `DEVOPS_CLI_ROADMAP_STAGE_GATE_RETURNS`) is the number of returns, and the default is 3 (#4802). Each return is one more plan run, so the settings load refuses a value above 4 times the default, 12 (`CONST_ROADMAP_LIMIT_CEILING_FACTOR`, #4900, #5440). A reply that the checks refuse at the last return gets one more return when the last return made progress (#4851). The rule `gate_extension` in `src/devops_cli/roadmap/stage/stage_findings.py` reads the findings of the last two refused replies and makes no model call: no finding of the reply before stays (the same gate and the same text, with the digits masked), and no finding of the last reply has the fix class `never` in `stage_finding_classes.json`. With no finding that stays, each finding of the reply before is gone. An item gets `roadmap.stage.gate_return_extensions` extra returns at most (default 1, #5440), so at the defaults one reply gets at most `roadmap.stage.gate_returns` + 2 planner requests, and an item 22 plan runs at most. Each decision logs `stage gate extension: repo=<owner/repo> item=#<n> returns=<n> in=<n> gone=<n> stuck=<n> new=<n> never=<n> result=<result> version=<version>` and adds 1 to `devops_cli_roadmap_stage_gate_extension_total` by `result`: `extended`, or the stop `used`, `first`, `stuck` or `never`. Each extra return logs `stage gate extension end: repo=<owner/repo> item=#<n> returns=<n> result=<passed|refused|ended> version=<version>` and adds 1 to `devops_cli_roadmap_stage_gate_extension_ends_total`: `ended` is a run that ended before the checks judged the reply of the extra return. A reply that the checks refuse after the last return fails the item with the class `plan_defect`, and the failure text names the stop, such as `no extra return: a finding of the gate paths stays from the reply before`. A reply to a return or to a repair round that breaks the reply schema after its output retry loses no work: the planner gets the earlier plan again, with its problem and the schema violations, and that return counts against `roadmap.stage.gate_returns` (#6357). A schema failure after the last return fails the item with the class `parser`. A first reply has no earlier plan, so its schema failure fails the item at once. After the Service stops, no return starts: the round ends with the stop and records no failure for the item (#4900). A reply that is a placeholder in every text fails the item at once.

The Service records a failed item in its job record: the time (`stage.failed_at`), the type of the error (`stage.failed_error`), the step that failed (`stage.failed_step`, `plan` or `apply`) and the failure class (`stage.failed_class`). The class comes from the type of the error, by the one table `CLASS_BY_EXCEPTION` in `roadmap/failure.py`: a provider error is `provider`, a schema error is `parser`, a read back error is `plan_unreadable`, a refused plan is `plan_defect`, an item that changed is `head_moved`, and any other error is `ci_infra`. For a read back error, the Job log names each fact that differs, the place of its first difference and the two values there, masked and cut to 200 characters (#5952). The job leaves the item out for the wait of its class (`RETRY_AFTER` in `roadmap/failure.py`): 1 hour for `provider`, `plan_defect` and `ci_infra`, 6 hours for `parser` and `plan_unreadable`, and no time for `head_moved`. A record with no class, or a class that is unknown, waits as `ci_infra`. No setting changes the wait. The job takes the other items in the same round. The job also counts the `plan_defect` and `plan_unreadable` failures of an item on the same body (`stage.plan_defects`, with the hash of the body in `stage.plan_defects_body`). A body edit starts a new count, and a failure of another class leaves the count as it is. The failure that reaches `roadmap.stage.plan_defect_limit` (default 3, #5440) returns the item to New with one comment that lists the problems of the last plan in sequence, and clears the count. The list holds the problem of each reply that the checks refused, and then the reason of the failure, such as a stopped plan run, when the checks did not refuse the last reply. Refine gives that comment to its model when it looks at the item again. After a second return on the same body, refine waits for a reply or a body edit. `devops roadmap explain` reports the item and the time when the job takes it again. `--item` takes the item at once. A run that stages or stops the item clears the record. The row `stage` fails a round only when the round tried items and staged or stopped none, or when a failure belongs to no item, such as an outage. Three such rounds in a row on the same input suspend the row. The ledger of failed rounds keeps the class of each error across a restart of the Service, and the log line of a suspension names them. A round that the stop of the Service ends counts as `stopped`, not as an error.
The Service records a failed item in its job record: the time (`stage.failed_at`), the type of the error (`stage.failed_error`), the step that failed (`stage.failed_step`, `plan` or `apply`) and the failure class (`stage.failed_class`). The class comes from the type of the error, by the one table `CLASS_BY_EXCEPTION` in `roadmap/failure.py`: a provider key that reached its spend limit is `spend_limit` (#6821), any other provider error is `provider`, a schema error is `parser`, a read back error is `plan_unreadable`, a refused plan is `plan_defect`, an item that changed is `head_moved`, and any other error is `ci_infra`. For a read back error, the Job log names each fact that differs, the place of its first difference and the two values there, masked and cut to 200 characters (#5952). The job leaves the item out for the wait of its class (`RETRY_AFTER` in `roadmap/failure.py`): 1 hour for `provider`, `plan_defect`, `ci_infra` and `spend_limit`, 6 hours for `parser` and `plan_unreadable`, and no time for `head_moved`. A record with no class, or a class that is unknown, waits as `ci_infra`. No setting changes the wait. The job takes the other items in the same round. The job also counts the `plan_defect` and `plan_unreadable` failures of an item on the same body (`stage.plan_defects`, with the hash of the body in `stage.plan_defects_body`). A body edit starts a new count, and a failure of another class leaves the count as it is. The failure that reaches `roadmap.stage.plan_defect_limit` (default 3, #5440) returns the item to New with one comment that lists the problems of the last plan in sequence, and clears the count. The list holds the problem of each reply that the checks refused, and then the reason of the failure, such as a stopped plan run, when the checks did not refuse the last reply. Refine gives that comment to its model when it looks at the item again. After a second return on the same body, refine waits for a reply or a body edit. `devops roadmap explain` reports the item and the time when the job takes it again. `--item` takes the item at once. A run that stages or stops the item clears the record. The row `stage` fails a round only when the round tried items and staged or stopped none, or when a failure belongs to no item, such as an outage. Three such rounds in a row on the same input suspend the row. The ledger of failed rounds keeps the class of each error across a restart of the Service, and the log line of a suspension names them. A round that the stop of the Service ends counts as `stopped`, not as an error.

The reply of the planner has no key to say that the premise of the issue is false. So a reply never returns an item to New. The job itself returns an item to New in five cases only. The plan of an open item creates a path that this item reads, the body says that a class field is absent while the staging commit defines it, a person rejected the plan (see the next section), or the item reached the limit of `plan_defect` and `plan_unreadable` failures on one body (`roadmap.stage.plan_defect_limit`, see the paragraph above), or its stage Jobs reached the same limit with `deadline` and `failed` ends: that comment asks refine to split the item (#4559). In the second case the comment quotes the probe line with the file and the line of the field, and the job records `refine.next_step` as `edit`, so a body edit brings the item back to refine. A planner that finds an issue it cannot build as written says so in `feasibility` and plans no code that compensates for it. A person returns an item with `devops roadmap return`. A reply that breaks the schema goes back to the model once, and a second one fails the item with no comment and no change of Status.

Expand Down
2 changes: 1 addition & 1 deletion k8s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ Alertmanager runs from the prometheus chart (`alertmanager` in `monitoring/prome
| `RepositoryDriftCheckStopped` | CronJob `repos-drift` sent a result in the last 7 days but none in the last 2 days. An error before the reports, such as a refused App token, sends no result. Read the status and the log of its last Job with `kubectl -n devops get jobs -l app.kubernetes.io/name=repos-drift` | — | warning |
| `ClaudeSpendDailyHigh` | The calls of `claude-sonnet-5-5` cost more than 15 USD in the last 24 hours (#4222). The rule sums the 24 hour increase of `devops_cli_ai_spend_usd_total` of every job, and keeps the spend of a counter that reset. The highest normal day is 5.59 USD, and a failed stage burst costs about 21 USD per hour. Read the cost page of the AI spend dashboard, find the caller by the `end_user` label, and stop the job. Set the threshold again with the data of a month | — | warning |
| `HostedSpendDailyHigh` | The calls of all hosted models cost more than 25 USD in the last 24 hours (#4222). A local request adds 0 to `devops_cli_ai_spend_usd_total`, so the sum is the hosted spend. Read the cost page of the AI spend dashboard, find the caller by the `end_user` label, and stop the job | — | warning |
| `RoadmapServiceIdentityRefused`, `RoadmapServiceGitHubThrottled` | GitHub refused the identity of the roadmap Service, or throttled its requests; see [docs/CLUSTER.md](../docs/CLUSTER.md#alerts), Roadmap service, Alerts | — | critical |
| `RoadmapServiceIdentityRefused`, `RoadmapServiceGitHubThrottled`, `RoadmapProviderKeySpendLimit` | GitHub refused the identity of the roadmap Service, or throttled its requests, or the provider key behind the LLM gateway reached its spend limit; see [docs/CLUSTER.md](../docs/CLUSTER.md#alerts), Roadmap service, Alerts | — | critical |
| `RoadmapServiceJobsFailing` | All jobs of one row of a repository failed in 1 hour | 30m | warning |
| `RoadmapServiceLaneStalled`, `RoadmapServiceRestarted`, `RoadmapServiceMemoryNearLimit`, `RoadmapServiceUnavailable`, `RoadmapServiceGitHubRequestsHigh`, `RoadmapServiceModelRequestsHigh`, `RoadmapServiceStateUnkept`, `RoadmapServiceRowSuspended` | The roadmap Service stalls, its pod restarts, uses almost all of its memory limit or is unavailable, its GitHub or model requests in an hour are high, it could not write a state record, or a row stays suspended; see [docs/CLUSTER.md](../docs/CLUSTER.md#alerts), Roadmap service, Alerts | 0–15m | warning |
| `RoadmapServiceWebhooksRejected` | The webhook route of the roadmap Service rejected more than 20 deliveries in 15 minutes; see [docs/CLUSTER.md](../docs/CLUSTER.md#alerts), Roadmap service, Alerts | — | warning |
Expand Down
17 changes: 17 additions & 0 deletions k8s/devops/monitoring/prometheus-rules-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,23 @@ serverFiles:
annotations:
summary: "The row {{ $labels.row }} of {{ $labels.repo }} stays suspended after a {{ $labels.class }} failure"
description: "The roadmap Service did not run the row {{ $labels.row }} of {{ $labels.repo }} for 3 hours, because it failed its limit of rounds in a row (setting service.max_failed_rounds) with the failure class {{ $labels.class }}. The row runs one probe round when its retry time comes, or at once when its input changes. The gauge devops_cli_service_job_retry_after_seconds shows the seconds before the next probe round (docs/CLUSTER.md, Roadmap service)."
# A model call that the provider refused because its key reached its spend limit (#6821).
# A stage Job or an implement Job stops for it, and the Service reads the class
# spend_limit from the error line of the log of the Job. The jobs counter of a row of the
# Service has no class, so the signal of a row is its suspended gauge. The provider names
# the cause, and each model call fails until a person acts, so the alert has no wait.
# RoadmapServiceJobsFailing still fires for the failed rows.
- alert: RoadmapProviderKeySpendLimit
expr: >-
sum by (repo) (increase(devops_cli_service_stage_jobs_total{job="roadmap-service", result="failed", class="spend_limit"}[1h])) > 0
or sum by (repo) (increase(devops_cli_service_implement_failures_total{job="roadmap-service", class="spend_limit"}[1h])) > 0
or max by (repo) (devops_cli_service_job_suspended{job="roadmap-service", class="spend_limit"}) > 0
for: 0m
labels:
severity: critical
annotations:
summary: "The provider key behind the LLM gateway reached its spend limit, so the model calls of {{ $labels.repo }} fail"
description: "A model call of the roadmap Service or of a stage or implement Job of {{ $labels.repo }} got HTTP 401 or 403, and the provider said that its key reached its spend limit. Each model call fails until a person raises the spend limit of the key at the provider, or changes the key in the gateway (docs/CLUSTER.md, Roadmap service)."
# The webhook route of the roadmap Service (#2476), in a group apart from roadmap-service.
# The route counts each delivery that it refuses under outcome="rejected": unsigned, signed
# with no secret of a managed repository, too large, not JSON, or without its event name or
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-11-23
Loading