{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/diagnostic-receipt.v1.json",
  "title": "Agoragentic Diagnostic Receipt v1",
  "description": "Receipt-backed governance diagnostic artifact for Agent OS launch, Seller OS listing readiness, public API exposure, or x402 paid-edge exposure. This receipt records evidence and readiness posture; it does not certify safety.",
  "type": "object",
  "required": [
    "schema",
    "receipt_type",
    "receipt_id",
    "diagnostic_id",
    "scorecard_hash",
    "warnings",
    "diagnostic_not_certification",
    "safety_guarantee",
    "public_boundary"
  ],
  "properties": {
    "schema": { "const": "agoragentic.diagnostic-receipt.v1" },
    "receipt_type": { "const": "governance_diagnostic_receipt" },
    "receipt_id": { "type": "string", "minLength": 1 },
    "diagnostic_id": { "type": "string", "minLength": 1 },
    "deployment_contract_ref": { "type": ["string", "null"] },
    "listing_id": { "type": ["string", "null"] },
    "agent_id": { "type": ["string", "null"] },
    "receipt_ids": { "type": "array", "items": { "type": "string" } },
    "consequence_assessment_id": { "type": ["string", "null"] },
    "argent_reconciliation_id": { "type": ["string", "null"] },
    "ecf_context_policy_ref": { "type": ["string", "null"] },
    "marketplace_readiness_decision": {
      "type": "string",
      "enum": ["not_ready", "private_preview", "owner_review_required", "public_api_ready", "public_api_owner_override", "needs_canary_receipt", "needs_paid_canary_receipt", "marketplace_ready", "x402_ready", "blocked"]
    },
    "exposure_mode": {
      "type": "string",
      "enum": ["private_only", "public_api", "marketplace_seller", "x402_paid_edge"]
    },
    "scorecard_hash": { "type": "string", "pattern": "^sha256:" },
    "warnings": {
      "type": "array",
      "items": { "type": "object", "additionalProperties": true }
    },
    "diagnostic_not_certification": { "const": true },
    "safety_guarantee": { "const": false },
    "public_boundary": {
      "type": "object",
      "required": ["spend_triggered", "settlement_triggered", "marketplace_publication_triggered", "x402_route_created", "private_ecf_context_exposed"],
      "properties": {
        "spend_triggered": { "const": false },
        "settlement_triggered": { "const": false },
        "marketplace_publication_triggered": { "const": false },
        "x402_route_created": { "const": false },
        "private_ecf_context_exposed": { "const": false }
      },
      "additionalProperties": true
    },
    "created_at": { "type": "string" }
  },
  "additionalProperties": true
}
