carlos / platform Public

Console Protection tab (per app) and operator /fleet/protection page: say plainly how much bad traffic edge protection caught. The edge counts protection checks and matches per host+account+app (hourly counts and a daily group tally, burst rules excluded, counted where records are filed incl. the far-asset path) into the usage edge day it already writes every 5 minutes: no new storage writes. The console reads root and fleet edge days through the settled-day cache, scoping fleets by owning account before any I/O (ownerless fleets vouch for nobody; dot segments refused), sums whole UTC days, and renders the tab (headline, share of checked requests, day bars, what they were after, Logs link) and the operator page; Logs gains a protection filter applied before collection caps. No coverage claims (Paul's ruling): zero checked reads 'No protection counts yet'. Rate-limit counts move onto the shared reader and now include fleet boxes. Also fixes a race in three #471 tunnel tests (the box server now gets the bytes the test's bufio.Reader took). Copy PT-C01..C43 approved by Paul unchanged. Reviews: spec builder check (Astra); plan Astra R1-R3; task reviews (Astra) on Tasks 1-3 with one fix round each; whole-branch Astra R1 with fixes (one test P2 fixed). Census console-protection-tab approved by Astra on #280 (re-approved after merging main twice). Follow-ups in discussion 479. Not released.

Squashed from design-console-protection-tab into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 66c324fd3937d1cbf1c838bb12c9f856f217694e parent d937c46
72 files changed, +4,565 −160
  • docs/superpowers/notes/census-console-protection-tab-claims.md +8 −0
  • docs/superpowers/notes/census-proposal-console-protection-tab.md +39 −0
  • docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md +73 −0
  • docs/superpowers/plans/2026-10-30-console-protection-tab.md +397 −0
  • docs/superpowers/plans/CODEX-FINDINGS-CONSOLE-PROTECTION-TAB-PLAN-R1.md +47 −0
  • docs/superpowers/plans/CODEX-FINDINGS-CONSOLE-PROTECTION-TAB-PLAN-R2.md +48 −0
  • docs/superpowers/plans/CODEX-FINDINGS-CONSOLE-PROTECTION-TAB-PLAN-R3.md +41 −0
  • docs/superpowers/specs/2026-10-30-console-protection-tab-design.md +305 −0
  • docs/superpowers/specs/CODEX-FINDINGS-CONSOLE-PROTECTION-TAB.md +23 −0
  • fleet_public_routes_e2e_test.go +2 −2
  • internal/applog/filter.go +8 −0
  • internal/applog/filter_test.go +2 −0
  • internal/console/apiinstances_ratelimit.go +26 −49
  • internal/console/apiinstances_ratelimit_test.go +1 −1
  • internal/console/apilogs.go +7 −0
  • internal/console/appnav_test.go +2 −2
  • internal/console/approved_protection_copy_test.go +125 −0
  • internal/console/claim_invariant_fixtures_test.go +4 −0
  • internal/console/claim_invariant_probes_read_test.go +4 −0
  • internal/console/edgedays.go +180 −0
  • internal/console/edgedays_test.go +365 −0
  • internal/console/opshell.go +1 −0
  • internal/console/opshell_test.go +2 −2
  • internal/console/perfwalk_test.go +1 −1
  • internal/console/protection.go +182 −0
  • internal/console/protection_test.go +222 −0
  • internal/console/protectiongroups.go +39 −0
  • internal/console/protectionview.go +388 −0
  • internal/console/protectionview_test.go +658 −0
  • internal/console/server.go +18 −0
  • internal/console/templates/app_logs.html +13 −0
  • internal/console/templates/app_protection.html +52 −0
  • internal/console/templates/appnav.html +1 −0
  • internal/console/templates/fleet_protection.html +60 −0
  • internal/console/templates/layout.html +9 −0
  • internal/console/testdata/claim-routes.txt +4 −0
  • internal/console/testdata/perf-budgets.txt +4 −0
  • internal/console/usagedays.go +21 −6
  • internal/console/usagedays_test.go +112 −0
  • internal/edge/asset_e2e_test.go +1 −1
  • internal/edge/asset_far_test.go +5 −5
  • internal/edge/asset_local_test.go +6 −6
  • internal/edge/assetcatch.go +8 −3
  • internal/edge/backhaul_e2e_test.go +2 −2
  • internal/edge/compress_test.go +1 −1
  • internal/edge/edge.go +5 −0
  • internal/edge/edge_test.go +1 −1
  • internal/edge/forwardha_test.go +1 −1
  • internal/edge/gate_test.go +1 −1
  • internal/edge/guard.go +21 −0
  • internal/edge/guard_usage_test.go +359 −0
  • internal/edge/path_test.go +1 −1
  • internal/edge/planthrottle_test.go +1 −1
  • internal/edge/ratelimit_test.go +4 −4
  • internal/edge/regional_e2e_test.go +1 −1
  • internal/edge/tunnel_register_race_test.go +6 −2
  • internal/edge/tunnel_upgrade_test.go +3 −1
  • internal/edge/upgrades_test.go +4 −4
  • internal/edge/usagemeter.go +55 −7
  • internal/edge/usagemeter_test.go +81 −5
  • internal/edgeguard/catalogue.go +11 −0
  • internal/edgeguard/catalogue_test.go +14 −0
  • internal/host/applessroute_test.go +1 −1
  • internal/host/usage_loop.go +6 −6
  • internal/host/usage_loop_test.go +36 −6
  • internal/provision/console_protection_tab_census_test.go +43 −0
  • internal/provision/plan9_b8_census_test.go +1 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-console-protection-tab.tsv +16 −0
  • internal/usage/edge.go +127 −13
  • internal/usage/edge_ratelimit_test.go +10 −10
  • internal/usage/edge_test.go +238 −13

