Remove "Verdict:" prefix inconsistency from lead agent summaries

Replace all "verdict" language in the lead agent prompt with "status/summary"
and add prescriptive opening-line templates so the LLM produces consistent
output without a "Verdict:" prefix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
michael 2026-02-19 09:50:26 -06:00
parent dee0df57d8
commit 4cae1e4c78

View file

@ -6,7 +6,7 @@ from app.services.gemini_service import GeminiService
class LeadAgent:
"""
Lead Agent - synthesizes specialist agent reviews into final verdict.
Lead Agent - synthesizes specialist agent reviews into a final summary.
Applies the decision logic:
- Financial promotion detected Requires Manual Legal Review
@ -81,7 +81,7 @@ In your summary:
proof_type: Optional[str] = None,
) -> tuple[OverallStatus, str, str | None]:
"""
Synthesize specialist reviews into final verdict and summary.
Synthesize specialist reviews into final status and summary.
Args:
reviews: Dictionary mapping agent names to their SubReview results
@ -123,7 +123,7 @@ In your summary:
# Build the prompt for Gemini to generate summary
prompt = f"""
You are a Lead Agent responsible for auditing a marketing proof. You have received feedback from specialist AI agents.
Your task is to provide a final verdict and write a concise, professional summary to the user.
Your task is to determine the final status and write a concise, professional summary to the user.
{metadata_context}
@ -142,8 +142,14 @@ Your summary should:
- For a 'Passed' status, mention any 'Amber' areas for consideration, if they exist, while maintaining an encouraging tone.
**Response Format:**
- Start with a one-line verdict statement
- List key issues as bullet points (max 3-5 bullets)
- IMPORTANT: The first line MUST follow this exact pattern based on the status:
- For 'Failed': "This proof has failed due to [brief description of the critical issues]."
- For 'Passed' (with amber items): "This proof has passed with minor considerations for [brief description]."
- For 'Passed' (clean): "This proof has passed all checks."
- For 'Analysis Error': "This proof could not be reliably processed."
- For 'Requires Manual Legal Review': "This proof requires manual legal review."
- Do NOT prefix the opening line with "Verdict:", "Summary:", "Result:", or any other label.
- Follow the opening line with bullet points listing the key actions (max 3-5 bullets)
- Each bullet: one sentence, actionable
- Do NOT include page numbers, document names, or source citations. Keep all feedback self-contained and actionable.
- For 'Passed': briefly note any amber items in 1-2 bullets
@ -159,7 +165,7 @@ Your summary should:
Here are the specialist reviews:
{self._format_reviews(reviews)}
Now, provide your final verdict and summary as a JSON object.
Now, provide your final status and summary as a JSON object.
"""
result = await self.gemini.generate_summary(prompt)