Skip to content

refactor(review): render the review report from one input, outside the orchestrator - #2563

Merged
dan-petty merged 3 commits into
mainfrom
refactor/1008-review-report-module
Oct 28, 2026
Merged

dan-petty merged 3 commits into
mainfrom
refactor/1008-review-report-module

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The review report was rendered inside ReviewPipelineOrchestrator: 28 methods and 23 module-level helpers and tables in ai/review/pipeline.py, and the executive summary in ai/review/stages/reporting.py. The report read 15 orchestrator attributes, and it opened files itself: the review history for the category baseline and the knowledge base for the reference drift. Severity was counted in two places, and tests reached the rendering through private methods and patches of pipeline.print_table.

  • src/devops_cli/review/report.py renders review.md (render_markdown) and the terminal view (render_console) from one frozen ReportInput. It reads no orchestrator attribute and opens no file.
  • generate_consolidated_report builds the input once. The orchestrator keeps collection, deduplication, group analysis and persistence. It reads the review history (only when the session has findings) and the knowledge-base drift (only when no group analysis ran), and it computes the executive summary's analyzer line and each analyzer's notes from its scan.
  • format_category_baseline_markdown takes the review history to compare with, and historical_category_metrics computes the metrics of a loaded history.
  • The console summary and the executive summary count severities through one function.
  • ai/review/stages/ and the pipeline alias format_markdown_fix are deleted. ARCHITECTURE.md describes the report module.
  • Tests call the module's public functions or generate_consolidated_report, and no test calls a private render method or patches pipeline.print_table. make_report_input in tests/support/builders.py builds the input.

The text of review.md and of the terminal view does not change. A syrupy snapshot of one session, with a section of each kind, was recorded on the base before the move and passes unchanged after it.

Closes #1008

Change: openspec/changes/archive/2026-10-28-1008-review-report-module/

…ssion

The snapshot holds review.md and the summary and full terminal views of one
session that has a section of each kind. It is recorded on the base, before
the report rendering leaves the orchestrator (#1008), so the move keeps the
text.
…e orchestrator

The review report was rendered inside `ReviewPipelineOrchestrator`: 28
methods and 23 module-level helpers and tables in `ai/review/pipeline.py`,
and the executive summary in `ai/review/stages/reporting.py`. The report
read the orchestrator's state and opened files itself.

- `review/report.py` renders review.md (`render_markdown`) and the terminal
  view (`render_console`) from one frozen `ReportInput`. It reads no
  orchestrator attribute and opens no file.
- `generate_consolidated_report` builds the input once. It reads the review
  history for the category baseline and the knowledge-base drift, and it
  computes the analyzer line and the analyzer notes from its scan.
- `format_category_baseline_markdown` takes the history to compare with.
- The console summary and the executive summary count severities through
  one function.
- `ai/review/stages/` and the pipeline alias `format_markdown_fix` are
  deleted.
- Tests call the module's public functions or `generate_consolidated_report`,
  and no test patches `pipeline.print_table`.

The snapshot of one session, recorded before the move, holds the text of
review.md and of the terminal view: it does not change.
@dan-petty

Copy link
Copy Markdown
Owner Author

Test evidence:

  • The golden snapshot (tests/review/test_report.py, 2 snapshots) was recorded on the base, before the move. It passes at the first commit on origin/main 0702d13 (pre-move code, checked in a detached worktree) and at the head (moved code), with the same .ambr file. So review.md and both terminal views keep their text.
  • On the head: the 19 review test files that the change touches, 361 tests, pass (uv run pytest ... -n 8).
  • Before the rebase: uv run devops ci test narrowed to the changed source paths ran 906 tests, all passed. The invariant and hygiene suites (tests/invariants, test_architectural_invariants.py, test_codebase_hygiene_and_shims.py, test_swallowed_failures_ratchet.py, test_test_module_independence.py), 173 tests, passed.
  • The full local uv run devops ci passed every gate except test. The one failure was tests/test_output.py::test_rich_imports_confined_to_output_submodule: the new module imported rich.console.Console for typing. It now takes Console from devops_cli.output, and the test passes. The test gate took 5 m 24 s and 5 m 44 s on a shared host; perf(ci): the startup-import tests start 56 interpreters and take 204 s of the suite's 2,423 s #2369, perf(ci): each test shard collects only its own test files #2371 and perf(ci): measure coverage and branch cost #2373 cover the suite's speed.
  • The issue's searches return nothing: rg 'devops_cli\.ai\.review\.pipeline\.print_table|(orchestrator|pipeline|ReviewPipelineOrchestrator|\))\._(build|render|format)_' tests, rg 'print_table|print_panel|format_markdown_fix|_CONSOLE_|_REPORT_|stages\.reporting' src/devops_cli/ai/review/pipeline.py, rg -i persona src/devops_cli/review/report.py and rg 'stages/' ARCHITECTURE.md.

Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD).

