carlos / platform Public

Record the first demo abuse alert review brief

claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 0bef0a68f3265dd0b9af1615732992816d10131e parent 5c9fb44
1 file changed, +67 −0
  • docs/superpowers/reviews/REVIEW-BRIEF-demo-abuse-alerts-R1.md +67 −0
diff --git a/docs/superpowers/reviews/REVIEW-BRIEF-demo-abuse-alerts-R1.md b/docs/superpowers/reviews/REVIEW-BRIEF-demo-abuse-alerts-R1.md
new file mode 100644
index 000000000..10393c713
--- /dev/null
+++ b/docs/superpowers/reviews/REVIEW-BRIEF-demo-abuse-alerts-R1.md
@@ -0,0 +1,67 @@
+# Review brief: demo abuse alerts implementation, round 1 of 3
+
+Repo carlos/platform, branch `demo-abuse-alerts`, implementation commit
+`5c9fb44b5deae7a4236ea019b5c5f2abe48337fc`.
+Under review: diff `9622c65a159480a687f066f7a24e28a31c68360d..5c9fb44b5deae7a4236ea019b5c5f2abe48337fc`.
+Authorities: merged `docs/superpowers/specs/2026-11-02-agent-start-demo-design.md`
+section 4.6 and `docs/superpowers/notes/agent-start-demo-2-rulings.md`.
+The task brief is `/home/paulca/.cache/demo-abuse-basics/ASTRA-BRIEF.md`.
+
+You are an independent Opus reviewer. Read the note, then the code it names,
+and check every claim against that code. Work only in this checkout. Read-only:
+no edits, commits, pushes, AWS, other checkouts or HANDOFF files.
+
+## Fixed: do not re-argue
+
+- Off by default, thresholds adjustable. The task explicitly permits console
+ environment settings if justified and draft copy for Paul to edit later.
+- All alert inputs are SQLite. No new S3 reads or polling. Existing startup
+ mail identity ensure already runs; caching its returned verified record adds
+ no read. SendReady must never ensure or verify anything itself.
+- No merge or activation is authorised. This is a local implementation review,
+ including its changed SQL gate and mail path, before returning the branch.
+- This is round 1; there are no earlier independent review findings.
+
+## What to check
+
+1. Thresholds, UTC windows, top-K IP budgets, salted /24 and /48 hashes,
+ retention, migration idempotence and bounded refusal storage.
+2. HTTP refusal counting must never authorise a request or count an update as
+ a create; failure to persist must preserve the original refusal.
+3. The SQL NonApp classifications must not weaken any app gate. Host-claim
+ mode must refuse alert evaluation. No root-binary files are changed.
+4. Recipient authority matches apiSystemRoller (system operators plus ops
+ owners), and alert text contains no attacker-controlled report/IP data.
+5. No repeated successful notification while firing; quiet observations rearm.
+ Failure retries per recipient, persisted across restart. AlertSeen demo rows
+ must not enter fleet cutover. The direct path's crash-after-send duplicate
+ window and retry-only-while-firing limitation are documented.
+6. Daily report digest and strict greater-than-N immediate report threshold;
+ disable switches; restart behaviour and mail readiness without extra reads.
+7. Existing mail Send semantics must remain intact. SendReady uses only a
+ verified cached identity, including the record returned by startup ensure.
+8. Tests and note accurately describe behaviour. New tests use injected time
+ and no sleeps. Targeted demo/alert regression run is ongoing; initial new
+ tests, vet, build and whole-tree gofmt passed. A fleet-cutover exclusion test
+ was added afterward and its focused run is ongoing.
+
+## Severity
+
+- P1: unsafe, would not compile, a test fails, or it would not work. Blocks merge.
+- P2: wrong or missing. Fixed without reopening this review. The census and
+ review of newly changed security, root, termination or production-storage
+ behaviour still check the fix within the same round budget.
+- P3: clarity or polish. Follow-up only; never a reason for another round.
+
+A P1 states its failure scenario and evidence (file:line). Do not promote a
+P2 to P1 to keep the review open. Two rounds in one fault family stop fixing;
+a fourth round needs Paul. Stop at the first round with no P1.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the problem, verified file:line evidence,
+failure scenario, concrete fix, and invariant or trust boundary (fault family).
+End with exactly one verdict: READY (no P1/P2), READY AFTER FIXES (P2 only), or
+NOT READY (P1). Do not edit files, spawn reviewers or subagents, or run full
+suites. You may run a narrowly targeted test if necessary, nice -n 10, default
+Go cache, disk TMPDIR. Return your findings as the final response.