Skip to content

perf(roadmap): Cut review reads with a snapshot and counts - #6716

Merged
dan-petty merged 5 commits into
mainfrom
perf/6603-the-project-review-keeps-its-own
Nov 22, 2026
Merged

dan-petty merged 5 commits into
mainfrom
perf/6603-the-project-review-keeps-its-own

Conversation

@devops-cli-service

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

Copy link
Copy Markdown
Contributor

A 7-day project review with no intake snapshot sends 49 GitHub requests (#6603), above the limit of 45 of #4692, because the review writes no listing snapshot and pages about 25 pages of Actions runs.

The review now keeps its own listing snapshot under review-listing. It reads the changes after the later of its watermark and the window start, or from the window start when the window starts before the first window of its snapshot. When that read starts after the watermark, the snapshot covers only the time from the read start, so a later, wider review reads the changes before it. The runs reader reads counts, not pages. GitHub stops the total_count of a filtered runs list at 2,500, so the reader reads the total of each created slice first, splits a slice at the cap in two halves, and reads four status counts for each slice under it. A 7-day window costs 5 requests.

Closes #6603

Change: openspec/changes/archive/2026-11-22-6603-the-project-review-keeps-its-own/

@devops-cli-service devops-cli-service Bot added scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/infra Type infra: the build, CI, images or cluster labels Nov 22, 2026
@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

Step Status Attempts Tokens in/out Last failing command
group 1 done 1 4039194/23449 -
group 2 done 1 12339718/68678 -
group 3 done 1 829996/4981 -
group 4 done 1 416536/2544 -
fix done 1 2970025/16881 -
  • tools: run_command 125, read_file 57, grep 41, edit_file 40, list_files 2, write_file 1
  • scoped check pre-push: passed, 4 s
  • scoped check static: passed, 24 s
  • scoped check tests: passed, 28 s
  • scoped check strength: failed, 0 s
  • scoped check pre-push: passed, 4 s
  • scoped check static: passed, 24 s
  • scoped check tests: passed, 29 s
  • scoped check strength: passed, 0 s
  • scoped check tests: the changed files select more than 30 test modules, so only the changed test modules ran. The required checks of CI run the others
  • group 3: skipped, group 3: kind other
  • group 4: skipped, group 4: kind other
  • fail-to-pass of group 1: fails on the base commit. Tests that fail on the base commit: tests.roadmap.project_review.test_review_readers::test_the_listing_reads_the_issue_after_the_watermark_once_and_keeps_the_snapshot, tests.roadmap.project_review.test_review_readers::test_an_old_snapshot_of_this_schema_gives_only_the_changes_after_its_watermark, tests.roadmap.project_review.test_review_readers::test_with_no_snapshot_of_this_schema_the_listing_reads_the_changes_since_the_window_start[None], tests.roadmap.project_review.test_review_readers::test_with_no_snapshot_of_this_schema_the_listing_reads_the_changes_since_the_window_start[0000000000000000], tests.roadmap.project_review.test_review_readers::test_a_second_review_over_a_new_window_reads_only_the_gap_pages, tests.roadmap.project_review.test_review_readers::test_a_stale_review_snapshot_reads_from_the_window_start.
  • fail-to-pass of group 2: fails on the base commit. Tests that fail on the base commit: tests.roadmap.project_review.test_review_readers::test_the_runs_reader_counts_each_status_with_one_request, tests.roadmap.project_review.test_review_readers::test_two_thousand_runs_split_into_slices_under_the_cap_and_no_run_is_lost, tests.roadmap.project_review.test_review_readers::test_a_slice_of_one_second_at_the_cap_raises, tests.roadmap.project_review.test_review_readers::test_a_first_seven_day_review_sends_at_most_45_requests.
  • verify of group 3: uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py exits 0.
No coverage index found. Run `devops ci coverage --build-index` to build one.
  tests/roadmap/test_roadmap_limit_classes.py \u2192 tests/roadmap/test_roadmap_limit_classes.py
================================================================================================================== test session starts ===================================================================================================================
platform linux -- Python 3.14.10, pytest-9.2.0, pluggy-1.7.0
rootdir: /home/devops/.data/roadmap/implement-runs/devops-implement-qkat9_6u/work/model-clone
configfile: pyproject.toml
plugins: xdist-3.8.0, cov-7.1.0, asyncio-1.4.1.post1, platformdirs-4.14.8, time-machine-3.6.0, mock-3.17.0, anyio-4.16.0, syrupy-7.0.3, timeout-2.4.0, hypothesis-6.170.17
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
timeout: 600.0s
timeout method: signal
timeout func_only: False
collected 41 items

tests/roadmap/test_roadmap_limit_classes.py .........................................                                                                                                                                                              [100%]

=================================================================================================================== 41 passed in 0.63s ===================================================================================================================
/home/devops/.data/roadmap/implement-runs/devops-implement-qkat9_6u/work/model-clone/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
  • verify of group 4: uv run devops ci docs exits 0.
\u2139 Quality gate root: /home/devops/.data/roadmap/implement-runs/devops-implement-qkat9_6u/work/model-clone
\u2713 All documentation files are up to date.
  • verify of group 0: uv run devops ci test tests/roadmap/project_review/test_review_readers.py exits 0.
No coverage index found. Run `devops ci coverage --build-index` to build one.
  tests/roadmap/project_review/test_review_readers.py \u2192 tests/roadmap/project_review/test_review_readers.py
================================================================================================================== test session starts ===================================================================================================================
platform linux -- Python 3.14.10, pytest-9.2.0, pluggy-1.7.0
rootdir: /home/devops/.data/roadmap/implement-runs/devops-implement-qkat9_6u/work/model-clone
configfile: pyproject.toml
plugins: xdist-3.8.0, cov-7.1.0, asyncio-1.4.1.post1, platformdirs-4.14.8, time-machine-3.6.0, mock-3.17.0, anyio-4.16.0, syrupy-7.0.3, timeout-2.4.0, hypothesis-6.170.17
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
timeout: 600.0s
timeout method: signal
timeout func_only: False
collected 15 items

tests/roadmap/project_review/test_review_readers.py ...............                                                                                                                                                                                [100%]

=================================================================================================================== 15 passed in 5.58s ===================================================================================================================
/home/devops/.data/roadmap/implement-runs/devops-implement-qkat9_6u/work/model-clone/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
  • verify of group 0: uv run devops ci test tests/roadmap/test_roadmap_limit_classes.py exits 0.
No coverage index found. Run `devops ci coverage --build-index` to build one.
  tests/roadmap/test_roadmap_limit_classes.py \u2192 tests/roadmap/test_roadmap_limit_classes.py
================================================================================================================== test session starts ===================================================================================================================
platform linux -- Python 3.14.10, pytest-9.2.0, pluggy-1.7.0
rootdir: /home/devops/.data/roadmap/implement-runs/devops-implement-qkat9_6u/work/model-clone
configfile: pyproject.toml
plugins: xdist-3.8.0, cov-7.1.0, asyncio-1.4.1.post1, platformdirs-4.14.8, time-machine-3.6.0, mock-3.17.0, anyio-4.16.0, syrupy-7.0.3, timeout-2.4.0, hypothesis-6.170.17
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
timeout: 600.0s
timeout method: signal
timeout func_only: False
collected 41 items

tests/roadmap/test_roadmap_limit_classes.py .........................................                                                                                                                                                              [100%]

=================================================================================================================== 41 passed in 0.64s ===================================================================================================================
/home/devops/.data/roadmap/implement-runs/devops-implement-qkat9_6u/work/model-clone/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.py:300: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the "fixture" caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to "function" scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
  • verify of group 0: uv run devops ci docs exits 0.
\u2139 Quality gate root: /home/devops/.data/roadmap/implement-runs/devops-implement-qkat9_6u/work/model-clone
\u2713 All documentation files are up to date.

@dan-petty

Copy link
Copy Markdown
Owner

Advisory pre-merge review (automated; a person decides).

Recommendation: hold. Two major correctness findings stand: a hole in the review snapshot, and run counts that stop at 2,500 with no error.

Reviewed head: a4284349a. Base: merge-base 671f24192. origin/main is now f14cb8b00, so the branch is behind main.

Findings

1. Major: the review snapshot keeps a permanent hole

  • Where: src/devops_cli/roadmap/project_review/readers.py:120 (full_at = min(held.full_at, self.start)) and :129-135 (_gap).
  • Problem: When the watermark is before the window start, _gap reads the changes only from the window start. The reader does not read the changes between the old watermark and the window start. Then it saves the snapshot with a new watermark and with the old, earlier full_at. A later review whose window starts after that full_at reads only from the new watermark. It never reads the records that changed in the hole. The listing facts (issues opened, issues closed, pulls merged, Renovate facts) then undercount with no message. The intake source (own=False) has the same defect. The case occurs in normal use: for example, review week 40, then week 42, then --last 30d.
  • Evidence: A scratch pytest ran _ReviewListing at the head in three runs: A (day 0, 30-day window, empty stores), B (day 20, 7-day window), C (day 21, 30-day window). The reads used since=2026-09-01, 2026-10-14 and 2026-10-18T23:59. Issue 2 changed on 2026-10-06, which is in the window of run C. Run C gave [1, 3] and the test failed: issue 2 opened in run C's window is missing. A second reviewer ran the test again with the worktree pyproject.toml and got the same result. test_a_stale_review_snapshot_reads_from_the_window_start (tests/roadmap/project_review/test_review_readers.py:375) sets up this state, but it checks only the request count of the first read.
  • Fix: When the gap starts after the watermark of held, save full_at = gap (or the later of held.full_at and the gap). Then a wider window later reads from its own start. Add a test with three reads, as the scratch test does.

2. Major: the run counts stop at 2,500 with no error

  • Where: src/devops_cli/roadmap/project_review/readers.py:209-221 (_run_count) and :231 (docstring of read_runs). Also the catalog fact github_runs.main_push_runs.
  • Problem: The reader takes each total_count as exact. GitHub stops the total_count of a filtered runs list at 2,500. Above that, the fact gets a wrong n and wrong status counts, and no error shows. The old reader split the window and raised RoadmapReviewError when it could not count each run. --last Nd and --since/--until accept any span (window.py:130, :152). One week now holds about 1,866 runs, so a window of more than about 10 days goes above the limit. The plan measured only 1,942 runs (proposal.md:55) and does not name a limit of 2,500.
  • Evidence: Two reviewers sent devops gh api repos/dan-petty/devops-cli/actions/runs?branch=main&event=push&per_page=1:
    • created=2026-10-01..2026-11-22: total 2500, success 2500, failure 445, cancelled 903. The sum is more than the total.
    • created=2026-11-07..2026-11-15: total 2500, success 2304, failure 170, cancelled 347. The sum is 2,821 or more.
    • created=2026-11-15..2026-11-22: total 1866. This is below the limit, and the count is exact there.
    • The test fake RunsApi returns {"total_count": len(found), ...} (test_review_readers.py:109) with no limit, so no test can find this defect.
  • Fix: When a total_count is 2,500 or more, do not use it as exact. Split the created range (with per_page=1 counts) until each slice is below the limit, or give the fact the status error with a reason. Make RunsApi stop total_count at 2,500, and add a test of a window above that limit.

3. Minor: two tests have names that state removed behavior

  • Where: tests/roadmap/project_review/test_review_readers.py:138 (test_two_thousand_runs_split_into_slices_under_the_cap_and_no_run_is_lost) and :162 (test_a_slice_of_one_second_at_the_cap_raises).
  • Problem: The test named ..._raises now asserts that nothing raises. The test named ..._split_into_slices_... now asserts five count requests, and no slice exists. This breaks docs/TESTING.md:107: "A test is named after the behaviour it checks." A failed test ID then gives a wrong message. Task 2.1 says that these tests are "replaced", but it does not say to keep the names.
  • Evidence: The docstrings say: "The case keeps the name that it had while such a window raised." The diff removes with pytest.raises(RoadmapReviewError, match="1,000"):.
  • Fix: Rename the two tests to tell what they check. For example: test_a_one_second_window_at_the_cap_counts_every_run and test_two_thousand_runs_are_counted_by_status_and_no_run_is_lost.

4. Minor: the runs window now includes its start second

  • Where: src/devops_cli/roadmap/project_review/readers.py:205 (_count_path).
  • Problem: The old reader read created=<start + 1 s>..<end>, so the window was (start, end]. That agrees with the listing facts ($t > $start and $t <= $end in catalog.yaml). The new reader reads created=<start>..<end>. A run created in the start second now counts in this window and also in the previous one. No test checks either boundary, because _push_runs puts each run strictly inside the window.
  • Evidence: Removed: slices = [(start.replace(microsecond=0) + _SECOND, end.replace(microsecond=0))]. Added: created={utc_text(start)}..{utc_text(end)}&per_page=1.
  • Fix: Keep the old lower bound, utc_text(start.replace(microsecond=0) + timedelta(seconds=1)). Add a test with one run in the start second and one run in the end second.

5. Minor: fail-to-pass gives no result for each test of the readers module

  • Where: tests/roadmap/project_review/test_review_readers.py:33 (from devops_cli.roadmap.stores.listing_snapshot import ... review_listing).
  • Problem: On the base, the whole module stops at collection with an ImportError. Thus fail-to-pass does not show that the gap-page, stale-snapshot, wider-window and 45-request tests find the old behavior.
  • Evidence: uv run devops ci fail-to-pass --base origin/main: errored on base: tests.roadmap.project_review.test_review_readers (collection failure).
  • Fix: Import the module (import devops_cli.roadmap.stores.listing_snapshot as listing_snapshot) and call listing_snapshot.review_listing in the test that needs it.

6. Minor: the "new window" criterion is tested over the same window

  • Where: tests/roadmap/project_review/test_review_readers.py:344 (test_a_second_review_over_a_new_window_reads_only_the_gap_pages), and test_a_second_seven_day_review_sends_at_most_45_requests.
  • Problem: The first acceptance criterion of perf(roadmap): the project review keeps its own listing snapshot #6603 asks for a second review over a new window. Both tests run the second review over the same window START..END.
  • Evidence: The test calls _held(review, full_at=START) and read_listing(..., start=START, ..., now=END). _review() builds ReadContext(window=_window(), ...), and _window() always gives START..END.
  • Fix: Start the second run later, for example START + 1 day to END + 1 day.

7. Minor: the spec scenario of 2,072 runs has no test

  • Where: openspec/specs/roadmap-project-review/spec.md, requirement "The runs reader counts the runs of each status", scenario "A window of 2,072 runs".
  • Problem: No test reads the shipped fact github_runs.main_push_runs through the catalog. Thus no test proves the new catalog lines value: .statuses and n: .total_count. The reader tests use other numbers (1800/150/30/20). The "another status" scenario names 3 skipped runs, but the test uses 1.
  • Evidence: grep -rn main_push_runs tests/ gives no match.
  • Fix: Add one catalog-level test with RunsApi(_push_runs(1927, 29, 104, 12)) that asserts the value map and n == 2072. Or change the scenario to agree with the tests.

Nits

  • test_review_readers.py:434-435: review_listing() returns SnapshotStore, which has no path attribute. uv run mypy on the test file gives two attr-defined errors. The gate checks only src, so CI does not fail. Fix: return FileSnapshotStore, or cast in the test.
  • No test puts a review snapshot of another schema in the review store. The parametrized test (:324) puts the old schema only in the intake store. Fix: parametrize the store that holds the old schema.
  • The spec scenario "A second 7-day review" says that the listing count goes down. The test compares only the sum of all GitHub reads. Fix: also assert that the listing count of the second review is lower.
  • test_a_second_review_over_a_new_window_reads_only_the_gap_pages asserts kept < empty and then the exact pair (1, 3). The first assertion adds nothing.
  • Commit a4284349a has the same subject as 85683dce2, but adds only two tests. The squash merge removes this.

Checks that ran

  • git diff -M --name-status origin/main...HEAD: 15 files. Each file is in a "Changes:" line of tasks.md. The change folder is archived, all task boxes are checked, and the base spec agrees with the archived delta.
  • PR title and body: Conventional Commit, scope roadmap, summary 43 characters. Closes #6603 names only the delivered issue.
  • uv sync --locked in the review worktree: exit 0.
  • uv run ruff check and ruff format --check on the 7 changed Python files: pass.
  • uv run mypy on the 5 changed src files: no issues. On the test file: 2 errors (nit above).
  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: all 10 rows pass, 3m 1s.
  • uv run devops ci test tests/roadmap/project_review tests/roadmap/test_roadmap_limit_classes.py tests/roadmap/stores tests/lang: 548 passed, 1 failed. The failure is test_review_facts.py::test_the_facts_of_a_version_window: lizard.complexity is SKIPPED because the lizard module is not in the worktree .venv. The PR does not change that file or facts.py, so the cause is the environment.
  • uv run devops ci fail-to-pass --base origin/main: 2 limit-class tests fail on the base. The readers module stops at collection on the base (finding 5).
  • Scratch pytest of three _ReviewListing runs against the head: fails, which proves finding 1.
  • devops gh api run counts for each status on 4 windows: total_count stops at 2,500 (finding 2).
  • CI check runs of head a4284349a: all completed with success or skipped. Fail-to-Pass is skipped, as expected for a perf title. CI does not find findings 1 and 2, because the test fakes do not have these behaviors.
  • Refute pass: findings 1 and 2 stay major. The test-name finding stays, but goes down from major to minor.

@dan-petty
dan-petty marked this pull request as draft November 22, 2026 01:13
devops-cli-service Bot and others added 5 commits November 22, 2026 02:02
The review snapshot now covers only the time from the gap start when
the gap starts after the watermark, so a later, wider review reads the
changes in that hole (#6603).

GitHub stops the total_count of a filtered runs list at 2,500. The runs
reader reads the total of each created slice first, splits a slice at
the cap in two halves, and adds the four status counts of each slice
under the cap. A one-second slice at the cap, or status counts above a
total, raise RoadmapReviewError. The window counts the runs after its
start second, as before.
A runs page with no total_count gave a count of 0 with no error. Now
the reader raises RoadmapReviewError, so the runs fact gives an error.
A total_count that is not a whole number at or above 0 raises too.

The requirement, the docs line and the catalog definition now state the
final behavior: the listing reads from the window start when the window
starts before the first window that the review snapshot covers, and a
slice under the count cap gets the status counts. The archived proposal
and tasks state the kept cap message, the plan of each created slice and
the correct test counts. CONTRIBUTING.md states that a limit of a roadmap
job stays in config/ when one module reads it.
@dan-petty
dan-petty force-pushed the perf/6603-the-project-review-keeps-its-own branch from a428434 to 6bdb287 Compare November 22, 2026 02:13
@dan-petty

Copy link
Copy Markdown
Owner

Advisory re-review after the fix commit (automated; a person decides).

Recommendation: merge after minor fixes. Fix S1, S2 and S3 in this pull request, and let a person decide S4. The nits S5 to S11 are optional.

Head: 8679a51da on merge base f075f16ce. Four lenses ran: fidelity, tests, correctness and standards. No refute verdict came back, so a refute dropped no finding. I checked the evidence of each standing finding again in the review worktree. Each claim has a file and line or a command result, so I dropped no finding for lack of evidence. No major finding or blocker stands.

Status of the original findings

ID Status Evidence
F1 Fixed readers.py:125 sets full_at to the gap start when the gap starts after the watermark. test_a_wider_review_reads_a_change_between_the_watermark_and_a_later_window_start fails on the old head (AssertionError) and passes now. The correctness lens checked earlier, later, wider, narrower and equal windows with the own snapshot, the intake seed and another schema, and found no hole.
F2 Fixed read_runs reads the total of each slice first, splits at CONST_ROADMAP_REVIEW_RUN_COUNT_CAP = 2500, and raises review_runs_at_cap and review_runs_above_total (readers.py:242-270). Four runs tests fail on the old head and pass now. A live read of 2026-10-23..2026-11-22 gave a total of 2,500 (fidelity lens), so the cap is real.
F3 Fixed Each slice starts at start.replace(microsecond=0) + 1 s (readers.py:245). test_a_run_in_the_start_second_counts_in_the_window_before_and_not_in_this_one fails on the old head with assert (2, 1, 1) == (1, 0, 1) and passes now.
F4 Fixed grep 'keeps the name' in the test module finds 0 lines. The renamed tests exist and state current behavior.
F5 Fixed devops ci fail-to-pass --base origin/main: 20 failed on base, 0 errored, on f075f16ce and on ad63da937.
F6 Fixed The test runs two reviews (START..END, then START+1d..END+1d). The listing counts are 3, 1 and 3.
F7 Fixed in part Each runs and listing scenario maps to a test. The catalog-level test asserts the value, n = 2072 and 5 runs reads. One THEN clause has no assertion (S5).
F8 Fixed review_listing returns FileSnapshotStore. mypy gives 0 errors in the changed files. The 14 errors in tests/support/fakes are also on the old head.

Standing findings

S1. minor. openspec/changes/archive/2026-11-22-6603-the-project-review-keeps-its-own/proposal.md:13 and :58

  • Problem: Two statements of the archived proposal are false for the final code. The pull request does not change this file. AGENTS.md rule 8 says to fix a document that a change makes wrong in the same pull request.
  • Evidence: :13 says "The unused result-cap constant and its error message go", but readers.py:253 uses review_runs_at_cap (messages.py:7154). :58 says that the plan lists the count requests "with no created slice", but dispatch.py:653 uses review_plan_each_slice (messages.py:7116). :11 ("so five requests replace about 25 pages") is true only under the cap. git diff --name-status origin/main...HEAD shows proposal.md as R100.
  • Fix: Say that review_runs_at_cap now names the count cap of 2,500. Say that the plan lists the count requests for each created slice. Say that five requests is the cost of a window under the cap.

S2. minor. openspec/specs/roadmap-project-review/spec.md:200, the same requirement in the archived delta, docs/ROADMAP_WORKFLOW.md:500 and line 3 of the PR body

  • Problem: The requirement says that the reader SHALL send "only" the changes at or after the later of the watermark and the window start. The code sends more: it reads from the window start when the window starts before the full_at of the review's own snapshot. The requirement text, the docs line and the PR body leave out this rule.
  • Evidence: readers.py:138-140 returns self.start when own and self.start < held.full_at. The scenario "A window wider than the review snapshot" (spec.md:218-220) and test_a_window_before_the_review_snapshot_reads_from_its_start (test_review_readers.py:552) read from 2026-11-04T14:51:23Z, which is before the watermark. proposal.md:10 already states the full rule.
  • Fix: Copy the clause of proposal.md:10 into the requirement, the docs line and the PR body. The requirement text is now 492 characters (fidelity lens script), so make other sentences shorter to keep it under 500.

S3. minor. src/devops_cli/roadmap/project_review/readers.py:226

  • Problem: int(page.get("total_count", 0)) gives a count of 0 with no error when the answer has no total_count. Four zero status counts against a zero total pass the guard at readers.py:261. The docstring at readers.py:240-241 says that no count is wrong with no message. On main the same default only chose whether to split (readers.py:185 on origin/main). Now the count is the fact value.
  • Evidence: the code lines above. dispatch.py:111 and :454-458 turn a DevOpsCLIError into a fact error, and RoadmapReviewError is a DevOpsCLIError (exceptions/roadmap.py:399). A bare KeyError is not in _READ_ERRORS.
  • Fix: Write a test first with a fake page that has no total_count. Then raise RoadmapReviewError with a new message when the key is missing or is not an integer, so that the fact gives error.

S4. minor (a person decides). src/devops_cli/config/constants.py:4277

  • Problem: Only one module reads CONST_ROADMAP_REVIEW_RUN_COUNT_CAP. CONTRIBUTING.md:205 says that such a constant is _<NAME> in that module, and goes in config/constants.py only when modules of two or more packages import it.
  • Evidence: grep -rn CONST_ROADMAP_REVIEW_RUN_COUNT_CAP src tests finds one import, readers.py:33. The limit table finds limits only by the prefixes CONST_ROADMAP_ and DEFAULT_ROADMAP_ in config/ (tests/roadmap/test_roadmap_limit_classes.py:44-46 and :875-880). On main, the old cap had one reader too (config/defaults.py:922, readers.py:32). So the pull request follows the limit-table pattern of the base, and the written rule conflicts with that pattern.
  • Fix: Make no change in this pull request. A person decides whether CONTRIBUTING.md:205 gets an exception for the limits that the limit table scans. File an issue for the conflict (AGENTS.md rule 11).

S5. nit. tests/roadmap/project_review/test_review_readers.py:552-566

  • Problem: The second THEN clause of "A window wider than the review snapshot" ("the review store holds a snapshot that covers the new window", spec.md:220) has no assertion.
  • Evidence: The test asserts only the record numbers and github_api.requested.
  • Fix: Assert that the saved review snapshot has full_at == START after the read.

S6. nit. tests/roadmap/project_review/test_review_readers.py:246-247

  • Problem: The test asserts the sum of the status counts and the absence of skipped. It does not compare the whole value, as docs/TESTING.md:108 says. A reader that moves a count from one status to another still passes.
  • Evidence: assert sum(answer["statuses"].values()) == 1997. The fixture is _push_runs(1500, 400, 70, 27).
  • Fix: assert answer["statuses"] == {"success": 1500, "failure": 400, "cancelled": 70, "in_progress": 27}.

S7. nit. src/devops_cli/roadmap/project_review/dispatch.py:589-591 and src/devops_cli/lang/en/messages.py:7113

  • Problem: The dry-run plan pairs since=<watermark> with "a listing snapshot of this record schema is kept, of any age". The reader reads from the later of the watermark and the window start, or from the window start (S2). The plan does not show this rule.
  • Fix: Name the later of the watermark and the window start in the condition text, or add a plan row for the window-start case.

S8. nit. openspec/specs/roadmap-project-review/spec.md:476 and the archived delta spec.md:19

  • Problem: "the reader counted 5 runs reads" is not clear STE.
  • Fix: "and the review counts 5 reads of the github_runs reader".

S9. nit. src/devops_cli/roadmap/project_review/catalog.yaml:126-129

  • Problem: The definition says that the reader reads one count for each status "of each created slice". A slice at the cap gets only its total and then splits (readers.py:250-257).
  • Fix: "The reader reads the total of each created slice, splits a slice at the count cap of 2,500, and reads one count for each status of each slice under the cap."

S10. nit. openspec/changes/archive/2026-11-22-6603-the-project-review-keeps-its-own/tasks.md:10 and :20

  • Problem: "Write the two tests first", but task 1.1 names three tests and task 2.1 names eight.
  • Fix: "Write the tests of 1.1 first" and "Write the tests of 2.1 first".

S11. nit. openspec/specs/roadmap-project-review/spec.md:200 and :472, and the archived delta

  • Problem: The two new requirement sentences have 50 and 52 words. The STE limit is 25 words. vale STE.SentenceLength goes from 41 hits on main to 53 on the head. vale runs at the suggestion level (CONTRIBUTING.md:191), so no gate fails.
  • Fix: Write one SHALL in each sentence.

Open risk (not a finding)

The builder reports a risk that no run proves. The reader reads the total of a slice before its 4 status counts. When the window end is after the time of the read, a new run can count in a status and not in the total. Then review_runs_above_total raises with no real defect. A current --week window can end after the time of the read (window.py:122). The impact is one fact: dispatch.py:454-458 gives that fact error, and the review continues. A possible mitigation is to end the runs count at min(window.end, now). That change needs its own test. A person decides.

Checks that ran

  • This re-review, in the review worktree at 8679a51da: uv run devops ci test tests/roadmap/project_review/test_review_readers.py tests/roadmap/test_roadmap_limit_classes.py gave 61 passed.
  • This re-review: git merge-tree --write-tree origin/main HEAD is clean. origin/main (6e497c2b7) is 2 commits after the merge base f075f16ce, and the two commits change one file of this pull request, messages.py. Rebase the branch before the push.
  • Standards lens: uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures passed all 10 rows, exit 0. The 4 commit subjects are Conventional Commits with summaries of 60 characters or fewer. The scan of the added lines for private data found no match.
  • Tests lens: uv run devops ci fail-to-pass --base origin/main (ad63da937) gave 20 failed on base, 0 errored, 41 passed. The old-head proof at a4284349a with only the new test module gave 6 failed and 14 passed: the tests of F1, F2 and F3. The fake RunsApi stops each total_count at 2,500 and reads a created range in whole seconds with both ends in. No test is skipped, marked xfail or loosened.
  • Correctness and tests lenses: uv run devops ci test tests/roadmap/project_review tests/roadmap/test_roadmap_limit_classes.py tests/roadmap/stores gave 545 passed and 1 failed. The failure is test_review_facts.py::test_the_facts_of_a_version_window. The worktree venv has no lizard (the optional review extra, pyproject.toml:99). This pull request does not change facts.py, its test or pyproject.toml, so the cause is the environment.
  • Correctness lens: uv run mypy on the 8 changed Python files gave 0 errors in them and 14 errors in tests/support/fakes, which are also on the old head. ruff check, ruff format --check and the C901 and PLR1702 complexity checks passed.
  • Fidelity lens: uv run devops ci --check --only openspec,docs passed. A script found that each of the 4 delta requirements is equal to the base spec. A live GitHub read gave a total of 2,500 for the main push runs of 2026-10-23..2026-11-22, and 1,853 for 2026-11-15..2026-11-22. The PR body has 899 characters and Closes #6603.
  • Builder: the scoped gate passed all 10 rows, and the pre-commit hooks passed without --no-verify.

Follow-up commit 6bdb287

The commit fixes S1, S2, S3, S5, S6 and S8 to S11. S3 has two new tests that failed before the fix. A runs page with no count, a negative count or a text count now raises an error, so the fact gives an error and no count is 0. For S4, 120 other names of the limit table have exactly one reader, so the cap stays in config/constants.py, and the Constant row of CONTRIBUTING.md now says that a roadmap limit lives in config/. S7 (the dry-run plan text) stays as it is. Checks at 6bdb287: the reader and limit tests pass (65), the scoped checks pass, and fail-to-pass gives 24 tests that fail on the base and 0 errors.

@dan-petty
dan-petty marked this pull request as ready for review November 22, 2026 02:22
@dan-petty
dan-petty merged commit df731a7 into main Nov 22, 2026
32 checks passed
@dan-petty
dan-petty deleted the perf/6603-the-project-review-keeps-its-own branch November 22, 2026 02:31
dan-petty pushed a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.191.1](v0.191.0...v0.191.1)
(2026-11-22)


### Bug Fixes

* **pr:** Measure the body above its trailer lines
([#6701](#6701))
([ad63da9](ad63da9))


### Performance Improvements

* **roadmap:** Cut review reads with a snapshot and counts
([#6716](#6716))
([df731a7](df731a7))


### Code Refactoring

* **roadmap:** fix-conflict runs on the phases
([#6709](#6709))
([6e497c2](6e497c2))
* **roadmap:** stage pushes the plan commit on the phases
([#6710](#6710))
([f075f16](f075f16)),
closes [#6704](#6704)

---
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/infra Type infra: the build, CI, images or cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(roadmap): the project review keeps its own listing snapshot

1 participant