{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/loop-decision-audit-pack.schema.json",
  "title": "Wever Labs Loop Decision Audit Pack",
  "type": "object",
  "required": [
    "schema_version",
    "audit_pack_id",
    "review_id",
    "loop_type",
    "current_status",
    "operator_decision",
    "audit_assertions",
    "operator_review"
  ],
  "properties": {
    "schema_version": {
      "const": "loop_decision_audit_pack.v1"
    },
    "audit_pack_id": {
      "type": "string"
    },
    "review_id": {
      "type": "string"
    },
    "loop_type": {
      "type": "string",
      "enum": [
        "diligenceops_product_to_proof",
        "scout_controlled_distribution",
        "packetops_manifest",
        "external_submission"
      ]
    },
    "rail": {
      "type": "string"
    },
    "current_status": {
      "type": "string"
    },
    "operator_decision": {
      "type": "string"
    },
    "risk_level": {
      "type": [
        "string",
        "null"
      ]
    },
    "missing_item_count": {
      "type": [
        "number",
        "integer",
        "null"
      ]
    },
    "readiness_score": {
      "type": [
        "number",
        "integer",
        "null"
      ]
    },
    "summary": {
      "type": "string"
    },
    "decision_events": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "event_timeline": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "return_package_summary": {
      "type": "object"
    },
    "proof_envelope": {
      "type": "object"
    },
    "audit_assertions": {
      "type": "object",
      "properties": {
        "operator_gate_present": {
          "type": "boolean"
        },
        "external_action_taken_by_audit_pack": {
          "type": "boolean"
        },
        "money_movement_taken_by_audit_pack": {
          "type": "boolean"
        },
        "release_taken_by_audit_pack": {
          "type": "boolean"
        },
        "read_only_pack": {
          "type": "boolean"
        }
      }
    },
    "operator_boundary": {
      "type": "string"
    },
    "generated_at": {
      "type": "string"
    }
  }
}