diff --git a/README.md b/README.md index 6880c66..d8de5ca 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,22 @@ Templates currently supported: - `typescript-nextjs` - `monorepo` +## Matrix Orchestrator Rail + +Mosaic includes a runtime-agnostic orchestrator rail at: + +- `~/.mosaic/rails/orchestrator-matrix/` + +Run from a bootstrapped repo: + +```bash +~/.mosaic/bin/mosaic-orchestrator-run --once +~/.mosaic/bin/mosaic-orchestrator-run --poll-sec 10 +``` + +The controller reads/writes repo-local state in `.mosaic/orchestrator/` and emits +structured events to `.mosaic/orchestrator/events.ndjson` for Matrix bridge consumption. + ## Bootstrap Any Repo (Slave Linkage) Attach any repository/workspace to the master layer: diff --git a/STANDARDS.md b/STANDARDS.md index d7a98c2..d0dfd79 100644 --- a/STANDARDS.md +++ b/STANDARDS.md @@ -21,6 +21,7 @@ Master/slave model: - Run validation checks before claiming completion. - Apply quality rails from `~/.mosaic/rails/` when relevant (review, QA, git workflow). - For project-level mechanical enforcement templates, use `~/.mosaic/rails/quality/` via `~/.mosaic/bin/mosaic-quality-apply`. +- For runtime-agnostic delegation/orchestration, use `~/.mosaic/rails/orchestrator-matrix/` with repo-local `.mosaic/orchestrator/` state. - Avoid hardcoded secrets and token leakage in remotes/commits. - Do not perform destructive git/file actions without explicit instruction. diff --git a/bin/mosaic-bootstrap-repo b/bin/mosaic-bootstrap-repo index 71d09d5..1a4210d 100755 --- a/bin/mosaic-bootstrap-repo +++ b/bin/mosaic-bootstrap-repo @@ -37,6 +37,7 @@ if [[ ! -d "$TEMPLATE_ROOT" ]]; then fi mkdir -p "$TARGET_DIR/.mosaic" "$TARGET_DIR/scripts/agent" +mkdir -p "$TARGET_DIR/.mosaic/orchestrator" "$TARGET_DIR/.mosaic/orchestrator/logs" "$TARGET_DIR/.mosaic/orchestrator/results" copy_file() { local src="$1" @@ -54,6 +55,11 @@ copy_file() { copy_file "$TEMPLATE_ROOT/.mosaic/README.md" "$TARGET_DIR/.mosaic/README.md" copy_file "$TEMPLATE_ROOT/.mosaic/repo-hooks.sh" "$TARGET_DIR/.mosaic/repo-hooks.sh" copy_file "$TEMPLATE_ROOT/.mosaic/quality-rails.yml" "$TARGET_DIR/.mosaic/quality-rails.yml" +copy_file "$TEMPLATE_ROOT/.mosaic/orchestrator/config.json" "$TARGET_DIR/.mosaic/orchestrator/config.json" +copy_file "$TEMPLATE_ROOT/.mosaic/orchestrator/tasks.json" "$TARGET_DIR/.mosaic/orchestrator/tasks.json" +copy_file "$TEMPLATE_ROOT/.mosaic/orchestrator/state.json" "$TARGET_DIR/.mosaic/orchestrator/state.json" +copy_file "$TEMPLATE_ROOT/.mosaic/orchestrator/logs/.gitkeep" "$TARGET_DIR/.mosaic/orchestrator/logs/.gitkeep" +copy_file "$TEMPLATE_ROOT/.mosaic/orchestrator/results/.gitkeep" "$TARGET_DIR/.mosaic/orchestrator/results/.gitkeep" for file in "$TEMPLATE_ROOT"/scripts/agent/*.sh; do base="$(basename "$file")" @@ -97,6 +103,7 @@ 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 ~/.mosaic/bin/mosaic-quality-apply --template