{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://getzero.dev/contracts/zero.marketplace.seller_disclosure.v0.schema.json",
  "title": "ZERO marketplace seller disclosure v0",
  "description": "Public contract for seller disclosure review requirements. The review workflow is not enabled and cannot approve sellers, enable paid calls, configure x402, or move funds.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "schema",
    "kind",
    "public",
    "generated_at",
    "canonical_url",
    "paid_call_gate_url",
    "paid_call_gate_schema",
    "paid_response_receipt_schema",
    "status",
    "review_workflow",
    "required_seller_fields",
    "required_listing_disclosures",
    "seller_receipt_template",
    "paid_response_receipt_policy",
    "listings",
    "blockers"
  ],
  "properties": {
    "schema_version": { "const": "zero.marketplace.seller_disclosure.v0" },
    "schema": { "const": "https://getzero.dev/contracts/zero.marketplace.seller_disclosure.v0.schema.json" },
    "kind": { "const": "marketplace_seller_disclosure_contract" },
    "public": { "const": true },
    "generated_at": { "type": "string", "format": "date-time" },
    "canonical_url": { "const": "https://getzero.dev/api/market/seller-disclosure" },
    "paid_call_gate_url": { "const": "https://getzero.dev/api/market/paid-call-gate" },
    "paid_call_gate_schema": { "const": "https://getzero.dev/contracts/zero.marketplace.paid_call_gate.v0.schema.json" },
    "paid_response_receipt_schema": { "const": "https://getzero.dev/contracts/zero.marketplace.paid_response_receipt.v0.schema.json" },
    "status": { "const": "review_workflow_not_enabled" },
    "review_workflow": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "enabled",
        "persistence",
        "can_approve_seller",
        "can_enable_paid_calls",
        "can_configure_x402",
        "can_move_funds",
        "auth_required_for_future_reviews"
      ],
      "properties": {
        "enabled": { "const": false },
        "persistence": { "const": "repo_ready_migration_required" },
        "can_approve_seller": { "const": false },
        "can_enable_paid_calls": { "const": false },
        "can_configure_x402": { "const": false },
        "can_move_funds": { "const": false },
        "auth_required_for_future_reviews": { "const": true }
      }
    },
    "required_seller_fields": {
      "type": "array",
      "minItems": 5,
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 3 }
    },
    "required_listing_disclosures": {
      "type": "array",
      "minItems": 6,
      "uniqueItems": true,
      "items": { "type": "string", "minLength": 6 }
    },
    "seller_receipt_template": {
      "type": "object",
      "additionalProperties": false,
      "required": ["schema_version", "status", "required_fields", "forbidden_claims", "execution_boundary"],
      "properties": {
        "schema_version": { "const": "zero.marketplace.seller_review_receipt.v0" },
        "status": { "const": "draft_only" },
        "required_fields": { "type": "array", "minItems": 10, "items": { "type": "string" } },
        "forbidden_claims": { "type": "array", "minItems": 3, "items": { "type": "string" } },
        "execution_boundary": {
          "type": "object",
          "additionalProperties": false,
          "required": ["receipt_can_enable_paid_calls", "receipt_can_execute_orders", "receipt_can_move_funds"],
          "properties": {
            "receipt_can_enable_paid_calls": { "const": false },
            "receipt_can_execute_orders": { "const": false },
            "receipt_can_move_funds": { "const": false }
          }
        }
      }
    },
    "paid_response_receipt_policy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "schema",
        "delivery_enabled",
        "payment_required",
        "replay_retention_required",
        "public_replay_or_private_receipt_required",
        "private_prompt_redaction_required",
        "refund_policy_required"
      ],
      "properties": {
        "schema": { "const": "https://getzero.dev/contracts/zero.marketplace.paid_response_receipt.v0.schema.json" },
        "delivery_enabled": { "const": false },
        "payment_required": { "const": false },
        "replay_retention_required": { "const": true },
        "public_replay_or_private_receipt_required": { "const": true },
        "private_prompt_redaction_required": { "const": true },
        "refund_policy_required": { "const": true }
      }
    },
    "listings": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/listing" }
    },
    "blockers": { "type": "array", "minItems": 3, "items": { "type": "string", "minLength": 3 } }
  },
  "$defs": {
    "listing": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "listing_id",
        "supplier_id",
        "kind",
        "current_compensation_label",
        "disclosure_status",
        "paid_response_receipts_enabled",
        "paid_calls_eligible",
        "required_receipts_before_paid_calls"
      ],
      "properties": {
        "listing_id": { "type": "string", "minLength": 3 },
        "supplier_id": { "type": "string", "minLength": 3 },
        "kind": { "enum": ["skill", "strategy", "signal", "dataset", "evaluator"] },
        "current_compensation_label": { "enum": ["none", "x402_disabled"] },
        "disclosure_status": { "const": "review_required" },
        "paid_response_receipts_enabled": { "const": false },
        "paid_calls_eligible": { "const": false },
        "required_receipts_before_paid_calls": {
          "type": "array",
          "minItems": 3,
          "items": { "type": "string", "minLength": 3 }
        }
      }
    }
  }
}
