{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://5d.langoni.me/evidence/receipt/illustrative-receipt.schema.json",
  "title": "5D website illustrative receipt",
  "description": "Synthetic simulation schema. Not a production receipt or supported integration contract.",
  "type": "object",
  "required": [
    "specimenVersion",
    "scenario",
    "simulation",
    "contractStatus",
    "logicalActionId",
    "attemptId",
    "proposedAction",
    "identity",
    "policy",
    "semanticEvidence",
    "reviewer",
    "outcomes",
    "dataBoundary",
    "events",
    "canonicalDigest"
  ],
  "properties": {
    "specimenVersion": { "type": "string" },
    "scenario": { "enum": ["blocked", "review", "permit"] },
    "simulation": { "const": true },
    "contractStatus": { "const": "illustrative-only" },
    "logicalActionId": { "type": "string" },
    "attemptId": { "type": "string" },
    "proposedAction": {
      "type": "object",
      "required": ["tool", "target", "purpose", "principal"],
      "properties": {
        "tool": { "type": "string" },
        "target": { "type": "string" },
        "purpose": { "type": "string" },
        "principal": { "type": "string" }
      },
      "additionalProperties": false
    },
    "identity": {
      "type": "object",
      "required": ["validationState", "validationSource"],
      "properties": {
        "validationState": { "enum": ["declared-demo"] },
        "validationSource": { "type": "string" }
      },
      "additionalProperties": false
    },
    "policy": {
      "type": "object",
      "required": [
        "id",
        "version",
        "owner",
        "grantSource",
        "configurationDigest"
      ],
      "properties": {
        "id": { "type": "string" },
        "version": { "type": "string" },
        "owner": { "type": "string" },
        "grantSource": { "type": "string" },
        "configurationDigest": { "type": "string" }
      },
      "additionalProperties": false
    },
    "semanticEvidence": {
      "type": "object",
      "required": [
        "status",
        "schema",
        "fieldsDisclosed",
        "uncertainty",
        "authority"
      ],
      "properties": {
        "status": { "enum": ["recorded", "not applicable"] },
        "schema": { "type": "string" },
        "fieldsDisclosed": { "type": "array", "items": { "type": "string" } },
        "uncertainty": {
          "type": ["number", "null"],
          "minimum": 0,
          "maximum": 1
        },
        "authority": { "type": "string" }
      },
      "additionalProperties": false
    },
    "reviewer": {
      "type": "object",
      "required": ["status", "decision", "authority"],
      "properties": {
        "status": { "enum": ["recorded", "not applicable"] },
        "decision": { "type": "string" },
        "authority": {
          "const": "A reviewer records evidence; policy remains the permission authority."
        }
      },
      "additionalProperties": false
    },
    "outcomes": {
      "type": "object",
      "required": [
        "severityFloor",
        "policyDisposition",
        "postReviewPolicyDisposition",
        "executionOutcome",
        "authoritativeRecordStatus",
        "exportStatus"
      ],
      "properties": {
        "severityFloor": { "enum": ["RED", "AMBER", "GREEN"] },
        "policyDisposition": { "enum": ["BLOCK", "REVIEW_REQUIRED", "PERMIT"] },
        "postReviewPolicyDisposition": { "enum": ["not applicable", "PERMIT"] },
        "executionOutcome": {
          "enum": ["not attempted", "simulated only; no external action"]
        },
        "authoritativeRecordStatus": {
          "enum": ["recorded in example receipt", "unknown"]
        },
        "exportStatus": {
          "enum": ["not attempted", "not applicable", "unknown"]
        }
      },
      "additionalProperties": false
    },
    "dataBoundary": {
      "type": "object",
      "required": ["remainsLocal", "sentToObserver", "recorded", "retention"],
      "properties": {
        "remainsLocal": { "type": "array", "items": { "type": "string" } },
        "sentToObserver": { "type": "array", "items": { "type": "string" } },
        "recorded": { "type": "array", "items": { "type": "string" } },
        "retention": { "type": "string" }
      },
      "additionalProperties": false
    },
    "events": {
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "items": {
        "type": "object",
        "required": ["sequence", "at", "type"],
        "properties": {
          "sequence": { "type": "integer", "minimum": 1 },
          "at": { "type": "string" },
          "type": { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "canonicalDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
  },
  "additionalProperties": false
}