@dan-petty
dan-petty marked this pull request as ready for review October 28, 2026 23:31
@dan-petty
dan-petty merged commit 9e73e6d into main Oct 28, 2026
17 checks passed
@dan-petty
dan-petty deleted the refactor/1008-review-report-module branch October 28, 2026 23:33
dan-petty pushed a commit that referenced this pull request Oct 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.12.0](v0.11.3...v0.12.0)
(2026-10-29)


### Features

* **ai:** constrain structured replies on the openai and claude
providers ([#2550](#2550))
([4f7390a](4f7390a))
* **argo:** retire the Helm release records of the charts that Argo CD
renders ([#2568](#2568))
([cabfcd4](cabfcd4))
* **k8s:** devops k8s tunnel keeps the cloudflared forward to
k8s.<domain> running
([#2567](#2567))
([f9493fa](f9493fa)),
closes [#1641](#1641)
* **monitoring:** alert when the otel collector fails to export spans,
metric points or log records
([#2565](#2565))
([4fc8ff7](4fc8ff7))
* **telemetry:** the roadmap Service counts its GitHub writes, budget
holds, Firecrawl searches and own deliveries, and caps refine's comments
on one item
([#2556](#2556))
([9819877](9819877)),
closes [#2475](#2475)


### Bug Fixes

* **git:** report a worktree that a run in parallel removed as removed,
not a failed reclaim
([#2557](#2557))
([a556984](a556984)),
closes [#2408](#2408)
* **k8s:** the devops perimeter opens only the collector's OTLP/HTTP
port, 4318
([#2549](#2549))
([d156ce7](d156ce7))
* **sandbox:** devops sandbox logs reads each line with its stream from
a real engine
([#2546](#2546))
([e7216d5](e7216d5)),
closes [#2520](#2520)
* **service:** the webhook route refuses an unsigned or oversized
delivery before it reads the body, and a rate limit guards it
([#2553](#2553))
([40efcd4](40efcd4)),
closes [#2476](#2476)


### Performance Improvements

* **ai:** price a request with one load of the settings
([#2555](#2555))
([5d86538](5d86538)),
closes [#1420](#1420)


### Code Refactoring

* **config:** a default that backs a settings field is read only through
the settings
([#2561](#2561))
([0702d13](0702d13))
* **exceptions:** each exception class declares its error_code and
exit_code ([#2558](#2558))
([410dece](410dece))
* **review:** render the review report from one input, outside the
orchestrator
([#2563](#2563))
([9e73e6d](9e73e6d)),
closes [#1008](#1008)
* **security:** src has no unreviewed Bandit findings, and the gate
scans src at low severity
([#2560](#2560))
([45261dd](45261dd)),
closes [#1538](#1538)
* **security:** the scanners stop looking for mocks, and their tests run
on the scanner fake
([#2551](#2551))
([2b7f37a](2b7f37a))

---
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(review): report rendering leaves the orchestrator

1 participant