{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://nmdvcell.com/resource/api/v2/outcome_ledger.schema.json",
  "title": "NMD-VCell Outcome Ledger",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "ledger_id",
    "generated_at",
    "append_only",
    "state",
    "counts",
    "allowed_outcome_states",
    "records",
    "empty_state",
    "zero_semantics",
    "source_registries",
    "claim_boundary",
    "does_not_imply",
    "is_new_scientific_claim",
    "ledger_sha256"
  ],
  "properties": {
    "schema": {
      "const": "nmd-vcell-outcome-ledger/1.0"
    },
    "ledger_id": {
      "const": "OUTCOME-LEDGER:NMDVCELL:CURRENT:V1"
    },
    "generated_at": {
      "type": "string"
    },
    "append_only": {
      "const": true
    },
    "state": {
      "enum": [
        "OPEN_EMPTY_LEDGER",
        "OPEN_WITH_RECORDS"
      ]
    },
    "counts": {
      "type": "object",
      "required": [
        "registered_studies",
        "registered_predictions",
        "measured_outcomes"
      ],
      "properties": {
        "registered_studies": {
          "type": "integer",
          "minimum": 0
        },
        "registered_predictions": {
          "type": "integer",
          "minimum": 0
        },
        "measured_outcomes": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "allowed_outcome_states": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "records": {
      "type": "array"
    },
    "empty_state": {
      "type": "boolean"
    },
    "zero_semantics": {
      "type": "string"
    },
    "source_registries": {
      "type": "object"
    },
    "claim_boundary": {
      "type": "string"
    },
    "does_not_imply": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    },
    "is_new_scientific_claim": {
      "const": false
    },
    "ledger_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    }
  }
}
