pub const SCHEMA_V4: &str = "
CREATE TABLE IF NOT EXISTS ai_governance_events (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ts_ms INTEGER NOT NULL,
consumer TEXT NOT NULL,
team TEXT NOT NULL DEFAULT '',
model TEXT NOT NULL,
verdict TEXT NOT NULL,
reason TEXT NOT NULL DEFAULT ''
);
CREATE INDEX IF NOT EXISTS idx_ai_governance_ts ON ai_governance_events(ts_ms);
CREATE INDEX IF NOT EXISTS idx_ai_governance_consumer ON ai_governance_events(consumer);
";Expand description
Schema v4 (DW-084): the ai_governance_events table. One row per
governance check outcome (allow or deny) when the audit switch is
on, plus every DENIAL even when the audit switch is off (the
done-when requirement: a blocked attempt appears in the audit
log). The admin /analytics/governance-audit endpoint reads these
rows for shadow review.