alerts: approved Rules lines for verify rules; reason after a colon
Fix round 1 for Task 8, from Paul's second copy review (approved 2026-11-11, unedited): - rules.when.verify_* and rules.th.verify_* replace the derived what.none placeholders and the "No threshold." fallback. - rule.verify_unverified.what_to_do now says "Check the reason above". - verify_unverified's what line ends with its reason label after a colon instead of the label on a line of its own (controller ruling). - The copy record gains the six Rules ids and the new what_to_do text; TestApprovedMemberBackups2aCopy pins all 31.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
approved_member_backups_2a_copy_test.go+4 −0docs/superpowers/plans/member-backups-slice2a-copy.json+8 −2internal/alerting/ruletext.go+1 −1internal/console/alertdetail_test.go+9 −6internal/console/alertengine_pass.go+4 −4internal/console/alertnotify.go+2 −2internal/console/alertpages.go+8 −6internal/console/alertpages_test.go+12 −2
CI failed — run details
Intent
<task-notification> <task-id>a946e4523bf500067</task-id> <tool-use-id>toolu_01DMrbXscSjzyFBu1L9EMVpj</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/a946e4523bf500067.output</output-file> <status>completed</status> <summary>Agent "Implement slice 2a Task 0+8" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Status: DONE_WITH_CONCERNS Commit: 0bcdd2de `alerts: restore drill rules verify_failed, _unverified, _coverage (#898)` (not pushed) Tests: all targeted tests pass in metrics, alerting, host, console, ops, dbverify and root (`TestApprovedMemberBackups2aCopy`); vet is clean and the linux, darwin and windows builds are OK. Concerns: 1. The approved copy has no Rules-page "Fires when" line (`rules.when.*`), and the order test requires one. Each rule reuses its approved `what.none` string, marked as derived. With no threshold line either, the Threshold column falls back to "No threshold.", which is misleading for the 3-run and 7-day rules. Paul may want approved lines for both. 2. verify_unverified's what_to_do says "Check the reason below". As ruled, the reason line comes right after the what line, which is above "What to do" in email and Slack. Either move the reason line below it (one line in alertEmitNote) or reword the copy. 3. Levels: verify_failed is incident (like restarts); the other two are warning (like disk_eta and geoip). 4. The reason labels live in `alerting.VerifyReasons` beside BoxRuleText. The reason is carried as the alert's value, an index into that list. 5. A reason that changes while the alert fires sends a new firing event, as geoip does, so the console names the current reason. 6. I added `dbverify.LocalPath`, and ops now uses it, so the drill and the agent read the same path. 7. Root-binary packages changed (metrics, alerting, dbverify, host, ops), so Task 9 needs the census overlay. 8. The sandbox broke mid-task, so I ran go and git commands with it off, inside the worktree only. Report: /home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups-2a/.superpowers/sdd/2026-11-11-member-backups-slice2a/task-8-report.md</result> <usage><subagent_tokens>195939</subagent_tokens><tool_uses>88</tool_uses><duration_ms>988349</duration_ms></usage> </task-notification>
<task-notification> <task-id>a2f8107f26e974b68</task-id> <tool-use-id>toolu_01RqN8qUhQrQ3ChAfZmmncKc</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/a2f8107f26e974b68.output</output-file> <status>completed</status> <summary>Agent "Implement slice 1 Task 0+4" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Status:** DONE_WITH_CONCERNS. Task 4 and Task 0 are built and committed together. **Commit:** ae7950f3 on member-backups-1 (base f5b886ff), not pushed. **Tests:** I ran only the named tests. Six new page tests pass: copied, the known gaps (9 cases), another region, no forbidden words, the time formatting, and a route with no record. `TestApprovedMemberBackupsCopy`, `TestConsoleStyleguideClassesExist` and `go build ./...` / `go vet` pass. Both tests were run failing first. I compared screenshots at 390 and 1280 px with the approved mockup: it matches apart from the missing Download button (1b) and the " UTC" suffix. **Concerns:** 1. `backups.why.otherregion` says "You can still download one." There's no button until 1b, and spec §2b refuses Download for other-region instances anyway. Paul or 1b needs to decide the wording. 2. `TestPlan9B8RecordWriteCensus` (internal/provision) already fails at f5b886ff, on Task 3's `linkedPolicies` and `routeDecls`. My one-line change to `handleAppInstance` adds a third changed site. The census needs new digests, and Task 6's test list doesn't include this test, so CI will fail. I didn't edit census files. 3. The console has no viewer time zone, so tiles show "20:49 UTC" in the format the page's other times use. The mockup has a bare "14:02". 4. `carlos db pull` exits without `--out`, which the brief and mockup leave out. I added `--out <first-label>.db` to both commands. 5. The command line section also shows when the copy is too large to read here (db pull can still serve it), and is hidden when it can't be read now. The override names only copied and other region. **Report:** /home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups-1/.superpowers/sdd/2026-11-11-member-backups-slice1/task-4-report.md</result> <usage><subagent_tokens>227292</subagent_tokens><tool_uses>89</tool_uses><duration_ms>1137253</duration_ms></usage> </task-notification>
<task-notification> <task-id>b9yhjpvav</task-id> <tool-use-id>toolu_0197S6rLQvvM6kCcHEU2BAD9</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/b9yhjpvav.output</output-file> <status>completed</status> <summary>Background command "Draft the six rule strings; start Astra review of Task 8" completed (exit code 0)</summary> </task-notification>
approved.
Attributed to this commit: 22.5 g CO₂e (2,829,271 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on member-backups-2a, 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/approved_member_backups_2a_copy_test.go b/approved_member_backups_2a_copy_test.go| index 3cb0f2fb9..b6036afe1 100644 |
| --- a/approved_member_backups_2a_copy_test.go |
| +++ b/approved_member_backups_2a_copy_test.go |
| @@ -27,6 +27,10 @@ var memberBackups2aCopyIDs = []string{ |
| "verify.reason.nothing_replicated", "verify.reason.no_assignment", "verify.reason.restore_error", |
| "verify.reason.stale", "verify.reason.plan_moved", "verify.reason.record_unreadable", |
| "verify.reason.no_record", |
| + // The second review (approved-copy-2): the Rules section's lines. |
| + "rules.when.verify_failed", "rules.th.verify_failed", |
| + "rules.when.verify_unverified", "rules.th.verify_unverified", |
| + "rules.when.verify_coverage", "rules.th.verify_coverage", |
| } |
| // Every approved string is in the file the record names, byte for byte, and |
diff --git a/docs/superpowers/plans/member-backups-slice2a-copy.json b/docs/superpowers/plans/member-backups-slice2a-copy.json| index 52ca93ac8..85140680c 100644 |
| --- a/docs/superpowers/plans/member-backups-slice2a-copy.json |
| +++ b/docs/superpowers/plans/member-backups-slice2a-copy.json |
| @@ -11,7 +11,7 @@ |
| {"id": "rule.verify_unverified.what", "file": "internal/console/alertnotify.go", "text": "%s couldn't test an instance's copy three nights in a row."}, |
| {"id": "rule.verify_unverified.what.none", "file": "internal/console/alertnotify.go", "text": "An instance's copy couldn't be tested three nights in a row."}, |
| {"id": "rule.verify_unverified.how_long", "file": "internal/alerting/ruletext.go", "text": "Nothing is down, but nobody knows whether this copy would restore."}, |
| - {"id": "rule.verify_unverified.what_to_do", "file": "internal/alerting/ruletext.go", "text": "Check the reason below. If the instance is moving or was just recreated, it clears on its own."}, |
| + {"id": "rule.verify_unverified.what_to_do", "file": "internal/alerting/ruletext.go", "text": "Check the reason above. If the instance is moving or was just recreated, it clears on its own."}, |
| {"id": "rule.verify_coverage.title", "file": "internal/alerting/ruletext.go", "text": "Restore tests behind"}, |
| {"id": "rule.verify_coverage.what", "file": "internal/console/alertnotify.go", "text": "Some instances on %s haven't had a restore test for more than 7 days."}, |
| {"id": "rule.verify_coverage.what.none", "file": "internal/console/alertnotify.go", "text": "Some instances haven't had a restore test for more than 7 days."}, |
| @@ -26,6 +26,12 @@ |
| {"id": "verify.reason.stale", "file": "internal/alerting/ruletext.go", "text": "the copy is behind the live database"}, |
| {"id": "verify.reason.plan_moved", "file": "internal/alerting/ruletext.go", "text": "the copy was tidied up while the test was starting, on both tries"}, |
| {"id": "verify.reason.record_unreadable", "file": "internal/alerting/ruletext.go", "text": "the instance's details couldn't be read"}, |
| - {"id": "verify.reason.no_record", "file": "internal/alerting/ruletext.go", "text": "there's no instance record for it"} |
| + {"id": "verify.reason.no_record", "file": "internal/alerting/ruletext.go", "text": "there's no instance record for it"}, |
| + {"id": "rules.when.verify_failed", "file": "internal/console/alertpages.go", "text": "A nightly restore test of an instance's copy fails. Each instance is its own alert."}, |
| + {"id": "rules.th.verify_failed", "file": "internal/console/alertpages.go", "text": "Fixed at one failed test. Not configurable."}, |
| + {"id": "rules.when.verify_unverified", "file": "internal/console/alertpages.go", "text": "A restore test can't run for an instance three nights in a row. Each instance is its own alert."}, |
| + {"id": "rules.th.verify_unverified", "file": "internal/console/alertpages.go", "text": "Fixed at 3 nights in a row. Not configurable."}, |
| + {"id": "rules.when.verify_coverage", "file": "internal/console/alertpages.go", "text": "An instance on a box hasn't had a restore test for more than 7 days."}, |
| + {"id": "rules.th.verify_coverage", "file": "internal/console/alertpages.go", "text": "Fixed at 7 days. Not configurable."} |
| ] |
| } |
diff --git a/internal/alerting/ruletext.go b/internal/alerting/ruletext.go| index 2ff82ca4b..d169a7639 100644 |
| --- a/internal/alerting/ruletext.go |
| +++ b/internal/alerting/ruletext.go |
| @@ -79,7 +79,7 @@ var BoxRuleText = map[string]RuleText{ |
| "verify_unverified": { |
| Title: "Restore test not running", |
| HowLong: "Nothing is down, but nobody knows whether this copy would restore.", |
| - WhatToDo: "Check the reason below. If the instance is moving or was just recreated, it clears on its own.", |
| + WhatToDo: "Check the reason above. If the instance is moving or was just recreated, it clears on its own.", |
| }, |
| "verify_coverage": { |
| Title: "Restore tests behind", |
diff --git a/internal/console/alertdetail_test.go b/internal/console/alertdetail_test.go| index 001a7036a..f5acd05d4 100644 |
| --- a/internal/console/alertdetail_test.go |
| +++ b/internal/console/alertdetail_test.go |
| @@ -131,9 +131,9 @@ func TestAlertRestartsRuleRowStatesItsThreshold(t *testing.T) { |
| // TestAlertVerifyRulesWords: the restore drill's per-host rules name the |
| // host in their title and the box in their what line. verify_unverified's |
| -// message carries its reason's label on its own line after the what line, |
| -// read from the rule's value, and the metrics page shows the label too. An |
| -// unknown reason adds no line. verify_coverage is one per box. |
| +// what line ends with its reason's label after a colon, read from the rule's |
| +// value, and the metrics page shows the label too. An unknown reason leaves |
| +// the approved what line as it is. verify_coverage is one per box. |
| func TestAlertVerifyRulesWords(t *testing.T) { |
| now := alertT0 |
| note := func(rule string, value float64) alertNote { |
| @@ -159,11 +159,14 @@ func TestAlertVerifyRulesWords(t *testing.T) { |
| if h := alertHeadline(n); h != "Restore test not running (blog) on box-a" { |
| t.Errorf("unverified headline = %q", h) |
| } |
| - if n.What != "box-a couldn't test an instance's copy three nights in a row.\nthe instance was moving to another box" { |
| + if n.What != "box-a couldn't test an instance's copy three nights in a row: the instance was moving to another box." { |
| t.Errorf("unverified what = %q", n.What) |
| } |
| - if _, body := renderEmail(n); !strings.Contains(body, "three nights in a row.\nthe instance was moving to another box\n") { |
| - t.Errorf("email body does not put the reason on its own line:\n%s", body) |
| + if n.WhatToDo != "Check the reason above. If the instance is moving or was just recreated, it clears on its own." { |
| + t.Errorf("unverified what to do = %q", n.WhatToDo) |
| + } |
| + if _, body := renderEmail(n); !strings.Contains(body, ": box-a couldn't test an instance's copy three nights in a row: the instance was moving to another box.\n") { |
| + t.Errorf("email body does not carry the reason in the what line:\n%s", body) |
| } |
| if got := alertValueText("verify_unverified@blog", moving); got != "the instance was moving to another box" { |
| t.Errorf("metrics page value = %q", got) |
diff --git a/internal/console/alertengine_pass.go b/internal/console/alertengine_pass.go| index 254cd2672..476f970b3 100644 |
| --- a/internal/console/alertengine_pass.go |
| +++ b/internal/console/alertengine_pass.go |
| @@ -434,12 +434,12 @@ func alertEmitNote(em alertEmit, sig *alertSignals, now time.Time) alertNote { |
| if v, ok := sig.value(alertKey{in.Scope, in.Rule, n.Subject}); ok && alertValued[alertRuleKind(in.Rule)] && named { |
| n.What += " " + fmt.Sprintf(alertCopy["what.value"], alertValueText(in.Rule, v)) |
| } |
| - // verify_unverified's value is its reason: the label goes on a line of |
| - // its own after the what line. A reason this console has no label for |
| - // (a newer box's) adds nothing. |
| + // verify_unverified's value is its reason: the what line ends with the |
| + // reason's label after a colon, in place of its full stop. A reason this |
| + // console has no label for (a newer box's) leaves the line as it is. |
| if v, ok := sig.value(alertKey{in.Scope, in.Rule, n.Subject}); ok && alertRuleKind(in.Rule) == "verify_unverified" && named { |
| if label, ok := alerting.VerifyReasonLabel(v); ok { |
| - n.What += "\n" + label |
| + n.What = strings.TrimSuffix(n.What, ".") + ": " + label + "." |
| } |
| } |
| switch { |
diff --git a/internal/console/alertnotify.go b/internal/console/alertnotify.go| index 3c85189a3..48c93d0dd 100644 |
| --- a/internal/console/alertnotify.go |
| +++ b/internal/console/alertnotify.go |
| @@ -204,8 +204,8 @@ var alertCopy = map[string]string{ |
| // The restore drill's rules (member backups slice 2a). verify_failed |
| // and verify_unverified are per host: the title names the host, the |
| - // what names the box. verify_unverified's message adds its reason's |
| - // label as a line of its own (alertEmitNote). |
| + // what names the box. verify_unverified's what line ends with its |
| + // reason's label after a colon (alertEmitNote). |
| "rule.verify_failed.title": alerting.BoxRuleText["verify_failed"].Title, |
| "rule.verify_failed.what": "A restore test of an instance's copy failed on %s.", |
| "rule.verify_failed.what.none": "A restore test of an instance's copy failed.", |
diff --git a/internal/console/alertpages.go b/internal/console/alertpages.go| index b9286cef6..accd8b8af 100644 |
| --- a/internal/console/alertpages.go |
| +++ b/internal/console/alertpages.go |
| @@ -184,12 +184,14 @@ var alertPageCopy = map[string]string{ |
| // derived (Task 10): an unsubscribe or snooze that failed on our side. |
| "door.err.failed": "That did not work. Try the link again in a few minutes.", |
| - // derived (member backups 2a Task 8): the Rules section's "fires when" |
| - // for the restore drill's rules. The approved copy has no such line, so |
| - // each is its rule's approved subjectless what line. |
| - "rules.when.verify_failed": alertCopy["rule.verify_failed.what.none"], |
| - "rules.when.verify_unverified": alertCopy["rule.verify_unverified.what.none"], |
| - "rules.when.verify_coverage": alertCopy["rule.verify_coverage.what.none"], |
| + // The restore drill's rules (member backups slice 2a, second copy |
| + // review, approved 2026-11-11). |
| + "rules.when.verify_failed": "A nightly restore test of an instance's copy fails. Each instance is its own alert.", |
| + "rules.th.verify_failed": "Fixed at one failed test. Not configurable.", |
| + "rules.when.verify_unverified": "A restore test can't run for an instance three nights in a row. Each instance is its own alert.", |
| + "rules.th.verify_unverified": "Fixed at 3 nights in a row. Not configurable.", |
| + "rules.when.verify_coverage": "An instance on a box hasn't had a restore test for more than 7 days.", |
| + "rules.th.verify_coverage": "Fixed at 7 days. Not configurable.", |
| } |
| // The operator Alerts pages (fleet alerts spec §5, plan 1 Task 10): |
diff --git a/internal/console/alertpages_test.go b/internal/console/alertpages_test.go| index 46744d4ed..ccc22e512 100644 |
| --- a/internal/console/alertpages_test.go |
| +++ b/internal/console/alertpages_test.go |
| @@ -929,8 +929,18 @@ func TestAlertRuleOrderCoversVerify(t *testing.T) { |
| if alertRuleLevel(rule+"@shop") != level { |
| t.Errorf("%s@shop level = %q, want the kind's", rule, alertRuleLevel(rule+"@shop")) |
| } |
| - if alertPageCopy["rules.when."+rule] != alertCopy["rule."+rule+".what.none"] { |
| - t.Errorf("%s: rules.when = %q, want its approved what.none", rule, alertPageCopy["rules.when."+rule]) |
| + } |
| + for rule, want := range map[string][2]string{ |
| + "verify_failed": {"A nightly restore test of an instance's copy fails. Each instance is its own alert.", |
| + "Fixed at one failed test. Not configurable."}, |
| + "verify_unverified": {"A restore test can't run for an instance three nights in a row. Each instance is its own alert.", |
| + "Fixed at 3 nights in a row. Not configurable."}, |
| + "verify_coverage": {"An instance on a box hasn't had a restore test for more than 7 days.", |
| + "Fixed at 7 days. Not configurable."}, |
| + } { |
| + v := alertRuleRow(rule, nil, nil, alertNoise{}) |
| + if v.When != want[0] || v.Threshold != want[1] || v.Editable || v.BoxEnv { |
| + t.Errorf("%s row: when %q, threshold %q (editable %v, box env %v), want %q, %q", rule, v.When, v.Threshold, v.Editable, v.BoxEnv, want[0], want[1]) |
| } |
| } |
| } |