diff --git a/SKILL.md b/SKILL.md index a7c91eaa..1eb9a936 100644 --- a/SKILL.md +++ b/SKILL.md @@ -105,6 +105,14 @@ If argument is "team", "team --json", "team --fix", "team --fix-pane-names", or - `--rename-sessions` repairs the CLI session name by **typing** the type's rename command (e.g. `/rename -`) into each session whose name mismatches, is renamable, and is at a prompt; reported as `changed`, `poked_unverified`, `skipped`, or `failed`. - `--fix` does both, unconditionally, including the keystroke. +If argument starts with "sweep" followed by a team name: +1. Run `~/.agents/skills/__SKILL_NAME__/scripts/sweep.sh `. +2. This is an explicit leader action. Never run it from inbox delivery, session + startup, a status command, or any other automatic path. +3. Show the complete result. A skipped `none`, `unknown`, unreadable, + unsupported, or malformed observation is part of the result, not noise to + summarize away; the command returns non-zero when any such row exists. + If argument starts with "send" (e.g. "send misaki check the server"): 1. Parse target agent and message from the arguments 2. Determine which team the target agent belongs to, then run: diff --git a/scripts/lib/sweep.sh b/scripts/lib/sweep.sh new file mode 100644 index 00000000..75685ba7 --- /dev/null +++ b/scripts/lib/sweep.sh @@ -0,0 +1,214 @@ +#!/usr/bin/env bash +# sweep.sh -- explicit leader-side fan-out for a team's self-repair (#1152). + +[ -n "${_AGMSG_SWEEP_SH:-}" ] && return 0 +_AGMSG_SWEEP_SH=1 + +# This is the only seam between the command and #1155's read-only census. The +# census is shared infrastructure, not a sweep-owned scan: diagnostics and this +# command consume the same observation independently and never consume one +# another's output. Once #1155 lands, the body is exactly the production +# primitive. Keeping the call here also lets the orchestrator tests replace the +# observation without an environment-based target injection path in the shipped +# command. +_agmsg_sweep_agent_rows() { + declare -F agmsg_terminal_enumerate >/dev/null 2>&1 || return 127 + agmsg_terminal_enumerate +} + +# These adapters are intentionally fail-closed until the instance-aware process +# observer, label reader and compare-and-poke ABI land. None may be emulated by +# loading a driver against the leader's environment: two terminal instances +# routinely contain the same bare pane id. +_agmsg_sweep_process_at() { return 127; } # +_agmsg_sweep_label_at() { return 127; } # +_agmsg_sweep_poke_fenced() { return 127; } # +_agmsg_sweep_instance_allowed() { return 127; } # +_agmsg_sweep_locator() { # + declare -F agmsg_locator_compose >/dev/null 2>&1 || return 127 + agmsg_locator_compose "$1" "$2" "$3" +} + +# Is