carlos / platform Public

Fleet alerts Plan 2: Astra plan review brief R2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev b7ae2e33e1459d878ec924750c450565a89c5d90 parent cda7a66
1 file changed, +93 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-alerts-2-plan-R2.md +93 −0

CI failed — run details

Intent

Attributed to this commit: 32.9 g CO₂e (3,403,186 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on fleet-alerts-2-traffic, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-alerts-2-plan-R2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-alerts-2-plan-R2.md
new file mode 100644
index 000000000..a0bf3d2d5
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-fleet-alerts-2-plan-R2.md
@@ -0,0 +1,93 @@
+# Review brief: fleet alerts Plan 2 (fleet traffic) plan, round 2 of 3
+
+Repo carlos/platform, branch `fleet-alerts-2-traffic`. The commit is named in the reviewer's prompt.
+Under review: `docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md` (rev 2).
+Authorities, all MERGED on main:
+- `docs/superpowers/specs/2026-10-30-fleet-alerts-and-traffic-design.md`, APPROVED. Plan 2 is §11 item 2, with §10, §9, §7.2 and the two Plan 2 rows of §7.1.
+- `docs/superpowers/plans/2026-10-30-fleet-alerts-1-engine-connectors.md` (rev 4, merged 27173ed), and the engine code it built in `internal/console/alert*.go`.
+- `AGENTS.md`.
+
+Do not review against unmerged branches. If this work needs one, say so as a P1 and stop.
+
+You are an independent reviewer. Read the plan, then the code it names, and check every claim against that code. Line numbers were taken at 11c8c864.
+
+## Fixed: do not re-argue
+
+- **Paul's rulings in spec §2:** layout A, four tiles; noise is the anti-goal; order engine, then traffic, then account and app alerts.
+- **Spec §9:** no new bucket objects, and the counters ride the heartbeat. Reading the usage edge day instead is out.
+- **Plan 1 build rulings** (amadan discussion 495), especially:
+ - R-25: the 24 h heartbeat listing horizon.
+ - R-41: no unconditional fallbacks after conditional-read errors.
+ - R-17: incident `Members` are the members firing now.
+- **The author's calls, which are not defects unless they break the spec:**
+ - Daily bars for the 30 d range.
+ - No region filter in v1.
+ - Busiest apps not linked, since no operator app view exists.
+ - Capacity omits "region has no room" until that rule is on the engine.
+ - Rate refusals counted enforced and observed apart.
+ - Unknown hosts counted only at the outsider call sites.
+
+Report only mechanisms that fail to honour these.
+
+## What to check
+
+1. **Counted once and agreeing with `/fleet/protection`.**
+ - The edge choke points named in Task 2 (`internal/edge/edge.go` observer defer, `assetcatch.go` `serveAssetFar` defer, `guard.go` `observeGuardCount`, `ratelimit.go`, `planthrottle.go`, `answered.go`): does every answered request land in exactly one of Refused or a class?
+ - Are hopped, backhauled, tunnelled and far-asset requests each counted once fleet-wide?
+ - Do Blocked and Watched equal the usage meter's guard counts?
+ - Does the `outcome` really reach `rateAdmit` and `planThrottleAdmit` on every path that can refuse?
+2. **Hostile input.** Unknown hostnames, paths and every heartbeat field are box- or attacker-controlled.
+ - Are the edge key caps, the heartbeat size, the console sanitising and the template escaping enough?
+ - Can one box's heartbeat poison fleet sums, for example with huge counts, forged starts, or a label collision?
+3. **Gaps and evaluation timing.** Heartbeats are written every 5-6 min with jitter, and the engine reads them every 5th one-minute pass.
+ - Are the `fleet_5xx` windows (`cur-20m..cur-10m`) and the `abuse_surge` windows reliably present when evaluated?
+ - Does "not complete" hold state without Gone or a false clear, given `withGone` and `keepMissing` in `internal/console/alertsignals.go`?
+ - Is the hysteresis via `AlertFiring` consistent with how `stepIncidents` (`alertengine.go`) treats Firing?
+4. **Request budget.** Does anything in Tasks 3-5 add a store call (`TestEnginePassFiveCycleRequests`)?
+5. **Tiles and alerts never disagree** (spec anti-goal "Contradiction"). Is the tile state read from the same incidents the engine opens? Do the tile rule IDs match `alertRuleLevels`?
+6. **Buildability.**
+ - Would each task's named interfaces compile against the code as it is? Check `Probes`, the `BoxMetrics` attach condition, the `agent.go` edge-ready callback, `outcomeFrom`, `alertThreshold`, `alertRuleOrder` and the record-write census selection at `internal/provision/plan9_b8_census_test.go:369`.
+ - Are the registry and perf tests a new operator route moves listed?
+7. **Census.** Is anything in Tasks 1-3 a new root read, beyond "body" changes?
+8. **Proportion.** Is anything here more than the spec asks for Plan 2? Is anything the spec asks for missing (§10.1 fields, §10.3 page parts, §7.1 Plan 2 rules, §13 tile test)?
+
+## Round 2
+
+Earlier rounds: `docs/superpowers/reviews/CODEX-FINDINGS-fleet-alerts-2-plan-R1.md` (4 P1s and 1 P2). The round number counts every earlier review of this plan, under any file name or reviewer.
+
+First give one line per P1 and P2 from round 1: resolved, partly, or not. The plan's "R1 dispositions" section says how each was addressed. Carry every unresolved or partly resolved finding forward at its current severity, then add new findings. The verdict covers everything outstanding, earlier rounds included.
+
+New mechanisms in rev 2 to check hardest:
+- the counting-owner rule for forwarded requests (the delivered flag)
+- the watermark and interval judging
+- "missing evidence never clears"
+- per-box coverage
+- `TrimTrafficWindow`
+
+## 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 any newly changed security, root, termination or production-storage behaviour, still check the fix; see AGENTS.md, "Stopping rules".
+- **P3:** clarity or polish. Goes on a follow-up list, and is never a reason for another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open.
+
+## Output
+
+Rank findings P1, then P2, then P3. Each finding gives:
+- the section or task
+- the problem
+- the evidence (file:line, verified)
+- the failure scenario
+- a concrete fix
+- the invariant or trust boundary it breaks (its fault family)
+
+End with exactly one verdict:
+
+- **READY:** no P1 and no P2.
+- **READY AFTER FIXES:** no P1. The listed P2s are fixed without another round.
+- **NOT READY:** one or more P1s, listed.
+
+In round 3, a NOT READY also says whether the P1s share one cause, and whether refusing the case up front or cutting the feature would remove them.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites.