{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Federal Preemption Risk Event",
  "description": "Structured intelligence about federal actions that may preempt state AI regulations. Each event includes risk scoring, affected provisions, compliance impact assessment, and RAG-optimized chunks for AI agent consumption.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the preemption event (format: source-type-hash)"
    },
    "type": {
      "type": "string",
      "enum": [
        "executive_order",
        "court_case",
        "court_opinion",
        "doj_action",
        "doj_guidance",
        "federal_rule_proposed",
        "federal_rule_final",
        "agency_guidance",
        "preemption_challenge",
        "enforcement_action"
      ],
      "description": "Classification of the federal action type"
    },
    "title": {
      "type": "string",
      "description": "Official title of the federal action or case name"
    },
    "summary": {
      "type": "string",
      "description": "Plain-language summary of the event and its preemption implications"
    },
    "riskScore": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Calculated preemption risk score (0-100). Higher scores indicate greater likelihood of state law preemption. Critical: 80+, High: 60-79, Medium: 40-59, Low: 0-39"
    },
    "riskLevel": {
      "type": "string",
      "enum": ["low", "medium", "high", "critical"],
      "description": "Risk level classification based on score thresholds"
    },
    "affectedStates": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": ["CO", "CA", "CT", "IL", "TX", "NY", "VA", "WA"]
      },
      "description": "State codes whose AI regulations may be affected by this federal action"
    },
    "affectedProvisions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Specific state law provisions potentially impacted (e.g., 'Colorado SB 24-205', 'Section 6-1-1703')"
    },
    "preemptionBasis": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "express_preemption",
          "field_preemption",
          "conflict_preemption",
          "commerce_clause",
          "supremacy_clause",
          "agency_exclusive",
          "federal_funding_threat"
        ]
      },
      "description": "Legal basis for potential preemption"
    },
    "timeline": {
      "type": "string",
      "enum": ["immediate", "near_term", "medium_term", "long_term", "speculative"],
      "description": "Expected timeline for preemption impact. Immediate: now, Near-term: <6mo, Medium-term: 6-18mo, Long-term: 18+mo"
    },
    "reasoning": {
      "type": "string",
      "description": "Human-readable explanation of the risk assessment"
    },
    "recommendedActions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Specific compliance actions recommended in response to this event"
    },
    "federalAuthority": {
      "type": "string",
      "enum": ["executive_branch", "doj", "ftc", "eeoc", "sec", "cfpb", "hhs", "commerce", "federal_courts", "congress", "multiple"],
      "description": "Federal entity or branch responsible for the action"
    },
    "sourceUrl": {
      "type": "string",
      "format": "uri",
      "description": "Direct URL to the source document (Federal Register, CourtListener, DOJ, etc.)"
    },
    "datePublished": {
      "type": "string",
      "format": "date",
      "description": "Publication or filing date of the federal action"
    },
    "dateEffective": {
      "type": "string",
      "format": "date",
      "description": "Effective date of the rule or order, if applicable"
    },
    "citations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Citation text"
          },
          "citation": {
            "type": "string",
            "description": "Formal legal citation format"
          },
          "type": {
            "type": "string",
            "enum": ["statute", "regulation", "case", "executive_order", "guidance"]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "verified": {
            "type": "boolean",
            "description": "Whether the citation has been verified against source"
          }
        }
      },
      "description": "Legal citations referenced in or related to this event"
    },
    "ragChunks": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique chunk identifier"
          },
          "content": {
            "type": "string",
            "description": "Text content optimized for RAG retrieval"
          },
          "chunkType": {
            "type": "string",
            "enum": ["summary", "holding", "rationale", "requirement", "deadline", "citation"],
            "description": "Semantic classification of chunk content"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string"
              },
              "date": {
                "type": "string"
              },
              "relevanceScore": {
                "type": "number"
              },
              "tokens": {
                "type": "integer",
                "description": "Estimated token count for LLM context management"
              }
            }
          }
        }
      },
      "description": "Pre-chunked content for RAG/vector database ingestion. Each chunk is semantically classified and token-counted for optimal AI agent consumption."
    },
    "complianceDeadlines": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "source": {
            "type": "string"
          },
          "isHard": {
            "type": "boolean",
            "description": "True for statutory deadlines, false for advisory timelines"
          }
        }
      },
      "description": "Key compliance deadlines extracted from the federal action"
    },
    "confidence": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Confidence score in the risk assessment based on data completeness"
    },
    "extractedAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO timestamp when this event was extracted"
    }
  },
  "required": [
    "id",
    "type",
    "title",
    "summary",
    "riskScore",
    "riskLevel",
    "affectedStates",
    "sourceUrl",
    "datePublished",
    "extractedAt"
  ]
}
