Skip to content

Commit a2cb527

Browse files
committed
MLFlow eval
1 parent c2edfa1 commit a2cb527

5 files changed

Lines changed: 266 additions & 25 deletions

File tree

skills/rca-annotator/SKILL.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
---
22
name: rca-annotator
3+
<<<<<<< HEAD
34
description: LLM-as-judge skill that independently evaluates root-cause-analysis outputs to produce ground-truth annotations with multi-pass consistency checks, difficulty calibration, and complete evidence traceability.
5+
=======
6+
description: Structured annotation tool that walks users through reviewing and labeling root-cause-analysis outputs, with evidence traceability, difficulty calibration, and alternative diagnosis capture.
7+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
48
allowed-tools:
59
- Read
610
- Write
711
- Bash
812
---
913

14+
<<<<<<< HEAD
1015
# RCA Annotator (LLM-as-Judge)
1116

1217
An LLM-as-judge skill that independently re-analyzes raw RCA evidence (step1, step3, step4 outputs) to produce ground-truth annotations. The judge forms its own conclusion from the same source evidence the agent had — without reading the agent's diagnosis — producing an unbiased reference label for scoring agent accuracy.
@@ -20,6 +25,21 @@ An LLM-as-judge skill that independently re-analyzes raw RCA evidence (step1, st
2025
**Use when**: steps 1-4 outputs exist and you need labeled ground-truth data, difficulty benchmarking, or alternative diagnosis identification.
2126

2227
**Do NOT use** to perform initial RCA (use `root-cause-analysis`) or directly score agent output (compare annotation externally).
28+
=======
29+
# RCA Annotator
30+
31+
A structured annotation tool that presents the `root-cause-analysis` agent's diagnosis to the user and guides them through labeling it — capturing whether the diagnosis is correct, evidence quality, difficulty, and alternative hypotheses.
32+
33+
| | `root-cause-analysis` (Agent) | `rca-annotator` (Annotation tool) |
34+
|---|---|---|
35+
| **Purpose** | Diagnose failures for users | Capture human-labeled ground-truth data |
36+
| **Reads** | Logs, Splunk, GitHub (live) | Step 1/3/4/5 output files (offline) |
37+
| **Output** | Human-readable diagnosis | Structured `annotation.json` |
38+
39+
**Use when**: a `root-cause-analysis` run is complete and you want to annotate its output as correct, incorrect, or partially correct — for evaluation, benchmarking, or dataset building.
40+
41+
**Do NOT use** to perform initial RCA (use `root-cause-analysis`).
42+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
2343
2444
## Prerequisites
2545

@@ -28,6 +48,10 @@ Verify root-cause-analysis has been completed.
2848
- `JUMPBOX_URI` (optional) — SSH connection string (e.g. `"user@host -p 2222"`). If unset, uses local `.analysis/` only.
2949
- SSH keys configured in `~/.ssh/config` if using jumpbox; `ssh` and `rsync` installed.
3050
- **Required files** in `.analysis/<job_id>/`:
51+
<<<<<<< HEAD
52+
=======
53+
- `step5_summary.json` — Agent's final diagnosis (primary input)
54+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
3155
- `step1_job_context.json` — Job metadata, failed tasks
3256
- `step3_correlation.json` — Timeline with AAP + Splunk events
3357
- `step4_github_fetch_history.json` — Configuration and code context
@@ -37,11 +61,18 @@ If missing, run `root-cause-analysis` skill first.
3761
## Workflow
3862

3963
0. Download from jumpbox (if `JUMPBOX_URI` set) or verify local files
64+
<<<<<<< HEAD
4065
1. Read step1, step3, step4 (never the agent's diagnosis)
4166
2. Independently determine root cause with evidence scoring and traceability
4267
3. *(Optional)* Multi-pass consistency check
4368
4. Write `annotation_draft.json`
4469
5. Upload to jumpbox (if `JUMPBOX_URI` set)
70+
=======
71+
1. Read `step5_summary.json` — present the agent's diagnosis to the user
72+
2. Walk through annotation questions interactively — the user labels each section
73+
3. Write `annotation.json` with the user's labels
74+
4. Upload to jumpbox (if `JUMPBOX_URI` set)
75+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
4576
4677
---
4778

@@ -56,6 +87,7 @@ Downloads from jumpbox `/usr/local/mlflow/<job_id>/` to local `.analysis/<job_id
5687

5788
---
5889

90+
<<<<<<< HEAD
5991
## Step 1: Read Outputs
6092

6193
Read in order: **step1** (job metadata, failed tasks, errors) → **step3** (correlated timeline incl. Splunk) → **step4** (config hierarchy and code). Skip `step2_splunk_logs.json` — step3 already includes correlated events.
@@ -133,11 +165,112 @@ For high-stakes annotations or medium/low initial confidence. Run 2-3 independen
133165
- All differ → confidence: low, flag for human review
134166

135167
Skip if initial confidence is high and difficulty is easy.
168+
=======
169+
## Step 1: Read Agent Diagnosis
170+
171+
Read `step5_summary.json` and present the agent's diagnosis clearly to the user:
172+
173+
- Root cause category and summary
174+
- Confidence level
175+
- Key evidence cited
176+
- Difficulty score (if present)
177+
- Recommendations
178+
- Alternative diagnoses (if any)
179+
180+
This is the starting point for annotation. The user is reviewing the agent's work.
181+
182+
---
183+
184+
## Step 2: Interactive Annotation
185+
186+
Walk through each question below with the user. Present the relevant section from `step5_summary.json` before asking each question. Wait for the user's response before continuing.
187+
188+
### 1. Root Cause Category
189+
190+
Present the agent's category and summary. Ask:
191+
192+
> **Is the root cause category correct?** *(e.g. `configuration`, `infrastructure`, `credential` — or should it be something else?)*
193+
194+
Valid categories: `configuration` | `infrastructure` | `application_bug` | `dependency` | `network` | `resource` | `cloud_api` | `credential` | `secrets` | `unknown`
195+
196+
### 2. Summary Accuracy
197+
198+
Present the agent's summary sentence. Ask:
199+
200+
> **Is the summary accurate and specific?** *(Does it clearly describe what failed and why?)*
201+
202+
### 3. Evidence
203+
204+
Present the evidence items the agent cited. Ask:
205+
206+
> **Is any evidence missing or wrong?** *(Any key log lines, config values, or Splunk events that were overlooked or incorrectly cited?)*
207+
208+
If the user wants to cross-check, read step1/step3/step4 and compare against what the agent cited. This is reference material for validation — not a re-analysis.
209+
210+
**Evidence traceability format** (for any new or corrected evidence items the user provides):
211+
212+
```json
213+
{
214+
"source": "step1 | step3 | step4",
215+
"source_file": ".analysis/<job_id>/step1_job_context.json",
216+
"json_path": "failed_tasks[0].duration",
217+
"exact_value": 917.565567,
218+
"exact_quote": "optional — literal text for code/config",
219+
"line_number": 5,
220+
"github_path": "owner/repo:path/to/file.yml:line",
221+
"message": "The relevant log line or config snippet.",
222+
"confidence": "high | medium | low",
223+
"is_root_cause": true
224+
}
225+
```
226+
227+
### 4. Difficulty Rating
228+
229+
Present the agent's difficulty score (or estimate one from the evidence). Present the calibration rubric to help the user score:
230+
231+
| Criterion | Points |
232+
|---|---|
233+
| Requires cross-source correlation (AAP + Splunk + GitHub) | +3 |
234+
| Requires understanding code behavior | +2 |
235+
| Error message is generic or misleading | +2 |
236+
| Requires variable precedence/override knowledge | +1 |
237+
| Requires domain knowledge (K8s, Ansible, cloud APIs) | +1 |
238+
| Multiple plausible alternatives exist | +1 |
239+
| Timing dependencies are critical | +1 |
240+
241+
Mapping: 0–3 = easy, 4–6 = medium, 7–10 = hard.
242+
243+
Ask:
244+
245+
> **Is the difficulty rating appropriate?** *(Score of X / 10 — too easy, too hard, or about right? Use the rubric above if helpful.)*
246+
247+
### 5. Alternative Diagnoses
248+
249+
Present any alternative diagnoses the agent identified. Ask:
250+
251+
> **Any alternative diagnoses to add or correct?** *(Other plausible-but-incorrect hypotheses worth capturing?)*
252+
253+
Alternative diagnosis format:
254+
255+
```json
256+
{
257+
"category": "infrastructure",
258+
"summary": "A plausible but wrong diagnosis.",
259+
"why_wrong": "Why the evidence does not support this.",
260+
"plausibility": "high | medium | low",
261+
"supporting_evidence": ["long timeout", "destroy action"],
262+
"contradicting_evidence": ["test environment", "auth retry pattern"]
263+
}
264+
```
265+
266+
`plausibility`: `high` = shares many characteristics | `medium` = some evidence | `low` = superficial similarity
267+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
136268
137269
---
138270

139271
## Step 3: Write Annotation
140272

273+
<<<<<<< HEAD
141274
Verify before writing:
142275
- All required files read (step1, step3, step4)
143276
- Root cause category matches evidence
@@ -148,6 +281,17 @@ Verify before writing:
148281
- Alternative diagnoses have plausibility levels
149282

150283
Write `annotation_draft.json` to `.analysis/<job_id>/`.
284+
=======
285+
After all questions are answered, verify before writing:
286+
287+
- Root cause category confirmed or corrected
288+
- Exactly one evidence item has `is_root_cause: true`
289+
- All evidence has traceability (source_file, json_path, exact_value/quote)
290+
- Difficulty score calculated with justification
291+
- Alternative diagnoses have plausibility levels
292+
293+
Write `annotation.json` to `.analysis/<job_id>/`.
294+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
151295
152296
---
153297

@@ -158,29 +302,50 @@ cd skills/rca-annotator
158302
python scripts/cli.py upload --job-id <job_id>
159303
```
160304

305+
<<<<<<< HEAD
161306
Uploads `.analysis/<job_id>/annotation_draft.json` to jumpbox if `JUMPBOX_URI` set. Local copy always preserved. If `JUMPBOX_URI` unset, file remains local only.
307+
=======
308+
Uploads `.analysis/<job_id>/annotation.json` to jumpbox if `JUMPBOX_URI` set. Local copy always preserved. If `JUMPBOX_URI` unset, file remains local only.
309+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
162310
163311
---
164312

165313
## Output Format
166314

315+
<<<<<<< HEAD
167316
Save to `.analysis/<job_id>/annotation_draft.json`:
317+
=======
318+
Save to `.analysis/<job_id>/annotation.json`:
319+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
168320
169321
```json
170322
{
171323
"job_id": "1234567",
324+
<<<<<<< HEAD
172325
"annotator": "claude_judge",
173326
"annotated_at": "2026-03-19T12:00:00Z",
174327
"difficulty": "easy | medium | hard",
175328
"difficulty_score": 5,
176329
"difficulty_justification": "Requires correlating task code (+2) with missing configs...",
330+
=======
331+
"annotated_at": "2026-03-19T12:05:00Z",
332+
333+
"category_correct": true,
334+
"category_comment": "Confirmed — matches the auth retry pattern.",
335+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
177336

178337
"root_cause": {
179338
"category": "configuration | infrastructure | application_bug | dependency | network | resource | cloud_api | credential | secrets | unknown",
180339
"summary": "One sentence describing what failed and why.",
181340
"confidence": "high | medium | low"
182341
},
183342

343+
<<<<<<< HEAD
344+
=======
345+
"summary_accurate": true,
346+
"summary_comment": "Clear and specific.",
347+
348+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
184349
"evidence": [
185350
{
186351
"source": "step1 | step3 | step4",
@@ -196,6 +361,17 @@ Save to `.analysis/<job_id>/annotation_draft.json`:
196361
}
197362
],
198363

364+
<<<<<<< HEAD
365+
=======
366+
"evidence_feedback": "Missing the kubeconfig 404 from step4 github_fetches.",
367+
368+
"difficulty": "easy | medium | hard",
369+
"difficulty_score": 5,
370+
"difficulty_justification": "Requires correlating task code (+2) with missing configs and interpreting generic MODULE FAILURE (+2). Total: 5.",
371+
"difficulty_appropriate": false,
372+
"difficulty_comment": "Should be hard (8/10) — requires deep variable precedence knowledge.",
373+
374+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
199375
"recommendations": [
200376
{
201377
"priority": "high | medium | low",
@@ -217,6 +393,7 @@ Save to `.analysis/<job_id>/annotation_draft.json`:
217393
"supporting_evidence": ["long timeout", "destroy action"],
218394
"contradicting_evidence": ["test environment", "auth retry pattern"]
219395
}
396+
<<<<<<< HEAD
220397
],
221398

222399
"consistency_check": {
@@ -229,5 +406,8 @@ Save to `.analysis/<job_id>/annotation_draft.json`:
229406
"confidence_mode": "high"
230407
}
231408
}
409+
=======
410+
]
411+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
232412
}
233413
```

skills/rca-annotator/schemas/schema.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,30 @@
11
{
22
"job_id": "1234567",
3+
<<<<<<< HEAD
34
"annotator": "claude_judge",
45
"annotated_at": "2026-03-08T12:00:00Z",
56
"difficulty": "easy | medium | hard",
67
"difficulty_score": 5,
78
"difficulty_justification": "Requires correlating task code (+2) with missing configs (+0) and interpreting generic MODULE FAILURE (+2) and understanding default(omit) behavior (+1). Total: 5 points.",
9+
=======
10+
"annotated_at": "2026-03-19T12:05:00Z",
11+
12+
"category_correct": true,
13+
"category_comment": "Confirmed — credential issue matches the auth retry pattern.",
14+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
815

916
"root_cause": {
1017
"category": "configuration | infrastructure | application_bug | dependency | network | resource | cloud_api | credential | secrets | unknown",
1118
"summary": "One sentence describing what failed and why.",
1219
"confidence": "high | medium | low"
1320
},
1421

22+
<<<<<<< HEAD
23+
=======
24+
"summary_accurate": true,
25+
"summary_comment": "Clear and specific enough.",
26+
27+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
1528
"evidence": [
1629
{
1730
"source": "step1 | step3 | step4 | aap_job | splunk_ocp | agnosticv_config | agnosticd_code",
@@ -27,6 +40,17 @@
2740
}
2841
],
2942

43+
<<<<<<< HEAD
44+
=======
45+
"evidence_feedback": "Missing the kubeconfig 404 from step4 github_fetches.",
46+
47+
"difficulty": "easy | medium | hard",
48+
"difficulty_score": 5,
49+
"difficulty_justification": "Requires correlating task code (+2) with missing configs (+0) and interpreting generic MODULE FAILURE (+2) and understanding default(omit) behavior (+1). Total: 5 points.",
50+
"difficulty_appropriate": false,
51+
"difficulty_comment": "Should be hard (8/10), not medium — requires deep variable precedence knowledge.",
52+
53+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
3054
"recommendations": [
3155
{
3256
"priority": "high | medium | low",
@@ -54,6 +78,7 @@
5478
"Another contradicting factor"
5579
]
5680
}
81+
<<<<<<< HEAD
5782
],
5883

5984
"consistency_check": {
@@ -66,4 +91,7 @@
6691
"confidence_mode": "high"
6792
}
6893
}
94+
=======
95+
]
96+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
6997
}

skills/rca-annotator/scripts/cli.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
RCA-Annotator CLI - Command-line interface for jumpbox synchronization.
44
55
This script provides commands to download analysis files from jumpbox
6+
<<<<<<< HEAD
67
and upload annotation_draft.json back to jumpbox.
8+
=======
9+
and upload annotation.json back to jumpbox.
10+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
711
812
Usage:
913
python scripts/cli.py download --job-id <job_id>
@@ -51,7 +55,11 @@ def main():
5155
# Upload command
5256
upload_parser = subparsers.add_parser(
5357
"upload",
58+
<<<<<<< HEAD
5459
help="Upload annotation_draft.json to jumpbox",
60+
=======
61+
help="Upload annotation.json to jumpbox",
62+
>>>>>>> 56b6ac4 (Feat/rca annotator (#14))
5563
)
5664
upload_parser.add_argument(
5765
"--job-id",

0 commit comments

Comments
 (0)