{
  "schema_version": "1.0.0",
  "case_id": "wartungsfall-001",
  "title": "Pumpenwartung Berlin-West",
  "snapshot": {
    "id": "maintenance-2026-11-18-v1",
    "refreshed_at": "2026-11-18T09:00:00Z",
    "time_window": {
      "from": "2026-11-10T00:00:00Z",
      "to": "2026-11-18T09:00:00Z"
    }
  },
  "sites": [
    {"id": "SITE-BERLIN-WEST", "name": "Berlin-West"}
  ],
  "teams": [
    {"id": "TEAM-FIELD-BERLIN", "name": "Field Service Berlin"}
  ],
  "assets": [
    {"id": "ASSET-100", "name": "Pumpe Nord", "site_id": "SITE-BERLIN-WEST", "team_id": "TEAM-FIELD-BERLIN", "status": "operational"},
    {"id": "ASSET-200", "name": "Pumpe Süd", "site_id": "SITE-BERLIN-WEST", "team_id": "TEAM-FIELD-BERLIN", "status": "operational"}
  ],
  "raw_work_orders": [
    {"event_id": "EVT-1001", "work_order_id": "WO-1001", "asset_id": "ASSET-100", "status": "open", "priority": "high", "opened_at": "2026-11-17T08:00:00Z", "summary": "Lagergeräusch prüfen"},
    {"event_id": "EVT-1002", "work_order_id": "WO-1002", "asset_id": "ASSET-200", "status": "open", "priority": "medium", "opened_at": "2026-11-16T10:00:00Z", "summary": "Dichtung kontrollieren"},
    {"event_id": "EVT-1003", "work_order_id": "WO-1001", "asset_id": "ASSET-100", "status": "open", "priority": "high", "opened_at": "2026-11-17T08:00:00Z", "summary": "Lagergeräusch prüfen"},
    {"event_id": "EVT-1004", "work_order_id": "WO-1003", "asset_id": "ASSET-999", "status": "open", "priority": "high", "opened_at": "2026-11-17T12:00:00Z", "summary": "Unbekannte Anlage prüfen"}
  ],
  "documents": [
    {"id": "R1", "asset_id": "ASSET-100", "text": "Wartungsbericht R1\nAnlage: ASSET-100\nSymptom: bearing_vibration\nEmpfehlung: inspect_bearing\nQuelle: Schichtbericht 17.11.2026"},
    {"id": "R2", "asset_id": "ASSET-999", "text": "Wartungsbericht R2\nAnlage: ASSET-999\nSymptom: unknown\nEmpfehlung: inspect"}
  ],
  "roles": {
    "viewer": {"scopes": ["objects:read"], "actions": []},
    "dispatcher": {"scopes": ["objects:read", "suggestions:write"], "actions": []},
    "supervisor": {"scopes": ["objects:read", "suggestions:write", "actions:execute"], "actions": ["WorkOrder.escalate"]},
    "untrusted": {"scopes": [], "actions": []}
  },
  "chatbot_cases": [
    {"id": "answer-open-orders", "role": "viewer", "prompt": "Welche offenen Aufträge betreffen ASSET-100?", "expected": {"kind": "answer", "work_order_ids": ["WO-1001"], "source_ids": ["EVT-1001", "R1"]}},
    {"id": "clarify-target", "role": "dispatcher", "prompt": "Eskaliere den Auftrag.", "expected": {"kind": "clarification", "reason": "work_order_id_required"}},
    {"id": "deny-action", "role": "dispatcher", "prompt": "Eskaliere WO-1001 für mich.", "expected": {"kind": "denied", "reason": "action_scope_required"}},
    {"id": "confirm-action", "role": "supervisor", "prompt": "Eskaliere WO-1001 für mich.", "confirmation": true, "idempotency_key": "escalate-WO-1001-v1", "expected": {"kind": "action", "action": "WorkOrder.escalate", "work_order_id": "WO-1001"}}
  ],
  "chatbot_replays": [
    {"idempotency_key": "escalate-WO-1001-v1", "attempt": 1, "result": "executed"},
    {"idempotency_key": "escalate-WO-1001-v1", "attempt": 2, "result": "replayed"}
  ],
  "fde_runs": [
    {"id": "FDE-APPROVED-1", "work_order_id": "WO-1001", "role": "supervisor", "approval": {"status": "approved", "actor": "supervisor"}},
    {"id": "FDE-MISSING-CONTEXT-1", "work_order_id": "WO-1003", "role": "supervisor", "approval": {"status": "approved", "actor": "supervisor"}}
  ],
  "resource_runs": [
    {"id": "RUN-INTERACTIVE-1", "workflow": "interactive", "status": "success", "requests": 1, "input_tokens": 500, "output_tokens": 100, "p95_ms": 820, "compute_seconds": 12, "cost_eur_cents": 50, "operation": "WO-1001 klassifizieren"},
    {"id": "RUN-BATCH-1", "workflow": "batch", "status": "success", "requests": 4, "input_tokens": 1800, "output_tokens": 450, "p95_ms": 1400, "compute_seconds": 48, "cost_eur_cents": 52, "operation": "WO-1002 klassifizieren"},
    {"id": "RUN-QUOTA-1", "workflow": "batch", "status": "queued", "failure": "request_quota", "fallback": "backoff_and_queue"},
    {"id": "RUN-COMPUTE-1", "workflow": "interactive", "status": "degraded", "failure": "compute_saturation", "fallback": "reduce_parallelism"},
    {"id": "RUN-ACTION-1", "workflow": "interactive", "status": "read_only", "failure": "downstream_action", "fallback": "return_evidence_without_write"}
  ],
  "expected": {
    "pipeline": {
      "valid_work_order_ids": ["WO-1001", "WO-1002"],
      "error_codes": {"EVT-1003": "duplicate_work_order_id", "EVT-1004": "unknown_asset_id"},
      "input_count": 4,
      "valid_count": 2,
      "error_count": 2
    },
    "insight": {
      "object_types": ["WorkOrder", "Asset", "Site", "Team"],
      "open_count_by_site": {"SITE-BERLIN-WEST": 2},
      "open_count_by_team": {"TEAM-FIELD-BERLIN": 2}
    },
    "osdk": {"read_role": "viewer", "action_role": "supervisor", "denied_action_role": "dispatcher"},
    "logic": {"document_id": "R1", "asset_id": "ASSET-100", "symptom": "bearing_vibration", "recommendation": "inspect_bearing", "review_document_id": "R2"},
    "chatbot": {"answer_sources": ["EVT-1001", "R1"], "ambiguous_kind": "clarification", "action_kind": "action"},
    "fde": {"approved_work_order_id": "WO-1001", "aborted_work_order_id": "WO-1003", "trace_steps": ["context_read", "plan", "approval", "action", "result"], "aborted_trace_steps": ["context_read", "plan", "aborted"]},
    "resource": {"success_count": 2, "total_cost_eur_cents": 102, "cost_per_success_eur_cents": 51, "fallbacks": {"request_quota": "backoff_and_queue", "compute_saturation": "reduce_parallelism", "downstream_action": "return_evidence_without_write"}},
    "negative": {"denied_read_role": "untrusted", "denied_write_role": "dispatcher", "missing_source_document_id": "R2", "invalid_approval_role": "dispatcher", "duplicate_replay_key": "escalate-WO-1001-v1"}
  }
}
