CREATE TABLE IF NOT EXISTS ask_events (
    id BIGSERIAL PRIMARY KEY,
    query TEXT NOT NULL,
    user_id BIGINT REFERENCES users(id),
    completeness TEXT,
    synthesis_status TEXT,
    confidence TEXT,
    refused BOOLEAN DEFAULT false,
    classifier_verdict TEXT,
    max_rerank_score REAL,
    aggregate_score REAL,
    hallucination_flags JSONB DEFAULT '[]',
    evidence_count INT,
    citation_count INT,
    defense_layers JSONB,
    total_ms INT,
    created_at TIMESTAMPTZ DEFAULT now()
)
