Compare commits
1 Commits
plan/tmux-
...
b464c39fc7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b464c39fc7 |
@@ -3,11 +3,6 @@
|
|||||||
This directory contains the first durable tmux-backed fleet primitives for the
|
This directory contains the first durable tmux-backed fleet primitives for the
|
||||||
Mosaic software-factory model.
|
Mosaic software-factory model.
|
||||||
|
|
||||||
The lifecycle model follows the organization-neutral AI Guide playbook
|
|
||||||
`mosaicstack/aiguide:playbooks/tmux-fleet.md` (commit `2a0b0b5`): a dedicated
|
|
||||||
holder owns the tmux server/socket; agent units join it and stop only their own
|
|
||||||
exact-match session.
|
|
||||||
|
|
||||||
## Layout
|
## Layout
|
||||||
|
|
||||||
- `mosaic-tmux-holder.service` — user-mode holder that owns the named tmux server.
|
- `mosaic-tmux-holder.service` — user-mode holder that owns the named tmux server.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Environment=MOSAIC_AGENT_RUNTIME=pi
|
|||||||
Environment=MOSAIC_AGENT_WORKDIR=%h
|
Environment=MOSAIC_AGENT_WORKDIR=%h
|
||||||
EnvironmentFile=-%h/.config/mosaic/fleet/agents/%i.env
|
EnvironmentFile=-%h/.config/mosaic/fleet/agents/%i.env
|
||||||
ExecStart=/bin/bash %h/.config/mosaic/tools/fleet/start-agent-session.sh %i
|
ExecStart=/bin/bash %h/.config/mosaic/tools/fleet/start-agent-session.sh %i
|
||||||
ExecStop=-/bin/bash -lc 'tmux -L "${MOSAIC_TMUX_SOCKET:-mosaic-factory}" kill-session -t "=%i"'
|
ExecStop=-/bin/bash -lc 'tmux -L "${MOSAIC_TMUX_SOCKET:-mosaic-factory}" kill-session -t "=%i:0.0"'
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ grep -qF 'tmux -L' "$HOLDER" || fail "holder does not use named tmux socket"
|
|||||||
grep -qF '_holder' "$HOLDER" || fail "holder session is not explicit"
|
grep -qF '_holder' "$HOLDER" || fail "holder session is not explicit"
|
||||||
grep -qF 'Requires=mosaic-tmux-holder.service' "$AGENT" || fail "agent does not require holder"
|
grep -qF 'Requires=mosaic-tmux-holder.service' "$AGENT" || fail "agent does not require holder"
|
||||||
grep -qF 'start-agent-session.sh' "$AGENT" || fail "agent unit does not call start-agent-session.sh"
|
grep -qF 'start-agent-session.sh' "$AGENT" || fail "agent unit does not call start-agent-session.sh"
|
||||||
grep -qF 'kill-session -t "=%i"' "$AGENT" || fail "agent stop does not exact-match its session"
|
|
||||||
|
|
||||||
if command -v systemd-analyze >/dev/null 2>&1; then
|
if command -v systemd-analyze >/dev/null 2>&1; then
|
||||||
systemd-analyze verify --user "$HOLDER" "$AGENT" >/tmp/mosaic-fleet-systemd-verify.log 2>&1 || {
|
systemd-analyze verify --user "$HOLDER" "$AGENT" >/tmp/mosaic-fleet-systemd-verify.log 2>&1 || {
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
**Architecture:** Mosaic should ship generic tmux fleet primitives in the framework, then layer local rosters through configuration. The holder service owns the tmux socket; each agent service joins the holder-owned server and runs `mosaic yolo <runtime>`. The orchestrator addresses agents through `mosaic agent ...` abstractions so tmux can later be replaced by Matrix-backed agent comms without changing mission flow.
|
**Architecture:** Mosaic should ship generic tmux fleet primitives in the framework, then layer local rosters through configuration. The holder service owns the tmux socket; each agent service joins the holder-owned server and runs `mosaic yolo <runtime>`. The orchestrator addresses agents through `mosaic agent ...` abstractions so tmux can later be replaced by Matrix-backed agent comms without changing mission flow.
|
||||||
|
|
||||||
**Reference:** AI Guide `playbooks/tmux-fleet.md` at commit `2a0b0b5` documents the organization-neutral holder-service pattern, exact-match `=<name>` stop targets, and coupled-server cutover/verification sequence. The Stack implementation should treat that as the lifecycle model and keep concrete Mosaic unit/tooling details here.
|
|
||||||
|
|
||||||
**Tech Stack:** Bash, tmux, user systemd units, Mosaic CLI/framework installer, JSON/YAML roster config, existing `packages/mosaic/framework/tools/tmux/{agent-send.sh,send-message.sh}`.
|
**Tech Stack:** Bash, tmux, user systemd units, Mosaic CLI/framework installer, JSON/YAML roster config, existing `packages/mosaic/framework/tools/tmux/{agent-send.sh,send-message.sh}`.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -717,7 +715,7 @@ The implementation is complete when:
|
|||||||
## Risks and mitigations
|
## Risks and mitigations
|
||||||
|
|
||||||
| Risk | Mitigation |
|
| Risk | Mitigation |
|
||||||
| --------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|---|---|
|
||||||
| Killing existing tmux sessions | Use named `mosaic-factory` socket; no default `tmux kill-server`. |
|
| Killing existing tmux sessions | Use named `mosaic-factory` socket; no default `tmux kill-server`. |
|
||||||
| systemd unit quoting/env expansion bugs | Move logic into shell wrappers; verify with `systemd-analyze --user verify`. |
|
| systemd unit quoting/env expansion bugs | Move logic into shell wrappers; verify with `systemd-analyze --user verify`. |
|
||||||
| Runtime reset command mismatch | Make reset command runtime-configurable; fallback to service restart + kickstart. |
|
| Runtime reset command mismatch | Make reset command runtime-configurable; fallback to service restart + kickstart. |
|
||||||
|
|||||||
Reference in New Issue
Block a user