{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "MERENIC decision receipt \u2014 Draft 0.1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "receipt_id",
    "run_id",
    "committed_at",
    "observation_refs",
    "hypothesis",
    "prediction",
    "alternatives",
    "guardrails",
    "budget",
    "stopping_rule",
    "artifact_hash"
  ],
  "properties": {
    "receipt_id": {
      "type": "string",
      "minLength": 1
    },
    "run_id": {
      "type": "string",
      "minLength": 1
    },
    "committed_at": {
      "type": "string",
      "minLength": 1,
      "format": "date-time"
    },
    "hypothesis": {
      "type": "string",
      "minLength": 1
    },
    "prediction": {
      "type": "string",
      "minLength": 1
    },
    "stopping_rule": {
      "type": "string",
      "minLength": 1
    },
    "artifact_hash": {
      "type": "string",
      "minLength": 1
    },
    "observation_refs": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "alternatives": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "guardrails": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "budget": {
      "type": "object",
      "required": [
        "unit",
        "limit"
      ],
      "additionalProperties": false,
      "properties": {
        "unit": {
          "type": "string",
          "minLength": 1
        },
        "limit": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "commit_sha": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}$"
    },
    "tools_declared": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "signature": {
      "type": "string",
      "minLength": 1
    },
    "supersedes": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}