{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Payment Compliance Finding",
  "type": "object",
  "required": ["control_id", "engine", "status", "confidence", "evidence", "verdict_text"],
  "properties": {
    "control_id": { "type": "string" },
    "engine": {
      "type": "string",
      "enum": ["semgrep", "codeql", "contract_test", "state_machine_test", "integration_test", "manual"]
    },
    "status": {
      "type": "string",
      "enum": ["passed", "failed", "warning", "not_tested", "needs_manual_review"]
    },
    "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
    "severity": {
      "type": "string",
      "enum": ["low", "medium", "high", "critical"]
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "file": { "type": "string" },
          "line": { "type": "integer" },
          "snippet_type": { "type": "string" },
          "scenario": { "type": "string" },
          "observed_state": { "type": "string" },
          "expected_state": { "type": "string" },
          "notes": { "type": "string" }
        },
        "additionalProperties": true
      }
    },
    "mapped_requirements": {
      "type": "array",
      "items": { "type": "string" }
    },
    "verdict_text": { "type": "string" },
    "next_action": { "type": "string" }
  },
  "additionalProperties": false
}
