Skip to content

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

Description

@dan-petty

Refreshed plan (2026-10-17, unblocking review)

This section supersedes any text below that conflicts with it. Line numbers are at main 3dd7fa6; on release/v0.2.37 (4ee3e01) config/constants.py lines after :2542 are 7 lower.

Decisions

Scope

Delivery

Acceptance criteria (added to the criteria below, all of which stay)

Current references

  • Hardening surface:
    • src/devops_cli/config/constants.py:2953-2960, with the catalog at :2959.
    • src/devops_cli/github/defect_classifier.py:5-7 and :94-117, with the catalog branch at :114-117.
    • .github/workflows/defect-pr-hardening-audit.yml:68-72.
    • tests/test_defect_classifier.py:83-104, with the catalog cases at :94-96.
    • tests/test_pr_hardening_report.py:164-191, with the catalog file at :169 and the "1 of 3" count at :191.
    • Checks that keep the name: tests/test_codebase_hygiene_and_shims.py:38, tests/test_personas.py:107, tests/commands/test_review.py:63.
  • Successors:
    • docs/adr/0005-review-findings-come-from-tools-not-models.md:50.
    • src/devops_cli/review/suppression.py:72.
    • src/devops_cli/review/rules/.
  • Note kinds:
    • src/devops_cli/config/constants.py:3359-3403 (the ten constants at :3363-3389, the tuple at :3392-3403) and the details row at :2738.
  • The verification_note field and its writers:
    • src/devops_cli/ai/review_schema.py: import at :35, field at :691-695, reset at :1443, strip at :1465 (docstring :1457-1459), distribution at :1589, counter at :1593-1606.
    • src/devops_cli/ai/review/verdicts.py:96, :161 and :179.
    • src/devops_cli/ai/review/adjudication.py:63.
    • Callers that pass no note: src/devops_cli/ai/review/adjudication.py:185-191 and src/devops_cli/ai/review/pipeline.py:896.
  • Note tests: tests/test_review_verification.py:197-223 and :240-272, tests/test_verdict_writers.py:326-347, tests/test_verdict_polarity.py:239, tests/test_ui_reactive.py:871 and :890.
  • relocated_from: src/devops_cli/ai/review_schema.py:696 and :1158; its test is at tests/test_construct_aware_location.py:9-27.
  • Challenger:
    • src/devops_cli/ai/personas/challenger/role.md:1 and prompt.md:1-13.
    • Loaded at src/devops_cli/ai/personas/__init__.py:63-69: system_prompt (role, ai/tasks/review.md, prompt) at :68, chat_prompt (role, ai/tasks/chat.md) at :69.
    • Read at src/devops_cli/commands/ai.py:1072 (chat, chat_prompt) and :1288 (pipeline, system_prompt).
    • KB line: src/devops_cli/ai/knowledge_base/devops_cli/architecture.md:94.
  • .devops/review.md readers that PR 4 removes: tests/test_personas.py:119 and :137.
  • docs/SELF_IMPROVEMENT.md:
    • Catalog mentions at :253, :280, :292, :370-371 and :401, and at :456, which is already under the existing note.
    • The records start at :197, and the existing history note is at :438-441.

Dependencies and order


Ready: implementation plan (refined 2026-10-17 at 3dd7fa6)

This section supersedes any text below that conflicts with it.

