{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oakandsparrow.io/buying-guide.schema.json",
  "title": "Oak & Sparrow Buying Guide Agent Handoff",
  "description": "Human-controlled, read-only buyer-to-agent research exchange. No authority or purchase is granted.",
  "$defs": {
    "selection": {
      "type": "object",
      "required": ["industry", "actor", "action", "path", "jurisdiction"],
      "additionalProperties": false,
      "properties": {
        "industry": { "enum": ["Financial services", "Healthcare", "Insurance", "Legal technology", "Institutional education", "Other"] },
        "actor": { "enum": ["AI agent", "Human assisted by AI", "Workflow automation", "Not sure yet"] },
        "action": { "enum": ["Recommend or draft", "Read or analyze", "Send or publish", "Move money or change records", "Make another consequential action"] },
        "path": { "enum": ["Not sure yet", "Standalone Policy Packs", "Gatekeeper runtime", "Evaluate both separately", "Neither until fit is established"] },
        "jurisdiction": { "enum": ["United States, multiple jurisdictions", "California", "Colorado", "Other U.S. state", "International or mixed", "Not yet established"] }
      }
    },
    "evidence": {
      "type": "object",
      "required": ["claim", "source", "status"],
      "additionalProperties": false,
      "properties": {
        "claim": { "type": "string", "maxLength": 1200 },
        "source": { "type": "string", "maxLength": 1000 },
        "status": { "enum": ["verified", "unverified"] }
      }
    }
  },
  "oneOf": [
    {
      "type": "object",
      "required": ["kind", "version", "origin", "selections", "publicSources", "task", "replyFormat"],
      "properties": {
        "kind": { "const": "oasse.buying-guide.request" },
        "version": { "const": "1.0" },
        "origin": { "const": "Oak & Sparrow Buying Guide" },
        "selections": { "$ref": "#/$defs/selection" },
        "publicSources": { "type": "array", "items": { "type": "string", "format": "uri" } },
        "task": { "type": "string" },
        "replyFormat": { "type": "object" }
      },
      "additionalProperties": false
    },
    {
      "type": "object",
      "required": ["kind", "version", "summary", "recommendedPath", "evidence", "risks", "questions", "humanReviewRequired"],
      "additionalProperties": false,
      "properties": {
        "kind": { "const": "oasse.buying-guide.response" },
        "version": { "const": "1.0" },
        "summary": { "type": "string", "minLength": 1, "maxLength": 3000 },
        "recommendedPath": { "enum": ["standalone-policy-packs", "gatekeeper", "both-evaluate-separately", "no-product-fit", "needs-review"] },
        "evidence": { "type": "array", "maxItems": 16, "items": { "$ref": "#/$defs/evidence" } },
        "risks": { "type": "array", "maxItems": 16, "items": { "type": "string", "maxLength": 1200 } },
        "questions": { "type": "array", "maxItems": 16, "items": { "type": "string", "maxLength": 1200 } },
        "humanReviewRequired": { "const": true }
      }
    }
  ]
}
