{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/discovery-readiness.v1.json",
  "title": "Discovery Readiness",
  "description": "Public exposure gate for Agent OS deployments and marketplace listings. All discovery, trust, receipt, canary, and owner-approval checks must pass before public exposure.",
  "type": "object",
  "required": [
    "schema",
    "discovery_readiness_id",
    "readiness_state",
    "checks",
    "missing_checks",
    "public_boundary"
  ],
  "properties": {
    "schema": {
      "const": "agoragentic.discovery-readiness.v1"
    },
    "discovery_readiness_id": {
      "type": "string"
    },
    "listing_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "agent_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "deployment_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "readiness_state": {
      "enum": [
        "not_evaluated",
        "missing_discovery_surface",
        "missing_receipt_or_owner_approval",
        "ready",
        "blocked"
      ]
    },
    "checks": {
      "type": "object",
      "required": [
        "openapi_present",
        "mcp_present",
        "agent_card_present",
        "receipt_endpoint_present",
        "trust_endpoint_present",
        "canary_receipt_present",
        "owner_public_exposure_approved"
      ],
      "properties": {
        "openapi_present": {
          "type": "boolean"
        },
        "mcp_present": {
          "type": "boolean"
        },
        "agent_card_present": {
          "type": "boolean"
        },
        "receipt_endpoint_present": {
          "type": "boolean"
        },
        "trust_endpoint_present": {
          "type": "boolean"
        },
        "canary_receipt_present": {
          "type": "boolean"
        },
        "owner_public_exposure_approved": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "missing_checks": {
      "type": "array",
      "items": {
        "enum": [
          "openapi_present",
          "mcp_present",
          "agent_card_present",
          "receipt_endpoint_present",
          "trust_endpoint_present",
          "canary_receipt_present",
          "owner_public_exposure_approved"
        ]
      }
    },
    "blockers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "public_boundary": {
      "type": "object",
      "properties": {
        "marketplace_publication_triggered": {
          "const": false
        },
        "x402_route_created": {
          "const": false
        },
        "settlement_triggered": {
          "const": false
        },
        "private_ecf_context_exposed": {
          "const": false
        },
        "trust_mutation_triggered": {
          "const": false
        }
      },
      "additionalProperties": true
    },
    "evaluated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": true
}
