carlos / platform Public

demo-abuse-alerts

Operator alert on unusual demo creates (#527; a prerequisite for the flagship demo window on FLAGSHIP-CARD section 00).

What changes. A console worker that is off by default, reads only console SQLite (no new S3 reads or polling) and emails system operators and ops owners when:

  • demo creates pass a set share of the rolling daily budget (default 80%);
  • many creates come from the busiest few IP budgets (default 20 from the top 3 in 1 h);
  • many creates come from one IPv4 /24 or IPv6 /48 (default 30 in 1 h; a new HMAC prefix hash made with the admission salt, never a raw IP, gone with its admission row after 24 h);
  • admission refusals spike (default 30 in 10 min; new per-minute counters, pruned after 24 h);
  • abuse reports arrive: immediately for more than N in an hour (default 5), plus a daily digest.

Thresholds come from CONSOLE_DEMO_ALERT_* drop-in settings and take effect when the console restarts. Mail goes through the existing console sender, using only a sender that is already verified and cached. Design, file:line findings and the SQL are in docs/superpowers/notes/demo-abuse-alerts.md. The fleet alert engine was looked at and not reused: its pass needs a release store and box reads, its first message waits 5 min, and its recipients are fleet connectors (cites in the note).

Copy. The operator email text in internal/console/demo_alert_copy.go is a draft. Paul reviews it before switch-on, not before merge (it is off by default). The strings deck is at ~/amadan.net/carlos/demo-alert-copy/copy-review/strings.json.

Review. Implemented by Astra (gpt-6-astra, high). Opus review round 1: no P1, two P2s (a slow mail path held up the fleet pass; late report arrivals and rejected mail), both fixed. A bounded check returned READY. Review is closed under rule 1, and P3s are listed in the review files. Console-only change, so out of root census scope.

Tests. 18 new tests, plus targeted demo, alert and SQL-scope runs: 416 pass and 2 are skipped. CI runs the full suite.

Commits 7
Discussions 0 0 open
Tasks 0/0 done

Discussions

  • No discussions on this branch yet.

Tasks

  • No tasks yet.

Activity