Files
bootstrap/templates/repo/.mosaic
Jason Woltje 5ba531e2d0 feat: r0 coordinator tooling for orchestrator protocol
Implements the manual coordinator workflow for multi-session agent
orchestration. Agents stop after one milestone (confirmed limitation);
these tools let the human coordinator check status, generate continuation
prompts, and chain sessions together.

New:
- tools/orchestrator/ — 5 scripts + shared library (_lib.sh)
  - mission-init.sh: initialize mission with milestones and state files
  - mission-status.sh: dashboard showing milestones, tasks, sessions
  - session-status.sh: check if agent is running/stale/dead
  - continue-prompt.sh: generate paste-ready continuation prompt
  - session-resume.sh: crash recovery with dirty state detection
- guides/ORCHESTRATOR-PROTOCOL.md: agent-facing mission lifecycle guide
- templates/docs/: mission manifest, scratchpad, continuation templates
- templates/repo/.mosaic/orchestrator/mission.json: state file template

Modified:
- bin/mosaic: add 'coord' subcommand + resume advisory on launch
- AGENTS.md: conditional loading for protocol guide + rule 37
- bin/mosaic-doctor: checks for new coordinator files
- session hooks: mission detection on start, cleanup on end

Usage: mosaic coord init|mission|status|continue|resume

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:22:50 -06:00
..

Repo Mosaic Linkage

This repository is attached to the machine-wide Mosaic framework.

Load Order for Agents

  1. ~/.config/mosaic/STANDARDS.md
  2. AGENTS.md (this repository)
  3. .mosaic/repo-hooks.sh (repo-specific automation hooks)

Purpose

  • Keep universal standards in ~/.config/mosaic
  • Keep repo-specific behavior in this repo
  • Avoid copying large runtime configs into each project

Optional Quality Rails

Use .mosaic/quality-rails.yml to track whether quality rails are enabled for this repo.

Apply a template:

~/.config/mosaic/bin/mosaic-quality-apply --template <template> --target .

Verify enforcement:

~/.config/mosaic/bin/mosaic-quality-verify --target .

Optional Matrix Orchestrator Rail

Repo-local orchestrator state lives in .mosaic/orchestrator/.

Run one cycle:

~/.config/mosaic/bin/mosaic-orchestrator-matrix-cycle
~/.config/mosaic/bin/mosaic-orchestrator-run --once

Run continuously:

~/.config/mosaic/bin/mosaic-orchestrator-run --poll-sec 10

Bridge events to Matrix:

~/.config/mosaic/bin/mosaic-orchestrator-matrix-publish
~/.config/mosaic/bin/mosaic-orchestrator-matrix-consume

Run until queue is drained (syncs from docs/tasks.md first):

~/.config/mosaic/bin/mosaic-orchestrator-drain

Set worker command if auto-detect does not match your CLI:

export MOSAIC_WORKER_EXEC="codex -p"
# or
export MOSAIC_WORKER_EXEC="opencode -p"

Use repo helper (foreground or detached):

bash scripts/agent/orchestrator-daemon.sh drain
bash scripts/agent/orchestrator-daemon.sh start
bash scripts/agent/orchestrator-daemon.sh status
bash scripts/agent/orchestrator-daemon.sh stop