{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://torneo.ai/schemas/buyer_decision.v1",
  "title": "buyer_decision.v1",
  "description": "P-3 and P-6: a decision taken by a real external buyer (C6 admitted, suspended attestation refused by the agent), possibly a renewal. Shape of the fields check_finalite reads; extra evidence fields are allowed. Dated, not synthetic and bound by sha256 to files of the repository (receipts/gates/<schema>/*.json).",
  "type": "object",
  "required": [
    "schema",
    "synthetic",
    "observed_on",
    "buyer",
    "c6_admitted",
    "agent_refused_suspended",
    "dossier_ref"
  ],
  "properties": {
    "schema": {
      "const": "buyer_decision.v1"
    },
    "synthetic": {
      "type": "boolean",
      "description": "Only false counts (gate_common.read_receipts)."
    },
    "observed_on": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}"
    },
    "buyer": {
      "type": "object",
      "required": [
        "name",
        "external"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "external": {
          "type": "boolean"
        }
      }
    },
    "c6_admitted": {
      "type": "boolean"
    },
    "agent_refused_suspended": {
      "type": "boolean"
    },
    "dossier_ref": {
      "type": "object",
      "required": [
        "path",
        "sha256"
      ],
      "additionalProperties": false,
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        }
      }
    },
    "renewal": {
      "type": "boolean"
    }
  }
}
