{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ser6buzz.tail3ab3aa.ts.net/machine/luna-architecture.schema.json",
  "title": "AncientOS / Luna Architecture Manifest",
  "type": "object",
  "required": [
    "schema_version",
    "thesis",
    "system",
    "human_docs",
    "machine_readable",
    "invariants",
    "continuity_stack",
    "continuity_primitives",
    "subsystem_relationships",
    "execution_lanes",
    "primary_surfaces"
  ],
  "properties": {
    "schema": {
      "type": "string"
    },
    "schema_version": {
      "type": "string"
    },
    "thesis": {
      "type": "object",
      "required": [
        "technical_framing",
        "public_framing",
        "core_purpose",
        "not_primary_identity"
      ],
      "properties": {
        "technical_framing": {
          "type": "string"
        },
        "public_framing": {
          "type": "string"
        },
        "core_purpose": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "not_primary_identity": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "system": {
      "type": "object",
      "required": [
        "name",
        "host",
        "description"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "host": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "human_docs": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "machine_readable": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "invariants": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "taxonomy": {
      "type": "object",
      "properties": {
        "core_components": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/classified_entry"
          }
        },
        "shared_substrate_primitives": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "apps_workflows": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/classified_entry"
          }
        },
        "providers_adapters": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "interfaces_transports": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "continuity_stack": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/named_role_entry"
      }
    },
    "continuity_primitives": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/named_owner_entry"
      }
    },
    "subsystem_relationships": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/named_role_entry"
      }
    },
    "future_continuity_concepts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "continuity_risks": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "execution_lanes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "purpose",
          "risk_posture"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "risk_posture": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "primary_surfaces": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "role"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "$defs": {
    "named_role_entry": {
      "type": "object",
      "required": [
        "name",
        "role"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "role": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "named_owner_entry": {
      "type": "object",
      "required": [
        "name",
        "owner",
        "meaning"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "meaning": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "classified_entry": {
      "type": "object",
      "required": [
        "symbolic_name",
        "classification",
        "canonical_role"
      ],
      "properties": {
        "component_id": {
          "type": "string"
        },
        "app_id": {
          "type": "string"
        },
        "symbolic_name": {
          "type": "string"
        },
        "classification": {
          "type": "string"
        },
        "canonical_role": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
