gstack/supabase/migrations
Garry Tan a5588ec061
feat(supabase): schema migration for attack_attempt telemetry fields
Extends telemetry_events with five nullable columns:
  * security_url_domain   (hostname only, never path/query)
  * security_payload_hash (salted SHA-256 hex)
  * security_confidence   (numeric 0..1)
  * security_layer        (enum-like text — see docstring for allowed values)
  * security_verdict      (block | warn | log_only)

Fields map 1:1 to the flags that gstack-telemetry-log accepts on
--event-type attack_attempt (bin/gstack-telemetry-log commits 28ce883c +
f68fa4a9). All nullable so existing skill_run inserts keep working.

Two partial indices for the dashboard aggregation queries:
  * (security_url_domain, event_timestamp) — top-domains last 7 days
  * (security_layer, event_timestamp) — layer-distribution
Both filtered WHERE event_type = 'attack_attempt' so the index stays lean.

RLS policies (anon_insert, anon_select) from 001_telemetry already
cover the new columns — no RLS changes needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 04:58:08 +08:00
..
001_telemetry.sql feat: opt-in usage telemetry + community intelligence platform (v0.8.6) (#210) 2026-03-19 17:21:05 -07:00
002_tighten_rls.sql fix: Supabase telemetry security lockdown (v0.11.16.0) (#460) 2026-03-24 15:01:31 -07:00
003_installations_upsert_policy.sql fix: community security wave — 8 PRs, 4 contributors (v0.15.13.0) (#847) 2026-04-06 00:47:04 -07:00
004_attack_telemetry.sql feat(supabase): schema migration for attack_attempt telemetry fields 2026-04-20 04:58:08 +08:00