Repository navigation
Description
Refreshed plan (2026-10-17, unblocking review)
This section supersedes any text below that conflicts with it.
Decisions
- Decision D13 (owner, 2026-10-17): "refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 goes in v0.2.38, with feat(review): feedback export counts each review subject once and keeps every human verdict #877 and feat(review): verified findings about merged code enter the roadmap through intake #883 following refactor(review): review session store that owns layout, fingerprints and verdicts #771 (done)." This item waits on refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 2 and stays in the backlog itself.
- The block now waits on refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 2, not on a report rebuilt from findings.sarif. feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871 did not rebuild the report, and no item plans to. refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 2 rewrites the persona columns, the report dedupe and
ReviewSessionPayload.personasinside the code this item moves. - The report takes a typed input, not the session store (refactor(review): review session store that owns layout, fingerprints and verdicts #771). A pure function of its input can be tested without files, and refactor(review): review session store that owns layout, fingerprints and verdicts #771 can pass it the same input later.
- The module is
src/devops_cli/review/report.py. feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 Q9 recommends new review spine code insrc/devops_cli/review/, where the admission and group-analysis code already live, and says survivors ofai/review/move when an item touches them. src/devops_cli/ai/review/stages/(reporting.pyand its__init__.py) moves into the module and is deleted. Report text then has one owner, and severity counting has one implementation.- Collection, dedupe and persistence stay in the orchestrator:
_collect_and_deduplicate_findings,_collect_unique_dependencies_and_network_endpoints,_compute_symbol_delta_summary,_run_group_analysis_stageand_persist_session_artifacts. refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 2 rewrites the dedupe, refactor(review): review session store that owns layout, fingerprints and verdicts #771's PR 2 moves persistence onto the store, and the report only renders what it is given. - Reading the review history for the category baseline also stays in the orchestrator. Today the report loads that history from disk itself, so the orchestrator now reads it and passes it in. The report then opens no file, and its output stays the same.
- The output does not change. The verdict rows (Verification Rate, False Positive Rate, Verdict Field Distributions) move as they are. Review-time code marks every vulnerable-dependency finding VERIFIED (
pipeline.py:896), and admission keeps that status, so the rows are not constant. Changing what the report says is outside a move.
Scope
- Delivers: one module that renders review.md and the console view from a typed, frozen input built once in
generate_consolidated_report. The input holds the session payload, the candidate findings, the admitted scanner findings, the static analyzers' states, severities and reasons, coverage, the group-analysis report, the errored files, the partial-context and full-output flags, the session directory, and the review history that the category baseline compares against. - Moved elsewhere: renaming persona to
producerand keying the report dedupe on (fingerprint, location) go to refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 2. Writing review.md, findings.json and findings.sarif goes to refactor(review): review session store that owns layout, fingerprints and verdicts #771's PR 2.
Delivery
- One PR (L), after refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 2 merges. Commit 1 adds the golden test, which goes through
generate_consolidated_reportand passes before the move. It uses a saved payload fixture plustests/golden/review_report.mdandtests/golden/review_console.txt. Files: newsrc/devops_cli/review/report.pyandtests/review/test_report.py;src/devops_cli/ai/review/pipeline.py;src/devops_cli/ai/review/category_metrics.py(the baseline renders from history it is given); deletedsrc/devops_cli/ai/review/stages/__init__.pyandreporting.py;ARCHITECTURE.md:184-185, which describestages/;tests/test_codebase_hygiene_and_shims.py, whose_DELETED_REVIEW_MODULESentrydevops_cli.ai.review.stages.adversarial_debate(:46) becomesdevops_cli.ai.review.stages, becausefind_spec(:279) raises once the parent package is gone; and the 12 test files thergcheck below names. Closes refactor(review): report rendering leaves the orchestrator #1008.
Acceptance criteria (these replace the matching criteria below; the rest stand)
-
src/devops_cli/review/report.pyholds all report rendering: the 26_build_*,_render_*and_format_*methods and_select_console_findings; the module-level render helpers and tables;_status_rows; and the functions ofstages/reporting.py.rg -n -i persona src/devops_cli/review/report.pyreturns nothing. - The report reads no orchestrator attribute and opens no file. The orchestrator reads the review history for the category baseline and passes it in. The golden test calls the report with no orchestrator.
-
rg -n 'print_table|print_panel|format_markdown_fix|_CONSOLE_|_REPORT_|stages\.reporting' src/devops_cli/ai/review/pipeline.pyreturns nothing,src/devops_cli/ai/review/stages/does not exist, andrg -n 'stages/' ARCHITECTURE.mdreturns nothing. - Severity counting has one implementation: the console breakdown (today
_format_severity_breakdown) counts through the same function as the summary's_severity_breakdown. This replaces "One_format_severity_breakdownremains", which is already true word for word. -
rg -n 'devops_cli\.ai\.review\.pipeline\.print_table|(orchestrator|pipeline|ReviewPipelineOrchestrator|\))\._(build|render|format)_' testsreturns nothing. Today it matches 40 lines in 13 files. 3 of those lines are_build_multi_persona_pipelinecalls that refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 2 deletes. The\)alternative catches calls on_orchestrator(tmp_path), which the narrower pattern missed. - The golden payload also holds a
producer, a title containing|and a backtick fence, Rich markup in a description, and an errored file. The console view is recorded at a fixed width. Markdown and console text equal the output at the PR's base, so escaping is unchanged. -
_persist_session_artifacts, the collection and dedupe helpers and_run_group_analysis_stagestay in the orchestrator, unchanged.
Current references (at 3dd7fa6)
- Report methods:
src/devops_cli/ai/review/pipeline.py:3911-4721, 26 methods plus_select_console_findingsat:4382._run_group_analysis_stageat:4191-4218sits inside that range and stays. - Module-level render helpers and tables:
pipeline.py:1617-1803;_status_rowsat:2012-2020; the test-only aliasformat_markdown_fixat:4894, used attests/test_review_report_summary.py:282. - Orchestrator state the report reads today:
self.partial_contextatpipeline.py:4128;self.full_outputat:4387,:4466and:4505; and the review history, which_build_category_baseline_section(:4063-4075) loads throughformat_category_baseline_markdown(src/devops_cli/ai/review/category_metrics.py:102, history read at:115and:97). - Call site:
generate_consolidated_reportatpipeline.py:4781-4891, with the report calls at:4856-4882. Persistence:_persist_session_artifactsat:4736-4779, which writes the SARIF at:4754-4778. - Code refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 changes first: persona columns at
pipeline.py:1679,:1737,:3948,:3958,:3976,:4432; report dedupe at:3875-3884; payloadpersonasat:4795-4800and:4825-4843(all PR 2); thehas_personasgate at:4191-4198and its call at:4854(PR 1). - Severity:
pipeline.py:4543andsrc/devops_cli/ai/review/stages/reporting.py:59.stagesis imported atpipeline.py:2014,:4119andstages/__init__.py:5, and named attests/test_codebase_hygiene_and_shims.py:46. - Group-analysis section:
render_model_analysis_markdownatsrc/devops_cli/review/analysis.py:907, called atpipeline.py:4175-4177. - Tests:
_build_consolidated_markdown_reportis called 20 times in 5 files:test_review_report_summary.py10,test_review_report_integrity.py4,test_review_static_analyzers.py4,test_category_metrics.py1,test_review_ruff_mypy_evidence.py1.pipeline.print_tableis patched attests/test_review_history.py:91,tests/test_review_report_integrity.py:236,tests/test_verdict_polarity.py:345,tests/test_review_symbol_delta.py:96andtests/ai/review/test_cited_code.py:112.- Other private render calls:
tests/test_review_admission.py:623-631,:888,:928-929;tests/test_verdict_polarity.py:324-325,:346;tests/test_review_report_integrity.py:251;tests/test_review_worktree_regression.py:246;tests/test_review_pipeline.py:1092.
Dependencies and order
- refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 (closed, P1): this item waited on refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 2. refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 closed as completed on 2026-10-21, so that work has merged and this item can start. refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151's PR 3 and PR 4 did not gate this item.
- When it merges, a person removes
status/blockedwith a comment, and feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's frozen row for this item records "lifts with refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 PR 2". The native blocked-by link from refactor(review): report rendering leaves the orchestrator #1008 to refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 is for a person to add now. - Done: feat(review): terminal output lists what matters and summarizes low findings, dependencies and network references with a pointer to the report #987, fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948 and fix(security): bandit reports failed on every review of more than 50 python files #1009 (v0.2.25), feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871 (v0.2.28), refactor(review): delete the legacy segment engine so the orchestrator is the only review engine #995 (v0.2.34), fix(review): a dry-run review writes no session directory or findings #872 (v0.2.36).
- refactor(review): review session store that owns layout, fingerprints and verdicts #771 (open, P1, v0.2.40): coordination only. Its PR 2 moves
_persist_session_artifactsonto the store and editsgenerate_consolidated_report, so whichever lands second rebases. - feat(review): related findings are linked by shared CWE, rule family, symbol-graph component or package, and one review-level plan orders the work across groups #1148 (open, v0.2.38): adds a correlation table to review.md through
render_model_analysis_markdown. The report keeps calling that function, so the most it needs is a rebase. - refactor(review): the review's single-owner tables move out of config/ into ai/review/ and review/ #1025 (open, P3, blocked): Decision D15 (owner, 2026-10-17): "refactor(review): the review's single-owner tables move out of config/ into ai/review/ and review/ #1025 widens to cover src/devops_cli/review/, with no new sibling item." Any single-owner config table this module reads joins refactor(review): the review's single-owner tables move out of config/ into ai/review/ and review/ #1025's set, and whichever lands second rebases.
- Priority stays P3: this item blocks nothing, so the blocker rule raises nothing.
Context & Rationale
Report rendering lives inside the orchestrator. Checked at 9c879ae.
ai/review/pipeline.py:2976-3629: 20_render_*,_build_*and_format_*methods, 630 of the orchestrator's 2,301 lines; 42 console print calls inpipeline.pyand 46 inrunner.py.- Tests call
_build_consolidated_markdown_report11 times and patchpipeline.print_table3 times. stages/reporting.pyalready holds 3 pure report functions outside the orchestrator.- feat(review): terminal output lists what matters and summarizes low findings, dependencies and network references with a pointer to the report #987 (what the terminal prints) and fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948 (how findings rank) both land in the orchestrator file today, re-running its history.
Deletion test: the code moves rather than vanishes, but report changes stop touching the orchestrator, which is the locality this item buys.
Scope & Deliverables
- Deliverable: a report built from
ReviewSessionPayloadwith markdown and console outputs; the orchestrator calls it once. - Tests:
test_review_report_summary.pyand theprint_tablepatches move to the report module. - Key questions (open):
- Sequence after feat(review): terminal output lists what matters and summarizes low findings, dependencies and network references with a pointer to the report #987 and fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948, which are in v0.2.25.
- Does the report read through the Review session store (refactor(review): review session store that owns layout, fingerprints and verdicts #771) rather than take the payload?
- Constraint: none beyond sequencing.
Strategic Alignment
- Design: CONTEXT.md (Review session)
- Depends on: none
- Related: feat(review): terminal output lists what matters and summarizes low findings, dependencies and network references with a pointer to the report #987, fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948, refactor(review): review session store that owns layout, fingerprints and verdicts #771
- Source: architecture review of 2026-10-02, review pipeline cluster
Scope added 2026-10-02: checked at 38517a8; the claims hold. The 20 rendering methods are at ai/review/pipeline.py:2976-3629, tests name _build_consolidated_markdown_report 12 times and patch pipeline.print_table 3 times. _format_severity_breakdown exists twice, at pipeline.py:3444 and ai/review/stages/reporting.py:141. #987 merged after the baseline (b1fddd0, pipeline.py +270/-117), so line numbers moved. #1009 merged after it too (79e1e93, PR #1012) and added a failed analyzer's reason to the report (pipeline.py +27/-2). #948 (v0.2.25, in flight) changes how the report ranks and groups findings.
Acceptance criteria
- One report module renders the markdown report and the console output from a
ReviewSessionPayload, the static analyzers' states and reasons, and the errored files. It holds the rendering methods now in the orchestrator, including feat(review): terminal output lists what matters and summarizes low findings, dependencies and network references with a pointer to the report #987's and fix(security): bandit reports failed on every review of more than 50 python files #1009's additions. - The orchestrator calls the report module once, from
generate_consolidated_report, andpipeline.pyhas no report rendering left. - One
_format_severity_breakdownremains. - Tests call the report module's public functions with a payload. No test calls
_build_consolidated_markdown_reportor patchespipeline.print_table. - A golden test renders one saved payload, with findings in every status, dependencies, network references and a failed static analyzer with its reason. Its markdown and console text equal the output before the move.
- The tests run offline.
-
uv run devops cipasses.
Key questions
- Sequence after feat(review): terminal output lists what matters and summarizes low findings, dependencies and network references with a pointer to the report #987 and fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948, which are in v0.2.25. (proposed) feat(review): terminal output lists what matters and summarizes low findings, dependencies and network references with a pointer to the report #987 (b1fddd0) and fix(security): bandit reports failed on every review of more than 50 python files #1009 (79e1e93) have merged, so the move takes their report code as it stands. This item lands after fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948, which still edits the report, and after refactor(review): delete the legacy segment engine so the orchestrator is the only review engine #995, so the report has one caller.
- Does the report read through the Review session store (refactor(review): review session store that owns layout, fingerprints and verdicts #771) rather than take the payload? (proposed) It takes the payload. A pure function of the payload is tested without files, and refactor(review): review session store that owns layout, fingerprints and verdicts #771 can hand it the payload later without changing the report.
Update 2026-10-08: refinement
The re-check the freeze asked for; it stays frozen. #871 did not rebuild the report from findings.sarif, which holds only admitted scanner findings (ai/review/pipeline.py:4887-4910). Rendering is 26 methods (:3995-4810); the suppressed section reads admitted_scanner_findings.
- The module takes the admitted findings as input; the golden test has introduced, pre-existing and suppressed findings; one severity-breakdown function remains.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsReady
Activity
dan-petty commentedon Oct 3, 2026
Frozen by the evidence-first review redesign (#1137, owner direction of 2026-10-03): patches to the model generator and verifier stop, and tool-layer fixes continue. Report rendering survives the redesign, but the report is rebuilt from
findings.sarifby #871 (one admission step). This item stays open, labelledstatus/blocked, and linked to #871; it is re-checked against #871's output before any work starts.dan-petty commentedon Oct 8, 2026
Linked: #771 and #872 (frozen item, link only). All three edit the constructor and
generate_consolidated_report(ai/review/pipeline.py:2372-2377,:4811-4958); whichever lands second rebases. Found by the 2026-10-08 backlog review.test(review): hold the review report's text with a snapshot of one se…
chore(main): release 0.12.0 (#2552)