{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://law.arxo.io/schema/law-timeline.schema.json",
  "title": "Arxo law timeline answer 0.1",
  "description": "Declarative lifecycle and effective values from the lowered compiler snapshot, without applicability computation.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "uri", "version", "status"],
  "properties": {
    "schema": { "const": "law.timeline/0.1" },
    "uri": { "type": "string", "pattern": "^file://" },
    "version": { "type": "integer" },
    "status": { "enum": ["available", "unavailable"] },
    "reason": { "type": "string", "minLength": 1 },
    "entries": {
      "type": "array",
      "items": {
        "type": "object", "additionalProperties": false,
        "required": ["carrierId", "kind", "extent"],
        "properties": {
          "carrierId": { "type": "string", "minLength": 1 },
          "kind": { "enum": ["effective", "editionLifecycle"] },
          "status": { "type": "string", "minLength": 1 },
          "extent": {}
        },
        "allOf": [
          { "if": { "properties": { "kind": { "const": "editionLifecycle" } } }, "then": { "required": ["status"] } }
        ]
      }
    }
  },
  "allOf": [
    { "if": { "properties": { "status": { "const": "available" } } }, "then": { "required": ["entries"] } },
    { "if": { "properties": { "status": { "const": "unavailable" } } }, "then": { "required": ["reason"] } }
  ]
}
