Files
felhom.eu/hub/internal/claim/d68_seed_test.go
T
admin b14eb0fad4
gates / gates (push) Successful in 2m0s
hub: a full host disk is the operator's alarm (D68, decision 287) — commit only, not built
host_disk_warning and host_disk_critical join the operator-only register, so a
household that already has the type saved gets no mail. The type leaves the
claim seed list. storage_fill_* is split by storage kind: a drive the household
can free (usb, local-dir, nfs, cifs) still reaches the household; the thin pool,
a PBS store, an unknown kind and a missing kind go to the operator only.

Tests: TestD68_HostDiskIsOperatorOnly_EvenWhenTheHouseholdSavedIt,
TestD68_StorageFillReachesAHouseholdOnlyForADriveItCanFree,
TestD68_RegisterAndGate, TestD68_SeedHoldsNoOperatorOnlyType. Red seen three
times (register lines out; gate reading the register only; type back in the seed).

No hub build, no deploy. Also: dated lines on R-1368 and R-1371 for the agent
(776025c8) and controller (844f19f1) commits, and the filesystem-identity
measurement the controller commit cites.

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
2026-11-10 14:25:41 +01:00

31 lines
1.1 KiB
Go

package claim
import (
"testing"
"gitea.dooplex.hu/admin/felhom-hub/internal/notify"
)
// D68 (`09` §3 decision 287, 2026-11-10): the claim must not seed a type the dispatcher will never deliver — a saved
// string that does nothing. And the two types the ruling names are pinned by name.
//
// RED-PROOF (observed 2026-11-10): put "host_disk_critical" back into defaultSeedEvents → fails naming it.
func TestD68_SeedHoldsNoOperatorOnlyType(t *testing.T) {
seeded := map[string]bool{}
for _, et := range defaultSeedEvents {
seeded[et] = true
if notify.IsOperatorOnly(et) {
t.Errorf("defaultSeedEvents holds %q, which is operator-only: the household would get a saved type that never mails", et)
}
}
if seeded["host_disk_critical"] {
t.Error("host_disk_critical must not be seeded: the host's system disk is the operator's (D68)")
}
if !seeded["storage_fill_critical"] {
t.Error("storage_fill_critical must stay seeded: a household is told when a drive it can free is full (D68)")
}
if !seeded["disk_critical"] {
t.Error("disk_critical must stay seeded: it is the household's own fill alarm")
}
}