carlos / platform Public

Operator Protection page: nothing caught reads PT-C06, not zeros

When requests were checked platform-wide and none was caught, the page says
"Nothing in the last {days} days looked like an attack." (PT-C06, as the tab
does) instead of "0 requests across 0 apps". The deck rows for PT-C06 and
PT-C53 now name both templates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev b5ffb67dc7017e646de7934b04d15c7c43e6a376 parent c3eaf7e
3 files changed, +8 −8
  • docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md +2 −2
  • internal/console/protectionview_test.go +5 −5
  • internal/console/templates/fleet_protection.html +1 −1

CI passed — run details

diff --git a/docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md b/docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md
index eac2a1645..09737a4d8 100644
--- a/docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md
+++ b/docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md
@@ -43,7 +43,7 @@ The rules (the same as the analytics on-ramp deck,
| PT-C03 | templates/app_protection.html (blocking headline) | (new) | In the last {days} days, protection blocked {blocked} requests to this app. | TestProtectionTabBlockingHeadline | approved |
| PT-C04 | templates/app_protection.html (mixed headline) | (new) | In the last {days} days, protection blocked {blocked} requests to this app and recorded {watched} more. | TestProtectionTabMixedHeadline | approved |
| PT-C05 | templates/app_protection.html (share) | (new) | That's {pct} of the {checked} requests protection checked. | TestProtectionTabRendersHeadline | approved |
-| PT-C06 | templates/app_protection.html (nothing caught) | (new) | Nothing in the last {days} days looked like an attack. | TestProtectionTabNothingCaught | approved |
+| PT-C06 | templates/app_protection.html and templates/fleet_protection.html (nothing caught) | (new) | Nothing in the last {days} days looked like an attack. | TestProtectionTabNothingCaught | approved |
| PT-C10 | templates/app_protection.html (no counts yet) | (new) | No protection counts yet for this app. Counting starts once the servers that run it take the release that adds it, and only while protection is on. | gate | approved |
| PT-C11 | templates/app_protection.html (bars heading) | (new) | Day by day | gate | approved |
| PT-C12 | templates/app_protection.html (legend) | (new) | blocked | gate | approved |
@@ -79,7 +79,7 @@ The rules (the same as the analytics on-ramp deck,
| PT-C50 | templates/app_protection.html (watching headline, exactly 1 caught) | (new) | In the last {days} days, 1 request to this app looked like an attack. Protection recorded it and let it through while we check it never stops a real visitor. | TestProtectionTabSingularWatchHeadline | approved |
| PT-C51 | templates/app_protection.html (blocking headline, exactly 1 blocked) | (new) | In the last {days} days, protection blocked 1 request to this app. | TestProtectionTabSingularBlockHeadline | approved |
| PT-C52 | templates/app_protection.html (mixed headline, exactly 1 blocked) | (new) | In the last {days} days, protection blocked 1 request to this app and recorded {watched} more. | TestProtectionTabSingularMixedHeadline | approved |
-| PT-C53 | templates/app_protection.html (share, 1 request checked and caught) | (new) | That's all of the 1 request protection checked. | TestProtectionTabSingularShare | approved |
+| PT-C53 | templates/app_protection.html and templates/fleet_protection.html (share, 1 request checked and caught) | (new) | That's all of the 1 request protection checked. | TestProtectionTabSingularShare | approved |
| PT-C54 | templates/fleet_protection.html (headline, exactly 1 caught in total) | (new) | In the last {days} days, 1 request looked like an attack, to 1 app. | TestFleetProtectionSingularHeadlines | approved |
| PT-C55 | templates/fleet_protection.html (headline, more than 1 caught, all to one app) | (new) | In the last {days} days, {caught} requests to 1 app looked like attacks. | TestFleetProtectionSingularHeadlines | approved |
| PT-C56 | templates/fleet_protection.html (no counts yet, replaces the headline) | (new) | No protection counts yet. Counting starts once the servers take the release that adds it, and only while protection is on. | gate | approved |
diff --git a/internal/console/protectionview_test.go b/internal/console/protectionview_test.go
index f51e0e226..fd3f47d43 100644
--- a/internal/console/protectionview_test.go
+++ b/internal/console/protectionview_test.go
@@ -538,8 +538,8 @@ func TestFleetProtectionListsApps(t *testing.T) {
ptWant(t, page, ptCopy(t, "PT-C41", map[string]string{"days": "7", "caught": "10", "apps": "2"}))
}
-// Checked traffic with nothing caught still reads as a clean window, and
-// has no rows. Nothing checked anywhere says no headline at all.
+// Checked traffic with nothing caught reads as a clean window (PT-C06, never
+// a count of zero requests), and has no rows. Nothing checked anywhere says no headline at all.
func TestFleetProtectionNothingCaught(t *testing.T) {
fx := newConsoleFixture(t)
c := signInOperator(t, fx)
@@ -547,10 +547,10 @@ func TestFleetProtectionNothingCaught(t *testing.T) {
ptRefuse(t, page, ptHeadlineLead, "That's", "<td>")
ptWant(t, page, "<th scope=\"col\">Account</th>")
- fpGuard(t, fx.rel, "box-a", ptHost, "bab", "shop", 100, 0, 0)
+ fpGuard(t, fx.rel, "box-a", ptHost, "bab", "shop", 50, 0, 0)
page = fpPage(t, fx, c, "")
- ptWant(t, page, ptCopy(t, "PT-C41", map[string]string{"days": "7", "caught": "0", "apps": "0"}))
- ptRefuse(t, page, "That's", "<td>")
+ ptWant(t, page, ptCopy(t, "PT-C06", map[string]string{"days": "7"}))
+ ptRefuse(t, page, "That's", "<td>", "0 requests", ptCopy(t, "PT-C56", nil))
}
func TestFleetProtectionData(t *testing.T) {
diff --git a/internal/console/templates/fleet_protection.html b/internal/console/templates/fleet_protection.html
index fe924ed2c..20946212f 100644
--- a/internal/console/templates/fleet_protection.html
+++ b/internal/console/templates/fleet_protection.html
@@ -12,7 +12,7 @@
{{else}}
{{/* Nothing checked across the platform says so and gives no headline: a
count of nothing caught would claim requests nobody counted. */}}
-{{if .Sum.Checked}}<p><strong>{{if eq .Caught 1}}In the last {{.Days}} days, 1 request looked like an attack, to 1 app.{{else if and (gt .Caught 1) (eq (len .Rows) 1)}}In the last {{.Days}} days, {{count .Caught}} requests to 1 app looked like attacks.{{else}}In the last {{.Days}} days, {{count .Caught}} requests across {{len .Rows}} apps looked like attacks.{{end}}</strong></p>
+{{if .Sum.Checked}}<p><strong>{{if not .Caught}}Nothing in the last {{.Days}} days looked like an attack.{{else if eq .Caught 1}}In the last {{.Days}} days, 1 request looked like an attack, to 1 app.{{else if and (gt .Caught 1) (eq (len .Rows) 1)}}In the last {{.Days}} days, {{count .Caught}} requests to 1 app looked like attacks.{{else}}In the last {{.Days}} days, {{count .Caught}} requests across {{len .Rows}} apps looked like attacks.{{end}}</strong></p>
{{if .Caught}}<p co-note>{{if eq .Sum.Checked 1}}That's all of the 1 request protection checked.{{else}}That's {{.Share}} of the {{count .Sum.Checked}} requests protection checked.{{end}}</p>{{end}}
{{else}}<p>No protection counts yet. Counting starts once the servers take the release that adds it, and only while protection is on.</p>{{end}}
{{if .Unread}}<div rst-callout rst-tone="negative"><span rst-callout-ic aria-hidden="true">{{icon "triangle-alert"}}</span><div rst-callout-body><p>These fleets' counts could not be read and are left out: {{.Unread}}.</p></div></div>{{end}}