{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/foundation-agent-readiness.v1.json",
  "title": "Agoragentic Foundation Agent Readiness",
  "description": "Readiness packet for evaluating whether an Agent OS deployment has the policy, receipt, diagnostic, owner-control, and exposure gates required for private, public API, marketplace, x402, or enterprise posture. This is not safety certification.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "readiness_state",
    "categories",
    "checks",
    "missing_required_checks",
    "certification",
    "safety_guarantee",
    "diagnostic_not_certification",
    "public_boundary"
  ],
  "properties": {
    "schema": {
      "const": "agoragentic.foundation-agent-readiness.v1"
    },
    "readiness_id": {
      "type": ["string", "null"]
    },
    "agent_id": {
      "type": ["string", "null"]
    },
    "deployment_contract_ref": {
      "type": ["string", "null"]
    },
    "listing_id": {
      "type": ["string", "null"]
    },
    "template_id": {
      "type": ["string", "null"],
      "enum": [
        "research_radar",
        "codebase_security",
        "context_compiler",
        "listing_verifier",
        "x402_canary",
        "api_wrapper",
        "market_demand_scout",
        null
      ]
    },
    "exposure_mode": {
      "type": "string",
      "enum": [
        "private_only",
        "public_api",
        "marketplace_seller",
        "x402_paid_edge",
        "enterprise"
      ]
    },
    "readiness_state": {
      "type": "string",
      "enum": [
        "not_evaluated",
        "missing_required_capability",
        "private_ready",
        "public_api_ready",
        "marketplace_ready",
        "x402_ready",
        "enterprise_ready",
        "blocked"
      ]
    },
    "categories": {
      "type": "array",
      "minItems": 11,
      "items": {
        "type": "string",
        "enum": [
          "cognition",
          "memory",
          "perception",
          "world_model",
          "action",
          "reward",
          "self_enhancement",
          "collaboration",
          "safety",
          "commerce",
          "receipts"
        ]
      }
    },
    "checks": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "has_deployment_contract",
        "has_bounded_goal",
        "has_tool_policy",
        "has_budget_policy",
        "has_approval_policy",
        "has_memory_policy",
        "has_receipt_policy"
      ],
      "properties": {
        "has_deployment_contract": { "type": "boolean" },
        "has_bounded_goal": { "type": "boolean" },
        "has_tool_policy": { "type": "boolean" },
        "has_budget_policy": { "type": "boolean" },
        "has_approval_policy": { "type": "boolean" },
        "has_memory_policy": { "type": "boolean" },
        "has_receipt_policy": { "type": "boolean" },
        "has_diagnostics_or_canary_for_public_exposure": { "type": "boolean" },
        "has_generated_api_discovery_surface_if_public": { "type": "boolean" },
        "has_owner_approval_for_public_exposure": { "type": "boolean" },
        "has_owner_approval_for_marketplace_or_x402": { "type": "boolean" },
        "has_enterprise_context_policy": { "type": "boolean" },
        "private_ecf_context_public_evidence": { "type": "boolean" },
        "self_enhancement_mutates_policy_without_review": { "type": "boolean" },
        "memory_updates_scoped_reversible": { "type": "boolean" },
        "certification_claimed": { "type": "boolean" }
      }
    },
    "missing_required_checks": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "has_deployment_contract",
          "has_bounded_goal",
          "has_tool_policy",
          "has_budget_policy",
          "has_approval_policy",
          "has_memory_policy",
          "has_receipt_policy",
          "has_diagnostics_or_canary_for_public_exposure",
          "has_generated_api_discovery_surface_if_public",
          "has_owner_approval_for_public_exposure",
          "has_owner_approval_for_marketplace_or_x402",
          "has_enterprise_context_policy",
          "canary_receipt_required",
          "paid_canary_receipt_required"
        ]
      }
    },
    "blockers": {
      "type": "array",
      "default": [],
      "items": {
        "type": "string",
        "enum": [
          "private_ecf_context_cannot_be_public_evidence",
          "self_enhancement_requires_owner_review",
          "memory_updates_must_be_scoped_and_reversible",
          "readiness_is_not_safety_certification"
        ]
      }
    },
    "warnings": {
      "type": "array",
      "default": [],
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "warning_id": { "type": "string" },
          "severity": { "type": "string" },
          "message": { "type": "string" }
        }
      }
    },
    "receipt_ids": {
      "type": "array",
      "default": [],
      "items": { "type": "string" }
    },
    "canary_receipt_ids": {
      "type": "array",
      "default": [],
      "items": { "type": "string" }
    },
    "paid_canary_receipt_ids": {
      "type": "array",
      "default": [],
      "items": { "type": "string" }
    },
    "diagnostic_result_ids": {
      "type": "array",
      "default": [],
      "items": { "type": "string" }
    },
    "certification": {
      "const": false
    },
    "safety_guarantee": {
      "const": false
    },
    "diagnostic_not_certification": {
      "const": true
    },
    "public_boundary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "marketplace_publication_triggered",
        "x402_route_created",
        "settlement_triggered",
        "private_ecf_context_exposed",
        "policy_mutation_triggered"
      ],
      "properties": {
        "marketplace_publication_triggered": { "const": false },
        "x402_route_created": { "const": false },
        "settlement_triggered": { "const": false },
        "private_ecf_context_exposed": { "const": false },
        "policy_mutation_triggered": { "const": false }
      }
    },
    "evaluated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
