hub + installer (unreleased): fixes after an independent review of the night's code — per-thing mail cooldown, a box's input bounded and checked, both off-site account types on a reset, a quiet first run, strict-mode installer

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-14 19:08:55 +01:00
1 parent a044eb8c16
commit f618c591eb
31 files changed
+796 -88

No files matched your search

+6 -2
View File
@@ -928,7 +928,7 @@ func main() {
// R-523: the agent's in-guest controller supervisor → controller_restarted_by_agent / controller_crashloop.
controllerSupervisorChecker := monitor.NewControllerSupervisorChecker(dataStore, dispatcher.ProcessEvent, logger)
// R-1383 (2) an operator mail that was never sent — told at this start, in one mail (after the mail hold is wired).
go dispatcher.ReportLostOperatorMails(time.Now())
go dispatcher.ReportLostOperatorMails(time.Now(), processStart)
// R-1383 (3) a signed job a box never took — on the 60 s sweep.
signedJobWaitChecker := monitor.NewSignedJobWaitChecker(
func() ([]monitor.PendingSignedJob, error) {
@@ -966,7 +966,7 @@ func main() {
}
return out, err
},
dataStore.OSAlarmRaised, dataStore.SetOSAlarmRaised, hubEvent, logger)
dataStore.OSAlarmRaised, dataStore.SetOSAlarmRaised, dataStore.OSAlarmKeys, hubEvent, logger)
// D53 (`08` §10): a held app reaches the OPERATOR — one reminder after the grace per reason, then weekly.
var heldGrace time.Duration
if v := cfg.Alerting.HeldAppGraceOverride; v != "" {
@@ -1133,6 +1133,10 @@ func loadConfig(path string, logger *log.Logger) *Config {
return cfg
}
// processStart is when this hub process began. The lost-mail scan tells only mails that failed BEFORE it: a mail
// that failed since still has this process's retry timers.
var processStart = time.Now()
// dailyLedger remembers across a restart when a watched daily check last ran (R-1383). nil until main wires it; a nil
// ledger is safe to call.
var dailyLedger *monitor.DailyLedger