hub: Restart controller (the agent's closed list on the host-report reply) and Clear hold (D64 = B, the controller's list) on the host page, each behind a confirm; controller_unresponsive (R-1344, alarm only); 04 §6.1 + 09 §3 decision 283; wire gate declares both new wires; R-1344 filed — tests red first
gates / gates (push) Successful in 3m23s

This commit is contained in:
admin committed 2026-10-29 12:31:33 +01:00
1 parent 70862fa7b3
commit 3d0c907b56
20 files changed
+663 -20

No files matched your search

+20
View File
@@ -809,6 +809,16 @@ type hostReportPayload struct {
DeliberateOff *struct {
RequestedAt string `json:"requested_at"`
} `json:"deliberate_off"`
// OperatorActionResults (2026-10-29, the agent's operator actions): the answers to the previous replies'
// operator_actions — the controller's shape. Absent on an older agent.
OperatorActionResults []hostOperatorActionResult `json:"operator_action_results"`
}
// hostOperatorActionResult mirrors the agent's hub.OperatorActionResult.
type hostOperatorActionResult struct {
ID int64 `json:"id"`
Outcome string `json:"outcome"`
Message string `json:"message"`
}
// hostForeignKeyArchives mirrors the agent's hub.ForeignKeyArchives (R-366 slice 2).
@@ -1133,6 +1143,14 @@ func (h *Handler) handleHostReport(w http.ResponseWriter, r *http.Request) {
if pending, err := h.store.PendingLogBundleRequest(hostID, store.LogBundleComponentAgent); err == nil && pending {
resp["log_tail_requested"] = true
}
// The agent's operator actions (2026-10-29): the results this report carries close their rows (one event each);
// what is still pending rides this reply. A store error drops nothing from the heartbeat.
h.ingestHostOperatorActionResults(hostID, custID, rep.OperatorActionResults)
if acts, err := h.store.PendingHostOperatorActions(hostID); err != nil {
h.logger.Printf("[WARN] host operator actions for %s: %v", hostID, err)
} else if len(acts) > 0 {
resp["operator_actions"] = acts
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
json.NewEncoder(w).Encode(resp)
@@ -2400,6 +2418,8 @@ var allowedEventTypes = map[string]bool{
"controller_crashloop": true,
// R-539 (hub v0.117.0, agent v0.132.0) — hub-generated from slow_crashloop_since; operator-only.
"controller_slow_crashloop": true,
// R-1344 (2026-10-29): hub-generated from the stanza's unresponsive_since; operator-only (notify.operatorOnlyEvents).
"controller_unresponsive": true,
// R-550 (hub v0.117.0, controller v0.246.0) — pushed by the controller at startup when it finds a
// restore that was in flight when the box stopped. For the household: they can run it again.
"restore_interrupted": true,