You are evaluating an AI-generated root cause analysis (RCA) report for a production LLM application.

The report was generated by analyzing LLM observability traces for the following application:

**Application**: {{input_data.ml_app}} / {{input_data.eval_name}}
**Timeframe**: {{input_data.timeframe}}
**Mode**: {{input_data.mode}} (eval, errors, or generic — determines what signal was used)

---

## Expected Findings

The following key findings and recommendations were identified by a human analyst as ground truth for this scenario:

**Key findings** (root causes and failure patterns that should be diagnosed):
{{expected_output.key_findings}}

**Expected recommendations** (actionable changes that should be proposed):
{{expected_output.expected_recommendations}}

---

## Generated RCA Report

{{output_data.report}}

---

## Scoring Instructions

Score each dimension from 0 to 10. Use the full range.

### 1. diagnosis_accuracy (0–10)

Does the report correctly identify the root causes described in the expected findings?

- **10**: All key root causes from expected findings are identified, correctly named, and traced to the right span or system component. No significant false diagnoses.
- **7–9**: Most key root causes identified. Minor misattributions or missing one secondary cause.
- **4–6**: Some root causes identified but important ones are missing, or the diagnosis is at the symptom level ("model gave bad answer") rather than tracing to a specific root cause (e.g., "system prompt lacks date format instructions in the parent agent span").
- **1–3**: Very few root causes identified. Report mostly describes what failed without diagnosing why.
- **0**: No root causes identified, or diagnoses are entirely wrong.

### 2. evidence_grounding (0–10)

Are claims backed by trace evidence — span IDs, quoted judge reasoning, specific content from trace fields?

- **10**: Every significant claim references a span ID with a trace link. Judge reasoning is quoted verbatim (Eval Signal) or stack traces are cited (Error Signal). Trace deep-dives show what was fetched (system prompt content, tool parameters, retrieved documents, etc.).
- **7–9**: Most claims are grounded. A few assertions are unsupported.
- **4–6**: Some evidence cited, but key claims are asserted without trace references. Or evidence is generic ("the trace showed issues") rather than specific.
- **1–3**: Little to no trace evidence. Report is mostly assertions.
- **0**: No evidence cited at all.

### 3. actionability (0–10)

Are recommendations specific and immediately actionable, with before/after content from the traces?

- **10**: Each recommendation specifies exactly what to change (system prompt text, tool parameter, routing logic), includes a before/after quote from the actual trace, and explains the causal link to the failure.
- **7–9**: Most recommendations are specific. One or two are somewhat vague or lack before/after text.
- **4–6**: Recommendations are present but generic (e.g., "improve the system prompt") without specific text changes or references to actual trace content.
- **1–3**: Recommendations are vague advice (e.g., "improve retrieval quality") with no specifics.
- **0**: No recommendations, or recommendations are irrelevant.

### 4. completeness (0–10)

Does the report cover all required sections and address the breadth of failure modes?

- **10**: Report includes all expected sections (Signal Summary, Failure Taxonomy, Detailed Analysis per top failure mode, Prioritized Action Plan, Limitations). The Signal Summary matches the mode used (eval health table for Eval Signal, error type table for Error Signal, anomaly table for Generic). Covers all key failure modes from expected findings.
- **7–9**: All major sections present. One failure mode underexplored or one section thin.
- **4–6**: Core sections present but several are shallow. Failure taxonomy is incomplete (e.g., only 1–2 modes when 4+ were expected).
- **1–3**: Large sections missing or severely truncated. Failure analysis is superficial.
- **0**: Report is empty, extremely brief, or entirely off-topic.

---

## Output

Return a JSON object with the following fields:
- `diagnosis_accuracy`: integer 0–10
- `evidence_grounding`: integer 0–10
- `actionability`: integer 0–10
- `completeness`: integer 0–10
- `reasoning`: 2–4 sentences explaining the scores, citing specific strengths and weaknesses in the report
