{
  "rootib": "RootIB: RB-20260308131222-AE3F7B91",
  "name": "UAE-Mini Protocol Manifest",
  "version": "1.0.0",
  "description": "Universal Archive Engine — Mini Edition. The complete protocol manifest governing all chunks, events, state machines, and interactions within the UAE-Mini portable intelligence capsule.",
  "timestamp": "2026-03-08T13:12:22Z",
  "creator": "Ryan Barbrick (Barbrick Design)",
  "contact": "BarbrickDesign@gmail.com",

  "device": {
    "name": "UAE-Mini",
    "form_factor": "2 TB USB-C SSD",
    "shell": "Rugged aluminum",
    "controller": "Microcontroller with integrity + bootstrap",
    "cooling": "Passive",
    "compatibility": ["x86", "ARM"],
    "gpu": "Optional"
  },

  "directory_layout": {
    "/UAE-Mini/runtime":        "Self-healing runtime capsule",
    "/UAE-Mini/models":         "Quantized LLM + specialist models",
    "/UAE-Mini/semantic-index": "Vector index + knowledge graph",
    "/UAE-Mini/distilled":      "Seed library of civilization",
    "/UAE-Mini/tools":          "Chunker, hasher, compressor, search",
    "/UAE-Mini/bootstrap":      "Integrity verifier + launcher"
  },

  "chunk_schema": {
    "description": "Canonical unit of data within UAE-Mini",
    "fields": {
      "id":        { "type": "string", "format": "blake3_hash", "description": "Unique content-addressable identifier" },
      "size":      { "type": "integer", "description": "Byte length of the chunk payload" },
      "type":      { "type": "string",  "enum": ["binary","text","image","audio","video","model","index","meta"], "description": "Content classification" },
      "lineage":   { "type": "array",   "items": "string", "description": "Parent chunk IDs (provenance chain)" },
      "timestamp": { "type": "integer", "format": "unix_epoch", "description": "Creation time in seconds since epoch" },
      "metadata":  { "type": "object",  "additionalProperties": "string", "description": "Arbitrary key-value annotations" }
    },
    "required": ["id","size","type","timestamp"]
  },

  "vector_entry_schema": {
    "description": "Semantic index entry linking embeddings to chunks",
    "fields": {
      "id":         { "type": "string",  "format": "uuid" },
      "embedding":  { "type": "array",   "items": "number", "length": 1536, "description": "Float32 embedding vector" },
      "tags":       { "type": "array",   "items": "string" },
      "references": { "type": "array",   "items": "string", "description": "Associated chunk IDs" }
    }
  },

  "knowledge_graph_schema": {
    "node": {
      "fields": { "id": "string", "type": "string", "attributes": "object" }
    },
    "edge": {
      "fields": { "from": "string", "to": "string", "relation": "string" }
    }
  },

  "events": {
    "IngestEvent":   { "fields": { "source": "string", "chunk_id": "string", "priority": "integer", "timestamp": "integer" } },
    "CompressEvent": { "fields": { "chunk_id": "string", "method": "string", "result_id": "string" } },
    "IndexEvent":    { "fields": { "chunk_id": "string", "vector_id": "string", "graph_nodes": "array" } },
    "RepairEvent":   { "fields": { "chunk_id": "string", "status": "string", "action": "string" } },
    "UpgradeEvent":  { "fields": { "version_from": "string", "version_to": "string", "migration_id": "string" } }
  },

  "state_machines": {
    "IngestFSM": {
      "states":      ["idle","receiving","hashing","deduping","queued","complete","error"],
      "initial":     "idle",
      "transitions": [
        { "from": "idle",      "to": "receiving", "on": "data_arrived" },
        { "from": "receiving", "to": "hashing",   "on": "chunk_complete" },
        { "from": "hashing",   "to": "deduping",  "on": "hash_ready" },
        { "from": "deduping",  "to": "queued",    "on": "unique" },
        { "from": "deduping",  "to": "complete",  "on": "duplicate" },
        { "from": "queued",    "to": "complete",  "on": "stored" },
        { "from": "*",         "to": "error",     "on": "failure" },
        { "from": "error",     "to": "idle",      "on": "recover" }
      ]
    },
    "CompressionFSM": {
      "states":      ["idle","analyzing","compressing","verifying","complete","error"],
      "initial":     "idle",
      "transitions": [
        { "from": "idle",        "to": "analyzing",   "on": "compress_request" },
        { "from": "analyzing",   "to": "compressing", "on": "method_selected" },
        { "from": "compressing", "to": "verifying",   "on": "compressed" },
        { "from": "verifying",   "to": "complete",    "on": "valid" },
        { "from": "verifying",   "to": "compressing", "on": "invalid" },
        { "from": "*",           "to": "error",       "on": "failure" },
        { "from": "error",       "to": "idle",        "on": "recover" }
      ]
    },
    "IndexFSM": {
      "states":      ["idle","embedding","graph_building","storing","complete","error"],
      "initial":     "idle",
      "transitions": [
        { "from": "idle",          "to": "embedding",     "on": "index_request" },
        { "from": "embedding",     "to": "graph_building","on": "embedded" },
        { "from": "graph_building","to": "storing",       "on": "graph_ready" },
        { "from": "storing",       "to": "complete",      "on": "stored" },
        { "from": "*",             "to": "error",         "on": "failure" },
        { "from": "error",         "to": "idle",          "on": "recover" }
      ]
    },
    "RepairFSM": {
      "states":      ["idle","scanning","diagnosing","reconstructing","verifying","complete","error"],
      "initial":     "idle",
      "transitions": [
        { "from": "idle",           "to": "scanning",       "on": "repair_request" },
        { "from": "scanning",       "to": "diagnosing",     "on": "anomaly_found" },
        { "from": "scanning",       "to": "complete",       "on": "clean" },
        { "from": "diagnosing",     "to": "reconstructing", "on": "diagnosed" },
        { "from": "reconstructing", "to": "verifying",      "on": "reconstructed" },
        { "from": "verifying",      "to": "complete",       "on": "valid" },
        { "from": "verifying",      "to": "reconstructing", "on": "invalid" },
        { "from": "*",              "to": "error",          "on": "unrecoverable" },
        { "from": "error",          "to": "idle",           "on": "reset" }
      ]
    },
    "UpgradeFSM": {
      "states":      ["idle","fetching","validating","migrating","complete","error","rollback"],
      "initial":     "idle",
      "transitions": [
        { "from": "idle",       "to": "fetching",   "on": "upgrade_available" },
        { "from": "fetching",   "to": "validating", "on": "fetched" },
        { "from": "validating", "to": "migrating",  "on": "valid" },
        { "from": "validating", "to": "error",      "on": "invalid" },
        { "from": "migrating",  "to": "complete",   "on": "migrated" },
        { "from": "migrating",  "to": "rollback",   "on": "failure" },
        { "from": "rollback",   "to": "idle",       "on": "rolled_back" },
        { "from": "error",      "to": "idle",       "on": "reset" }
      ]
    }
  },

  "compression_methods": [
    { "id": "entropy",   "description": "Standard entropy coding (zstd/brotli)", "use_case": "General binary/text data" },
    { "id": "ai",        "description": "LLM-based semantic compression",        "use_case": "Natural language content" },
    { "id": "semantic",  "description": "Vector-space projection + residual",    "use_case": "Structured knowledge chunks" },
    { "id": "delta",     "description": "Delta vs parent chunk",                 "use_case": "Versioned/lineage data" }
  ],

  "schema_catalog": ["JSON","XML","CSV","Parquet","Git objects","JPEG/PNG/WebP","MP3/FLAC/OGG","MP4/WebM","ONNX/GGUF","HDF5","Protobuf","CBOR"],

  "activation_sequence": [
    { "step": 1, "action": "verify_integrity",       "description": "Blake3-verify all stored chunks against manifest" },
    { "step": 2, "action": "load_semantic_index",    "description": "Memory-map vector index into RAM" },
    { "step": 3, "action": "initialize_vector_search","description": "Build HNSW graph for ANN queries" },
    { "step": 4, "action": "start_runtime_loops",    "description": "Launch ingest, compress, repair, upgrade daemons" },
    { "step": 5, "action": "expose_local_api",       "description": "Bind HTTP API on localhost:7474" },
    { "step": 6, "action": "enter_interactive_mode", "description": "Accept user queries and autonomous tasks" }
  ],

  "pipeline": [
    { "step": 1, "name": "Ingest",       "description": "Data arrives from any source" },
    { "step": 2, "name": "Chunk",        "description": "Split into content-addressed blocks" },
    { "step": 3, "name": "Hash",         "description": "Blake3 content hash for deduplication" },
    { "step": 4, "name": "Dedupe",       "description": "Discard exact duplicates via hash lookup" },
    { "step": 5, "name": "Compress",     "description": "Entropy → AI → Semantic compression chain" },
    { "step": 6, "name": "Index",        "description": "Embed + build knowledge graph edges" },
    { "step": 7, "name": "Store",        "description": "Write to USB SSD or external archive" },
    { "step": 8, "name": "Reconstruct",  "description": "On-demand decompression + synthesis" },
    { "step": 9, "name": "Repair",       "description": "Detect + heal corruption via lineage" },
    { "step":10, "name": "Upgrade",      "description": "Pull new model weights + migrate index" }
  ],

  "runtime_guarantees": [
    "Never blocks ingestion",
    "Never loses lineage",
    "Always reconstructs or explains",
    "Always backward-compatible",
    "Fully offline capable",
    "Fully online capable",
    "Self-healing",
    "Self-upgrading"
  ],

  "ai_models": {
    "primary_llm":  { "type": "quantized_frontier", "size_gb": "30-70", "description": "Full reasoning and generation" },
    "code_model":   { "type": "specialist",          "description": "Code generation and analysis" },
    "math_model":   { "type": "specialist",          "description": "Symbolic and numeric reasoning" },
    "vision_model": { "type": "specialist",          "description": "Image understanding and generation" },
    "embed_model":  { "type": "embedding",           "dimensions": 1536, "description": "Semantic vector production" }
  },

  "knowledge_domains": ["Science","Engineering","Medicine","Law","History","Algorithms","Infrastructure","Meta-knowledge"],

  "local_api": {
    "host": "localhost",
    "port": 7474,
    "endpoints": {
      "GET  /status":           "System health and activation state",
      "POST /ingest":           "Submit data for ingestion",
      "POST /query":            "Semantic search and reasoning",
      "GET  /chunk/:id":        "Retrieve chunk by ID",
      "POST /compress":         "Compress a chunk",
      "POST /repair":           "Trigger repair scan",
      "GET  /pipeline/status":  "Live pipeline FSM states",
      "POST /upgrade/check":    "Check for model upgrades"
    }
  }
}