CI passed — run details

docs/superpowers/notes/census-console-protection-tab-claims.md

Loading diff…

docs/superpowers/notes/census-proposal-console-protection-tab.md

Loading diff…

docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md

Loading diff…

docs/superpowers/plans/2026-10-30-console-protection-tab.md

Loading diff…

docs/superpowers/plans/CODEX-FINDINGS-CONSOLE-PROTECTION-TAB-PLAN-R1.md

Loading diff…

docs/superpowers/plans/CODEX-FINDINGS-CONSOLE-PROTECTION-TAB-PLAN-R2.md

Loading diff…

docs/superpowers/plans/CODEX-FINDINGS-CONSOLE-PROTECTION-TAB-PLAN-R3.md

Loading diff…

docs/superpowers/specs/2026-10-30-console-protection-tab-design.md

Loading diff…

docs/superpowers/specs/CODEX-FINDINGS-CONSOLE-PROTECTION-TAB.md

Loading diff…

fleet_public_routes_e2e_test.go

Loading diff…

internal/applog/filter.go

Loading diff…

internal/applog/filter_test.go

Loading diff…

internal/console/apiinstances_ratelimit.go

Loading diff…

internal/console/apiinstances_ratelimit_test.go

Loading diff…

internal/console/apilogs.go

Loading diff…

internal/console/appnav_test.go

Loading diff…

internal/console/approved_protection_copy_test.go

Loading diff…

internal/console/claim_invariant_fixtures_test.go

Loading diff…

internal/console/claim_invariant_probes_read_test.go

Loading diff…

internal/console/edgedays.go

Loading diff…

internal/console/edgedays_test.go

Loading diff…

internal/console/opshell.go

Loading diff…

internal/console/opshell_test.go

Loading diff…

internal/console/perfwalk_test.go

Loading diff…

internal/console/protection.go

Loading diff…

internal/console/protection_test.go

Loading diff…

internal/console/protectiongroups.go

Loading diff…

internal/console/protectionview.go

Loading diff…

internal/console/protectionview_test.go

Loading diff…

internal/console/server.go

Loading diff…

internal/console/templates/app_logs.html

Loading diff…

internal/console/templates/app_protection.html

Loading diff…

internal/console/templates/appnav.html

Loading diff…

internal/console/templates/fleet_protection.html

Loading diff…

internal/console/templates/layout.html

Loading diff…

internal/console/testdata/claim-routes.txt

Loading diff…

internal/console/testdata/perf-budgets.txt

Loading diff…

internal/console/usagedays.go

Loading diff…

internal/console/usagedays_test.go

Loading diff…

internal/edge/asset_e2e_test.go

Loading diff…

internal/edge/asset_far_test.go

Loading diff…

internal/edge/asset_local_test.go

Loading diff…

internal/edge/assetcatch.go

Loading diff…

internal/edge/backhaul_e2e_test.go

Loading diff…

internal/edge/compress_test.go

Loading diff…

internal/edge/edge.go

Loading diff…

internal/edge/edge_test.go

Loading diff…

internal/edge/forwardha_test.go

Loading diff…

internal/edge/gate_test.go

Loading diff…

internal/edge/guard.go

Loading diff…

internal/edge/guard_usage_test.go

Loading diff…

internal/edge/path_test.go

Loading diff…

internal/edge/planthrottle_test.go

Loading diff…

internal/edge/ratelimit_test.go

Loading diff…

internal/edge/regional_e2e_test.go

Loading diff…

internal/edge/tunnel_register_race_test.go

Loading diff…

internal/edge/tunnel_upgrade_test.go

Loading diff…

internal/edge/upgrades_test.go

Loading diff…

internal/edge/usagemeter.go

Loading diff…

internal/edge/usagemeter_test.go

Loading diff…

internal/edgeguard/catalogue.go

Loading diff…

internal/edgeguard/catalogue_test.go

Loading diff…

internal/host/applessroute_test.go

Loading diff…

internal/host/usage_loop.go

Loading diff…

internal/host/usage_loop_test.go

Loading diff…

internal/provision/console_protection_tab_census_test.go

Loading diff…

internal/provision/plan9_b8_census_test.go

Loading diff…

internal/provision/testdata/plan14-root-reads-chain.tsv

Loading diff…

internal/provision/testdata/plan14-root-reads-console-protection-tab.tsv

Loading diff…

internal/usage/edge.go

Loading diff…

internal/usage/edge_ratelimit_test.go

Loading diff…

internal/usage/edge_test.go

Loading diff…