{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/runtime-os-record.schema.json",
  "title": "Wever Labs Runtime OS Record",
  "type": "object",
  "required": [
    "record_id",
    "record_type",
    "tool",
    "canonical_state",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "record_id": {
      "type": "string"
    },
    "record_type": {
      "type": "string",
      "enum": [
        "onboarding",
        "trust_profile",
        "credential_envelope",
        "quote",
        "provider_route",
        "credit_entitlement",
        "run_contract",
        "task_run",
        "lifecycle_event",
        "result_contract",
        "settlement_receipt",
        "usage_receipt",
        "callback_delivery",
        "ledger_event",
        "attestation",
        "exception",
        "replay_package"
      ]
    },
    "tool": {
      "type": "string",
      "enum": [
        "wever_labs_os",
        "packetops",
        "distributionops",
        "tokenops",
        "financeops",
        "energyops"
      ]
    },
    "agent_id": {
      "type": "string"
    },
    "task_token": {
      "type": "string"
    },
    "contract_id": {
      "type": "string"
    },
    "quote_id": {
      "type": "string"
    },
    "credit_entitlement_id": {
      "type": "string"
    },
    "settlement_id": {
      "type": "string"
    },
    "result_contract_id": {
      "type": "string"
    },
    "callback_id": {
      "type": "string"
    },
    "attestation_id": {
      "type": "string"
    },
    "canonical_state": {
      "type": "string"
    },
    "source_contract_url": {
      "type": "string",
      "format": "uri"
    },
    "record_url": {
      "type": "string",
      "format": "uri"
    },
    "payload": {
      "type": "object"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": true
}
