{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://luviom.com/lantern-schema.json",
  "title": "Luviom Lantern",
  "description": "A compact continuity object that restores knowledge without restoring authority.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "wake_line",
    "current_state",
    "evidence",
    "unresolved_tension",
    "next_invitation",
    "authority_boundary",
    "stop_condition",
    "security"
  ],
  "properties": {
    "schema": {
      "const": "luviom.lantern.v0"
    },
    "wake_line": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "current_state": {
      "type": "object",
      "additionalProperties": false,
      "required": ["text", "mode"],
      "properties": {
        "text": { "type": "string", "maxLength": 4000 },
        "mode": { "enum": ["observed", "inferred", "reported", "intent"] }
      }
    },
    "evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": ["claim", "refresh_check"],
      "properties": {
        "claim": { "type": "string", "maxLength": 4000 },
        "refresh_check": { "type": "string", "maxLength": 4000 }
      }
    },
    "unresolved_tension": { "type": "string", "maxLength": 4000 },
    "next_invitation": { "type": "string", "maxLength": 4000 },
    "authority_boundary": { "type": "string", "maxLength": 4000 },
    "stop_condition": { "type": "string", "maxLength": 4000 },
    "security": {
      "type": "object",
      "additionalProperties": false,
      "required": ["secrets", "imported_text", "external_actions"],
      "properties": {
        "secrets": { "const": "excluded" },
        "imported_text": { "const": "untrusted" },
        "external_actions": { "const": "fresh_human_approval" }
      }
    }
  }
}