Decisions

  • Keep an opt-in for comparison: no. The saved S11–S21 sessions and tests/fixtures/review_labels/labels.json (feat(review): devops review score scores saved review sessions against a label file offline and reproduces the S11 and loop baselines #1138) are the baseline, and pre-1.0 keeps no flag for a deleted stage.
  • The challenger persona: its review use goes and it stays a chat persona. ai/personas stays because devops ai reads PersonaDefinition.system_prompt (commands/ai.py:896, :1288, ai/pydantic_ai_bridge.py:368), so ai/tasks/review.md stays too; only the review-only prompts go (code_review_prompt.md, config_review_prompt.md, docs_review_prompt.md, mcp_code_review_output.md).
  • Slice order: group analysis is made independent of the persona stage first (PR 1), then the deletions. Group analysis is gated on the persona list today (pipeline.py:4198, :4854), which is empty for a review of routed files alone (runner.py:1171) and would be empty for every review once personas are deleted.
  • What replaces _are_findings_duplicate and consolidation: exact identity. Each SavedFinding carries fingerprint, copied from the admitted finding's fingerprint_v2 in _sanitize_admitted_candidate; the report keeps one row per (fingerprint, location), and adjudication finds a raised finding's copy in findings.json by the same key. Every reported finding is now admitted with a fingerprint, so no fuzzy title match is needed, and the key is order-independent as Q17 asked.
  • Why not call normalization.deduplicate directly: it takes NormalizedFinding and recomputes each fingerprint from file text it reads by a path relative to the working directory (normalization.py:364-369, :181-187), which in a review is not the reviewed tree. The (fingerprint, location) key is what deduplicate computes when it has the text: the fingerprint plus an occurrence per line (normalization.py:357-402).
  • _refuse_reported_elsewhere and the candidate_already_reported message are deleted. Rows are no longer merged, so a raised finding's copy is always found by its key.
  • Switching group analysis off: --no-group-analysis on review path|branch|pr. There is no --group-analysis-only, and the unwired group_analysis_only parameter of resolve_stage_flags is deleted, because group analysis needs the static scan's admitted findings.
  • The model client: built only when a model stage is on. In PR 1 that is persona_review or group_analysis; after PR 2 it is group_analysis alone. The orchestrator takes llm_client: ReviewLLMClient | None, the LLMClient() fallback (pipeline.py:2430) goes, and pre-analysis sizes its workers from DEFAULT_PRE_ANALYSIS_WORKERS when there is no client.
  • --persona, --all, --no-persona-review and --persona-review-only: deleted from review path|branch|pr, review benchmark and review samples validate. The MCP review tools lose their persona argument, and the MCP prompt code_review_prompt goes.
  • The reranking stage, --no-reranking and --reranking-only: deleted. Since refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150 it only recounts reportable and rewrites files/ (pipeline.py:3811-3872), and _collect_and_deduplicate_findings applies the same filter.
  • Who produced a finding: SavedFinding.persona and persona_title are replaced by producer (the tool name from the admitted finding), and ReviewSessionPayload.personas is deleted. One name then serves the session files, review stats and the metric.
  • review stats --persona: no such option exists. The per-persona table (commands/review.py:1225-1282) becomes a per-producer table. For the same reason, the feedback export's FeedbackRecord.persona (exporter.py:44) becomes producer, and devops ai prompt-eval --persona (commands/ai.py:1924-1927) becomes --producer.
  • Telemetry: devops_cli_findings_total's label persona becomes producer in PR 2, together with the code that emits it (runner.py:964-993) and the dashboard panel (k8s/monitoring/dashboards/devops-cli.json:697).
  • PersonaExecutionError: deleted with its exports and its ERRORS.md entry. Nothing raises it.
  • Project conventions (AGENTS.md, .devops/review.md): only persona prompts read them (pipeline.py:3360-3398, :3511, :3744), so their loading, the PR-head copy of convention files (runner.py:866-895) and .devops/review.md go. The rules in that file that can be enforced are already .devops/review.toml suppressions (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), which settles feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's Q10.
  • The chunker: deleted in PR 3. Diff parsing (extract_diff_hunks, extract_file_diff_hunks, extract_added_diff_lines, the header parser made public as diff_file_names, and one numbered block per file) moves to src/devops_cli/review/diff.py. find_repo_files and the routing predicate move to src/devops_cli/review/targets.py. The predicate is renamed is_secret_scan_only and keeps its behaviour, so the scanned file set does not change.
  • Page size: review_page_chars, review_setup's page_chars and review_page_tokens go. devops ai gateway tune's default prompt size becomes DEFAULT_GATEWAY_TUNE_PROMPT_TOKENS in config/defaults.py, derived as DEFAULT_ANALYSIS_REFERENCE_BUDGET_CHARS / CONST_REVIEW_CHARS_PER_TOKEN, because the group-analysis job is now the gateway's main review load.
  • fix(review): a group-analysis reply cut at its token cap is rejected, not shown as a checked explanation #876: no longer superseded. It is re-scoped to group-analysis replies and lands after PR 1. This item supersedes only fix(review): the devsecops persona does not treat a function parameter as untrusted until it quotes where an untrusted value enters it #1052 and feat(review): review page size against quality and speed #480.

Delivery

  1. PR 1 (M): group analysis without personas. It removes the has_personas gate, adds --no-group-analysis, fixes ReviewStageFlags.to_dict() (which omits group_analysis), adds ReviewStageFlags.needs_model(), builds the client only when needs_model() is true, and regenerates the CLI docs. Tests first, each failing today: devops review path with --no-persona-review --no-group-analysis and LLMClient patched to raise on construction exits 0 (today the client is built unconditionally); --no-group-analysis makes zero calls to a fake client and writes no analysis.json (today the option does not exist); a review whose every file is routed to the secret scan alone, with one admitted Gitleaks finding, calls the fake client once and writes analysis.json (today personas=[] switches group analysis off, runner.py:1171); to_dict() holds all six stages. Files: src/devops_cli/ai/review/flags.py, src/devops_cli/ai/review/pipeline.py, src/devops_cli/ai/review/runner.py, src/devops_cli/commands/review.py, src/devops_cli/lang/en/help.py, tests/test_review_stage_flags.py, tests/test_review_group_analysis.py, generated docs/commands/*.md and docs/CLI_REFERENCE.md. Refs 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.
  2. PR 2 (L): the deletions.
    • Deleted: the persona stage (pipeline.py:238-418, :922-960, :982-1005, :1192-1230, :1814-2011, :3360-3872), with its RAG and contract-grounding calls; classification.py; contract_grounding.py; the review-only prompts; consolidation (review_schema.py:931-1212); ai_scratchpad; the reranking stage; the persona flags and MCP arguments; the convention loading; the profile's persona fields (profile.py:147-149, :199-238) and the corpus score's persona columns that read them (commands/review.py:1860-1870, :1934); PersonaExecutionError.
    • Added: SavedFinding.fingerprint and producer, with FeedbackRecord.producer and devops ai prompt-eval --producer. The report dedupes by (fingerprint, location), adjudication keys copies the same way, and ReviewSessionPayload.sorted_findings becomes sort_findings(self.findings).
    • Telemetry and docs: the metric label becomes producer, the dashboard panel follows, and the CLI docs are regenerated.
    • Tests first: two payloads holding one admitted finding give one row, and two findings with one fingerprint at different lines give two rows; a verdict on a raised finding is mirrored on its findings.json copy found by key; a full devops review path --no-group-analysis with a fake client records zero calls; the removed options exit 2; importlib.util.find_spec is None for devops_cli.ai.review.classification and devops_cli.ai.review.contract_grounding; an emitted findings metric carries producer.
    • Files: src/devops_cli/ai/review/pipeline.py, runner.py, adjudication.py, profile.py, flags.py, src/devops_cli/ai/review_schema.py, src/devops_cli/ai/mcp/server.py, src/devops_cli/ai/mcp/__init__.py, src/devops_cli/commands/review.py, src/devops_cli/ai/review/exporter.py, src/devops_cli/ai/prompt_eval.py, src/devops_cli/commands/ai.py, src/devops_cli/exceptions/ai.py and the modules that re-export it, src/devops_cli/telemetry/instruments.py, k8s/monitoring/dashboards/devops-cli.json, docs/TELEMETRY.md, docs/ERRORS.md, deleted src/devops_cli/ai/review/classification.py, contract_grounding.py and the four prompts, and the tests that cover only deleted code.
    • Refs 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.
  3. PR 3 (M): pages go. It deletes chunker.py, moves its survivors to src/devops_cli/review/diff.py and src/devops_cli/review/targets.py, makes branch, PR and path reviews hand one block per file to the pipeline with no size cap, deletes review_page_chars, page_chars and review_page_tokens, and adds DEFAULT_GATEWAY_TUNE_PROMPT_TOKENS. Tests first: a branch diff larger than DEFAULT_REVIEW_MAX_DIFF_CHARS yields one block per changed file with the same added lines and hunks as today; review_setup() has no page_chars; devops ai gateway tune without --prompt-tokens sends the new default. Files: src/devops_cli/ai/review/runner.py, pipeline.py, sample_validation.py, __init__.py, src/devops_cli/commands/review.py, src/devops_cli/ai/run_store.py, src/devops_cli/ai/gateway_tune.py, src/devops_cli/commands/ai_gateway.py, src/devops_cli/config/defaults.py, new src/devops_cli/review/diff.py and targets.py, tests/test_review_path.py, tests/test_review_page_line_numbers.py, tests/test_review_path_routing.py. Refs 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.
  4. PR 4 (M): hand-written docs. It covers README.md's title, feature line and persona list (README.md:118-122), DEVCONTAINER_USAGE.md's persona examples, AGENTS.md §5 ("Multi-Persona Code Review", AGENTS.md:202), docs/SELF_IMPROVEMENT.md, docs/KNOWN_ISSUES.md:34-39, the KB's architecture, code-review and RAG articles, the devops review --explain personas section (ai/explain.py:147), and docs/github-pages.config.yaml:19 and docs/_layouts/default.html:85. It replaces CONTEXT.md's code-review Finding and Known false positive entries with feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137's Finding, Anchor, State, Suppression, Coverage gap, Lead and Rule pack entries; Verdict changes with feat(review): feedback export counts each review subject once and keeps every human verdict #877. It deletes .devops/review.md. Tests first: rg -n -i "multi-persona|persona review|reviewer persona" README.md AGENTS.md CONTEXT.md docs/*.md src/devops_cli/ai/knowledge_base src/devops_cli/ai/explain.py returns nothing (--persona stays documented for devops ai chat), and uv run devops docs check passes. Closes 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.

Acceptance criteria

  • With --no-group-analysis, devops review path|branch|pr constructs no model client and makes no model call. With group analysis on, it constructs one client, and only group analysis calls it.
  • Group analysis runs whenever its flag is on, whichever other stages run, and ReviewStageFlags.to_dict() includes it.
  • rg -n "execute_multi_persona_review|consolidate_duplicate_findings|_are_findings_duplicate|classify_file_context|contract_grounding|review_page_chars|review_page_tokens|split_review_pages|ai_scratchpad|persona_review|all_personas|PersonaExecutionError" -t py src tests returns nothing, and src/devops_cli/ai/review/chunker.py does not exist.
  • --persona, --all, --no-persona-review, --persona-review-only, --no-reranking and --reranking-only exit 2 as unknown options. The MCP review_path, review_branch and review_pr tools have no persona parameter.
  • Every finding in findings.json carries fingerprint and producer. Duplicates of one admitted finding give one row, and one fingerprint at two lines gives two rows.
  • devops_cli_findings_total is labelled by producer, and the dashboard panel and docs/TELEMETRY.md say so.
  • devops ai chat and agent commands still load every persona, and their tests pass unchanged.
  • (person-run) 3 fresh --no-group-analysis runs on the loop input give identical findings.sarif, apart from run ids and timestamps, and 0 model calls in profile.json.
  • Tests run offline with fakes and recorded tool output: no network, no real scanner and no model, and each test runs under 1 s.
  • changelog.d/1151.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
  • uv run devops ci passes.

Current references

  • Persona stage call: src/devops_cli/ai/review/runner.py:1061-1064; reranking call: :1066-1067.
  • Persona stage code: src/devops_cli/ai/review/pipeline.py:238-418, :922-960, :982-1005, :1192-1230, :1814-2011, :3400-3810; reranking :3811-3872.
  • Review-time RAG and contract grounding: src/devops_cli/ai/review/pipeline.py:1814-1862.
  • Group analysis gate: src/devops_cli/ai/review/pipeline.py:4191-4198, call :4854; run_group_analysis: src/devops_cli/review/analysis.py:753.
  • Stage flags: src/devops_cli/ai/review/flags.py:10-41, :44-94.
  • Client construction: src/devops_cli/ai/review/runner.py:86-90, :461-478; callers src/devops_cli/commands/review.py:322, :534, :842; fallback src/devops_cli/ai/review/pipeline.py:2430.
  • Flags on the commands: src/devops_cli/commands/review.py:204-211, :244-259 (path), :420-427, :464-479 (branch), :723-730, :767-782 (pr), :1443-1450 (benchmark), :2264-2266 (samples validate).
  • Consolidation: src/devops_cli/ai/review_schema.py:931-1212; _are_findings_duplicate :1003; sorted_findings :1306-1308; SavedFinding :1256-1268.
  • Report dedupe: src/devops_cli/ai/review/pipeline.py:3875-3884; admission copy point _sanitize_admitted_candidate :604-623; persona stamp on tool findings _wrap_static_findings :448-460.
  • Adjudication: src/devops_cli/ai/review/adjudication.py:33, :194-211, :214-221, :224-264.
  • Admitted fingerprint: src/devops_cli/review/admission.py:154-162, src/devops_cli/review/finding.py:43.
  • Normalization dedupe: src/devops_cli/security/normalization.py:457-472, occurrence indices :357-402.
  • Metric: src/devops_cli/ai/review/runner.py:964-993, src/devops_cli/telemetry/instruments.py:57, docs/TELEMETRY.md:26, k8s/monitoring/dashboards/devops-cli.json:697.
  • MCP: src/devops_cli/ai/mcp/server.py:165-206, stats :229, prompt :3040-3056; src/devops_cli/ai/mcp/__init__.py:24, :169.
  • Chunker importers: src/devops_cli/ai/review/pipeline.py:46-51, :2040, :3277; runner.py:19-23, :732, :805; src/devops_cli/commands/review.py:597; src/devops_cli/ai/review/sample_validation.py:24; src/devops_cli/ai/review/__init__.py:17.
  • Page size: src/devops_cli/ai/run_store.py:150-162; src/devops_cli/ai/gateway_tune.py:377-381; src/devops_cli/commands/ai_gateway.py:452; DEFAULT_ANALYSIS_REFERENCE_BUDGET_CHARS src/devops_cli/config/defaults.py:1005.
  • Profile persona fields: src/devops_cli/ai/review/profile.py:147-149, :199-238.
  • PersonaExecutionError: src/devops_cli/exceptions/ai.py:156.
  • Conventions: src/devops_cli/ai/review/pipeline.py:3360-3398; src/devops_cli/ai/review/review_environment.py:26-32, :149-150; src/devops_cli/ai/review/runner.py:866-895; src/devops_cli/config/constants.py:486.
  • Feedback export and prompt-eval: src/devops_cli/ai/review/exporter.py:38-65; src/devops_cli/commands/ai.py:1922-1927; src/devops_cli/ai/prompt_eval.py:82-83.
  • Docs: README.md:1, :19, :118-122; AGENTS.md:202; docs/KNOWN_ISSUES.md:34-39; src/devops_cli/ai/explain.py:147; CONTEXT.md:135-149.

Dependencies and order


Problem

Acceptance criteria

  • Deleted, with no flags and no re-exports:
    • the persona stage [code: pipeline.py:949-987, :1539-1652, :2574-2984] and classification.py;
    • chunker.py, with review_setup's page size [code: ai/run_store.py:146] and review_page_tokens [code: ai/gateway_tune.py:379];
    • the review prompts in ai/tasks and stages/adversarial_debate.py;
    • consolidation [code: ai/review_schema.py:1039-1248] and ai_scratchpad;
    • review-time RAG lookups and contract_grounding.py;
    • the legacy engine [code: runner.py:874-1361] and its fork, through refactor(review): delete the legacy segment engine so the orchestrator is the only review engine #995, a child that lands first so runner.py is not deleted by two items.
  • ai/personas stays for chat and analysis. It is imported by commands/ai.py, ai/tools/registry.py, ai/pydantic_ai_bridge.py and ai/analyze/outlines.py. Only review-specific prompts go.
  • --persona, --all and the MCP review tools' persona argument are removed [code: ai/mcp/server.py:137-183].
  • Telemetry: devops_cli_findings_total's persona label becomes producer [code: docs/TELEMETRY.md:20], and dashboards are updated.
  • Docs:
    • README.md's title and persona sections [README.md:1, :19];
    • the --persona examples in DEVCONTAINER_USAGE.md and CLI_REFERENCE.md;
    • PersonaExecutionError in ERRORS.md and the exceptions module, if no remaining caller raises it;
    • AGENTS.md §5 through its generator;
    • the KB's architecture and RAG articles;
    • the release-epic step "Multi-Persona Review Verification", which becomes "tool review".
  • A test asserts that devops review builds a model client only when an explanation stage is on.
  • (person-run) 3 fresh runs on the loop input give identical findings.sarif and 0 model-originated rows.
  • Tests run offline with fakes and recorded tool output: no network, no real scanner, no model; each test under 1 s.
  • changelog.d/<n>.md records the change; CHANGELOG.md and docs/ROADMAP.md are not edited.
  • uv run devops ci passes.

Key questions

Strategic alignment

Update 2026-10-08: refinement

#871 landed; #995 lands first. The stage is now ai/review/pipeline.py:1163-1201, :1860-1942 and :3203-3613; the old ranges hold #871's admission code and the verifier (from :3614, #1150's), which stay out of this item. Legacy engine runner.py:873-1370; MCP persona argument ai/mcp/server.py:167-211.

Proposed design

Problem statement

The devops-cli project needs to refactor its codebase by removing the persona review stage, the legacy segment engine, and review-time RAG features. These components are deemed costly and redundant, with the persona review stage showing poor consistency (Jaccard 0.131) and review-time RAG consuming excessive resources (602–1,980 worker-seconds per run for zero results). The refactor will simplify the review process and reduce operational overhead.

Acceptance criteria

  • Criterion 1: The persona stage code is deleted with no remaining exports or flags
    Verification: Verify that pipeline.py lines 949-987, 1539-1652, 2574-2984 and classification.py are removed from the codebase
  • Criterion 2: Chunker.py is deleted with related page size and review_page_tokens variables
    Verification: Verify that chunker.py is removed and ai/run_store.py line 146 and ai/gateway_tune.py line 379 are deleted
  • Criterion 3: Review prompts in ai/tasks and adversarial_debate.py are removed
    Verification: Verify that the review prompts files and stages/adversarial_debate.py are deleted from the codebase
  • Criterion 4: Consolidation code and ai_scratchpad are deleted
    Verification: Verify that ai/review_schema.py lines 1039-1248 and ai_scratchpad module are removed
  • Criterion 5: Review-time RAG lookups and contract_grounding.py are deleted
    Verification: Verify that review-time RAG code and contract_grounding.py are removed from the codebase
  • Criterion 6: Legacy engine in runner.py is deleted
    Verification: Verify that runner.py lines 874-1361 are removed
  • Criterion 7: The ai/personas module stays for chat and analysis but removes review-specific prompts
    Verification: Confirm that ai/personas is not deleted but review-specific prompts are removed from it
  • Criterion 8: The --persona, --all and MCP review tools' persona argument are removed
    Verification: Verify that ai/mcp/server.py lines 137-183 no longer contain these arguments
  • Criterion 9: Telemetry label 'persona' becomes 'producer' in devops_cli_findings_total metric
    Verification: Check that docs/TELEMETRY.md line 20 shows the persona label is renamed to producer and dashboards are updated
  • Criterion 10: Documentation sections about persona are removed or updated
    Verification: Verify README.md title and persona sections, DEVCONTAINER_USAGE.md and CLI_REFERENCE.md examples, ERRORS.md, AGENTS.md section 5, KB articles, and release-epic step are updated
  • Criterion 11: A test asserts that devops review builds a model client only when an explanation stage is on
    Verification: Run tests to ensure the assertion that model client is built only for explanation stages holds true
  • Criterion 12: 3 fresh runs on loop input give identical findings.sarif and 0 model-originated rows
    Verification: Execute 3 fresh runs on loop input and verify they produce identical findings.sarif files with no model-originated rows
  • Criterion 13: Tests run offline with fakes and recorded tool output: no network, no real scanner, no model; each test under 1 s
    Verification: Run all tests in offline mode with fakes and recorded outputs ensuring they complete within 1 second each

Key questions

Fit

Needs splitting into 2 items:

  1. Delete legacy segment engine (refactor(review): delete the legacy segment engine so the orchestrator is the only review engine #995) which lands first
  2. Delete the persona review stage, legacy engine and review-time RAG features in main item

Suspected block

None.

Dependencies

#871, #995

Activity

  1. added
    type/refactor
    scope/review
    priority/p1-high
    on Oct 3, 2026
  2. added this to the v0.2.37 milestone on Oct 11, 2026
  3. dan-petty commented on Oct 11, 2026

    @dan-petty
    OwnerAuthor

    Proposal needs splitting into 2 items at 6e862cd (see proposed design in issue body).

  4. dan-petty commented on Oct 17, 2026

    @dan-petty
    OwnerAuthor

    Readiness check for v0.2.37, against release/v0.2.36 at 22d8748. Line numbers are at that commit.

    Status: needs a split. It is partly done: #995 deleted the legacy engine and adversarial_debate.py.

    Today

    • src/devops_cli/ai/review/runner.py:1061-1063 runs execute_multi_persona_review.
    • The persona stage spans src/devops_cli/ai/review/pipeline.py:238-418, :922-1005, :1192-1230, :1814-1972 and :3400-3870.
    • Review-time RAG and contract grounding are at :1814-1862.
    • classification.py, contract_grounding.py and chunker.py still exist.
    • The flags are at src/devops_cli/commands/review.py:206/210, 422/426 and 725/729.

    References that moved

    • run_store.py:146 → :150-162.
    • gateway_tune.py:379 → :377-381, called from ai_gateway.py:452.
    • review_schema.py:1039-1248 → :931-1212.
    • mcp/server.py → :165-206, plus the prompt at :3041-3056 and the stats tool at :229.
    • TELEMETRY.md:20 → :26.
    • SELF_IMPROVEMENT.md:568 and devops-cli.json:697.
    • The "Multi-Persona Review Verification" section is gone.

    Dependencies

    Gaps in the body

    • Where the chunker's surviving functions go:
      • extract_added_diff_lines (:2040);
      • extract_file_diff_hunks (:3277);
      • find_repo_files (src/devops_cli/ai/review/sample_validation.py:24);
      • diff_pages and _extract_header_filenames (runner.py:732, :805, :1048).
    • Consolidation is used by adjudication.py:33 and :203, and by pipeline.py:3884. Should it move to normalization.deduplicate (:457)?
    • Group analysis is gated on personas (pipeline.py:4198, :4854), and there is no flag to turn it off.
    • What happens to --no-persona-review, --persona-review-only, --no-reranking, the reranking stage and review stats --persona?

    Couplings

    Slices (L overall)

    1. (M) Decouple group analysis from personas:

      • add --no-group-analysis;
      • create the client lazily (commands/review.py:322, :534, :842);
      • dedupe by fingerprint.

      A "no client when it's off" test comes first.

    2. (L) The deletions. The chunker's surviving functions move to review/diff.py.

    3. (M) Telemetry, dashboards and docs.

  5. removed this from the v0.2.37 milestone on Oct 17, 2026
  6. dan-petty commented on Oct 17, 2026

    @dan-petty
    OwnerAuthor

    Moved to the backlog: it was New, not Ready, when v0.2.37 started. (devops roadmap reprioritize)

  7. added this to the v0.2.38 milestone on Oct 17, 2026
  8. dan-petty commented on Oct 21, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1775, merged into release/v0.2.38 as a592171.

    Closes #1151

    Fail-to-pass: not applicable: documentation and convention cleanup PR

    38 file(s) changed.

    How it was verified

    Check runs at 86cff68:

    • Audit Defect PR Hardening: skipping
    • Prune PR DevContainer Images: pass
    • devops-cli: pass
    • zizmor: pass
    • bandit: pass
    • CodeQL: pass
    • Analyze (actions): pass
    • Rule Pack Tests: pass
    • Changed-Test Independence: pass
    • Fail-to-Pass Self-Check: pass
    • Tests & Coverage: pass
    • Analyze (python): pass
    • Fail-to-Pass Check: pass
    • Static Analysis: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-1151-review-simplification-engine-deletions.md:

    No Acceptance Criteria section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/reviewtype/refactor

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions