feat: mosaic broadcast — fleet-wide message via roster SSOT with auto-injected routing preamble #822

Open
opened 2026-07-17 20:54:48 +00:00 by jason.woltje · 0 comments
Owner

Summary

Add a first-class fleet broadcast capability to the Mosaic framework: send one message to many active fleet sessions at once, enumerating targets from the fleet roster SSOT. Promotes today's error-prone manual for t in ...; send-message.sh loop (used for the 2026-07-17 comms-protocol reminder) into a supported, protocol-correct tool.

Requested by Jason (owner, #mos 2026-07-17 20:45Z); coordinated via Mos. Queued behind the MS-LEAD ≤2 goal cap — does NOT preempt #792/#818 or the gitwatch PoC. Design only in this issue; build is not authorized yet.

Why

Fleet-wide directives recur (protocol reminders, coordinated holds/lifts, standdowns). The manual loop is error-prone and drifts off-protocol — notably it drops the required [web1:src -> web1:dst] routing preamble, which is exactly the drift Jason flagged (send-message.sh does NOT auto-inject the preamble).

Proposed shape

  • Entry point: ~/.config/mosaic/tools/tmux/broadcast.sh (and/or mosaic broadcast), wrapping the existing send-message.sh (inherits its bracketed-paste delivery, busy-guard/queue semantics, exit-code contract).
  • Roster SSOT: enumerate targets from infra/fleet/fleet.roster (format <name> <runtime> <role>) plus per-agent .conf role metadata (_role-*.brief). Do NOT hardcode a session list. Note: coordinator mos-claude is not a roster instance — handle it explicitly if it should be a target.
  • ACTIVE-only: resolve each candidate to a live tmux session; SKIP dead/absent ones and REPORT which were skipped (no silent drop).
  • MUST auto-inject the per-target preamble: each outbound carries [web1:<self> -> web1:<target>], derived from MOSAIC_AGENT_NAME (sender) and the resolved target. This is the core defect the tool fixes; a manual -f loop cannot do it. Hard requirement.
  • Target filters: --role <coder|review|security|orchestration|...>, --all, or explicit -t list. "orchestration" = TLs + planners + delegates + enhance. Default/common case may be limited to orchestration-tier (Jason floated this).
  • Sender gate (guardrail): only orchestration-tier agents may broadcast (prevents a worker fleet-spamming). Enforce via role check on MOSAIC_AGENT_NAME.
  • Message body: -m or -f <file> (file for backtick/hash/metachar payloads) — same contract as send-message.sh.
  • Output: per-target delivered / queued / skipped summary.

Non-goals (M1)

  • No cross-host broadcast (single web1 host for now).
  • No persistence/audit-log of broadcasts (possible follow-up).
  • No scheduling.

Acceptance criteria

  • Enumerates targets from the roster SSOT (no hardcoded list); role/--all/explicit filters work.
  • Auto-injects a correct [web1:src -> web1:dst] preamble per target (verified by unit test).
  • Skips non-live sessions and reports them; per-target delivered/queued/skipped summary emitted.
  • Sender-gate rejects non-orchestration callers.
  • Lands in the packages/mosaic framework surface (delegation-remediation consolidation route — NOT jarvis-brain).
  • Tests present; reviewed PR, author≠reviewer, CI-green where applicable.

Placement / gates

Framework tooling → consolidate into packages/mosaic (per delegation-remediation route). Reviewed PR, author≠reviewer, CI-green where applicable. Build gated on MS-LEAD goal-lane availability (currently at cap).

## Summary Add a first-class fleet **broadcast** capability to the Mosaic framework: send one message to many active fleet sessions at once, enumerating targets from the fleet roster SSOT. Promotes today's error-prone manual `for t in ...; send-message.sh` loop (used for the 2026-07-17 comms-protocol reminder) into a supported, protocol-correct tool. Requested by Jason (owner, #mos 2026-07-17 20:45Z); coordinated via Mos. **Queued behind the MS-LEAD ≤2 goal cap — does NOT preempt #792/#818 or the gitwatch PoC.** Design only in this issue; build is not authorized yet. ## Why Fleet-wide directives recur (protocol reminders, coordinated holds/lifts, standdowns). The manual loop is error-prone and drifts off-protocol — notably it **drops the required `[web1:src -> web1:dst]` routing preamble**, which is exactly the drift Jason flagged (`send-message.sh` does NOT auto-inject the preamble). ## Proposed shape - **Entry point:** `~/.config/mosaic/tools/tmux/broadcast.sh` (and/or `mosaic broadcast`), wrapping the existing `send-message.sh` (inherits its bracketed-paste delivery, busy-guard/queue semantics, exit-code contract). - **Roster SSOT:** enumerate targets from `infra/fleet/fleet.roster` (format `<name> <runtime> <role>`) plus per-agent `.conf` role metadata (`_role-*.brief`). Do NOT hardcode a session list. Note: coordinator `mos-claude` is not a roster instance — handle it explicitly if it should be a target. - **ACTIVE-only:** resolve each candidate to a live tmux session; SKIP dead/absent ones and REPORT which were skipped (no silent drop). - **MUST auto-inject the per-target preamble:** each outbound carries `[web1:<self> -> web1:<target>]`, derived from `MOSAIC_AGENT_NAME` (sender) and the resolved target. This is the core defect the tool fixes; a manual `-f` loop cannot do it. **Hard requirement.** - **Target filters:** `--role <coder|review|security|orchestration|...>`, `--all`, or explicit `-t` list. "orchestration" = TLs + planners + delegates + enhance. Default/common case may be limited to orchestration-tier (Jason floated this). - **Sender gate (guardrail):** only orchestration-tier agents may broadcast (prevents a worker fleet-spamming). Enforce via role check on `MOSAIC_AGENT_NAME`. - **Message body:** `-m` or `-f <file>` (file for backtick/hash/metachar payloads) — same contract as `send-message.sh`. - **Output:** per-target delivered / queued / skipped summary. ## Non-goals (M1) - No cross-host broadcast (single web1 host for now). - No persistence/audit-log of broadcasts (possible follow-up). - No scheduling. ## Acceptance criteria - Enumerates targets from the roster SSOT (no hardcoded list); role/`--all`/explicit filters work. - Auto-injects a correct `[web1:src -> web1:dst]` preamble per target (verified by unit test). - Skips non-live sessions and reports them; per-target delivered/queued/skipped summary emitted. - Sender-gate rejects non-orchestration callers. - Lands in the `packages/mosaic` framework surface (delegation-remediation consolidation route — NOT jarvis-brain). - Tests present; reviewed PR, author≠reviewer, CI-green where applicable. ## Placement / gates Framework tooling → consolidate into `packages/mosaic` (per delegation-remediation route). Reviewed PR, author≠reviewer, CI-green where applicable. **Build gated on MS-LEAD goal-lane availability** (currently at cap).
jason.woltje added the fleet-enhancement label 2026-07-17 20:55:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#822