carlos / platform Public

Fleet alerts Plan 2: Astra plan review R2 findings (NOT READY)

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

CI passed — run details

Intent

Human

<task-notification> <task-id>buo2xehoy</task-id> <tool-use-id>toolu_01BdvWfDJTgRbepSH4pCxLaB</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/1f8653ea-6b78-4712-b1ac-1eb863a870a6/tasks/buo2xehoy.output</output-file> <status>completed</status> <summary>Background command "Wait for Astra plan review R2" completed (exit code 0)</summary> </task-notification>

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-fleet-alerts-2-plan-R2.md b/docs/superpowers/reviews/CODEX-FINDINGS-fleet-alerts-2-plan-R2.md
new file mode 100644
index 000000000..26600479a
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-fleet-alerts-2-plan-R2.md
@@ -0,0 +1,65 @@
+Review of `b7ae2e33e1459d878ec924750c450565a89c5d90`, branch `fleet-alerts-2-traffic`, round **2 of 3**. References are verified against that commit. No files were edited, subagents spawned, or test suites run.
+
+- **R1 #1, P1 — Partly resolved.** Per-box coverage handles individual missing windows, but a restarted box can disappear from the expected set. Carried forward as finding 1.
+- **R1 #2, P1 — Partly resolved.** Local forwarding failures now have a hook, but delivered responses and far-asset paths still have missing or duplicate owners. Carried forward as finding 2.
+- **R1 #3, P1 — Resolved for normal heartbeat cadence.** The watermark replaces the insufficient fixed lag. Findings 3–4 concern additional failures in the new mechanism.
+- **R1 #4, P1 — Resolved.** The test now requires 1,500 not to fire and 1,501 to fire.
+- **R1 #5, P2 — Resolved.** Deterministic serialized-size trimming and the escaping-expansion test address the payload bound.
+
+1. **P1 — Task 5: a restarted box can disappear from completeness and permit a false clear.**
+
+ **Problem and evidence:** Expected membership requires a non-empty `Metrics.Traffic` in [plan:394](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:394). However, the counter deliberately reports no windows until a full post-start window completes ([plan:222](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:222)). There is no retained participation state distinguishing that restart from a box that never supported traffic.
+
+ **Failure scenario:** A and B have been reporting, and B caused an open `fleet_5xx` incident. B restarts and publishes a fresh heartbeat with no completed traffic windows. B immediately leaves the expected set. Once A supplies a healthy interval beyond B’s stored observations, that interval is declared complete and clears the incident despite B’s missing measurements. The explicit false signal removes the member at [alertengine.go:206](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/internal/console/alertengine.go:206); unknown-subject protection cannot help.
+
+ **Concrete fix:** Retain traffic participation independently of the latest payload’s non-emptiness. A previously participating, non-stale box with absent traffic must make coverage incomplete. Distinguish initial rollout from missing evidence, including across console restarts. Test a two-box timeline containing a restart and an empty traffic heartbeat.
+
+ **Fault family:** Missing observations must not become healthy fleet measurements. This recurs from R1 #1.
+
+2. **P1 — Task 2: the delivered/unbilled ownership rules still lose and duplicate client answers.**
+
+ **Problem and evidence:** [Plan:239](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:239) makes arrival of response headers sufficient to assign counting to the home. [Plan:48](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:48) assigns every far-asset answer to the far edge while suppressing only acknowledged fills at home. Those predicates do not describe all existing paths.
+
+ **Failure scenarios:**
+
+ - **No owner:** A stale home map forwards to a box that no longer serves the host. The home returns 503 at [edge.go:1956](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/internal/edge/edge.go:1956), before the observer installed at line 2182. The forwarding proxy receives those headers and sets `delivered`, so it also skips counting.
+ - **Two owners:** A far fill receives an unacknowledged home response, or falls back to ordinary forwarding. Home-side plan throttling explicitly returns before `markUnbilled` at [assetcatch.go:374](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/internal/edge/assetcatch.go:374). Fallback forwarding occurs inside the far observer’s lifetime at [assetcatch.go:1145](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/internal/edge/assetcatch.go:1145). The home counts these ordinary answers, and the proposed far-edge rule counts them again.
+ - **Wrong classification after ownership transfer:** An acknowledged fill can receive an enforced rate refusal at [assetcatch.go:413](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/internal/edge/assetcatch.go:413). The home’s traffic call is suppressed by `unbilled`; its `outcome.refused` and rate reason do not cross HTTP to the far edge. The far edge therefore classifies the 429 as `S4xx`, losing `Refused` and the rate counter.
+
+ **Concrete fix:** Define one accounting decision covering early home responses, acknowledged and unacknowledged fills, and fallback forwarding. Receiving headers must not imply that another observer counted them. Ownership transfer must preserve refusal classification. Add two-edge tests for all three cases above, alongside the existing successful-hop and dial-failure tests.
+
+ **Fault family:** Every client answer must have exactly one fleet counting owner, with its classification preserved. This recurs from R1 #2.
+
+3. **P1 — Tasks 4–5: rejected heartbeat timestamps still control the fleet watermark.**
+
+ **Problem and evidence:** Sanitizing occurs inside `IngestTraffic`, whose result contains only an insertion count and error ([plan:317](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:317)). Task 5 then passes the original `boxes` to `trafficSignals`, and `trafficWatermark` reads their `Metrics.Traffic` starts directly ([plan:382](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:382), [plan:390](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:390)).
+
+ **Failure scenario:** One box continually publishes a fresh `GeneratedAt` with a non-empty traffic list containing yesterday’s window starts. Ingest rejects those windows as too old. Nevertheless, the box remains expected and its rejected starts set the minimum watermark behind `trafficEvaluated`. No new interval is judged, even while other boxes report a sustained outage. The fresh heartbeat also prevents `box_silent` from identifying the problem.
+
+ **Concrete fix:** Return a validated per-box observation result from ingestion and use it for scheduling as well as coverage. Rejected timestamps must never control the evaluation cursor. Treat invalid contributions as unknown for clearing, while allowing valid observations from other boxes to be evaluated. Test a fresh heartbeat containing only rejected old starts alongside a healthy reporting stream that develops a breach.
+
+ **Fault family:** Box-controlled input must pass validation before controlling fleet-wide evaluation.
+
+4. **P1 — Task 5: evaluation advances before its incident transition commits.**
+
+ **Problem and evidence:** [Plan:399](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:399) advances `trafficEvaluated` immediately after judging. This runs inside `heartbeatSignals`. The engine subsequently reads incident inputs and commits the transition at [alertengine_pass.go:204](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/internal/console/alertengine_pass.go:204); either operation can fail.
+
+ **Failure scenario:** A breach qualifies in exactly one interval. Traffic ingestion and judging succeed, advancing the cursor, but `CommitAlertStep` fails. No incident is saved. On the next heartbeat pass, evaluation begins after the advanced cursor and never retries that qualifying interval. The stored traffic remains available, but its alert is lost.
+
+ **Concrete fix:** Stage cursor updates and publish them only after `CommitAlertStep` succeeds. Preserve the previous cursor on any intervening failure. Add a failure-injection test where the only qualifying interval’s incident commit fails once, then succeeds on retry without losing or duplicating the fire.
+
+ **Fault family:** Sampling and evaluation must not silently skip qualifying intervals. This is the same invariant as R1 #3, now at the commit boundary.
+
+5. **P2 — Task 5: abuse baselines accept hours already classified as partial.**
+
+ **Problem and evidence:** [Plan:397](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:397) accepts a baseline hour whenever `windows == 12`. But the plan’s own partial-hour definition also requires `box_windows == boxes*12` ([plan:313](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/docs/superpowers/plans/2026-11-01-fleet-alerts-2-traffic.md:313)).
+
+ **Failure scenario:** A contributes all twelve windows while B contributes only one. Seven such historical hours qualify as a full baseline despite missing most of B’s traffic. Their understated median can fire an abuse incident that a complete baseline would not, and bypasses the intended fallback for insufficient history.
+
+ **Concrete fix:** Use the same per-box completeness predicate for baseline eligibility and chart coverage, incorporating finding 1’s participation accounting. Test seven rows with twelve distinct starts but incomplete box coverage; they must not select the full-baseline rule.
+
+ **Fault family:** Missing observations must not become complete fleet measurements.
+
+The missing-observation and counting-owner families remain after two rounds. [AGENTS.md:54](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-alerts-2-traffic/AGENTS.md:54) therefore requires stopping the fix cycle for Paul’s choice: refuse unsupported cases with an operator-visible gate, cut the feature producing them, or enforce each invariant centrally with guard tests or a simulation. I recommend the central-invariant option for participation and response ownership.
+
+**NOT READY:** P1 findings 1–4 block implementation as written.
\ No newline at end of file