hub (unreleased): the notice lock — no notice, no deletion; the hub sends the household's notice itself (decision 315, R-1374)

The hub agrees to remove a removed app's off-site copies only when its OWN record
(offsite_end_notices) says the household was told at least 30 days ago, by the hub's
clock — beside the 30 days of absence. The notice is sent from the box's report, at
every report until the mail service accepts it; the box's event mails nobody.
No address or a blocked household: the operator is mailed in its place and that mail
starts the 30 days. A notice that cannot go out: no agreement, the window's answer
names the reason, one line to the operator after 3 days.

This commit also supplies the files that handler.go (c3fa43a4) already calls
(store.NoteEndNotices, api.kickEndNotices) and the tests that replace
TestD84_Receipt_* (their files left the tree in b8cf6c24).

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 16:17:44 +01:00
1 parent b8cf6c2417
commit 42ef25c23b
25 files changed
+2077 -184

No files matched your search

@@ -0,0 +1,40 @@
== MUTATION: no notice lock: the absence alone decides (the first build)
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AgreeEnded_NoNoticeNoDeletion (0.00s)
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
== MUTATION: a record that nobody was told about is enough
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AgreeEnded_NoNoticeNoDeletion (0.00s)
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
== MUTATION: told, however recently, is enough
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AgreeEnded_NoNoticeNoDeletion (0.00s)
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
== MUTATION: the told time counts 29 days
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AgreeEnded_NoNoticeNoDeletion (0.00s)
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
--- FAIL: TestNotice_Window_TheNoticeRecordDecides (0.14s)
notice_lock_test.go:114: told 29 days ago: agreed [a1b2c684 a1b2c685], refused []
== MUTATION: an app with no notice record at all is agreed
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AgreeEnded_NoNoticeNoDeletion (0.00s)
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
notice_lock_test.go:59: agreed ids = [a1b2c685 a1b2c686], want [a1b2c685] (refused: [])
--- FAIL: TestNotice_Window_TheNoticeRecordDecides (0.05s)
== MUTATION: a box that asks for an app it never named in a report is refused quietly
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Window_TheNoticeRecordDecides (0.05s)
notice_lock_test.go:86: the operator must hear of a box that asks for an app it never named in a report: []
== MUTATION: the notice is read IN PLACE of the absence
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AgreeEnded_NoNoticeNoDeletion (0.00s)
notice_lock_test.go:59: agreed ids = [a1b2c685], want [] (refused: [])
7 mutations, 0 not a red-proof
@@ -0,0 +1,54 @@
== MUTATION: a report never starts the walk
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AReportNamesAnApp_TheHubMailsTheHouseholdOncePerPress (0.05s)
end_notice_test.go:162: the household got 0 notice(s) after the first report that names the app, want 1: []
--- FAIL: TestNotice_TwoAppsInOneMinute_TwoNotices (0.05s)
end_notice_test.go:196: two apps: []
== MUTATION: the next try does not wait
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AFailedSendIsTriedAgainUntilItHasGone (0.05s)
end_notice_test.go:266: a second try ten minutes after a failed one: 1 mail(s)
== MUTATION: a failed notice is never tried again
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AFailedSendIsTriedAgainUntilItHasGone (0.07s)
end_notice_test.go:272: the try an hour later must send and set the told time to THAT try (2026-11-15T16:10:54Z): mails=0 {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:09:54 +0000 UTC ToldAt:0001-01-01 00:00:00
--- FAIL: TestNotice_TheMailHoldTellsNobody (0.04s)
end_notice_test.go:295: after the release: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:09:54 +0000 UTC ToldAt:0001-01-01 00:00:00 +0000 UTC ToldTo: Tries:1 LastTry:2026-11-15 15:09:54 +0000 UTC LastReason:the
== MUTATION: the operator is not told in place of a household with no address
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_NoAddress_TheOperatorIsToldInItsPlace_AndAnAddressLaterRestarts (0.05s)
end_notice_test.go:346: the operator must be told once, naming the household, the app and why: []
--- FAIL: TestNotice_NoAddress_AndTheOperatorsMailFails_NobodyWasTold (0.05s)
end_notice_test.go:392: no address and the operator's mail failed: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:09:59 +0000 UTC ToldAt:0001-01-01 00:00:00 +0000 UTC ToldTo: Tries:0 LastTry:0001-01-01 00:00:00 +
== MUTATION: the operator's notice counts although its mail failed
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_NoAddress_AndTheOperatorsMailFails_NobodyWasTold (0.05s)
end_notice_test.go:392: no address and the operator's mail failed: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:10:03 +0000 UTC ToldAt:2026-11-15 15:10:03 +0000 UTC ToldTo:operator Tries:1 LastTry:2026-11-15 15
== MUTATION: an address added later changes nothing (the operator's notice stays the one that counts)
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_NoAddress_TheOperatorIsToldInItsPlace_AndAnAddressLaterRestarts (0.06s)
end_notice_test.go:372: an address added after the press: the household must be told and the 30 days start again: mails=[{to:operator@felhom.eu subject:[Felhom] ⚠️ c1: offsite_end_notice_operator body:Customer: c1
== MUTATION: the operator's stuck line is filed at once
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_StuckForThreeDays_TheOperatorGetsOneLine (0.05s)
end_notice_test.go:409: told the operator after two days: [{ID:1 CustomerID:c1 EventType:offsite_end_notice_stuck Severity:warning Message:Off-site: the household c1 removed the app "vikunja" with „delete backup data” 0 days ago,
== MUTATION: the operator's stuck line is never filed
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_StuckForThreeDays_TheOperatorGetsOneLine (0.05s)
end_notice_test.go:425: want ONE warning naming the app and the reason: []
== MUTATION: the operator's stuck line is repeated
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_StuckForThreeDays_TheOperatorGetsOneLine (0.05s)
end_notice_test.go:431: the line was repeated: 6
== MUTATION: the stuck line is filed while the mail hold is on
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_StuckForThreeDays_TheOperatorGetsOneLine (0.05s)
end_notice_test.go:419: the line was filed while the hold is on: [{ID:1 CustomerID:c1 EventType:offsite_end_notice_stuck Severity:warning Message:Off-site: the household c1 removed the app "vikunja" with „delete backup data” 3 day
== MUTATION: the told time is the box's press, not the hub's clock
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AReportNamesAnApp_TheHubMailsTheHouseholdOncePerPress (0.05s)
end_notice_test.go:173: the hub's own record does not say the household was told now: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:10:23 +0000 UTC ToldAt:2026-11-15 10:00:00 +0000 UTC ToldTo:household Tries:1 L
--- FAIL: TestNotice_AFailedSendIsTriedAgainUntilItHasGone (0.06s)
end_notice_test.go:272: the try an hour later must send and set the told time to THAT try (2026-11-15T16:11:23Z): mails=1 {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:10:23 +0000 UTC ToldAt:2026-11-15 10:00:00
11 mutations, 0 not a red-proof
@@ -0,0 +1,45 @@
# Two mutants of the first run did not compile (an unused variable) and proved nothing; they were rewritten and the whole file was run again. This is the second run.
== MUTATION: a failed send is reported as sent
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_AFailedSendIsTriedAgainUntilItHasGone (0.04s)
end_notice_test.go:260: after a failed send: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:11:08 +0000 UTC ToldAt:2026-11-15 15:11:08 +0000 UTC ToldTo:household Tries:1 LastTry:2026-11-15 15:11:08 +0000 UTC Last
--- FAIL: TestNotice_StuckForThreeDays_TheOperatorGetsOneLine (0.05s)
end_notice_test.go:425: want ONE warning naming the app and the reason: []
== MUTATION: a held mail is reported as sent
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_TheMailHoldTellsNobody (0.04s)
end_notice_test.go:288: under the hold: {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:11:12 +0000 UTC ToldAt:2026-11-15 15:11:12 +0000 UTC ToldTo:household Tries:1 LastTry:2026-11-15 15:11:12 +0000 UTC LastReaso
--- FAIL: TestNotice_StuckForThreeDays_TheOperatorGetsOneLine (0.06s)
end_notice_test.go:425: want ONE warning naming the app and the reason: []
== MUTATION: the daily limit is not read
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_TheDailyLimitDelaysAndNeverDrops (0.08s)
end_notice_test.go:309: seven presses: 7 notices today, want the daily limit 5
--- FAIL: TestNotice_TheDailyLimitDelaysAndSurvivesARestart (0.05s)
end_notice_test.go:157: the sixth notice: outcome sent (""), want limit
== MUTATION: a blocked household is mailed
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_NoAddress_TheOperatorIsToldInItsPlace_AndAnAddressLaterRestarts (0.12s)
end_notice_test.go:381: a blocked household: record {App:vikunja Press:2026-11-15T10:00:00Z FirstNamed:2026-11-15 15:11:22 +0000 UTC ToldAt:2026-11-15 15:11:22 +0000 UTC ToldTo:household Tries:1 LastTry:2026-11-15 15:11:22 +0000 U
--- FAIL: TestNotice_NoAddressOrBlocked_SaysSoAndMailsNobody (0.08s)
end_notice_test.go:137: blocked: outcome sent, 1 mail(s)
== MUTATION: any name is mailed
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_OnlyAnAppNameIsMailed (0.06s)
end_notice_test.go:212: "": outcome sent, 1 mail(s)
== MUTATION: SendOperatorNow takes any type
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_SendOperatorNow (0.05s)
end_notice_test.go:246: a type that is not operator-only was accepted
== MUTATION: SendOperatorNow answers nil for a failed send
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_SendOperatorNow (0.05s)
end_notice_test.go:250: a failed send answered nil — the caller would start the 30 days on a mail that never went
7 mutations, 0 not a red-proof
== MUTATION: the box's event is routed like any other event again
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_TheBoxesEventMailsNobody (0.06s)
end_notice_test.go:113: the box's event caused 1 mail(s); first: {to:operator@felhom.eu subject:[Felhom] ⚠️ c1: offsite_end_scheduled body:Customer: c1
1 mutations, 0 not a red-proof
@@ -0,0 +1,47 @@
== MUTATION: an install does not void the notice
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_WhatVoidsIt (0.35s)
offsite_end_notice_test.go:113: the notice is told, want gone
== MUTATION: another press keeps the old notice
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_WhatVoidsIt (0.35s)
offsite_end_notice_test.go:113: the notice is told, want fresh
offsite_end_notice_test.go:113: the notice is told, want fresh
== MUTATION: a take-back does not void the notice
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_WhatVoidsIt (0.35s)
offsite_end_notice_test.go:113: the notice is told, want gone
== MUTATION: a report that does not show the tier voids the notice (its silence read as a take-back)
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_WhatVoidsIt (0.35s)
offsite_end_notice_test.go:113: the notice is gone, want told
== MUTATION: a told mark is written whatever the press
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_OnePressOneRow (0.05s)
offsite_end_notice_test.go:47: a told mark for ANOTHER press was written (ok=true err=<nil>)
== MUTATION: a recipient the hub never writes counts as told
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_IsBoundedAndFailsClosed (0.05s)
offsite_end_notice_test.go:160: an unreadable record counts as told: {App:app-00 Press: FirstNamed:2026-11-15 10:00:00 +0000 UTC ToldAt:2020-01-01 00:00:00 +0000 UTC ToldTo:box Tries:0 LastTry:0001-01-01 00:00:00 +0000 UTC LastRea
== MUTATION: no row limit per household
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_IsBoundedAndFailsClosed (0.05s)
offsite_end_notice_test.go:136: rows = 80, want the limit 50
== MUTATION: a name that is not an app name is stored
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_IsBoundedAndFailsClosed (0.05s)
offsite_end_notice_test.go:140: a name that is not an app name was stored: "<b>x</b>"
8 mutations, 0 not a red-proof
== MUTATION: the notice record is not purged with the household
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_GoesWithTheHousehold (0.05s)
offsite_end_notice_test.go:172: the residue count does not see the notice record: &{Reports:0 AppTelemetry:0 AppLogTails:0 LogTailRequests:0 NotificationPrefs:0 SelfBindTokens:0 ApplianceRegistrations:0 AppLogIssueRefs:0 OffsiteKe
1 mutations, 0 not a red-proof
== MUTATION: the notice record is not in the orphan sweep
RED on the mutant, GREEN on the real file
--- FAIL: TestNotice_Record_GoesWithTheHousehold (0.05s)
offsite_end_notice_test.go:184: orphan sweep: map[] <nil>
1 mutations, 0 not a red-proof