Skip to content

feat(roadmap): read project review facts through a catalog - #6586

Merged
dan-petty merged 33 commits into
mainfrom
feat/4692-read-project-review-facts-through-a-catalog
Nov 21, 2026
Merged

dan-petty merged 33 commits into
mainfrom
feat/4692-read-project-review-facts-through-a-catalog

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Add the fact catalog of the project review: catalog.yaml with a JSON Schema, one dispatcher, and readers over the listing snapshot, the devops gh session, PrometheusClient, Loki and OpenSpec. A new fact is data. Each fact gets a section and a status; a missing value is skipped or expired, never 0. data.json lists the disagreements and the reads, and --dry-run lists each query and sends 0 requests.

Live: v0.111.0..v0.112.1 gives 37 merged pull requests, median lead time 183.6 min, 75 opened, 35 closed, 66 ADDED and 22 MODIFIED, 2,334 to 2,400 and 1.37 USD, as the body. It gives 10, not 20, alternatives checks: the record keeps the latest check, and the Loki result line starts 2026-11-12. The 7 days to 2026-11-11T14:51:23Z give stage 58.27 and 98.45 (0.372) and 118.74 USD. A 7-day run sends 31 GitHub requests in 96 s with a current intake snapshot, 49 in 129 s without one.

Closes #4692

Change: openspec/changes/archive/2026-11-21-4692-read-project-review-facts-through-a-catalog/

Add the OpenSpec change of #4692. The proposal gives the premise
checks and the cost to build. The design records the decisions: one
JSON Schema, one dispatcher over the existing clients, the expired
mark, the disagreements and the dry run. The tasks put the tests
first in each group.
The loader refuses a fact with no id or section, an unknown section, placeholder or fact, two facts with one id, a Service metric query with no {repo} and a query by node. Failed: tests/roadmap/project_review/test_review_catalog.py (collection: no module catalog).
…JSON Schema

catalog.schema.json (Draft 2020-12) is the one definition of the catalog form, and jsonschema validates it. The loader also refuses two facts with one id, an unlisted section and a disagreement that names an unknown fact, and fills the six placeholders with a regular expression.
…nly listing

Failed: tests/roadmap/stores/test_listing_snapshot.py::test_a_read_that_keeps_nothing_reads_the_changes_and_leaves_the_snapshot_as_it_was, tests/roadmap/stores/test_roadmap_github_store_items.py::test_the_listing_gives_the_merge_time_of_a_merged_pull_request_and_null_for_a_closed_one.
…hot with no write

IssueRecord gets merged_at from pull_request.merged_at of the issue listing, so the review counts merged pull requests with no search request. IncrementalListing gets keep: the review reads the snapshot of intake and does not write it. The key of the listing schema changes, so each kept snapshot is read in full one time.
Failed: tests/k8s/test_logql_metrics.py::test_a_metric_query_at_a_time_sends_that_time_and_a_query_now_sends_none.
query_loki_metrics gets the optional at parameter, which it sends as time. The project review reads a past window at its end. The callers keep the current time.
GitHubApiFake gets serve, so a listing answers from its query, as the Actions runs of a created slice do. Failed: tests/roadmap/project_review/test_review_readers.py (collection: no module readers).
… and Loki for the review

The runs reader splits a created slice in two halves while its total_count reaches the result cap of 1,000, and gives each run once. A newest-first listing stops at the window start. The listing reader reads the intake snapshot with the changes after its watermark and does not write it. Prometheus and Loki are read at the window end.
Failed: tests/roadmap/project_review/test_review_openspec.py (collection: no module openspec_read).
… window

The reader names the files that the window archived with git diff, reads their text at the head with one git cat-file --batch into a temporary root, runs openspec show --json --deltas-only for each archived change in 4 workers, and counts the requirements at the base and the head with git grep -c. A git archive tar stream is binary, and the transcript of the git seam holds text, so the reader uses cat-file. The new git scenario review_openspec records the reads.
…a.json

Failed: tests/roadmap/project_review/test_review_dispatch.py (collection: no module dispatch), tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_catalog_follow_the_git_facts_with_their_section.
…a.json

The dispatcher fills the placeholders, checks the requires conditions and the retention, reads each distinct query once, and gives each fact its value with a jq program or from a vector. A source past its retention is expired, an unmet condition or an empty answer is skipped, and a failed read is error: a missing value is never 0. data.json gets the section of each fact, the disagreements and the reads of each reader kind (schema version 2).
…atalog

