Repository navigation
Description
Problem or Motivation
No job turns findings across items into work:
- 8 need areas hold items of one need with different tools.
- ADR conflicts stay open: feat(roadmap): several implement Jobs can run at once, on disjoint files #3064 against ADR 0008.
- CI queue means of 387-1,370 s against run means of 5-507 s showed in GitHub data for days before a person found them (CI audit).
ci_infrais the top implement failure class (about 23 in 7 days).- Brain pods cannot reach Prometheus on port 9090 today (
k8s/monitoring/networkpolicy.yaml:25-60admits only traefik and otel).
Proposed Solution & Architectural Design
- Signal runner over the data list
roadmap.brain.signals(name, kindpromql|logql|git|github, query, period, threshold, owner note), on the existing clients (the GitHub session, git, the Prometheus client). It runs as a step ofbrain-daily. Signals of the first phase:ci_queue,implement_failures,spend_by_row,github_requests_by_row,hot_files,conflict_files(after refactor(openspec): split big capabilities into nested ones #4622). A fact that stays over its threshold for 3 daily runs becomes a project-fact insight. Bounds: 60 GitHub requests, 20 PromQL queries, 0 model calls, 300 s. - Commands
devops roadmap brain weekly|aggregate|improve, and CronWorkflowbrain-weekly(schedules: ["0 1 * * 1"],activeDeadlineSeconds: 3600) on theroadmap-braintemplate. - Aggregate: near lists (5 nearest items), tool groups (one canonical tool on 2 or more open items), need areas, ADR conflicts and ring changes. Bounds: 0 generative calls, 1,200 s.
- Improve:
- enrich the top 50 entries from the fact cache, and run the reference step for a need area with fewer than 2 references;
- at most 5 area tool checks a week with the existing alternatives agent; the verdict goes to the insight and to the digest of each member, never directly to a member block;
- re-rank
brain-insightsin a temporary key and RENAME it; - at most 2 proposals a week through
devops roadmap intake --title <title> --body-file <file> --source <tracker comment URL> --filed-by agent --confirm, each body with the insight marker; an ADR change goes as adocsissue; before it files, improve looks for the marker (ADR 0021 rule 5); - rewrite the tracker body view (top insights, tool radar rings, facts with their queries), at most once a week.
- Bounds: 2 proposals, 5 area checks, 50 enriched entries, 0.50 USD, 1,800 s.
- The first 2 weekly runs use
--plan: plans go to the tracker comment, and nothing is filed. - A proposal closed as not planned marks its insight
declineduntil its members change. - NetworkPolicy pair: pods with
row=brainreach Prometheus on 9090, with the matching ingress in the monitoring perimeter. - Instrument
devops_cli_brain_proposals_total; spend rowsbrain_aggregateandbrain_improve. - Spec in
openspec/specs/project-brain/insights/spec.md.
Target Subsystem
SDLC, Git & PR Governance (roadmap insights), with k8s/monitoring/networkpolicy.yaml.
Existing Tool Considered
The existing alternatives agent, devops roadmap intake (which flags a possible duplicate and never drops a candidate; an agentic judge approves a bot-filed item, owner 2026-11-05), the Prometheus and GitHub clients, git, and Argo CronWorkflows. The signal list is data, so a new signal needs no code. Cost: about 300,000 tokens and 7 hours to build.
Acceptance Criteria
- A test: improve never files more than 2 proposals a run and reads the marker before it files.
- A test: a project fact files only after 3 daily runs over its threshold.
- A test: a declined proposal marks its insight
declineduntil its members change. - A test: the signal runner reads a new signal from one data line with no code change.
- Live: a brain pod gets an answer from Prometheus.
- Live: the first 2 weekly runs file 0 issues and write their plans to the tracker.
- Live: brain spend stays under 1.20 USD a week (
devops_cli_ai_spend_usd_total{row=~"brain_.*"}).
Dependencies
#4687. Related: #4622 (the conflict-files signal). Part of the project brain plan #4624.
Source: #4624
Alternatives check of 2026-11-26: none.
Tool: none found.
Reason: Searches surfaced only alert-to-ticket tools (Keep, alertmanager-github-receiver) that turn a firing Prometheus alert into an issue; none reads data-driven project signals, requires a 3-run streak, ranks insights or files capped plan-first proposals through intake.
Covers:
- Prometheus alert rule that opens a GitHub issue
- Alert webhook receiver with issue dedupe
- One alerting platform over many monitoring providers
Lacks:
- No config rows for promql, logql, git and github signals
- No 3-daily-run persistence before a project fact
- No insight ranking, plan-first runs or marker dedupe
- No capped intake with source and filed-by agent
Proposed design
Problem statement
The project has no job that turns findings across items into work. CI queue times, implement failures, spend, hot files and ADR conflicts stay unseen until a person finds them. Brain pods cannot reach Prometheus on port 9090. This change adds a data-driven signal runner to brain-daily. It adds weekly aggregate and improve runs that file at most 2 proposals a week through intake. It adds a NetworkPolicy pair and a spec.
Acceptance criteria
Requirement: Signal row
The signal runner SHALL read each signal from one row of roadmap.brain.signals and SHALL add a signal with no code change.
Scenario: New signal row
- WHEN A test adds a
promqlsignal row with a query, a period, a threshold and an owner note to the signal fixture. - THEN The runner reads one fact through the Prometheus client and returns it with the signal name.
Requirement: Daily step
The signal runner SHALL run as a step of brain-daily and SHALL make 0 model calls.
Scenario: Daily step run
- WHEN A test runs the daily step with a signal fixture.
- THEN The step returns one fact for each signal and records 0 model calls.
Requirement: Signal runner bounds
A signal run SHALL make at most 60 GitHub requests and 20 PromQL queries, SHALL make 0 model calls, and SHALL end within 300 s.
Scenario: Query bound cut
- WHEN A test gives 21
promqlsignal rows. - THEN The runner issues 20 queries and records the cut in its result line.
Requirement: Two-run guard
The brain MUST NOT write a project-fact insight before a fact stays over its threshold for 3 daily runs.
Scenario: Two daily runs
- WHEN A test runs the signal step on 2 days with the same fact over its threshold on both.
- THEN The brain writes no project-fact insight.
Requirement: Project-fact insight
The brain SHALL write one project-fact insight after a fact stays over its threshold for 3 daily runs.
Scenario: Third daily run
- WHEN A test runs the signal step on 3 days with the same fact over its threshold.
- THEN The brain writes one project-fact insight that names the signal, its query and its threshold.
Requirement: Brain commands
The CLI SHALL provide devops roadmap brain weekly, devops roadmap brain aggregate and devops roadmap brain improve.
Scenario: Command help
- WHEN A test invokes each of the three commands with
--help. - THEN Each command exits 0 and lists its options.
Requirement: Weekly CronWorkflow
The deployment MUST hold CronWorkflow brain-weekly with the schedule 0 1 * * 1, activeDeadlineSeconds: 3600 and the template roadmap-brain.
Scenario: Manifest check
- WHEN
uv run devops ci --check --only k8sruns on the change. - THEN The check passes and reports no error for CronWorkflow
brain-weekly.
Requirement: Aggregate output
The aggregate step SHALL produce the near lists, the tool groups, the need areas, the ADR conflicts and the ring changes with 0 generative calls within 1,200 s.
Scenario: Aggregate on a fixture
- WHEN A test runs the aggregate step on a fixture of items and tool facts.
- THEN The output holds each group and the run records 0 generative calls.
Requirement: Improve caps
The improve step SHALL enrich at most 50 fact-cache entries, SHALL run the reference step for a need area with fewer than 2 references, and SHALL run at most 5 area tool checks a week.
Scenario: Caps on a fixture
- WHEN A test gives 60 enrichable entries, one need area with 1 reference and 6 due area checks.
- THEN The step enriches 50 entries, runs the reference step once and runs 5 area checks.
Requirement: Area check verdict
An area tool check SHALL write its verdict to the insight and to the digest of each member and MUST NOT write to a member block.
Scenario: Area verdict
- WHEN A test gives an area check verdict for an area with 2 members.
- THEN The verdict is in the insight and in both member digests and no member block changes.
Requirement: Improve budget
The improve step SHALL spend at most 0.50 USD and SHALL end within 1,800 s.
Scenario: Budget cut
- WHEN A test gives an improve run that would exceed 0.50 USD.
- THEN The step stops at the budget and records the cut in its result line.
Requirement: Insight re-rank
The improve step SHALL write the new rank order to a temporary key and SHALL RENAME that key to brain-insights.
Scenario: Re-rank rename
- WHEN A test runs improve on an existing
brain-insightskey. - THEN The new order lands in the temporary key and
RENAMEreplacesbrain-insightswith it.
Requirement: Capped proposals
The improve step MUST file at most 2 proposals a week through devops roadmap intake with --source, --filed-by agent and --confirm, MUST search for the insight marker before it files, and MUST write the marker in each body.
Scenario: Third insight and marker
- WHEN A test gives 3 insights and one open issue holds the marker of the first.
- THEN The step files 2 proposals, skips the marked insight and each filed body holds its marker.
Requirement: ADR conflict proposal
An ADR conflict proposal SHALL file as a docs issue with the ADR path in its body.
Scenario: ADR conflict
- WHEN A test gives an insight that names an ADR conflict.
- THEN The intake call uses the
docstype and the ADR path.
Requirement: Plan-only first runs
The first 2 weekly runs SHALL call intake with --plan, SHALL write their plans to the tracker comment and SHALL file no issue.
Scenario: First two runs
- WHEN A test runs
weeklytwice with the run counter at 0. - THEN Both runs write a tracker comment, call intake with
--planand increment the counter.
Requirement: Tracker body view
The improve step SHALL rewrite the tracker body view at most once a week.
Scenario: Second rewrite in a week
- WHEN A test runs improve twice in one week.
- THEN The second run writes no tracker body view.
Requirement: Declined insight
A proposal closed as not planned SHALL set its insight state to declined until a member changes.
Scenario: Declined and unchanged
- WHEN A test closes a proposal as not planned and reruns improve with unchanged members.
- THEN The insight is
declinedand the step files no new proposal for it.
Requirement: Brain to Prometheus
The NetworkPolicy pair SHALL admit pods with row=brain to Prometheus on port 9090 and SHALL add the matching ingress to the monitoring perimeter.
Scenario: NetworkPolicy check
- WHEN
uv run devops ci --check --only k8sruns on the change. - THEN The check passes and reports no error for the two NetworkPolicy manifests.
Requirement: Brain metrics
The brain SHALL increment devops_cli_brain_proposals_total for each filed proposal and SHALL record the spend rows brain_aggregate and brain_improve.
Scenario: Metrics after improve
- WHEN A test runs improve with one filed proposal.
- THEN The metric shows one proposal and both spend rows are present.
Requirement: Project-brain spec
The change SHALL add the spec at openspec/specs/project-brain/insights/spec.md.
Scenario: Spec validation
- WHEN
uv run openspec validateruns in the repository. - THEN The change validates with no error and the spec holds the insight requirements.
Requirement: Pending a person after the merge
A brain pod SHALL get an answer from Prometheus on port 9090 and the first 2 brain-weekly runs after the merge SHALL file no issue.
Scenario: First live runs
- WHEN A person reads the signal step of the first
brain-dailyrun and the first 2brain-weeklyruns after the merge. - THEN Each
promqlsignal shows a Prometheus answer with no connection error and each weekly run shows a plan comment with 0 filed issues.
Existing Tool Considered
The alternatives check of 2026-11-20 in the issue body records the verdict none with no tool. It found only alert-to-ticket tools: m-lab/alertmanager-github-receiver, sharkops-io/alertmanager-github-issues and keephq/keep. Each starts from a firing alert. The issue body lists what they lack: data-driven signal rows, the 3-run persistence, insight ranking, plan-first capped intake and marker dedupe. The change builds the pipeline itself, at about 300,000 tokens and 7 hours, as the issue body states.
Key questions
- Which pods may reach Prometheus on port 9090 today?: The monitoring NetworkPolicy admits traefik from
kube-systemon port 9090 and theotelcollectors on port 9090. It admits no brain pod. [sources: k8s/monitoring/networkpolicy.yaml] - Where does the project brain keep derived state?: Valkey holds the project brain. Each entry is derived and has a durable copy in the block of its item, a hidden block on the tracker issue or the cited document on
main. GitHub stays the source of truth. [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md] - How should the signal runner read a signal?: From one row of the data list
roadmap.brain.signals. Each row names itskind(promql,logql,gitorgithub), its query, period, threshold and owner note. The runner sends each row to the existing Prometheus client, the GitHub session or git. (best practice) [sources: src/devops_cli/config/defaults.py, CONTEXT.md]- Chosen: Data rows in the config. A new signal is one data line and needs no code change or deploy.
- Rejected: One module for each signal. A new signal needs code and a deploy, against the issue.
- Rejected: A new external tool. The alternatives check found no tool that covers the need.
- Where should the daily streak and the fact cache live?: In Valkey under a brain key, with a durable copy in the tracker block of the repository. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]
- Chosen: Valkey key with a tracker copy. The brain uses Valkey and requires a durable copy of each entry.
- Rejected: JSON files on the home volume. A file adds a second state store and no shared access.
- Rejected: The issue body only. A daily read and write to GitHub costs requests.
- How should improve avoid a second proposal for one insight?: Search open and closed issues for the hidden marker
<!-- devops-roadmap-insight:<id> -->before it files. The intake duplicate flag is the second check. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md, CONTEXT.md]- Chosen: Marker search. ADR 0021 rule 5 makes the marker the first check, and it covers closed issues.
- Rejected: Title match. A title changes and does not identify an insight.
- Rejected: Intake duplicate flag only. It runs after a candidate exists and does not stop a closed duplicate.
- How should a declined proposal mark its insight?: Read the closing state of the proposal. A proposal closed as not planned sets the insight state
declinedand stores a fingerprint of its members. A change of a member clears the state. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]- Chosen: Closing state and member fingerprint. The GitHub state is authoritative and a fingerprint detects a member change.
- Rejected: A label on the proposal. A label is a second state and a person can remove it.
- Rejected: A comment on the proposal. A comment search costs requests and is no state.
- How should the first 2 weekly runs stay plan-only?: Keep a Valkey counter
brain:weekly:runs. A run with a count below 2 calls intake with--planand writes the plan to the tracker comment. It files nothing. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]- Chosen: Valkey run counter. It is shared state and survives a pod restart.
- Rejected: An issue label. It changes the item and a person can remove it.
- Rejected: A tracker comment. It costs a GitHub read and write on each run.
- What schedule and deadline should
brain-weeklyuse?: CronWorkflowbrain-weeklywithschedules: ["0 1 * * 1"],activeDeadlineSeconds: 3600and the templateroadmap-brain. ADR 0021 already sets the Monday 01:00 UTC schedule for this job. (best practice) [sources: docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]- Chosen: Weekly on Monday at 01:00 UTC. ADR 0021 sets this schedule for the job, and it fits the weekly cadence.
- Rejected: Daily. It spends the proposal and model budget more often.
- Rejected: Manual only. It needs a person, and the issue asks for a schedule.
- How should brain pods reach Prometheus?: A NetworkPolicy pair. Egress from pods with
row=brainadmits TCP 9090. The monitoring perimeter adds the matching ingress for that selector on 9090. (best practice) [sources: k8s/monitoring/networkpolicy.yaml]- Chosen: NetworkPolicy pair. It opens only the brain selector and the Prometheus port.
- Rejected: Open port 9090 to all pods. It gives every pod access to Prometheus.
- Rejected: Proxy through traefik. It adds a proxy path and a second network hop.
Fit
Needs splitting into 4 items:
feat(roadmap): run project signals from a data list in brain-daily- theroadmap.brain.signalsrows, the signal runner on the Prometheus, GitHub and git clients, its bounds, the 3-run persistence, the daily step and the NetworkPolicy pair that admitsrow=brainto Prometheus.feat(roadmap): add the brain weekly aggregate run- thebrain-weeklyCronWorkflow, thedevops roadmap brain weeklyandaggregatecommands, and the near lists, tool groups, need areas, ADR conflicts and ring changes.feat(roadmap): improve brain insights- enrichment of 50 entries, the reference step, the 5 weekly area checks, the insight re-rank and the weekly tracker body view.feat(roadmap): file capped insight proposals through intake- at most 2 proposals a week with the insight marker, thedocstype for an ADR conflict, the 2 plan-only runs, the declined state and the proposal and spend metrics.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It improves project self-awareness but does not block current work or fix a defect.It automates detection of CI queue, failure, and spend patterns and files them as proposals, reducing manual monitoring.The body states about 300,000 tokens and 7 hours to build, with multiple subsystems and a NetworkPolicy change.Both work on project facts and insights for the roadmap, but 4692 delivers a read-only fact catalog while the candidate delivers the signal-to-insight-to-proposal pipeline.dan-petty commentedon Nov 11, 2026
Related item
#4692 (child of #4679) adds a fact catalog for the project review: one dispatcher reads facts from a data file through reader kinds. The signal runner of this item also reads project facts (CI queue, implement failures, spend and requests by row) from a data list. Before this item starts, check whether the signal runner can read its signals through the #4692 catalog, so that the project keeps one fact reader. If #4692 merges first, use its catalog and add the signals as catalog entries.
dan-petty commentedon Nov 11, 2026
Scope from the CLI usage plan (2026-11-11)
Tracker #4833, child 4: feat(roadmap): the brain files CLI usage-error proposals.
Problem. The owner wants the usage errors to drive future work on missing flags, features and aliases. #4693 plans the weekly brain step that files at most 2 intake proposals a week, but its signals do not include CLI usage errors. Without a weekly step, a person must run the report command to see the ranking.
Scope to add. A signal
cli_usage_errorsinroadmap.brain.signals(PromQL overdevops_cli_usage_error_totalfor the count; the names from the report command's Loki source). The improve step calls the report code as a library for the 7-day window with caller agent, and makes an insight from a row that has a proposal class other than hinted or resolved in 2 weekly runs. These insights share the cap of 2 proposals a week of #4693; they do not add to it. Before it files, improve searches open and closed issues for the markercli-usage:<command path>:<name>(ADR 0021 rule 5); when an open issue holds it, improve plans a comment with the new counts, not a new issue. A proposal body holds counts, days, callers, the class and Click's suggestion, never a value. The first 2 runs use--plan.Acceptance. In a
--planrun with a fixture of 4 qualifying rows, 1 of which has an open marker issue, the plan lists 1 comment, 2 proposals and 1 deferred row. A test finds no argument value in a proposal body. The step sends at most 2 GitHub search requests for each row and counts against the 60-request bound of #4693.Dependencies. Merge first: #4839, #4840.
Privacy. A record, a proposal body and a review row hold command and option names and counts only, never an argument value, a body, a token, a path or a user name.
dan-petty commentedon Nov 12, 2026
Scope from the content freshness plan (2026-11-11)
This issue is child 18 of #4880, the content freshness tracker. The scope adds a document-drift lane with its own cap.
Why
This issue files at most 2 insight proposals a week. If document drift shares that cap, a week with insights files 0 document issues. The census baseline (22 living high findings, 48 findings in ADRs in force) needs a bounded lane of its own, with evidence, deduplication and a stop.
New scope
closed_issue_named_open,adr_in_force_names_removed,kb_reviewed_age,rag_ingest_age,docs_check_at_main_head,docs_drift_findings.SECURITY.mdrecords its egress.roadmap.brain.docs_issues_per_week, default 3). Each issue is one batch for one area (the owning document of the routing table). It has at most 20 findings, a path marker, permalinks at themainSHA, the exact token and the proposed fix.The lane makes 0 model calls and costs 0 USD.
Acceptance added
Depends on: #4687, and the dependencies that this issue already names.
devops-cli-service commentedon Nov 14, 2026
Alternatives check: none
Reason: Searches for tooling that turns project signals into roadmap work found only Prometheus alert-to-GitHub-issue bridges (m-lab/alertmanager-github-receiver, sharkops-io/alertmanager-github-issues) and the Keep alert platform; each begins at a firing alert and opens a ticket, with no data-driven multi-source signal runner, no 3-daily-run persistence before an insight, and no insight ranking, enrichment, plan-first capped intake proposals or marker dedupe. The need is a project-specific brain step over Prometheus, git and GitHub data, so no open tool covers it.
Tool: none found
Lacks:
devops roadmap intakewith the insight marker, plan-only for the first 2 runsTools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Refine cannot set this item to Ready at 0820a64 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 26, 2026
Next step: a person splits the item, or replies in a comment or edits the body to keep one item. See Fit in the section Proposed design of the body.