Files
stack/packages/mosaic/framework/tools
veronica d24acbd33f
ci/woodpecker/pr/ci Pipeline failed
fix(#1408): legacy-socket launch guard + seat launch.sh preference
Two cutover hazards in start-agent-session.sh, both measured on a live fleet
host (27 seats on the default tmux socket, holder active on mosaic-fleet):

1. Legacy-socket guard, exit 76 (seat-on-legacy-socket). The declared-socket
   has-session check cannot see a session living on the DEFAULT socket
   (measured: rc=1, launch proceeds), so a cutover-window launch creates a
   same-name duplicate that name-addressed comms delivery cannot tell apart.
   The guard refuses before any tmux mutation, with its own exit code so wave
   scripts can branch on 0 (already running) / 75 (broker absent) / 76.

2. LAUNCH_COMMAND prefers the seat's executable launch.sh, mosaic-yolo
   fallback otherwise. Measured basis: `mosaic yolo` relocates
   CLAUDE_CONFIG_DIR to the seat dir (launch.ts activeSeatDir/harnessEnv) but
   sets no CLAUDE_SECURESTORAGE_CONFIG_DIR and runs no config seeding — a
   yolo-launched seat points its config at a directory holding no
   credentials. The seat launch.sh path binds the auth profile and seeds the
   config; the env -i pane allowlist still applies.

test-agent-session-legacy-socket-guard.sh covers the guard with the same
hermetic contract as the broker-preflight suite (fake tmux answering the
ownership probe, real short-path unix socket, env -i): legacy present -> 76 +
no tmux mutation; legacy absent -> guard not the refusal; empty
MOSAIC_TMUX_SOCKET -> guard inert. Sabotage control verified: guard removed,
case 1 fails (exit 69), cases 2-3 pass; restored byte-identically.
2026-08-24 19:10:03 -05:00
..