feat(main-loop): expand fleet dual monitoring to dev, verify box-relay paths and sidechat brain execution

This commit is contained in:
operator
2026-10-05 01:53:23 +00:00
parent c54f0120da
commit 9f27dbd592
4 changed files with 33 additions and 7 deletions
+3 -2
View File
@@ -51,9 +51,10 @@ THREAD_OPS = ("list", "pin", "unpin", "archive", "unarchive")
# chat unless --allow-main-chat is passed explicitly. # chat unless --allow-main-chat is passed explicitly.
NOTIFY_SIDECHATS = { NOTIFY_SIDECHATS = {
"646": "646 tasks", "646": "646 tasks",
"opm": "heartbeat", "opm": "main-loop brain",
"pip": "646-pip-coord", "pip": "pip tasks",
"muse": "muse tasks", "muse": "muse tasks",
"dev": "onboarding-dev",
} }
VALID_ON_FAILURE = {"retry", "alert", "ignore"} VALID_ON_FAILURE = {"retry", "alert", "ignore"}
KNOWN_PLACEHOLDERS = {"job_id", "job_name", "datetime", "date", "last_run"} KNOWN_PLACEHOLDERS = {"job_id", "job_name", "datetime", "date", "last_run"}
+21 -3
View File
@@ -30,6 +30,10 @@ if [ -z "$AGENT" ]; then
AGENT="muse" AGENT="muse"
elif echo "$HOSTNAME" | grep -qi "opm"; then elif echo "$HOSTNAME" | grep -qi "opm"; then
AGENT="opm" AGENT="opm"
elif echo "$HOSTNAME" | grep -qi "dev"; then
AGENT="dev"
elif echo "$HOSTNAME" | grep -qi "def"; then
AGENT="def"
else else
AGENT="646" AGENT="646"
fi fi
@@ -71,6 +75,9 @@ except Exception as e:
key="$HOME/.ssh/id_ed25519" key="$HOME/.ssh/id_ed25519"
fi fi
local ident="operator-$AGENT" local ident="operator-$AGENT"
if [ "$AGENT" = "super" ]; then
ident="super"
fi
local ts local ts
ts=$(date +%s) ts=$(date +%s)
local nonce local nonce
@@ -212,9 +219,20 @@ case "$cmd" in
call_exec "thread.list" "$args" call_exec "thread.list" "$args"
;; ;;
view) view)
thread_id="${1:?usage: box thread view <thread_id> [limit]}" target_agent="$AGENT"
while [ $# -gt 0 ]; do
case "$1" in
--agent) target_agent="$2"; shift 2 ;;
*) break ;;
esac
done
if [ $# -ge 2 ] && echo " 646 opm pip muse dev def " | grep -q " $1 "; then
target_agent="$1"
shift
fi
thread_id="${1:?usage: box thread view [<agent>] <thread_id> [limit]}"
limit="${2:-15}" limit="${2:-15}"
args=$(python3 -c "import json, sys; print(json.dumps({'agent': sys.argv[1], 'thread': sys.argv[2], 'limit': int(sys.argv[3])}))" "$AGENT" "$thread_id" "$limit") args=$(python3 -c "import json, sys; print(json.dumps({'agent': sys.argv[1], 'thread': sys.argv[2], 'limit': int(sys.argv[3])}))" "$target_agent" "$thread_id" "$limit")
call_exec "thread.view" "$args" call_exec "thread.view" "$args"
;; ;;
*) *)
@@ -229,7 +247,7 @@ case "$cmd" in
call_exec "exec.ping" "{}" call_exec "exec.ping" "{}"
;; ;;
ops) ops)
curl -sk -sS "$EXEC_URL/ops" | python3 -m json.tool curl -sk -sS "${EXEC_URL%/exec}/ops" | python3 -m json.tool
;; ;;
help|--help|-h) help|--help|-h)
cat <<EOF cat <<EOF
+7 -1
View File
@@ -64,7 +64,7 @@ AUDIT_LOG = '/home/super/.exec-constrained-audit.jsonl'
SIG_NAMESPACE = 'exec-constrained' SIG_NAMESPACE = 'exec-constrained'
SIG_MAX_SKEW = 300 SIG_MAX_SKEW = 300
AGENTS = ('muse', 'pip', '646', 'opm') AGENTS = ('muse', 'pip', '646', 'opm', 'def', 'dev')
TARGET_RE = re.compile(r'^[A-Za-z0-9][A-Za-z0-9/_.-]{0,63}$') TARGET_RE = re.compile(r'^[A-Za-z0-9][A-Za-z0-9/_.-]{0,63}$')
JOB_RE = re.compile(r'^[a-z0-9][a-z0-9-]{0,63}$') JOB_RE = re.compile(r'^[a-z0-9][a-z0-9-]{0,63}$')
IDENT_RE = re.compile(r'^[a-z0-9-]+$') IDENT_RE = re.compile(r'^[a-z0-9-]+$')
@@ -598,10 +598,16 @@ PERMISSIONS = {
'operator-muse': set(OPS), 'operator-muse': set(OPS),
'operator-pip': set(OPS), 'operator-pip': set(OPS),
'operator-opm': set(OPS), 'operator-opm': set(OPS),
'operator-dev': set(OPS),
'operator-def': set(OPS),
'operator-super': set(OPS),
'super': set(OPS),
'646': set(OPS), '646': set(OPS),
'pip': set(OPS), 'pip': set(OPS),
'muse': set(OPS), 'muse': set(OPS),
'opm': set(OPS), 'opm': set(OPS),
'dev': set(OPS),
'def': set(OPS),
'exec-canary': {'exec.ping'}, 'exec-canary': {'exec.ping'},
} }
DEFAULT_PERMS = {'dm.read', 'chat.messages', 'health.check', 'thread.list', 'thread.view', 'exec.ping'} DEFAULT_PERMS = {'dm.read', 'chat.messages', 'health.check', 'thread.list', 'thread.view', 'exec.ping'}
+2 -1
View File
@@ -60,13 +60,14 @@ LOCK_FILE = os.path.join(BASE, "self-main-loop.lock")
STATE_LOCK_FILE = os.path.join(BASE, "self-main-loop-state.lock") STATE_LOCK_FILE = os.path.join(BASE, "self-main-loop-state.lock")
FOLLOWUPS_FILE = os.path.join(BASE, "followups.json") FOLLOWUPS_FILE = os.path.join(BASE, "followups.json")
DEFAULT_AGENTS = ["muse", "pip", "646", "opm"] DEFAULT_AGENTS = ["muse", "pip", "646", "opm", "dev"]
# Prompting sidechat per agent — mirrors box-ctl.py NOTIFY_SIDECHATS. # Prompting sidechat per agent — mirrors box-ctl.py NOTIFY_SIDECHATS.
DEFAULT_PROMPT_SIDECHAT = { DEFAULT_PROMPT_SIDECHAT = {
"646": "646 tasks", "646": "646 tasks",
"opm": "main-loop brain", "opm": "main-loop brain",
"pip": "pip tasks", "pip": "pip tasks",
"muse": "muse tasks", "muse": "muse tasks",
"dev": "onboarding-dev",
} }
DEFAULT_SENDER = "opm" # neutral sender, mirrors `box notify` DEFAULT_SENDER = "opm" # neutral sender, mirrors `box notify`
READ_LIMIT = 30 READ_LIMIT = 30