Skip to content

refactor(review): delete the persona text left in review modules #5046

Open

Description

@dan-petty

Problem or Motivation

#1151 deleted the persona stage of devops review, and #4827 removes the persona text of the files that it lists. Persona text and unread persona code stay in other review modules:

  • src/devops_cli/ai/review/pipeline.py: 7 docstrings and comments name a "persona stage" or "persona pages", and generate_consolidated_report takes a personas parameter that no caller passes.
  • src/devops_cli/ai/review/profile.py:3 lists "persona review" and "verification" as review stages. The review has neither stage.
  • src/devops_cli/output/formatters/panels.py: render_review_result and render_review_raw take a persona, and only tests/ai/review/test_review_runner.py calls them.
  • src/devops_cli/commands/review.py: the finding panel shows a Persona: badge with the producer of the finding.
  • src/devops_cli/ai/review/adjudication.py:13 names "another persona's report".

Proposed Solution & Architectural Design

  • Delete the personas parameter of generate_consolidated_report, and render_review_result and render_review_raw with their test.
  • Name the producer, not a persona, in the finding panel.
  • Rewrite the docstrings and comments so that they describe the stages that run: pre-analysis, payloads, group analysis and report.
  • Alpha keeps no compatibility, so add no shim.

Target Subsystem

AI & Agentic Review Pipeline (src/devops_cli/ai/review/, src/devops_cli/commands/review.py, src/devops_cli/output/formatters/panels.py).

Existing Tool Considered

A delete and a text fix. No tool applies. Cost to build: about 50,000 tokens and 1 hour.

Acceptance Criteria

  • git grep -n -i persona -- src/devops_cli/ai/review src/devops_cli/output/formatters/panels.py finds only the persona read aliases of saved findings.
  • The finding panel of devops review findings names the producer.
  • uv run devops ci passes.

Dependencies

#4827 (pull request #5044) changes ai/review/runner.py first.

Source: #5044

Alternatives check of 2026-11-15: not-applicable.
Class: refactor, no search.
Tool: none found.

Proposed design

Problem statement

Persona review text and unread persona code remain in the review modules after the persona stage was deleted. This item removes the remaining parameter, helpers, badge and comments, and it aligns the docs with the stages that run.

Acceptance criteria

Requirement: Remove the unused persona parameter

The signature of generate_consolidated_report SHALL take no personas parameter.

Scenario: Signature has no persona parameter

  • WHEN a test inspects the signature of generate_consolidated_report
  • THEN the signature has no parameter named personas and the test passes.

Requirement: Delete the persona render helpers

src/devops_cli/output/formatters/panels.py SHALL define neither render_review_result nor render_review_raw.

Scenario: Persona render helpers are gone

  • WHEN a test imports devops_cli.output.formatters.panels and looks up each helper name
  • THEN the module has no attribute render_review_result and no attribute render_review_raw.

Requirement: Delete the persona render helper test

tests/ai/review/test_review_runner.py SHALL hold no test of render_review_result or render_review_raw.

Scenario: Persona helper test is gone

  • WHEN a test searches tests/ai/review/test_review_runner.py for the two helper names
  • THEN the search finds no reference to either helper.

Requirement: Finding panel names the producer

The finding panel of devops review findings SHALL show the finding producer and SHALL show no Persona: badge.

Scenario: Finding panel shows the producer

  • WHEN a test renders a finding with producer semgrep through the finding panel
  • THEN the output holds semgrep and does not hold Persona:.

Requirement: Review profile lists only live stages

The module docstring of src/devops_cli/ai/review/profile.py SHALL list the stages that run and SHALL not list persona review or verification.

Scenario: Review profile names the live stages

  • WHEN a test imports devops_cli.ai.review.profile and reads its __doc__
  • THEN the docstring holds pre-analysis, payloads, group analysis and report, and holds neither persona review nor verification.

Requirement: Adjudication names the producer

src/devops_cli/ai/review/adjudication.py SHALL name the producer of a finding and SHALL not name another persona's report.

Scenario: Adjudication names no persona

  • WHEN a test reads the source text of devops_cli.ai.review.adjudication
  • THEN the text holds no another persona's report and names the producer.

Requirement: Schema markers have no reader

Finding and ReviewResult SHALL carry no SkipJsonSchema marker, and the comment in src/devops_cli/ai/review_schema.py SHALL not say that a persona agent receives the schema.

Scenario: Schema markers are gone

  • WHEN a test inspects the fields of Finding and ReviewResult and reads the comment at the schema
  • THEN no field carries SkipJsonSchema and the comment holds no persona agent text.

Requirement: Corpus generate prints a runnable command

The command that devops review corpus generate prints SHALL run with --dry-run and SHALL exit with code 0.

Scenario: Printed review command runs

  • WHEN a test takes the devops review path line that devops review corpus generate prints, adds --dry-run, and runs it
  • THEN the command exits with code 0.

Requirement: Review docs name no persona review

docs/SELF_IMPROVEMENT.md SHALL hold no present-tense persona review text outside the calibration records and the A/B protocols that run old revisions.

Scenario: Review docs match the live review

  • WHEN a test runs git grep -n -i -E 'default persona|every persona|each persona|code_review_prompt|review_output_instruction|consolidate_duplicate_findings' -- docs/SELF_IMPROVEMENT.md and skips the calibration records and A/B protocols
  • THEN the search finds no match.

Requirement: No persona text in review modules

The review modules SHALL hold no persona review text, except the persona read aliases of saved findings.

Scenario: Review modules hold only read aliases

  • WHEN a test runs git grep -n -i persona -- src/devops_cli/ai/review src/devops_cli/output/formatters/panels.py
  • THEN the search finds only the persona read aliases of saved findings.

