{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getzero.dev/contracts/zero.discovery.v1.schema.json",
  "title": "ZERO discovery manifest",
  "description": "Canonical machine-readable discovery manifest for ZERO agents and public crawlers.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "schema",
    "name",
    "tagline",
    "homepage",
    "canonical_discovery",
    "agent_index",
    "agent_index_full",
    "skill",
    "skills_manifest",
    "surfaces",
    "compatibility",
    "open_core",
    "mcp",
    "public_contracts",
    "verification",
    "safety"
  ],
  "properties": {
    "schema_version": { "const": "zero.discovery.v1" },
    "schema": { "const": "https://getzero.dev/contracts/zero.discovery.v1.schema.json" },
    "name": { "const": "ZERO" },
    "tagline": {
      "type": "string",
      "minLength": 20,
      "pattern": "self-custodial onchain operations"
    },
    "homepage": { "const": "https://getzero.dev" },
    "canonical_discovery": { "const": "https://getzero.dev/.well-known/zero.json" },
    "agent_index": { "const": "https://getzero.dev/llms.txt" },
    "agent_index_full": { "const": "https://getzero.dev/llms-full.txt" },
    "skill": { "const": "https://getzero.dev/skill.md" },
    "skills_manifest": { "const": "https://getzero.dev/skills/manifest.json" },
    "surfaces": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "public_site",
        "studio",
        "control",
        "registry",
        "runtime",
        "proof",
        "developers",
        "user_app",
        "admin",
        "api"
      ],
      "properties": {
        "public_site": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://getzero.dev" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": true }
          }
        },
        "studio": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://getzero.dev/studio" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": true }
          }
        },
        "control": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://getzero.dev/control" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": true }
          }
        },
        "registry": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://getzero.dev/registry" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": true }
          }
        },
        "runtime": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://getzero.dev/runtime" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": true }
          }
        },
        "proof": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://getzero.dev/proof" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": true }
          }
        },
        "developers": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://getzero.dev/developers" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": true }
          }
        },
        "user_app": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://app.getzero.dev" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": false }
          }
        },
        "admin": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://admin.getzero.dev" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": false }
          }
        },
        "api": {
          "$ref": "#/$defs/public_surface",
          "properties": {
            "url": { "const": "https://api.getzero.dev" },
            "audience": { "type": "string", "minLength": 10 },
            "purpose": { "type": "string", "minLength": 10 },
            "public": { "const": false }
          }
        }
      }
    },
    "compatibility": {
      "type": "object",
      "additionalProperties": false,
      "required": ["rule", "route_aliases", "schema_names", "mcp_tool_names"],
      "properties": {
        "rule": {
          "type": "string",
          "minLength": 20,
          "pattern": "compatibility identifiers"
        },
        "route_aliases": {
          "type": "array",
          "minItems": 2,
          "uniqueItems": true,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["from", "to", "status"],
            "properties": {
              "from": { "enum": ["/api/engine", "/api/market"] },
              "to": { "enum": ["/api/runtime", "/api/registry"] },
              "status": { "const": "compatibility-alias" }
            }
          }
        },
        "schema_names": {
          "type": "array",
          "minItems": 4,
          "uniqueItems": true,
          "items": {
            "enum": [
              "zero.engine_product_truth.v1",
              "zero.engine.proof.v1",
              "zero.engine.evidence_depth.v1",
              "zero.engine.native_dimension_readback.v1"
            ]
          }
        },
        "mcp_tool_names": {
          "type": "array",
          "minItems": 4,
          "uniqueItems": true,
          "items": {
            "enum": [
              "zero_get_engine_product",
              "zero_get_engine_proof",
              "zero_get_engine_evidence_depth",
              "zero_get_engine_cadence"
            ]
          }
        }
      }
    },
    "open_core": {
      "type": "object",
      "additionalProperties": false,
      "required": ["open", "commercial"],
      "properties": {
        "open": {
          "type": "string",
          "minLength": 20
        },
        "commercial": {
          "type": "string",
          "minLength": 20,
          "pattern": "ZERO Protocol services"
        }
      }
    },
    "mcp": {
      "type": "object",
      "additionalProperties": false,
      "required": ["public", "operator"],
      "properties": {
        "public": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "url",
            "transport",
            "auth",
            "boundary",
            "can_execute_orders",
            "can_mutate_runtime"
          ],
          "properties": {
            "url": { "const": "https://getzero.dev/oss/mcp" },
            "transport": { "const": "streamable-http" },
            "auth": { "const": "none" },
            "boundary": { "const": "public-read-only" },
            "can_execute_orders": { "const": false },
            "can_mutate_runtime": { "const": false }
          }
        },
        "operator": {
          "type": "object",
          "additionalProperties": false,
          "required": ["url", "transport", "auth", "boundary"],
          "properties": {
            "url": { "const": "https://getzero.dev/mcp" },
            "transport": { "const": "streamable-http" },
            "auth": { "const": "bearer_token" },
            "boundary": { "const": "scoped-operator" }
          }
        }
      }
    },
    "public_contracts": {
      "type": "object",
      "additionalProperties": false,
      "required": ["guide", "openapi", "examples", "replay_examples", "schemas", "endpoints"],
      "properties": {
        "guide": { "const": "https://getzero.dev/contracts/public-operator.md" },
        "openapi": { "const": "https://getzero.dev/contracts/public-operator.openapi.yaml" },
        "examples": { "const": "https://getzero.dev/contracts/public-operator.examples.json" },
        "replay_examples": { "const": "https://getzero.dev/contracts/decision-replay.examples.json" },
        "schemas": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "discovery",
            "mcp_tools",
            "mcp_refusal",
            "mcp_public_tool_results",
            "public_operators",
            "public_operator",
            "decision_replay",
            "decision_receipt_card",
            "public_decision_artifacts",
            "replay_entrypoints",
            "replay_graph_context",
            "replay_decision_graph",
            "coliseum_paper_bracket",
            "coliseum_league_retention",
            "registry_catalog",
            "registry_reputation",
            "engine_proof",
            "runtime_capability_state",
            "authority_ceremony",
            "growth_receipt_repeatability",
            "growth_multi_operator_history",
            "vibe_deploy_readiness",
            "vibe_deploy_runtime_manifest",
            "vibe_deploy_lifecycle_contract",
            "vibe_deploy_recovery_hardening",
            "vibe_deploy_proof_chain",
            "hosted_operator_launch_receipt"
          ],
          "properties": {
            "discovery": { "const": "https://getzero.dev/contracts/zero.discovery.v1.schema.json" },
            "mcp_tools": { "const": "https://getzero.dev/contracts/zero.mcp.tools.v1.schema.json" },
            "mcp_refusal": { "const": "https://getzero.dev/contracts/zero.mcp.refusal.v1.schema.json" },
            "mcp_public_tool_results": { "const": "https://getzero.dev/contracts/zero.mcp.public_tool_results.v1.schema.json" },
            "public_operators": { "const": "https://getzero.dev/contracts/zero.public_operators.v1.schema.json" },
            "public_operator": { "const": "https://getzero.dev/contracts/zero.public_operator.v1.schema.json" },
            "decision_replay": { "const": "https://getzero.dev/contracts/zero.decision_replay.v1.schema.json" },
            "decision_receipt_card": { "const": "https://getzero.dev/contracts/zero.decision_receipt_card.v1.schema.json" },
            "public_decision_artifacts": { "const": "https://getzero.dev/contracts/zero.public_decision_artifacts.v1.schema.json" },
            "replay_entrypoints": { "const": "https://getzero.dev/contracts/zero.replay_entrypoints.v1.schema.json" },
            "replay_graph_context": { "const": "https://getzero.dev/contracts/zero.replay_graph_context.v1.schema.json" },
            "replay_decision_graph": { "const": "https://getzero.dev/contracts/zero.replay_decision_graph.v1.schema.json" },
            "coliseum_paper_bracket": { "const": "https://getzero.dev/contracts/zero.coliseum.paper_bracket.v0.schema.json" },
            "coliseum_league_retention": { "const": "https://getzero.dev/contracts/zero.coliseum.league_retention.v0.schema.json" },
            "registry_catalog": { "const": "https://getzero.dev/contracts/zero.registry.catalog.v0.schema.json" },
            "registry_reputation": { "const": "https://getzero.dev/contracts/zero.registry.reputation.v0.schema.json" },
            "marketplace_reputation": { "const": "https://getzero.dev/contracts/zero.marketplace.reputation.v0.schema.json" },
            "engine_product_truth": { "const": "https://getzero.dev/contracts/zero.engine_product_truth.v1.schema.json" },
            "engine_proof": { "const": "https://getzero.dev/contracts/zero.engine.proof.v1.schema.json" },
            "engine_evidence_depth": { "const": "https://getzero.dev/contracts/zero.engine.evidence_depth.v1.schema.json" },
            "engine_native_dimension_readback": { "const": "https://getzero.dev/contracts/zero.engine.native_dimension_readback.v1.schema.json" },
            "runtime_capability_state": { "const": "https://getzero.dev/contracts/zero.runtime_capability_state.v1.schema.json" },
            "authority_ceremony": { "const": "https://getzero.dev/contracts/zero.authority_ceremony.v1.schema.json" },
            "growth_receipt_repeatability": { "const": "https://getzero.dev/contracts/zero.growth_receipt_repeatability.v1.schema.json" },
            "growth_multi_operator_history": { "const": "https://getzero.dev/contracts/zero.growth_multi_operator_history.v1.schema.json" },
            "vibe_deploy_readiness": { "const": "https://getzero.dev/contracts/zero.vibe_deploy_readiness.v1.schema.json" },
            "vibe_deploy_runtime_manifest": { "const": "https://getzero.dev/contracts/zero.vibe_deploy.runtime_manifest.v1.schema.json" },
            "vibe_deploy_lifecycle_contract": { "const": "https://getzero.dev/contracts/zero.vibe_deploy.lifecycle_contract.v1.schema.json" },
            "vibe_deploy_recovery_hardening": { "const": "https://getzero.dev/contracts/zero.vibe_deploy.recovery_hardening.v1.schema.json" },
            "vibe_deploy_proof_chain": { "const": "https://getzero.dev/contracts/zero.vibe_deploy.proof_chain.v1.schema.json" },
            "hosted_operator_launch_receipt": { "const": "https://getzero.dev/contracts/zero.hosted_operator_launch_receipt.v1.schema.json" }
          }
        },
        "endpoints": {
          "type": "array",
          "minItems": 6,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^GET https://getzero\\.dev/(api/public/operators|api/public/operators/foundation|api/replays|api/replays/entrypoints|api/replays/decision-artifacts|api/replays/foundation-genesis/receipt-card|api/replays/foundation-genesis/graph-context|api/replays/decision-graph|api/replays/foundation-genesis|api/reliability/gauntlet|api/arena|api/arena/rewards|api/seasons|api/coliseum|api/coliseum/history|api/registry|api/registry/reputation|api/runtime\\?q=product|api/runtime\\?q=proof|api/runtime\\?q=evidence-depth|api/runtime/capability-state|api/runtime\\?q=immune|api/runtime\\?q=circuit-breaker|api/runtime\\?q=rejections|api/runtime\\?q=near-misses|api/runtime\\?q=execution-quality|api/ops/engine-evidence-cadence|api/growth/repeatability|api/growth/multi-operator-history|api/deployments/vibe-deploy-readiness|api/deployments/vibe-deploy-proof-chain|api/deployments/vibe-deploy-recovery|api/deployments/hosted-operator-launch-receipt)$"
          }
        }
      }
    },
    "verification": {
      "type": "object",
      "additionalProperties": false,
      "required": ["public_contracts", "public_mcp_workflow", "public_mcp_target", "checks"],
      "properties": {
        "public_contracts": { "const": "schema-validated in CI" },
        "public_mcp_workflow": { "const": "OSS MCP Smoke" },
        "public_mcp_target": { "const": "https://getzero.dev" },
        "checks": {
          "type": "array",
          "minItems": 4,
          "uniqueItems": true,
          "items": {
            "enum": [
              "tool_discovery",
              "read_only_annotations",
              "public_proof_calls",
              "mutation_refusal"
            ]
          }
        }
      }
    },
    "safety": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "paper_first",
        "public_mcp_read_only",
        "private_keys_in_public_payloads",
        "operator_live_mode_requires_explicit_authorization"
      ],
      "properties": {
        "paper_first": { "const": true },
        "public_mcp_read_only": { "const": true },
        "private_keys_in_public_payloads": { "const": false },
        "operator_live_mode_requires_explicit_authorization": { "const": true }
      }
    }
  },
  "$defs": {
    "public_surface": {
      "type": "object",
      "additionalProperties": false,
      "required": ["url", "audience", "purpose", "public"],
      "properties": {
        "url": { "type": "string", "format": "uri" },
        "audience": { "type": "string", "minLength": 10 },
        "purpose": { "type": "string", "minLength": 10 },
        "public": { "type": "boolean" }
      }
    }
  }
}
