hub v0.115.0: host_* mails skip the quiet hour (ruling 2, R-529); ruling 1 recorded (CC may sign agent_update until the first paying customer)
gates / gates (push) Successful in 23s
gates / gates (push) Successful in 23s
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -24,6 +24,7 @@ func TestOperatorCooldown_NodeLivenessBypassesQuietHour(t *testing.T) {
|
||||
|
||||
// The previous node_stale mail went 39 minutes ago.
|
||||
d.mu.Lock()
|
||||
d.opCooldowns["c1:host_stale"] = time.Now().Add(-39 * time.Minute)
|
||||
d.opCooldowns["c1:node_stale"] = time.Now().Add(-39 * time.Minute)
|
||||
d.opCooldowns["c1:app_start_failed"] = time.Now().Add(-39 * time.Minute)
|
||||
d.mu.Unlock()
|
||||
@@ -37,9 +38,14 @@ func TestOperatorCooldown_NodeLivenessBypassesQuietHour(t *testing.T) {
|
||||
if count() != 1 {
|
||||
t.Fatalf("node_stale 1 min after a sent one was mailed again (sent=%d) — the 5-minute dedupe is gone", count())
|
||||
}
|
||||
// Ruling 2: the same for a HOST-plane mail, 39 minutes after the last one.
|
||||
d.processOperator("c1", "host_stale", "warning", "host stale", "{}", "hub")
|
||||
if count() != 2 {
|
||||
t.Fatalf("host_stale 39 min after the previous one was suppressed (sent=%d) — ruling 2 (R-529)", count())
|
||||
}
|
||||
// The design is unchanged for every other type: still the hour.
|
||||
d.processOperator("c1", "app_start_failed", "warning", "app down", "{}", "hub")
|
||||
if count() != 1 {
|
||||
if count() != 2 {
|
||||
t.Fatalf("a non-liveness type lost its 1-hour cooldown (sent=%d)", count())
|
||||
}
|
||||
for _, et := range []string{"node_down", "node_recovered"} {
|
||||
@@ -47,7 +53,14 @@ func TestOperatorCooldown_NodeLivenessBypassesQuietHour(t *testing.T) {
|
||||
t.Fatalf("%s is not in the ruling's bypass", et)
|
||||
}
|
||||
}
|
||||
if operatorCooldownFor("host_stale") != operatorCooldown {
|
||||
t.Fatal("host_stale is not in the 2026-09-15 ruling and must keep the hour")
|
||||
// Ruling 2 (2026-09-16, R-529): the host-plane siblings joined the bypass.
|
||||
for _, et := range []string{"host_stale", "host_down", "host_recovered"} {
|
||||
if operatorCooldownFor(et) != nodeLivenessDedupeWindow {
|
||||
t.Fatalf("%s must bypass the quiet hour too (operator ruling 2026-09-16)", et)
|
||||
}
|
||||
}
|
||||
// A type in neither ruling keeps the hour — the design is narrowed, not removed.
|
||||
if operatorCooldownFor("storage_disconnected") != operatorCooldown {
|
||||
t.Fatal("an unrelated type lost its 1-hour cooldown")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user