hub: box presence from the wait channel + delete a switched-off box at once (R-30, D2)
Slice 1: intent.Hub records one start/end per GET /api/v1/wait request and answers Presence(customer, now): connected (hold open, or one started < 333 s = 243 s cadence + 90 s grace ago), not connected since T, or unknown (hub up < 333 s; in memory only). The host page shows "Box connection". One DEBUG line per presence change. Slice 2 (operator ruling D2, 2026-10-08, 09 §3 decision 186): a host that is online by its report clock but whose box has had no wait-channel connection for >= 360 s may be deleted at once after the tick "I checked: the box is off". Presence is re-read at POST time; the tick alone, unknown presence, a connected box or a shorter gap keep today's 409. The delete logs the operator channel and saves one host_deleted_box_off event. RESET and the customer-delete cascade are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -604,6 +604,7 @@ func main() {
|
||||
// compares with != , so a restart costs exactly one harmless full-state report. Closed before
|
||||
// server.Shutdown (below) so held waits complete instantly instead of eating the grace window.
|
||||
intentHub := intent.New()
|
||||
intentHub.SetLogger(logger.Printf) // R-30: one DEBUG line per box-presence change
|
||||
apiHandler.SetIntentHub(intentHub)
|
||||
webServer.SetIntentHub(intentHub)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user