hub: operator actions for a box (D1, R-314/R-279/R-177, decision 185)
Host page "Operator Actions" card: run off-site backup now, run a check now
(fixed job list), stop / extend (1-30 days) a deletion countdown. POST
/hosts/{id}/operator-action validates against the CLOSED list before
storing (unknown -> 400, no row), stores operator_actions(id, customer_id,
action, arg, requested_at, requested_by, done_at, outcome, message), logs
who pressed (channel + address) and bumps the box's intent. The report ACK
lists pending rows as operator_actions until the box's
operator_action_results closes them (matched on id AND reporting
customer); each closed row becomes a hub-minted operator_action event
(stored, never dispatched). Unanswered after 24 h: expired. A customer
RESET cancels pending rows. Wire gate: new root + field-by-field mirror
(controller report.OperatorAction) — needs the controller commit first.
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:
@@ -171,8 +171,14 @@ func TestHandleHostDetail(t *testing.T) {
|
||||
// v0.47.0: this fixture host is ONLINE (report just saved), so the stale-host
|
||||
// danger-zone card must NOT render for it — this pin now doubles as the
|
||||
// "delete hidden for online hosts" proof (the stale case: TestHostDetail_DangerCardForStaleOnly).
|
||||
if got := strings.Count(strings.ToLower(body), "<button"); got != 2 {
|
||||
t.Errorf("host detail has %d buttons, want exactly the 2 log-request buttons", got)
|
||||
// Decision 185 (2026-10-08): plus the four operator-action buttons — a closed list, none of which
|
||||
// deletes or mutates the host (TestOperatorActions_* pin what they may do). Every OTHER button
|
||||
// remains absent: 2 log requests + 4 operator actions, and the 4 all post to /operator-action.
|
||||
if got := strings.Count(strings.ToLower(body), "<button"); got != 6 {
|
||||
t.Errorf("host detail has %d buttons, want exactly the 2 log-request + 4 operator-action buttons", got)
|
||||
}
|
||||
if got := strings.Count(body, `action="/hosts/demo-felhom-01/operator-action"`); got != 4 {
|
||||
t.Errorf("operator-action forms = %d, want 4", got)
|
||||
}
|
||||
if strings.Count(body, `action="/hosts/demo-felhom-01/request-logs"`) != 2 {
|
||||
t.Error("the request-logs forms are missing — every button must be a log-bundle request")
|
||||
|
||||
Reference in New Issue
Block a user