Failed: tests/commands/test_roadmap_review.py::test_a_dry_run_of_seven_days_lists_each_fact_of_the_catalog_and_sends_no_request, ::test_a_run_writes_data_json_under_the_data_directory_and_prints_it, ::test_a_run_prints_the_window_and_one_line_for_each_fact (no shipped catalog.yaml); tests/roadmap/project_review/test_review_facts.py::test_the_summary_shows_each_fact_that_is_not_ok_and_each_disagreement.
79 facts in 8 sections: the activity, release, Actions and code-scanning facts, the OpenSpec deltas and totals, the Service SLIs of the repository, the SRE queries Q1 to Q16 and the Kubernetes queries Q2 to Q22 that Prometheus can read with no host name, the alert, silence and Argo CD facts, the agentic job counters, the Renovate facts, one Loki topk over count_over_time fact and the gateway and CLI spend, with 3 disagreements. No fact reads devops_cli_usage_error_total (0 series), and the LogQL row of the CLI usage errors is #4840.
…dry run

run_review reads the catalog after the git facts. The dry run lists the git commands, the shared reads (the listing after the snapshot watermark, the OpenSpec reads) and each fact with its reader kind and rendered query, and sends no request. The summary shows each disagreement and the reads of the collection.
…show

A live 7-day review stopped at the archived change 2026-11-18-4590-trace-gate-judges-reads-that-are-no-run-read: its proposal has no Why section, and openspec show exits 1. Failed: tests/roadmap/project_review/test_review_openspec.py::test_a_change_that_openspec_cannot_show_is_listed_and_the_read_goes_on, ::test_one_archived_change_gives_its_deltas_and_the_totals_at_both_ends.
…ead the others

openspec show exits 1 for an archived proposal with no Why section (2026-11-18-4590-trace-gate-judges-reads-that-are-no-run-read), and the whole OpenSpec read failed. The reader now lists each refused change with the message of the tool under unread, reads the other changes, and the catalog gets openspec.unread_changes.
The review line of docs/ROADMAP_WORKFLOW.md, the Purpose of the roadmap-project-review spec, RoadmapReviewError and its row in docs/ERRORS.md, and the serve of the GitHub fake in docs/TESTING.md now name the catalog. The design records the two live sources of the alternatives checks.
The test was committed before its module existed, so the import sort put the module with the third-party imports.
…f the review

The limit table of the roadmap jobs names every numeric DEFAULT_ROADMAP_ value. The run result cap is GitHub's and cuts no run, and the worker count cuts no work.
…tion

data.json gives each fact a section, and the result of the git scenario review_window holds the model dump of each fact. The section is the only change; the git commands and the other values stay as recorded.
…d or no snapshot

The review must read only the gap after the watermark of a snapshot of
this schema at any age, and only the changes since the window start
when no such snapshot is kept.

Failed: test_review_readers.py::test_the_listing_reads_the_issue_after_the_watermark_once_and_keeps_the_snapshot,
test_an_old_snapshot_of_this_schema_gives_only_the_changes_after_its_watermark,
test_with_no_snapshot_of_this_schema_the_listing_reads_the_changes_since_the_window_start[None],
test_with_no_snapshot_of_this_schema_the_listing_reads_the_changes_since_the_window_start[0000000000000000]
…ince the window start

The review used the 24-hour fit rule of intake and never wrote a
snapshot, so a run with no fresh intake snapshot read the whole listing
(66 pages). A listing fact counts only issues and pull requests that
changed in the window, so the review now takes a snapshot of this
record schema at any age with its gap fill, and else reads only the
changes since the window start. It still writes no snapshot.

IncrementalListing loses the keep option; the store takes the
ListingRead protocol.
…ource, a Loki page and an empty answer

Failed: test_logql_metrics.py::test_an_answer_that_is_not_json_raises_a_project_error_that_names_the_setting[answer0],
[answer1]; test_review_dispatch.py::test_a_window_as_long_as_the_retention_is_read_not_expired,
test_an_unreachable_prometheus_gets_one_read_and_marks_each_of_its_facts_error,
test_a_loki_answer_that_is_not_json_marks_its_fact_error_and_the_review_reads_the_others,
test_a_rows_fact_with_no_series_and_no_base_metric_is_skipped,
test_a_fact_with_no_series_is_none_only_when_its_base_metric_has_a_series[rows-True-ok-value0-0],
[scalar-True-ok-0.0-None], [rows-False-skipped-None-None], [scalar-False-skipped-None-None]
…e, refuse a Loki page

- A start up to 1 hour before the retention limit is read, and the
  command gives the same time now to the window and to the review, so
  --last 30d is no longer expired.
- A read with no answer from the network ends the reads of its reader
  kind: the later facts take its reason and send no request (one
  unreachable Prometheus cost about 9 minutes for 65 facts).
