{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/schemas/offer-ecosystem.schema.json",
  "title": "Offer Ecosystem System",
  "type": "object",
  "required": ["description", "objective", "offer_ecosystem"],
  "properties": {
    "description": { "type": "string", "minLength": 1 },
    "objective": { "type": "string", "minLength": 1 },
    "offer_ecosystem": {
      "type": "object",
      "required": ["objective", "why", "sourceStudy", "funnelLayers", "funnelPaths", "agentWorkflow", "antiPatterns", "qaGates", "passCriteria", "objectiveAlignment"],
      "properties": {
        "objective": { "type": "string", "minLength": 1 },
        "why": { "type": "string", "minLength": 1 },
        "sourceStudy": {
          "type": "object",
          "required": ["name", "sourceBoundary", "sourceManifest", "studiedPatterns"]
        },
        "funnelLayers": {
          "type": "array",
          "minItems": 6,
          "items": {
            "type": "object",
            "required": ["id", "layer", "websiteRole", "why", "pageElements", "proofNeeds", "guardrails"]
          }
        },
        "funnelPaths": {
          "type": "array",
          "minItems": 2,
          "items": {
            "type": "object",
            "required": ["id", "useWhen", "sequence", "why", "agentCheck"]
          }
        },
        "agentWorkflow": { "type": "array", "minItems": 5 },
        "antiPatterns": {
          "type": "array",
          "minItems": 4,
          "items": {
            "type": "object",
            "required": ["id", "issue", "fix"]
          }
        },
        "qaGates": { "type": "array", "minItems": 1 },
        "passCriteria": { "type": "array", "minItems": 1 },
        "objectiveAlignment": { "type": "string", "minLength": 1 }
      }
    }
  }
}
