{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://humanoidindex.io/standard/schema/robot-manifest.schema.json",
  "title": "Humanoid Robot Capability Manifest",
  "description": "Layer 0 of the Humanoid Interop Standard (HIS): a vendor-neutral, machine-readable description of a robot's embodiment, autonomy, and control interfaces. An orchestrating LLM/controller reads this at session init to know what a robot physically is and what it can be commanded to do, before issuing any Layer 3 tool calls. This schema is derived from the Xodexa Humanoid Index (XHI) data model — every field here maps to a field already scored on humanoidindex.io.",
  "type": "object",
  "required": ["manifest_version", "robot", "embodiment", "autonomy", "provenance"],
  "additionalProperties": false,
  "properties": {
    "manifest_version": {
      "type": "string",
      "pattern": "^\\d+\\.\\d+\\.\\d+$",
      "description": "Semver of this manifest instance's schema version, e.g. '0.1.0'. Independent of the robot's own firmware/model version.",
      "examples": ["0.1.0"]
    },

    "robot": {
      "type": "object",
      "required": ["id", "name", "manufacturer"],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
          "description": "Stable slug identifying this robot model, e.g. 'figure-02'."
        },
        "name": { "type": "string", "description": "Display name, e.g. 'Figure 02'." },
        "manufacturer": {
          "type": "object",
          "required": ["name"],
          "additionalProperties": false,
          "properties": {
            "name": { "type": "string" },
            "url": { "type": "string", "format": "uri" }
          }
        },
        "first_unveiled_year": { "type": ["integer", "null"], "minimum": 1970 },
        "country": { "type": ["string", "null"], "description": "Primary country of manufacture/HQ." }
      }
    },

    "embodiment": {
      "type": "object",
      "description": "Physical hardware taxonomy (Layer 0 core). Mirrors the XHI Robot data model's physical spec fields.",
      "required": ["form_factor", "total_dof", "actuation"],
      "additionalProperties": false,
      "properties": {
        "form_factor": {
          "type": "string",
          "enum": ["bipedal", "wheeled-biped", "quadruped", "wheeled-base", "arm-only", "other"],
          "description": "Coarse locomotion/embodiment class. Determines which Layer 2 action-space families are even applicable (e.g. 'walk_to' is meaningless for arm-only)."
        },
        "height_cm": { "type": ["number", "null"], "minimum": 0 },
        "weight_kg": { "type": ["number", "null"], "minimum": 0 },
        "payload_kg": { "type": ["number", "null"], "minimum": 0 },
        "total_dof": { "type": ["integer", "null"], "minimum": 0 },
        "hand": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "dof_per_hand": { "type": ["integer", "null"], "minimum": 0 },
            "dexterous": { "type": ["boolean", "null"] }
          }
        },
        "mobility": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "walk_speed_ms": { "type": ["number", "null"], "minimum": 0 },
            "runtime_hours": { "type": ["number", "null"], "minimum": 0 },
            "battery_kwh": { "type": ["number", "null"], "minimum": 0 }
          }
        },
        "actuation": {
          "type": "string",
          "enum": ["electric", "hydraulic", "hybrid"]
        }
      }
    },

    "autonomy": {
      "type": "object",
      "required": ["level"],
      "additionalProperties": false,
      "properties": {
        "level": {
          "type": "string",
          "enum": ["research", "teleoperated", "supervised-autonomy", "task-autonomous"],
          "description": "How much of the robot's own control loop runs without a human or external planner in the loop. Governs which Layer 3 tool tiers can be safely auto-approved vs. require confirmation."
        },
        "onboard_compute": { "type": ["string", "null"] },
        "ai_model": { "type": ["string", "null"], "description": "Free-text description of the onboard/native control model family (e.g. VLA, transformer-based policy)." }
      }
    },

    "interfaces": {
      "type": "object",
      "description": "Layer 3 protocol surface this robot (or its vendor SDK) actually exposes. Absent or empty means the robot has a Layer 0 manifest (this document) but no live control protocol implementation yet — i.e. compliance.level MUST be 'documented'.",
      "additionalProperties": false,
      "properties": {
        "tiers": {
          "type": "array",
          "description": "Which control tiers are exposed, and how to reach each one.",
          "items": {
            "type": "object",
            "required": ["tier", "transport"],
            "additionalProperties": false,
            "properties": {
              "tier": {
                "type": "integer",
                "enum": [0, 1, 2],
                "description": "0 = raw actuator/joint-level (expert only). 1 = skills (grasp, walk_to, open_door) — the interoperable cross-vendor layer. 2 = semantic tasks composed from tier 1, often vendor-specific."
              },
              "transport": {
                "type": "string",
                "description": "Wire protocol + version for this tier, e.g. 'his-tool/0.1+jsonrpc' for orchestration-channel tiers, or 'ros2/humble+dds' for the raw telemetry/control channel.",
                "examples": ["his-tool/0.1+jsonrpc", "ros2/humble+dds"]
              },
              "endpoint": { "type": ["string", "null"], "description": "Connection URI, if this manifest is being published for a live/reachable robot rather than as a static spec-sheet entry." },
              "tool_manifest_url": { "type": ["string", "null"], "format": "uri", "description": "URL to the tier-1/tier-2 tool schema (the discoverable list of callable skills), analogous to an MCP server's tools/list response." }
            }
          }
        },
        "safety": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "e_stop_supported": { "type": ["boolean", "null"] },
            "force_limiting": { "type": ["boolean", "null"] },
            "confirmation_required_above_tier": {
              "type": ["integer", "null"],
              "enum": [0, 1, 2, null],
              "description": "Tools at or above this risk tier require explicit human/orchestrator confirmation before execution, per the protocol's mandatory safety-gating rule. Null means the vendor has not declared this — treat as maximally conservative (confirm everything) until it is."
            }
          }
        }
      }
    },

    "compliance": {
      "type": "object",
      "required": ["level"],
      "additionalProperties": false,
      "properties": {
        "level": {
          "type": "string",
          "enum": ["documented", "conformant", "interop-proven"],
          "description": "documented = self-reported manifest only, no live test. conformant = passed the automated HIS conformance suite (schema + safety-gating behavior). interop-proven = completed a zero-shot benchmark task suite driven by a reference orchestrator that had never seen this robot before."
        },
        "tested_at": { "type": ["string", "null"], "format": "date", "description": "Date the compliance level was last verified, e.g. '2026-06'." },
        "test_suite_version": { "type": ["string", "null"] }
      }
    },

    "provenance": {
      "type": "object",
      "required": ["sources", "confidence", "as_of"],
      "additionalProperties": false,
      "description": "Same evidentiary standard as XHI scoring: every manifest field must trace back to a cited source, not be assumed or inferred.",
      "properties": {
        "sources": {
          "type": "array",
          "items": { "type": "string", "format": "uri" },
          "minItems": 1
        },
        "confidence": { "type": "string", "enum": ["high", "medium", "low"] },
        "as_of": { "type": "string", "description": "Year-month this manifest was last verified against public specs, e.g. '2026-06'." }
      }
    }
  }
}
