From 0ff39bcee4043870b1012afc2e181512e7061918 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Tue, 17 Feb 2026 14:41:47 -0600 Subject: [PATCH] add drain-mode orchestration and docs/tasks sync for codex-opencode --- README.md | 10 + bin/mosaic-bootstrap-repo | 3 +- bin/mosaic-doctor | 3 + bin/mosaic-orchestrator-drain | 33 ++++ bin/mosaic-orchestrator-sync-tasks | 12 ++ guides/orchestrator.md | 2 + rails/orchestrator-matrix/README.md | 15 ++ .../controller/mosaic_orchestrator.py | 127 +++++++++++-- .../controller/tasks_md_sync.py | 174 ++++++++++++++++++ runtime/opencode/AGENTS.md | 1 + templates/repo/.mosaic/README.md | 41 ++++- .../repo/.mosaic/orchestrator/config.json | 5 +- .../repo/.mosaic/orchestrator/tasks.json | 15 +- .../repo/scripts/agent/orchestrator-daemon.sh | 102 ++++++++++ .../repo/scripts/agent/orchestrator-worker.sh | 63 +++++++ 15 files changed, 560 insertions(+), 46 deletions(-) create mode 100755 bin/mosaic-orchestrator-drain create mode 100755 bin/mosaic-orchestrator-sync-tasks create mode 100644 rails/orchestrator-matrix/controller/tasks_md_sync.py create mode 100755 templates/repo/scripts/agent/orchestrator-daemon.sh create mode 100755 templates/repo/scripts/agent/orchestrator-worker.sh diff --git a/README.md b/README.md index 3e54f6b..38a672b 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,8 @@ Run from a bootstrapped repo: ```bash ~/.config/mosaic/bin/mosaic-orchestrator-matrix-cycle ~/.config/mosaic/bin/mosaic-orchestrator-run --once +~/.config/mosaic/bin/mosaic-orchestrator-sync-tasks --apply +~/.config/mosaic/bin/mosaic-orchestrator-drain ~/.config/mosaic/bin/mosaic-orchestrator-run --poll-sec 10 ~/.config/mosaic/bin/mosaic-orchestrator-matrix-publish ~/.config/mosaic/bin/mosaic-orchestrator-matrix-consume @@ -147,6 +149,14 @@ Run from a bootstrapped repo: The controller reads/writes repo-local state in `.mosaic/orchestrator/` and emits structured events to `.mosaic/orchestrator/events.ndjson` for Matrix bridge consumption. +If your runtime command differs, set: + +```bash +export MOSAIC_WORKER_EXEC="codex -p" +# or +export MOSAIC_WORKER_EXEC="opencode -p" +``` + ## Bootstrap Any Repo (Slave Linkage) Attach any repository/workspace to the master layer: diff --git a/bin/mosaic-bootstrap-repo b/bin/mosaic-bootstrap-repo index 90dae9e..19cec36 100755 --- a/bin/mosaic-bootstrap-repo +++ b/bin/mosaic-bootstrap-repo @@ -104,7 +104,8 @@ fi echo "[mosaic] Repo bootstrap complete: $TARGET_DIR" echo "[mosaic] Next: edit $TARGET_DIR/.mosaic/repo-hooks.sh with project workflows" echo "[mosaic] Optional: apply quality rails via ~/.config/mosaic/bin/mosaic-quality-apply --template