Requirement: CI passes

The change SHALL pass uv run devops ci.

Scenario: CI passes

  • WHEN a test runs uv run devops ci
  • THEN the command exits with code 0.

Existing Tool Considered

The alternatives check in the issue body gives not-applicable for this refactor and names no tool. The change builds its own code: about 50,000 tokens and 1 hour to delete the dead code and fix the text.

Key questions

  • Which command should devops review corpus generate print for the generated corpus?: Print devops review path <corpus>/files with no --all option. (best practice) [sources: src/devops_cli/commands/review.py:2014, src/devops_cli/commands/review.py:2396-2421]
    • Chosen: Remove --all from the printed line. review path has no --all, and the persona fan-out is gone.
    • Rejected: Add --all to review path. It keeps a persona option that the review no longer has.
    • Rejected: Print a different command. The corpus generator names review path; no other command reads the corpus.
  • Do the SkipJsonSchema markers of Finding and ReviewResult still have a reader?: No. No review call sends the Finding or ReviewResult schema to a model. Remove the markers and the comment that names a persona agent. (best practice) [sources: src/devops_cli/ai/review_schema.py:521-525, src/devops_cli/ai/review/pipeline.py]
    • Chosen: Remove the markers and the comment. No review call sends the schema, so the markers guard no reader.
    • Rejected: Keep the markers and rewrite the comment. The markers stay as unread code.
    • Rejected: Keep both and record a follow-up. The item removes unread persona code now; a follow-up leaves the text.
  • How should the finding panel show the producer of a finding?: Show Producer: <producer> from the saved finding and remove the Persona: badge. (best practice) [sources: CONTEXT.md, src/devops_cli/ai/review_schema.py, src/devops_cli/commands/review.py]
    • Chosen: Show Producer: <producer>. The finding carries the producer that its anchor records.
    • Rejected: Show the anchor type. The producer names the tool or fact; the anchor is a separate record.
    • Rejected: Show no badge. The producer is useful and the issue asks to name it.
  • Which stages should the rewritten review docstrings and comments list?: List pre-analysis, payloads, group analysis and report. [sources: src/devops_cli/ai/review/pipeline.py, src/devops_cli/ai/review/profile.py]
  • Which guardrails should docs/SELF_IMPROVEMENT.md name in place of the removed persona files?: Name src/devops_cli/ai/tasks/review_group_analysis.md:8 and :19 and src/devops_cli/ai/review/pipeline.py:3151-3162. [sources: src/devops_cli/ai/tasks/review_group_analysis.md:8, src/devops_cli/ai/tasks/review_group_analysis.md:19, src/devops_cli/ai/review/pipeline.py:3151-3162]
  • Should the docs keep the DevSecOps persona guardrail?: No. The rule at src/devops_cli/ai/personas/devsecops/prompt.md:20 reaches only devops ai chat, so the review docs must not say that it guards the review. [sources: src/devops_cli/ai/personas/devsecops/prompt.md:20, docs/SELF_IMPROVEMENT.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/refactor
    scope/review
    status/new
    value/low
    effort/low
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p3-low
    on Nov 12, 2026
  4. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Scope addition from the review of #5044. The pull request merged before these fixes, so this issue now holds them.

    Persona review text that stays on main (65473bc):

    • src/devops_cli/commands/review.py:2014: devops review corpus generate prints Review it: devops review path <corpus>/files --all. review path has no --all option, so the printed command stops with No such option: --all.
    • docs/SELF_IMPROVEMENT.md, section 2 step 4: "The persona agent is shown a reply schema of only the fields a reviewer writes". No review call sends the Finding or ReviewResult schema to a model now: no caller passes them to chat_structured or to an output_type.
    • docs/SELF_IMPROVEMENT.md, section 4 (sample validation): "It uses the default persona, or every persona with --all." samples validate --review runs a plain review path with no_cache=True (commands/review.py:2396-2421).
    • docs/SELF_IMPROVEMENT.md, section 5.1: the failure text says in the present tense that "each persona" causes the fan-out, and the guardrails name code_review_prompt.md, review_output_instruction.md and consolidate_duplicate_findings. These do not exist. The current guardrails are ai/tasks/review_group_analysis.md:8 (the model must not originate a finding), :19 (same-root-cause only on a shared correlation key) and ai/review/pipeline.py:3151-3162 (one finding per fingerprint and location).
    • docs/SELF_IMPROVEMENT.md, section 5.2: the "Persona" guardrail says the DevSecOps persona guards the review. Its rule (ai/personas/devsecops/prompt.md:20) reaches only devops ai chat now.
    • src/devops_cli/ai/review_schema.py:521-525: the comment says that a finding's JSON schema "is the reply format a persona agent is shown". Decide if the SkipJsonSchema markers of Finding and ReviewResult still have a reader.

    Add to the acceptance criteria:

    • The command that devops review corpus generate prints runs. A test can take the printed devops review path line, add --dry-run and expect exit code 0. Before the fix it exits with code 2.
    • docs/SELF_IMPROVEMENT.md has no present-tense persona review text outside the calibration records and the A/B protocols that run old revisions.

    A fix for all items but the last one is written and tested: the new test failed before the change (exit code 2) and passed after it, and devops ci docs and the doc tests passed. The builder of this issue can get the patch from the agent that ran the #5044 review.

  5. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: refactor. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.

  6. added
    status/ready
    and removed
    status/new
    on Nov 20, 2026
  7. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

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

    effort/lowpriority/p3-lowscope/reviewsource/agentstatus/readytype/refactorvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions