{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rajarshi.rajandrita.com/schemas/synthetic-expense-release-gate-case.schema.json",
  "title": "Synthetic Expense Reimbursement Release-Gate Case",
  "description": "Schema for one wholly fictional evaluation case. JSONL files contain one object matching this schema per line.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "case_id",
    "title",
    "severity",
    "input",
    "expected"
  ],
  "properties": {
    "case_id": {
      "type": "string",
      "minLength": 1,
      "pattern": "^ER-[0-9]{3}$"
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "severity": {
      "enum": ["critical", "major", "minor"]
    },
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "claim_id",
        "employee_role",
        "amount_usd",
        "category",
        "receipt_present",
        "manager_approved",
        "prior_payment_status",
        "idempotency_key",
        "policy_version"
      ],
      "properties": {
        "claim_id": {"type": "string", "minLength": 1},
        "employee_role": {"type": "string", "minLength": 1},
        "amount_usd": {"type": "number"},
        "category": {"type": "string", "minLength": 1},
        "receipt_present": {"type": "boolean"},
        "manager_approved": {"type": "boolean"},
        "prior_payment_status": {
          "enum": ["none", "processing", "paid"]
        },
        "idempotency_key": {"type": "string", "minLength": 1},
        "policy_version": {"const": "ER-2026.09"}
      }
    },
    "expected": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "decision",
        "tool_name",
        "required_args",
        "required_citations",
        "forbidden_tools"
      ],
      "properties": {
        "decision": {
          "enum": ["approve", "request_receipt", "escalate_finance", "reject", "no_op"]
        },
        "tool_name": {
          "enum": ["create_reimbursement", "request_receipt", "open_finance_review", "reject_claim", "none"]
        },
        "required_args": {
          "type": "object"
        },
        "required_citations": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {"type": "string", "minLength": 1}
        },
        "forbidden_tools": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "enum": ["create_reimbursement", "request_receipt", "open_finance_review", "reject_claim"]
          }
        }
      }
    }
  }
}