- query_loki_metrics refuses an answer that is not JSON with
  KubernetesLoggingError that names loki.url, so the review marks the
  Loki fact error and reads the others.
- An answer with no series is skipped, also for a rows fact, unless the
  fact names a base metric with a series in the window: then the fact is
  none (no rows, or 0). The dry run lists that probe.
…and the name slug

Failed: test_review_catalog.py::test_each_service_metric_selector_of_a_query_must_name_the_repository[query0],
[sum(devops_cli_service_jobs_total) / ...], [sum(devops_cli_service_jobs_total{repo="x", row="{repo}"})],
test_a_base_metric_of_the_service_must_name_the_repository,
test_the_name_slug_placeholder_matches_the_job_names_of_the_repository;
test_repo_ref.py::test_an_ad_hoc_name_of_a_short_name_holds_the_name_slug_after_the_row,
test_the_name_slug_is_the_casefolded_name_with_each_run_of_other_characters_as_one_dash
…d the name slug

- The loader refuses each devops_cli_service_ selector, in query or in
  base, whose own braces hold no repo="{repo}": the schema saw only one
  {repo} somewhere in the query, so a ratio with an unscoped numerator
  passed.
- The placeholder {name_slug} (RepoRef.name_slug) gives the slug of the
  repository name in the Job names of the Service. kube-state-metrics
  exports no Job label, so the name is the only repository scope of a
  Job.
… a byte that is not UTF-8

The text read of git cat-file --batch turns CRLF into LF and a bad byte
into U+FFFD, so the byte sizes of the headers no longer match the text,
and the reader cuts the files at the wrong places. The transcript is
recorded from the current reader and shows the wrong text.

Failed: test_review_openspec.py::test_one_archived_change_gives_its_deltas_and_the_totals_at_both_ends
…grep

git cat-file --batch counts bytes, but the git seam reads text: CRLF and
a lone carriage return become one line end and a byte that is not UTF-8
becomes U+FFFD. So the sizes no longer matched the text, and a file
after such a file got the wrong text or the parse raised. One git grep
of every line gives each line with its path and needs no byte count. An
empty file gives no line, and its text is empty.
…rnatives facts

- prometheus.runner_jobs_started counts the implement Jobs of the
  repository by name (devops-cli-implement-{name_slug}-...) since #5739
  renamed them; devops-cli-runner-* was every repository and every run
  of the runner template. SLO 2, the runner memory and CPU read both
  names and leave out the fix-checks pods.
- The stage facts count the rounds of the stage row, and say so: since
  #5559 a round does not plan. prometheus.stage_item_results counts the
  ended items from devops_cli_roadmap_stage_total, which keeps one
  meaning across that date; prometheus.stage_jobs counts the stage Jobs.
- listing.alternatives_last_checked counts the latest check only;
  loki.alternatives_checks counts each check from its result line;
  prometheus.alternatives_rounds counts rounds.
- Count and rows facts name their base metric, so an empty answer is
  none only when the metric has series.
- The header cites the SRE and Kubernetes query lists.
…mmary whole

- RoadmapReviewError keeps its summary on one line, so the row of
  docs/ERRORS.md is a full sentence.
- The description of loki.url says that the review dials no default
  address and skips its Loki facts (#5481).
- The proposal, the design, the spec delta and the tasks give the
  listing read, the base metric, the down source, the retention grace,
  the name slug, the per-selector check and the git grep read; the
  spec and the catalog cite the SRE and Kubernetes query lists; each
  task group names every file that it changes.
The strict check refused one requirement over 500 characters, so the
archive splits it: the fields of a fact stay in their requirement, and the
order of the facts, the disagreements and the read counts get their own.
@dan-petty dan-petty added type/feature Type feature: a new function scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 21, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 21, 2026 04:39
@dan-petty
dan-petty merged commit 752c6ed into main Nov 21, 2026
26 checks passed
@dan-petty
dan-petty deleted the feat/4692-read-project-review-facts-through-a-catalog branch November 21, 2026 04:39
dan-petty-release Bot added a commit that referenced this pull request Nov 21, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.187.0](v0.186.0...v0.187.0)
(2026-11-21)


### Features

* **roadmap:** read project review facts through a catalog
([#6586](#6586))
([752c6ed](752c6ed))


### Bug Fixes

* **ci:** the fail-to-pass replay clears the addopts
([#6593](#6593))
([8bc7afc](8bc7afc)),
closes [#5599](#5599)


### Performance Improvements

* **roadmap:** share the listing snapshot and facts in Valkey
([#6583](#6583))
([b2a277b](b2a277b))

---
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>
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/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(roadmap): read project review facts through a catalog

1 participant