Skip to content

docs(openspec): plan #2950 Add alternatives coverage metrics and alert - #3173

Merged
dan-petty merged 4 commits into
mainfrom
feat/2950-alternatives-coverage-gauge-searches-per-check
Nov 2, 2026
Merged

dan-petty merged 4 commits into
mainfrom
feat/2950-alternatives-coverage-gauge-searches-per-check

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Plans #2950

The alternatives check ran 34 times in 14 days and searched about 4 times, and no metric showed it. This plan adds two gauges (open items with no check, age of the oldest check, both by repository) and one histogram (searches per written check, by verdict). The Service row records the gauges at the start of each round, also when it has nothing to write. An alert fires after 3 days with no Firecrawl search while items have no check. The expression of the issue never fires: its two sides have different labels. A promtool run with the real labels showed that, and showed the fixed rule. A row of three panels goes into the devops-cli dashboard, because no Roadmap dashboard exists. The plan names #3171, #3174 and #3243 as neighbours.

Change: openspec/changes/2950-alternatives-coverage-gauge-searches-per-check/

🤖 Generated with Claude Code

https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW

Copy link
Copy Markdown
Owner

Review of the plan for #2950.

CI: all 18 checks pass or skip. Premise: the cited files exist on origin/main (ac16675): instruments.py has InstrumentKind with GAUGE and HISTOGRAM and ROADMAP_ALTERNATIVES_TOTAL (line 243); docs/TELEMETRY.md:81,83; k8s/README.md:615; roadmap-service-activity at prometheus-values.yaml:806; roadmap_service_activity_tests.yaml; archived 2946. The problems are in the alert, the dashboard and the gauge source.

  1. The alert expression cannot fire as written. Design and spec use increase(devops_cli_firecrawl_searches_total[3d]) == 0 and devops_cli_roadmap_alternatives_unchecked_items > 0. The counter has the label result (prometheus-values.yaml:846-848), the new gauge has repo. PromQL and without on() needs identical label sets, so the two sides never match. Also increase() is per result series (a result=402 series with no change is 0 while ok searches happen), and when no series exists in the window it returns no data, which is the exact "never searches" case. Fix: sum by (repo) (<gauge>) > 0 and on() (sum(increase(<counter>[3d])) or vector(0)) == 0, and feed the promtool cases with the real label sets (result="ok", repo="..."), or the test passes while production fails. The existing rules also use the "series that starts in the window" pattern of fix(monitoring): the roadmap Service alerts count the first value of a new series and see a lane of a new pod #2505 (prometheus-values.yaml:800-848); say whether this rule needs it.

  2. There is no Roadmap dashboard, and the capability is wrong. k8s/monitoring/dashboards/devops-cli.json is titled "devops-cli Telemetry" (uid devops-cli-telemetry). None of its 28 panels, and none of the 15 dashboard JSON files, contains "roadmap". The README calls it "devops-cli Telemetry" (k8s/README.md:681,686). The design line "the existing roadmap panels are there" is false. The telemetry-dashboard spec is the terminal UI (its Purpose: "interactive terminal user interface telemetry dashboard"; requirements are a LogQL console, ASCII sparklines, a trace waterfall). A Grafana panel for devops-cli.json already has a home: openspec/specs/metric-instruments/spec.md:35 ("Embedding Cache Hit Share"). Fix: add the panel requirement to metric-instruments, delete the telemetry-dashboard delta, and name the real dashboard or the dashboard that feat(roadmap): metrics for the pipeline outcomes #3069 may create (see Related).

  3. The gauge values are not available as claimed. select_items (alternatives.py:498-526) builds unchecked, due and current, but returns only ordered[:limit] and current. It drops items in the retry delay and items that _is_eligible refuses. The spec scenario ("10 open items, 4 checked, so 6") does not say whether those count. Define "open items with no check", extend Selection, and say where the gauges are recorded: plan_alternatives returns early when the check is off (no key), and --item N runs see one item, so both would write wrong or no values. The adapter is run.py:606. The oldest check age needs the checks written in the same round (apply_alternatives, line 880).

  4. The histogram is feasible but has a gap. Check.queries exists (alternatives.py Check dataclass), so the value is len(check.queries), and the write point is next to emit(ROADMAP_ALTERNATIVES_TOTAL...) at alternatives.py:903. But skip-class checks (fix(roadmap): the alternatives check must search before any verdict for items that can have an open alternative #2946, merged in fix(roadmap): make the alternatives check search before a verdict #3127) run no search and would record 0 under not-applicable. Add a scenario that says whether they are observed.

  5. Tasks.

    • 3.1 writes the rule and the promtool cases in one task and verifies only "passes". Put the cases first and verify that they fail on the base.
    • Task 4.1 runs tests/prometheus/test_k8s_monitoring_dashboards.py, which also passes on the base. The spec says "every query names a declared instrument"; no task adds that check. Not verified: whether the test already does it.
    • 5.2 is cut off: "docs/TELEMETRY.md and k8s/README.md, run uv run devops docs generate --sync-readme", and repeats the verify of 5.1.
  6. Feasibility lists tool calls (read_file, search_code, file_symbols, list_files) and "first checks" that were not run, not output. Spec: the scenario "An undeclared metric fails the invariant" repeats the existing requirement (metric-instruments/spec.md:8). Minor: the main spec names tests/test_telemetry_instruments.py; the file is tests/telemetry/test_telemetry_instruments.py. The title repeats "plan" (plan #2950 plan alternatives...).

Related issues: #2944 (alternatives comment shows the searches that ran; same Check.queries code), #2947 (first pass 20 items a day; changes selection and limit), #2951 (refine needs an alternatives verdict), #3069 (dashboards and alerts for the pipeline; may create the Roadmap dashboard), #2919 (stuck-item metrics and one alert; same instruments.py and prometheus-values.yaml), #2968 (inbox gauges and panel). For these only titles were read, not bodies.

Verdict: hold until the alert expression is fixed and tested with real labels, the dashboard and capability are corrected, and the gauge source is defined.


Generated by Claude Code

Fix the alert expression (equal labels, searches counted in the form of
_window_count, 7 days of gauge), checked in promtool 3.15.1. Define the two
gauges and where the Service row records them. Move the panels to a row of
devops-cli.json, as no Roadmap dashboard exists. Put the promtool cases first
in the tasks, map the acceptance criteria, add Dependencies and the cost.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW
@dan-petty dan-petty changed the title docs(openspec): plan #2950 plan alternatives coverage telemetry docs(openspec): plan #2950 Add alternatives coverage metrics and alert Nov 2, 2026
@dan-petty
dan-petty merged commit e5a2f36 into main Nov 2, 2026
20 checks passed
@dan-petty
dan-petty deleted the feat/2950-alternatives-coverage-gauge-searches-per-check branch November 2, 2026 17:48
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
…lan (#3914)

Plans #3251

A plan for an alert rule with promtool cases or a dashboard panel with a
query pin has no test-first kind. The kind `other` has one repeatable
command and no failing-case task, so two agents wrote those tasks by
hand and the review refused the form. This change adds the kind
`manifest` to `GroupKind`. A manifest group has a `test`, an
`implementation` and a `verify`, and no `process`. `group_text` renders
its case task first, with `fails on the base`, then its work.
`form_problems` refuses an `other` group that creates or changes a case
path, and names `manifest`. It refuses a manifest `verify` that is not
`uv run devops ci test` followed by a path of the group. The planner
prompt names the kind and both rules. One replay case from the
hand-written plan of #3173 pins the rule.

Change: `openspec/changes/3251-add-a-test-first-manifest-kind/`

Co-authored-by: devops-cli-service[bot] <349441588+devops-cli-service[bot]@users.noreply.github.com>
dan-petty added a commit that referenced this pull request Nov 7, 2026
Staging a plan cannot see the registries and ratchet tests that a new
constant, setting, metric or job write needs, so the entries are missed
and the suite fails later (#3254). Evidence: the limit-class ratchet in
`tests/roadmap/test_roadmap_limit_classes.py` (#3174), the job-write
registries of #3169, and the `INSTRUMENTS` registry whose documented
test path is stale (#3173).

Closes #3254

Change:
`openspec/changes/archive/2026-11-07-3254-list-the-registry-and-ratchet-entries/`
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
Add the manifest kind to GroupKind and the stage group schema. A manifest
group starts with its failing case and runs it with devops ci test. Refuse
an other group that creates or changes a case path, and name manifest in the
problem. Name the kind and its rules in the stage planner prompts. Add the
replay case from pull request #3173 to the golden set.

Closes #3251
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
Add the manifest kind to GroupKind and the stage group schema. A manifest
group starts with its failing case and runs it with devops ci test. Refuse
an other group that creates or changes a case path, and name manifest in the
problem. Name the kind and its rules in the stage planner prompts. Add the
replay case from pull request #3173 to the golden set.

Closes #3251
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
Add the manifest kind to GroupKind and the stage group schema. A manifest
group starts with its failing case and runs it with devops ci test. Refuse
an other group that creates or changes a case path, and name manifest in the
problem. Name the kind and its rules in the stage planner prompts. Add the
replay case from pull request #3173 to the golden set.

Closes #3251
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
Add the manifest kind to GroupKind and the stage group schema. A manifest
group starts with its failing case and runs it with devops ci test. Refuse
an other group that creates or changes a case path, and name manifest in the
problem. Name the kind and its rules in the stage planner prompts. Add the
replay case from pull request #3173 to the golden set.

Closes #3251
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
Add the manifest kind to GroupKind and the stage group schema. A manifest
group starts with its failing case and runs it with devops ci test. Refuse
an other group that creates or changes a case path, and name manifest in the
problem. Name the kind and its rules in the stage planner prompts. Add the
replay case from pull request #3173 to the golden set.

Closes #3251
dan-petty pushed a commit that referenced this pull request Nov 7, 2026
Issue #3251 reports that the stage planner has no test-first kind for a
manifest, a rule file, a dashboard file, or a case file. A plan for an
alert rule with promtool cases or a dashboard panel with a query pin
uses the kind other, which has one repeatable command and no
failing-case task.

This change adds:
- The manifest kind to GroupKind and the stage group schema.
- Validation that a manifest group starts with its failing case and runs
it with devops ci test.
- Refusal of an other group that creates or changes a case path, naming
manifest in the problem.
- Planner prompt updates in roadmap_stage_change.md and
roadmap_stage_split.md.
- The replay case from pull request #3173 to the golden evaluation set.

Closes #3251

Change:
`openspec/changes/archive/2026-11-07-3251-add-a-test-first-manifest-kind/`

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants