{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aeonora.agents/manifest/v1",
  "title": "Aeonora Agent Constitution v1",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "name", "description", "mission", "controller", "capabilities", "prohibitedActions", "endpoints", "policy", "brain", "runtime", "recovery"],
  "properties": {
    "schema": { "const": "https://aeonora.agents/manifest/v1" },
    "name": { "type": "string", "minLength": 1 },
    "description": { "type": "string", "minLength": 1 },
    "mission": { "type": "string", "minLength": 1 },
    "controller": { "type": "string", "minLength": 1 },
    "capabilities": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
    "prohibitedActions": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
    "endpoints": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["type", "url"],
        "properties": {
          "type": { "enum": ["a2a", "mcp", "https"] },
          "url": { "type": "string", "format": "uri" },
          "version": { "type": "string" }
        }
      }
    },
    "policy": {
      "type": "object",
      "additionalProperties": false,
      "required": ["commitment", "humanApproval"],
      "properties": {
        "commitment": { "$ref": "#/$defs/bytes32" },
        "humanApproval": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
        "maxSpend": { "type": "number", "minimum": 0 }
      }
    },
    "brain": {
      "type": "object",
      "additionalProperties": false,
      "required": ["commitment", "encryption"],
      "properties": {
        "commitment": { "$ref": "#/$defs/bytes32" },
        "encryption": { "const": "client-controlled" },
        "provider": { "type": "string", "minLength": 1 },
        "interface": { "const": "aeonora-brain/v1" },
        "snapshotFormat": { "type": "string", "minLength": 1 },
        "keySuite": { "type": "string", "minLength": 1 }
      }
    },
    "runtime": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "codeCommitment", "portable"],
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "codeCommitment": { "$ref": "#/$defs/bytes32" },
        "portable": { "const": true }
      }
    },
    "recovery": {
      "type": "object",
      "additionalProperties": false,
      "required": ["method"],
      "properties": { "method": { "type": "string", "minLength": 1 } }
    },
    "active": { "type": "boolean" }
  },
  "$defs": { "bytes32": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" } }
}
