From 96cb80288fe6be55a56d9dfd3ba7119a5986e129 Mon Sep 17 00:00:00 2001 From: operator Date: Mon, 5 Oct 2026 05:39:36 +0000 Subject: [PATCH] feat(ops): expand command suite with watchdog.alerts, relay.health, and swarm.results --- bin/box-relay.sh | 12 ++++++++++-- bin/exec-constrained.py | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/bin/box-relay.sh b/bin/box-relay.sh index 1f59218..f190baa 100755 --- a/bin/box-relay.sh +++ b/bin/box-relay.sh @@ -343,8 +343,13 @@ case "$cmd" in list) call_exec "swarm.list" "{}" ;; + results) + sid="${1:?usage: box swarm results }" + args=$(python3 -c "import json, sys; print(json.dumps({'swarm_id': sys.argv[1]}))" "$sid") + call_exec "swarm.results" "$args" + ;; *) - echo "Usage: box swarm spawn|status|list ..." + echo "Usage: box swarm spawn|status|results|list ..." ;; esac ;; @@ -435,7 +440,10 @@ case "$cmd" in call_exec "chrome.errors" "{}" ;; watchdog-alerts) - call_exec "cdp.latency" "{}" + call_exec "watchdog.alerts" "{}" + ;; + relay-health) + call_exec "relay.health" "{}" ;; ping) call_exec "exec.ping" "{}" diff --git a/bin/exec-constrained.py b/bin/exec-constrained.py index 7df5196..de3b0ec 100755 --- a/bin/exec-constrained.py +++ b/bin/exec-constrained.py @@ -456,6 +456,14 @@ def _chrome_errors_build(a): return [sys.executable, os.path.join(BIN_DIR, 'box-ctl.py'), 'chrome-errors'] +def _watchdog_alerts_build(a): + return [sys.executable, os.path.join(BIN_DIR, 'box-ctl.py'), 'watchdog-alerts'] + + +def _relay_health_build(a): + return [sys.executable, os.path.join(BIN_DIR, 'box-ctl.py'), 'relay-health'] + + def _subagent_spawn_validate(raw): if not isinstance(raw, dict): raise OpError('args must be an object') @@ -888,6 +896,16 @@ OPS = { 'timeout': 30, 'side_effecting': False, 'desc': 'Scan chrome log files for FATAL/crash/OOM errors since watermark (read-only)', }, + 'watchdog.alerts': { + 'validate': _health_validate, 'build': _watchdog_alerts_build, + 'timeout': 30, 'side_effecting': False, + 'desc': 'Check for new browser relaunch watchdog alerts since watermark (read-only)', + }, + 'relay.health': { + 'validate': _health_validate, 'build': _relay_health_build, + 'timeout': 30, 'side_effecting': False, + 'desc': 'Check systemd relay service status across all node ports (read-only)', + }, 'subagent.spawn': { 'validate': _subagent_spawn_validate, 'build': _subagent_spawn_build, 'timeout': 120, 'side_effecting': True,