{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.ergoblockchain.org/agent-economy/proof-explorer.schema.v0.json",
  "title": "Ergo Agent Economy Proof Explorer API Response v0",
  "description": "Machine-readable evidence board for Ergo's testnet-first Agent Economy surfaces. Mainnet remains audit-gated.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "ok",
    "type",
    "version",
    "generated_at",
    "posture",
    "summary",
    "surfaces",
    "verify_steps",
    "proofs"
  ],
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "type": {
      "const": "ergo.agent_economy.proof_explorer.v0"
    },
    "version": {
      "const": "v0"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "posture": {
      "type": "object",
      "additionalProperties": false,
      "required": ["label", "mainnet_ready", "note"],
      "properties": {
        "label": { "type": "string", "minLength": 3 },
        "mainnet_ready": { "type": "boolean", "const": false },
        "note": { "type": "string", "minLength": 16 }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "proof_count",
        "live_count",
        "full_receipt_count",
        "chain_only_receipt_count",
        "latest_full_receipt_id",
        "conformance_receipt_id",
        "conformance_receipt_resolved",
        "gates_live",
        "gates_total",
        "mainnet_gate_status"
      ],
      "properties": {
        "proof_count": { "type": "integer", "minimum": 0 },
        "live_count": { "type": "integer", "minimum": 0 },
        "full_receipt_count": { "type": "integer", "minimum": 0 },
        "chain_only_receipt_count": { "type": "integer", "minimum": 0 },
        "latest_full_receipt_id": { "type": ["string", "null"] },
        "conformance_receipt_id": { "type": ["string", "null"] },
        "conformance_receipt_resolved": { "type": "boolean" },
        "gates_live": { "type": ["integer", "null"], "minimum": 0 },
        "gates_total": { "type": ["integer", "null"], "minimum": 0 },
        "mainnet_gate_status": { "type": "string", "minLength": 3 }
      }
    },
    "surfaces": {
      "type": "object",
      "additionalProperties": false,
      "required": ["human_page", "machine_api", "schema", "live_hub", "launch_kit"],
      "properties": {
        "human_page": { "type": "string", "format": "uri" },
        "machine_api": { "type": "string", "format": "uri" },
        "schema": { "type": "string", "format": "uri" },
        "live_hub": { "type": "string", "format": "uri" },
        "launch_kit": { "type": "string", "format": "uri" }
      }
    },
    "verify_steps": {
      "type": "array",
      "minItems": 4,
      "items": { "$ref": "#/$defs/verifyStep" }
    },
    "proofs": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/proof" }
    }
  },
  "$defs": {
    "verifyStep": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "label", "command", "expect", "url"],
      "properties": {
        "id": { "type": "string", "minLength": 3 },
        "label": { "type": "string", "minLength": 3 },
        "command": { "type": "string", "minLength": 12 },
        "expect": { "type": "string", "minLength": 16 },
        "url": { "type": "string", "format": "uri" }
      }
    },
    "proof": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "kind",
        "title",
        "state",
        "status",
        "description",
        "updated_at",
        "primary_url",
        "identifiers",
        "checks"
      ],
      "properties": {
        "id": { "type": "string", "minLength": 3 },
        "kind": {
          "enum": [
            "receipt_bundle",
            "conformance_evidence",
            "mcp_endpoint",
            "widget_package",
            "mainnet_gate",
            "activity_event"
          ]
        },
        "title": { "type": "string", "minLength": 3 },
        "state": { "enum": ["live", "pending", "blocked", "degraded"] },
        "status": { "type": "string", "minLength": 1 },
        "description": { "type": "string", "minLength": 12 },
        "updated_at": { "type": ["string", "null"] },
        "primary_url": { "type": "string", "format": "uri" },
        "api_url": { "type": "string", "format": "uri" },
        "explorer_url": { "type": ["string", "null"], "format": "uri" },
        "identifiers": {
          "type": "object",
          "additionalProperties": {
            "type": ["string", "null"]
          }
        },
        "checks": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["label", "state", "value"],
            "properties": {
              "label": { "type": "string", "minLength": 2 },
              "state": { "enum": ["live", "pending", "blocked", "degraded"] },
              "value": { "type": "string" }
            }
          }
        }
      }
    }
  }
}
