Skip to content

feat(review): orchestrator review prompts boundary isolation, guardrails, legible empty replies #605

Closed

Description

@dan-petty

Context & Rationale

The "Multi-Persona Code Review Engine" entry marks XML prompt boundary isolation done and the matrix's "Closed-Loop Hallucination Ledger & False-Positive Rate" row marks prompt exemplars done. Both hold only on the fallback _run_persona_loop (src/devops_cli/ai/review/runner.py:1969); an LLMClient review with extracted files runs ReviewPipelineOrchestrator (runner.py:1832,1923). There, page content, RAG and contract context follow bare labels with no enclosing element or untrusted preamble (src/devops_cli/ai/review/classification.py:280-285). Persona system prompts omit guardrails_isolation.md and the exemplars (src/devops_cli/ai/review/pipeline.py:1677-1680,1696); render_negative_exemplars has one caller, runner.py:222. persona_title is never passed (pipeline.py:554), so every persona reviews as "DevSecOps Specialist" (classification.py:246). Guardrail tests cover only the fallback builders (tests/test_review_prompt_guardrails.py:39-121). An unparsed persona reply adds zero findings and the file still gets stage reviewed (pipeline.py:245,1842); only a scratchpad thought differs from a clean review. vibes isolates <target_diff> and <metadata> in XML sections, gives each persona an exclusive domain, and treats an empty findings list as legitimate output.

Scope & Deliverables

  • Context & Rationale*: The "Multi-Persona Code Review Engine" entry marks XML prompt boundary isolation done and the matrix's "Closed-Loop Hallucination Ledger & False-Positive Rate" row marks prompt exemplars done. Both hold only on the fallback _run_persona_loop (src/devops_cli/ai/review/runner.py:1969); an LLMClient review with extracted files runs ReviewPipelineOrchestrator (runner.py:1832,1923). There, page content, RAG and contract context follow bare labels with no enclosing element or untrusted preamble (src/devops_cli/ai/review/classification.py:280-285). Persona system prompts omit guardrails_isolation.md and the exemplars (src/devops_cli/ai/review/pipeline.py:1677-1680,1696); render_negative_exemplars has one caller, runner.py:222. persona_title is never passed (pipeline.py:554), so every persona reviews as "DevSecOps Specialist" (classification.py:246). Guardrail tests cover only the fallback builders (tests/test_review_prompt_guardrails.py:39-121). An unparsed persona reply adds zero findings and the file still gets stage reviewed (pipeline.py:245,1842); only a scratchpad thought differs from a clean review. vibes isolates <target_diff> and <metadata> in XML sections, gives each persona an exclusive domain, and treats an empty findings list as legitimate output.
  • Deliverable*: (1) Parity, P0, one PR: build orchestrator system prompts with _persona_system_prompt (runner.py:214), which also wraps conventions. Wrap page content, RAG and contract context in existing _PROMPT_BOUNDARY_TAGS names (src/devops_cli/security/sanitizer.py:287-301) with the untrusted preamble. Delete persona_title and the {persona} placeholder outright. Prefer one builder for both paths; two drifting builders caused this. Extend tests/test_review_classification.py:105-152 and assert every _build_multi_persona_pipeline agent carries guardrails and exemplars. (2) Outcomes, separate PR: record each persona reply as findings, empty or unparsed in ai_scratchpad and profile.json, and name unparsed personas on the console. Accept bare [] as empty (src/devops_cli/ai/review_schema.py:1304 takes only non-empty lists) so the validator at runner.py:717 stops retrying it. Share vocabulary with Attribute Verification Failure in AI Review. (3) Split comma-joined personas (review_schema.py:1013) before review stats buckets them (src/devops_cli/commands/review.py:1011).
  • Constraint*: Do not add exclusive-scope text yet. Every persona carries the shared checklist (src/devops_cli/ai/tasks/review.md:11-21), and consolidation exists because personas report the same defect; exclusive domains adopted before Model-in-the-Loop Prompt Benchmarking measures recall can drop true positives only a second persona catches. The overlap rate is an input to Generator-Side Rule Pruning Measured Against Verifier Overlap. Guardrails and exemplars add tokens to up to 5 persona calls per page (runner.py:1926); report per-page prompt tokens before and after. Unparsed replies must degrade legibly, not abort. Conventions fetched from a PR head (runner.py:1740-1750) still reach system prompts as instructions; tags cannot neutralize that, which belongs to Synthetic Prompt Adversaries for Injection Resistance.
  • Measured*: 3 of 3 orchestrator page-prompt context types lack an XML container and name "DevSecOps Specialist" (uv run python probe/pipeline_prompt_probe.py). A prose persona reply yields 0 findings, as {"findings": []} does (uv run python probe/step_probe.py). 0 of 12 persona prompt files state exclusivity (grep -ci exclusiv src/devops_cli/ai/personas/*/*.md). 5 of 9 shared Inspect bullets are security checks (sed -n '/### 2. Inspect/,/### 3/p' src/devops_cli/ai/tasks/review.md | grep -cE '^- \*\*(Path|Egress|Complexity|Error|Secret)').
  • Source*: vibes artifacts/prompts/multi-persona-code-reviewer.md

Strategic Alignment

  • Milestone: v0.2.23 (devops ai Review Quality, LLM Routing & Multi-Language Validation)
  • Roadmap Reference: docs/ROADMAP.md

Activity

  1. added this to the v0.2.23 milestone on Sep 25, 2026
  2. added
    type/feature
    scope/review
    priority/p0-critical
    on Sep 25, 2026
  3. dan-petty commented on Sep 25, 2026

    @dan-petty
    OwnerAuthor

    Closed by #615, merged into release/v0.2.23.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

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/p0-criticalscope/reviewtype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions