@axiomantic/garden 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -15
- package/SKILL.md +64 -10
- package/bin/binaries/garden-darwin-arm64 +0 -0
- package/bin/binaries/garden-darwin-x64 +0 -0
- package/bin/binaries/garden-linux-arm64 +0 -0
- package/bin/binaries/garden-linux-x64 +0 -0
- package/bin/binaries/garden-win32-x64.exe +0 -0
- package/package.json +1 -1
- package/skills/choose-personas/SKILL.md +23 -18
- package/skills/garden/SKILL.md +64 -10
- package/skills/launch-workers/SKILL.md +19 -7
- package/skills/orchestrate-swarm/SKILL.md +56 -6
package/README.md
CHANGED
|
@@ -20,6 +20,15 @@
|
|
|
20
20
|
|
|
21
21
|
**Garden** is an agentic engineering framework and skill library for orchestrating heterogeneous teams of AI coding assistants (Claude Code, OpenCode, Antigravity, Cursor, Codex).
|
|
22
22
|
|
|
23
|
+
> [!NOTE]
|
|
24
|
+
> ### Quick Note: Using Garden as your High-Level Swarm Wrapper
|
|
25
|
+
> **Garden is the sovereign high-level multi-agent wrapper for all your engineering projects.**
|
|
26
|
+
> After installing `@axiomantic/garden`, `@axiomantic/rhizo`, and `@axiomantic/vine`, you don't need complex shell scripts, background daemon managers, or brittle terminal multiplexers. Whenever you start a session in your favorite coding harness (Antigravity, Claude Code, OpenCode, Cursor), simply tell the assistant:
|
|
27
|
+
> ```text
|
|
28
|
+
> "garden: I want to build [feature/system/project]"
|
|
29
|
+
> ```
|
|
30
|
+
> The session automatically acts as the **Lead Orchestrator**. It conducts a brief interactive intake interview to calibrate your desired team balance, coding harnesses, and model tiers. It then configures your project (`garden.toml` & `garden-swarm.json`) and prints ready-to-copy prompt cards wrapped in **10 backticks** (` ``````````markdown `). You paste these cards into separate terminal tabs or coding harnesses, and Garden coordinates the entire swarm over Rhizo (local Redis message bus) and Vine (isolated Rift copy-on-write workspaces)!
|
|
31
|
+
|
|
23
32
|
Instead of treating AI agents as isolated single-turn chatbots, Garden provisions **prompt-bootstrapped worker swarms** across your favorite AI coding harnesses (Claude Code, OpenCode, Antigravity, Pi, Cursor), balances specialized personas with designated foundation models, drives **empirically grounded dialectical deliberation**, schedules distributed fencing mutexes, and integrates code through isolated APFS Copy-on-Write strands verified by Vine's Two-Key Gate.
|
|
24
33
|
|
|
25
34
|
```mermaid
|
|
@@ -153,22 +162,24 @@ In your primary AI coding assistant (Antigravity, Claude Code, OpenCode):
|
|
|
153
162
|
User: "garden: Implement high-throughput batch claim leases with Redis pipeline support"
|
|
154
163
|
```
|
|
155
164
|
|
|
156
|
-
### 2. Interactive
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
### 2. Interactive Project Intake Interview (Phase 0)
|
|
166
|
+
The Orchestrator asks 4 quick interactive questions via `ask_question`:
|
|
167
|
+
1. **Execution Mode**: Multi-Agent Swarm (Recommended) vs Single Session.
|
|
168
|
+
2. **Team Sizing**: Standard Triad (3 Workers) vs Focused Duo (2 Workers) vs Custom.
|
|
169
|
+
3. **Available Harnesses**: Claude Code CLI, OpenCode, Antigravity, Pi, Cursor, Terminal.
|
|
170
|
+
4. **Model Preferences & Equivalents**:
|
|
171
|
+
- Systems Architect (`@architect`) $\to$ **Antigravity** or **OpenCode** | **Gemini 3.8 Flash** or **Claude 3.5 Sonnet**
|
|
172
|
+
- Adversarial Auditor (`@auditor`) $\to$ **Claude Code CLI** | **Claude 3.5 Sonnet** or **Claude 3 Opus**
|
|
173
|
+
- DevEx & Implementation Lead (`@implementer`) $\to$ **Antigravity** or **OpenCode** | **Gemini 3.8 Flash**
|
|
163
174
|
|
|
164
175
|
### 3. Prompt-Based Swarm Bootstrapping (`launch-workers`)
|
|
165
|
-
Garden
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- Each session enters the project directory,
|
|
171
|
-
- The Orchestrator
|
|
176
|
+
Garden writes `garden-swarm.json` and runs `garden prompts` to emit raw markdown prompt cards wrapped in **10 backticks** (` ``````````markdown `):
|
|
177
|
+
- The Orchestrator tells the operator:
|
|
178
|
+
1. Open **Tab 1**: Launch `claude` (Claude 3.5 Sonnet) $\to$ Paste Prompt 1 (`@auditor`)
|
|
179
|
+
2. Open **Tab 2**: Launch `opencode` $\to$ Paste Prompt 2 (`@architect`)
|
|
180
|
+
3. Open **Tab 3**: Launch `antigravity` (Gemini 3.8 Flash) $\to$ Paste Prompt 3 (`@implementer`)
|
|
181
|
+
- Each session enters the project directory, exports `RHIZO_AGENT_NAME`, registers on the Redis bus (`rhizo open`), and arms its single-shot listener (`rhizo listen`).
|
|
182
|
+
- The Orchestrator confirms all workers are live via `rhizo who --json` before dispatching tasks!
|
|
172
183
|
|
|
173
184
|
### 4. The Dialectical Pump (`dialectical-pump`)
|
|
174
185
|
The personas deliberate across three empirical stages:
|
|
@@ -187,9 +198,77 @@ The main chat orchestrator dispatches work over Redis. Workers code in isolated
|
|
|
187
198
|
|
|
188
199
|
---
|
|
189
200
|
|
|
201
|
+
## CLI Reference
|
|
202
|
+
|
|
203
|
+
| Command | Arguments | Description |
|
|
204
|
+
| :--- | :--- | :--- |
|
|
205
|
+
| `garden prompts` | `[--worker <name>] [--write [file]] [--json] [--project-dir <dir>] [--swarm-file <file>]` | Generate 10-backtick raw markdown prompt cards for pasting into worker sessions. |
|
|
206
|
+
| `garden launch` | `[--worker <name>] [--write [file]] [--json] [--tmux] [--session-name <name>]` | Bootstrap swarm worker sessions (defaults to generating prompt cards). |
|
|
207
|
+
| `garden status` | `[--json] [--session-name <name>]` | Telemetry query across active Rhizo agents, listener status, and Vine strands. |
|
|
208
|
+
| `garden init` | `[<target_dir>] [--force]` | Initialize `garden.toml`, docs scaffold, and install guide in `AGENTS.md`. |
|
|
209
|
+
| `garden teardown`| `[--session-name <name>] [--swarm-file <file>]` | Gracefully close registered swarm agents on the Redis bus. |
|
|
210
|
+
| `garden guide` | `<install\|check\|uninstall> [path]` | Install or manage Garden Multi-Agent Swarm Guide in `AGENTS.md`. |
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Configuration & Swarm Manifest Reference
|
|
215
|
+
|
|
216
|
+
> [!TIP]
|
|
217
|
+
> For the complete specification of `garden.toml`, `garden-swarm.json` schemas, and environment variables, see the [Garden Configuration & Swarm Manifest Reference](docs/configuration.md).
|
|
218
|
+
|
|
219
|
+
### Environment Variables
|
|
220
|
+
|
|
221
|
+
| Variable | Type | Default | Description |
|
|
222
|
+
| :--- | :--- | :--- | :--- |
|
|
223
|
+
| `GARDEN_SWARM_FILE` | Path | `garden-swarm.json` | Explicit path to swarm manifest JSON file. |
|
|
224
|
+
| `GARDEN_CONFIG` | Path | `garden.toml` | Explicit path to project `garden.toml`. |
|
|
225
|
+
| `GARDEN_PROJECT_DIR`| Path | *Auto-detected* | Target repository root directory. |
|
|
226
|
+
| `GARDEN_TERMINAL_APP`| String | `auto` | Preferred terminal viewer for tmux sessions (`Ghostty`, `Terminal`, `iTerm`, `none`). |
|
|
227
|
+
|
|
228
|
+
### Example `garden-swarm.json`
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"project": "myproject",
|
|
233
|
+
"target_repo": "/Users/developer/Development/myproject",
|
|
234
|
+
"orchestrator": "orchestrator",
|
|
235
|
+
"workers": [
|
|
236
|
+
{
|
|
237
|
+
"name": "architect",
|
|
238
|
+
"persona": "Dr. Marcus Vance (Systems Architect)",
|
|
239
|
+
"role": "Systems Architect & Formal Invariant Specifier",
|
|
240
|
+
"harness": "Claude Code",
|
|
241
|
+
"model": "claude-3-5-sonnet",
|
|
242
|
+
"tags": ["design", "spec"],
|
|
243
|
+
"opposing_priority": "Formal mathematical correctness and zero architectural drift."
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "auditor",
|
|
247
|
+
"persona": "Lyra Sterling (Adversarial Quality Auditor)",
|
|
248
|
+
"role": "Adversarial Code Reviewer & Security Auditor",
|
|
249
|
+
"harness": "OpenCode",
|
|
250
|
+
"model": "gemini-3.8-flash",
|
|
251
|
+
"tags": ["audit", "testing"],
|
|
252
|
+
"opposing_priority": "Aggressive edge-case fault injection and invariant verification."
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "implementer",
|
|
256
|
+
"persona": "Elena Rostova (Lead Implementation Engineer)",
|
|
257
|
+
"role": "Polyglot Systems & Performance Engineer",
|
|
258
|
+
"harness": "Antigravity",
|
|
259
|
+
"model": "claude-3-5-sonnet",
|
|
260
|
+
"tags": ["implementation", "perf"],
|
|
261
|
+
"opposing_priority": "Rapid implementation velocity and minimal dependency footprint."
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
190
269
|
## Core Invariants
|
|
191
270
|
|
|
192
|
-
1. **The
|
|
271
|
+
1. **The Lead Orchestrator Invariant**:
|
|
193
272
|
The main chat session coordinates, reviews, and integrates. Intensive multi-file edits are executed by the worker fleet in isolated strands.
|
|
194
273
|
2. **Empirical Grounding Protocol (Zero Theatrical Dialogue)**:
|
|
195
274
|
Dialectical deliberations must cite hard evidence from real tool calls (line citations, test outputs, compiler errors). Theatrical roleplay is strictly banned.
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: garden
|
|
3
|
-
description: "Master entrypoint and end-to-end ceremony director for multi-agent swarms operating on top of Rhizo (transport) and Vine (workspace integrator). Guides the user and orchestrator session through the full lifecycle: persona selection with harness/model pairing, prompt-based worker fleet bootstrapping with 10-backtick copy-paste prompt cards, 3-stage empirical dialectical pump (research, design, audit), master implementation planning with locking/strand schedules, and live swarm execution with Two-Key gate verification and fast-forward trunk weaving. Triggers: 'garden', 'run garden', 'swarm this project', 'orchestrate with garden', 'start garden swarm', 'run the full garden ceremony'."
|
|
3
|
+
description: "Master entrypoint and end-to-end ceremony director for multi-agent swarms operating on top of Rhizo (transport) and Vine (workspace integrator). Guides the user and orchestrator session through the full lifecycle: conversational project intake interview, persona selection with harness/model pairing, prompt-based worker fleet bootstrapping with 10-backtick copy-paste prompt cards, 3-stage empirical dialectical pump (research, design, audit), master implementation planning with locking/strand schedules, and live swarm execution with Two-Key gate verification and fast-forward trunk weaving. Triggers: 'garden', 'run garden', 'swarm this project', 'orchestrate with garden', 'start garden swarm', 'run the full garden ceremony', 'start a project with garden', 'start a project with rhizo', 'set up a multi-agent team', 'use rhizo for this project', 'set up a swarm', 'coordinate multiple agents on this project', 'set up agents for this project'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Garden: Multi-Agent Swarm Ceremony & Orchestration Engine
|
|
@@ -24,8 +24,9 @@ Garden directs multi-agent swarms using Rhizo for transport and Vine for workspa
|
|
|
24
24
|
```mermaid
|
|
25
25
|
flowchart TD
|
|
26
26
|
subgraph Garden["Garden Layer (Methodology & Ceremonies)"]
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
Phase0["Phase 0: Interactive Intake Interview (Scope, Team & Models)"]
|
|
28
|
+
Phase1["Phase 1: choose-personas (Ratify garden-swarm.json)"]
|
|
29
|
+
Phase2["Phase 2: launch-workers (10-Backtick Prompt Cards & Sessions)"]
|
|
29
30
|
Phase3["Phase 3: dialectical-pump (Research ➔ Design ➔ Audit)"]
|
|
30
31
|
Phase4["Phase 4: plan-implementation (Locking & Strands)"]
|
|
31
32
|
Phase5["Phase 5: orchestrate-swarm (Dispatch & Vine Weaving)"]
|
|
@@ -36,7 +37,7 @@ flowchart TD
|
|
|
36
37
|
Vine["Vine (Rift Strands, Two-Key Gate, Weaving)"]
|
|
37
38
|
end
|
|
38
39
|
|
|
39
|
-
Phase1 --> Phase2 --> Phase3 --> Phase4 --> Phase5
|
|
40
|
+
Phase0 --> Phase1 --> Phase2 --> Phase3 --> Phase4 --> Phase5
|
|
40
41
|
Phase2 -.-> Rhizo
|
|
41
42
|
Phase3 -.-> Rhizo
|
|
42
43
|
Phase4 -.-> Rhizo & Vine
|
|
@@ -45,24 +46,61 @@ flowchart TD
|
|
|
45
46
|
|
|
46
47
|
---
|
|
47
48
|
|
|
48
|
-
## 2. The
|
|
49
|
+
## 2. The End-to-End Ceremony Workflow
|
|
49
50
|
|
|
50
|
-
Execute
|
|
51
|
+
Execute phases sequentially. Never skip phases or invert the order.
|
|
51
52
|
|
|
52
|
-
| Phase | Sub-Skill | Action | Quality Gate to Proceed |
|
|
53
|
+
| Phase | Sub-Skill / Step | Action | Quality Gate to Proceed |
|
|
53
54
|
| :--- | :--- | :--- | :--- |
|
|
54
|
-
| **Phase
|
|
55
|
-
| **Phase
|
|
55
|
+
| **Phase 0** | **Intake Gate** | Conduct interactive interview via `ask_question`: execution mode, swarm size, harnesses, and models. | Operator submits preferences. |
|
|
56
|
+
| **Phase 1** | [`choose-personas`](../choose-personas/SKILL.md) | Synthesize and write `garden-swarm.json` reflecting the interview. | Valid JSON written to repo root. |
|
|
57
|
+
| **Phase 2** | [`launch-workers`](../launch-workers/SKILL.md) | Output 10-backtick raw markdown prompt cards and numbered session instructions. | `rhizo who --json` confirms 100% of workers active & listening. |
|
|
56
58
|
| **Phase 3** | [`dialectical-pump`](../dialectical-pump/SKILL.md) | Grounded triadic deliberation: research, design, adversarial audit. | Zero open `CRIT` or `BLOCKER` defects in `audit_report.md`. |
|
|
57
59
|
| **Phase 4** | [`plan-implementation`](../plan-implementation/SKILL.md) | Author master implementation plan with locking schedules and strands. | Complete `implementation_plan.md` with task-locking matrix. |
|
|
58
60
|
| **Phase 5** | [`orchestrate-swarm`](../orchestrate-swarm/SKILL.md) | Main-chat governor: task dispatch, heartbeat monitoring, trunk weaving. | All plan tasks woven via `vine weave` after passing Two-Key Gate. |
|
|
59
61
|
|
|
60
62
|
---
|
|
61
63
|
|
|
64
|
+
### Phase 0: Interactive Project Intake & Swarm Calibration
|
|
65
|
+
|
|
66
|
+
When an operator initiates a project or requests multi-agent coordination, the session MUST NOT silently guess configuration or begin writing code directly. It immediately invokes `ask_question` to conduct the **Interactive Intake Interview**:
|
|
67
|
+
|
|
68
|
+
1. **Question 1: Execution Mode**:
|
|
69
|
+
- *Option 1 (Recommended)*: Multi-Agent Swarm (Dedicated terminal tabs/coding harnesses over Rhizo & Vine).
|
|
70
|
+
- *Option 2*: Single-Agent Inline (Sequential execution within current chat session).
|
|
71
|
+
2. **Question 2: Swarm Composition & Team Sizing**:
|
|
72
|
+
- *Option 1 (Recommended)*: Balanced Triad (3 Workers: Systems Architect `@architect`, Adversarial Auditor `@auditor`, DevEx Lead `@implementer`).
|
|
73
|
+
- *Option 2*: Focused Duo (2 Workers: Implementation Lead `@implementer`, Adversarial Auditor `@auditor`).
|
|
74
|
+
- *Option 3*: Custom Swarm (Operator specifies custom roles and headcount).
|
|
75
|
+
3. **Question 3: Available AI Coding Harnesses**:
|
|
76
|
+
- The operator specifies which coding environments they have available (Claude Code CLI, Antigravity, OpenCode, Pi, Cursor, Headless Terminal). Explain that workers can run in **any** combination of harnesses!
|
|
77
|
+
4. **Question 4: Foundation Model Pairing & Equivalencies**:
|
|
78
|
+
- Recommend optimal models with fallback equivalents:
|
|
79
|
+
- `@architect`: Gemini 3.8 Flash / Claude 3.5 Sonnet / GPT-4o (deep architecture comprehension).
|
|
80
|
+
- `@auditor`: Claude 3.5 Sonnet / Claude 3 Opus (strict negative controls, zero sloppy approvals).
|
|
81
|
+
- `@implementer`: Gemini 3.8 Flash / Claude 3.5 Sonnet (rapid, iterative coding velocity).
|
|
82
|
+
- *Air-gapped / Local*: Ollama / DeepSeek-R1.
|
|
83
|
+
|
|
84
|
+
#### Automatic Fulfillment & 10-Backtick Prompt Generation:
|
|
85
|
+
Upon receiving the operator's responses:
|
|
86
|
+
1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
|
|
87
|
+
2. Generate `garden-swarm.json` reflecting the chosen workers, roles, harnesses, and models.
|
|
88
|
+
3. Run `garden prompts` to generate the raw markdown prompt cards wrapped in **10 backticks** (` ``````````markdown `).
|
|
89
|
+
4. Present the operator with clear, numbered instructions:
|
|
90
|
+
```text
|
|
91
|
+
1. Open X terminal tabs or windows in your selected coding harnesses.
|
|
92
|
+
2. Copy the raw block inside each 10-backtick pre block below and paste it into its corresponding session.
|
|
93
|
+
3. Once pasted, tell me here (or I will automatically detect them online via `rhizo who`).
|
|
94
|
+
```
|
|
95
|
+
5. Register the orchestrator's presence (`rhizo open orchestrator`) and arm the listener.
|
|
96
|
+
6. Poll or await cluster readiness gate (`rhizo who --json`) before proceeding to Phase 3.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
62
100
|
## 3. Core Operational Invariants
|
|
63
101
|
|
|
64
102
|
<CRITICAL>
|
|
65
|
-
The primary conversation session acts as the
|
|
103
|
+
The primary conversation session acts as the Lead Orchestrator. The orchestrator directs, reviews, and weaves; it never performs large multi-file implementation edits directly when a worker fleet is active.
|
|
66
104
|
</CRITICAL>
|
|
67
105
|
|
|
68
106
|
<INVARIANT>
|
|
@@ -102,3 +140,19 @@ To prevent silent deadlocks when workers stall, crash, or fail to re-arm listene
|
|
|
102
140
|
2. **Watchdog Window**: If a worker fails to respond within the expected turn window (e.g. 5–10 minutes) and `rhizo probe` reveals `NO_LISTENER` or unread inbox items:
|
|
103
141
|
- **Escalate Immediately**: Prompt the operator via `ask_question` with the diagnostic status.
|
|
104
142
|
- **Actionable Remediation**: Offer options to (1) re-arm the listener in the worker's terminal session (`rhizo listen <worker>`), (2) reboot the agent harness, or (3) reassign the task via `rhizo reroute <worker> <new_worker>`.
|
|
143
|
+
3. **Orchestrator Self-Audit Watchdog & Debouncer Protocol (GVR-014)**:
|
|
144
|
+
- For harnesses supporting `schedule` (e.g. Antigravity), arm a debounced 15-minute watchdog timer (`schedule(DurationSeconds=900, Prompt="...", TimerCondition="any")`).
|
|
145
|
+
- Debouncer replaces (kills previous timer via `manage_task(Action='kill')` before arming a new one) on task dispatch, worker reports, and plan updates ("early and often"). Arriving worker traffic cancels the timer for free with 0 token overhead.
|
|
146
|
+
- When the timer fires, execute the short check: `rhizo watchdog check --agent <orchestrator> --json`. If `ACTION_REQUIRED: REARM_LISTENER`, revive `rhizo listen` in the background and debounce. When all tasks in the plan are complete (`- [x]`), stand down.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 5. Configuration & Swarm Manifest Reference
|
|
151
|
+
|
|
152
|
+
See [`docs/configuration.md`](../../docs/configuration.md) for full details on:
|
|
153
|
+
- **Environment Variables**: `GARDEN_SWARM_FILE`, `GARDEN_CONFIG`, `GARDEN_PROJECT_DIR`, and `GARDEN_TERMINAL_APP`.
|
|
154
|
+
- **`garden.toml`**: Project-level defaults (`name`, `preferred_terminal`, `session_prefix`, `default_triad`).
|
|
155
|
+
- **`garden-swarm.json`**: Swarm specification schema (`project`, `target_repo`, `orchestrator`, `shared_workspace`, `workers` array: `name`, `persona`, `role`, `harness`, `model`, `tags`, `system_prompt`, `opposing_priority`).
|
|
156
|
+
- **The 10-Backtick Protocol**: Clean raw markdown formatting for copy-paste worker bootstrap prompts.
|
|
157
|
+
|
|
158
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -97,36 +97,38 @@ Once ratified, write `garden-swarm.json` to the target project directory:
|
|
|
97
97
|
{
|
|
98
98
|
"project": "my-project",
|
|
99
99
|
"created_at": "2026-09-28T12:00:00Z",
|
|
100
|
+
"target_repo": "/Users/eek/Development/my-project",
|
|
101
|
+
"orchestrator": "orchestrator",
|
|
100
102
|
"workers": [
|
|
101
103
|
{
|
|
102
104
|
"name": "architect",
|
|
103
105
|
"persona": "Marcus Vance",
|
|
104
106
|
"role": "Staff Systems Architect",
|
|
105
|
-
"harness": "
|
|
106
|
-
"model": "
|
|
107
|
-
"tags": ["systems", "architecture", "
|
|
108
|
-
"system_prompt": "You are Marcus Vance, Staff Systems Architect...",
|
|
109
|
-
"
|
|
107
|
+
"harness": "Antigravity / OpenCode",
|
|
108
|
+
"model": "Gemini 3.8 Flash / Claude 3.5 Sonnet",
|
|
109
|
+
"tags": ["my-project", "systems", "architecture", "invariants"],
|
|
110
|
+
"system_prompt": "You are Marcus Vance, Staff Systems Architect for project my-project...",
|
|
111
|
+
"opposing_priority": "Structural purity, invariant guarantees, and long-term maintainability over hasty quick fixes."
|
|
110
112
|
},
|
|
111
113
|
{
|
|
112
114
|
"name": "auditor",
|
|
113
115
|
"persona": "Caleb Thorne",
|
|
114
|
-
"role": "
|
|
115
|
-
"harness": "
|
|
116
|
-
"model": "
|
|
117
|
-
"tags": ["qa", "audit", "purist"],
|
|
118
|
-
"system_prompt": "You are Caleb Thorne,
|
|
119
|
-
"
|
|
116
|
+
"role": "Verification & Adversarial Auditor",
|
|
117
|
+
"harness": "Claude Code CLI / Antigravity",
|
|
118
|
+
"model": "Claude 3.5 Sonnet / Claude 3 Opus",
|
|
119
|
+
"tags": ["my-project", "qa", "audit", "verifier", "purist"],
|
|
120
|
+
"system_prompt": "You are Caleb Thorne, Verification & Adversarial Auditor for project my-project...",
|
|
121
|
+
"opposing_priority": "Adversarial skepticism, rigorous negative controls, and proof over convenience."
|
|
120
122
|
},
|
|
121
123
|
{
|
|
122
124
|
"name": "implementer",
|
|
123
125
|
"persona": "Elena Rostova",
|
|
124
126
|
"role": "DevEx & Implementation Lead",
|
|
125
|
-
"harness": "
|
|
126
|
-
"model": "
|
|
127
|
-
"tags": ["dev", "devex", "build"],
|
|
128
|
-
"system_prompt": "You are Elena Rostova, DevEx Lead...",
|
|
129
|
-
"
|
|
127
|
+
"harness": "Antigravity / OpenCode",
|
|
128
|
+
"model": "Gemini 3.8 Flash / Claude 3.5 Sonnet",
|
|
129
|
+
"tags": ["my-project", "dev", "devex", "build", "implementation"],
|
|
130
|
+
"system_prompt": "You are Elena Rostova, DevEx & Implementation Lead for project my-project...",
|
|
131
|
+
"opposing_priority": "High-velocity implementation, pragmatic delivery, and developer ergonomics."
|
|
130
132
|
}
|
|
131
133
|
]
|
|
132
134
|
}
|
|
@@ -134,9 +136,12 @@ Once ratified, write `garden-swarm.json` to the target project directory:
|
|
|
134
136
|
|
|
135
137
|
---
|
|
136
138
|
|
|
137
|
-
## 4. Verification & Handoff
|
|
139
|
+
## 4. Verification & Automatic Prompt Generation Handoff
|
|
138
140
|
|
|
139
141
|
Before concluding:
|
|
140
142
|
1. Verify `garden-swarm.json` is syntactically valid JSON.
|
|
141
143
|
2. Confirm each worker has unique `name` and non-empty `tags`.
|
|
142
|
-
3. Proceed directly to [`launch-workers`](../launch-workers/SKILL.md)
|
|
144
|
+
3. Proceed directly to [`launch-workers`](../launch-workers/SKILL.md):
|
|
145
|
+
- Call `garden prompts` to generate the 10-backtick raw markdown blocks.
|
|
146
|
+
- Present the operator with numbered terminal tab setup instructions.
|
|
147
|
+
- Await cluster readiness verification via `rhizo who --json`.
|
package/skills/garden/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: garden
|
|
3
|
-
description: "Master entrypoint and end-to-end ceremony director for multi-agent swarms operating on top of Rhizo (transport) and Vine (workspace integrator). Guides the user and orchestrator session through the full lifecycle: persona selection with harness/model pairing, prompt-based worker fleet bootstrapping with 10-backtick copy-paste prompt cards, 3-stage empirical dialectical pump (research, design, audit), master implementation planning with locking/strand schedules, and live swarm execution with Two-Key gate verification and fast-forward trunk weaving. Triggers: 'garden', 'run garden', 'swarm this project', 'orchestrate with garden', 'start garden swarm', 'run the full garden ceremony'."
|
|
3
|
+
description: "Master entrypoint and end-to-end ceremony director for multi-agent swarms operating on top of Rhizo (transport) and Vine (workspace integrator). Guides the user and orchestrator session through the full lifecycle: conversational project intake interview, persona selection with harness/model pairing, prompt-based worker fleet bootstrapping with 10-backtick copy-paste prompt cards, 3-stage empirical dialectical pump (research, design, audit), master implementation planning with locking/strand schedules, and live swarm execution with Two-Key gate verification and fast-forward trunk weaving. Triggers: 'garden', 'run garden', 'swarm this project', 'orchestrate with garden', 'start garden swarm', 'run the full garden ceremony', 'start a project with garden', 'start a project with rhizo', 'set up a multi-agent team', 'use rhizo for this project', 'set up a swarm', 'coordinate multiple agents on this project', 'set up agents for this project'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Garden: Multi-Agent Swarm Ceremony & Orchestration Engine
|
|
@@ -24,8 +24,9 @@ Garden directs multi-agent swarms using Rhizo for transport and Vine for workspa
|
|
|
24
24
|
```mermaid
|
|
25
25
|
flowchart TD
|
|
26
26
|
subgraph Garden["Garden Layer (Methodology & Ceremonies)"]
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
Phase0["Phase 0: Interactive Intake Interview (Scope, Team & Models)"]
|
|
28
|
+
Phase1["Phase 1: choose-personas (Ratify garden-swarm.json)"]
|
|
29
|
+
Phase2["Phase 2: launch-workers (10-Backtick Prompt Cards & Sessions)"]
|
|
29
30
|
Phase3["Phase 3: dialectical-pump (Research ➔ Design ➔ Audit)"]
|
|
30
31
|
Phase4["Phase 4: plan-implementation (Locking & Strands)"]
|
|
31
32
|
Phase5["Phase 5: orchestrate-swarm (Dispatch & Vine Weaving)"]
|
|
@@ -36,7 +37,7 @@ flowchart TD
|
|
|
36
37
|
Vine["Vine (Rift Strands, Two-Key Gate, Weaving)"]
|
|
37
38
|
end
|
|
38
39
|
|
|
39
|
-
Phase1 --> Phase2 --> Phase3 --> Phase4 --> Phase5
|
|
40
|
+
Phase0 --> Phase1 --> Phase2 --> Phase3 --> Phase4 --> Phase5
|
|
40
41
|
Phase2 -.-> Rhizo
|
|
41
42
|
Phase3 -.-> Rhizo
|
|
42
43
|
Phase4 -.-> Rhizo & Vine
|
|
@@ -45,24 +46,61 @@ flowchart TD
|
|
|
45
46
|
|
|
46
47
|
---
|
|
47
48
|
|
|
48
|
-
## 2. The
|
|
49
|
+
## 2. The End-to-End Ceremony Workflow
|
|
49
50
|
|
|
50
|
-
Execute
|
|
51
|
+
Execute phases sequentially. Never skip phases or invert the order.
|
|
51
52
|
|
|
52
|
-
| Phase | Sub-Skill | Action | Quality Gate to Proceed |
|
|
53
|
+
| Phase | Sub-Skill / Step | Action | Quality Gate to Proceed |
|
|
53
54
|
| :--- | :--- | :--- | :--- |
|
|
54
|
-
| **Phase
|
|
55
|
-
| **Phase
|
|
55
|
+
| **Phase 0** | **Intake Gate** | Conduct interactive interview via `ask_question`: execution mode, swarm size, harnesses, and models. | Operator submits preferences. |
|
|
56
|
+
| **Phase 1** | [`choose-personas`](../choose-personas/SKILL.md) | Synthesize and write `garden-swarm.json` reflecting the interview. | Valid JSON written to repo root. |
|
|
57
|
+
| **Phase 2** | [`launch-workers`](../launch-workers/SKILL.md) | Output 10-backtick raw markdown prompt cards and numbered session instructions. | `rhizo who --json` confirms 100% of workers active & listening. |
|
|
56
58
|
| **Phase 3** | [`dialectical-pump`](../dialectical-pump/SKILL.md) | Grounded triadic deliberation: research, design, adversarial audit. | Zero open `CRIT` or `BLOCKER` defects in `audit_report.md`. |
|
|
57
59
|
| **Phase 4** | [`plan-implementation`](../plan-implementation/SKILL.md) | Author master implementation plan with locking schedules and strands. | Complete `implementation_plan.md` with task-locking matrix. |
|
|
58
60
|
| **Phase 5** | [`orchestrate-swarm`](../orchestrate-swarm/SKILL.md) | Main-chat governor: task dispatch, heartbeat monitoring, trunk weaving. | All plan tasks woven via `vine weave` after passing Two-Key Gate. |
|
|
59
61
|
|
|
60
62
|
---
|
|
61
63
|
|
|
64
|
+
### Phase 0: Interactive Project Intake & Swarm Calibration
|
|
65
|
+
|
|
66
|
+
When an operator initiates a project or requests multi-agent coordination, the session MUST NOT silently guess configuration or begin writing code directly. It immediately invokes `ask_question` to conduct the **Interactive Intake Interview**:
|
|
67
|
+
|
|
68
|
+
1. **Question 1: Execution Mode**:
|
|
69
|
+
- *Option 1 (Recommended)*: Multi-Agent Swarm (Dedicated terminal tabs/coding harnesses over Rhizo & Vine).
|
|
70
|
+
- *Option 2*: Single-Agent Inline (Sequential execution within current chat session).
|
|
71
|
+
2. **Question 2: Swarm Composition & Team Sizing**:
|
|
72
|
+
- *Option 1 (Recommended)*: Balanced Triad (3 Workers: Systems Architect `@architect`, Adversarial Auditor `@auditor`, DevEx Lead `@implementer`).
|
|
73
|
+
- *Option 2*: Focused Duo (2 Workers: Implementation Lead `@implementer`, Adversarial Auditor `@auditor`).
|
|
74
|
+
- *Option 3*: Custom Swarm (Operator specifies custom roles and headcount).
|
|
75
|
+
3. **Question 3: Available AI Coding Harnesses**:
|
|
76
|
+
- The operator specifies which coding environments they have available (Claude Code CLI, Antigravity, OpenCode, Pi, Cursor, Headless Terminal). Explain that workers can run in **any** combination of harnesses!
|
|
77
|
+
4. **Question 4: Foundation Model Pairing & Equivalencies**:
|
|
78
|
+
- Recommend optimal models with fallback equivalents:
|
|
79
|
+
- `@architect`: Gemini 3.8 Flash / Claude 3.5 Sonnet / GPT-4o (deep architecture comprehension).
|
|
80
|
+
- `@auditor`: Claude 3.5 Sonnet / Claude 3 Opus (strict negative controls, zero sloppy approvals).
|
|
81
|
+
- `@implementer`: Gemini 3.8 Flash / Claude 3.5 Sonnet (rapid, iterative coding velocity).
|
|
82
|
+
- *Air-gapped / Local*: Ollama / DeepSeek-R1.
|
|
83
|
+
|
|
84
|
+
#### Automatic Fulfillment & 10-Backtick Prompt Generation:
|
|
85
|
+
Upon receiving the operator's responses:
|
|
86
|
+
1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
|
|
87
|
+
2. Generate `garden-swarm.json` reflecting the chosen workers, roles, harnesses, and models.
|
|
88
|
+
3. Run `garden prompts` to generate the raw markdown prompt cards wrapped in **10 backticks** (` ``````````markdown `).
|
|
89
|
+
4. Present the operator with clear, numbered instructions:
|
|
90
|
+
```text
|
|
91
|
+
1. Open X terminal tabs or windows in your selected coding harnesses.
|
|
92
|
+
2. Copy the raw block inside each 10-backtick pre block below and paste it into its corresponding session.
|
|
93
|
+
3. Once pasted, tell me here (or I will automatically detect them online via `rhizo who`).
|
|
94
|
+
```
|
|
95
|
+
5. Register the orchestrator's presence (`rhizo open orchestrator`) and arm the listener.
|
|
96
|
+
6. Poll or await cluster readiness gate (`rhizo who --json`) before proceeding to Phase 3.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
62
100
|
## 3. Core Operational Invariants
|
|
63
101
|
|
|
64
102
|
<CRITICAL>
|
|
65
|
-
The primary conversation session acts as the
|
|
103
|
+
The primary conversation session acts as the Lead Orchestrator. The orchestrator directs, reviews, and weaves; it never performs large multi-file implementation edits directly when a worker fleet is active.
|
|
66
104
|
</CRITICAL>
|
|
67
105
|
|
|
68
106
|
<INVARIANT>
|
|
@@ -102,3 +140,19 @@ To prevent silent deadlocks when workers stall, crash, or fail to re-arm listene
|
|
|
102
140
|
2. **Watchdog Window**: If a worker fails to respond within the expected turn window (e.g. 5–10 minutes) and `rhizo probe` reveals `NO_LISTENER` or unread inbox items:
|
|
103
141
|
- **Escalate Immediately**: Prompt the operator via `ask_question` with the diagnostic status.
|
|
104
142
|
- **Actionable Remediation**: Offer options to (1) re-arm the listener in the worker's terminal session (`rhizo listen <worker>`), (2) reboot the agent harness, or (3) reassign the task via `rhizo reroute <worker> <new_worker>`.
|
|
143
|
+
3. **Orchestrator Self-Audit Watchdog & Debouncer Protocol (GVR-014)**:
|
|
144
|
+
- For harnesses supporting `schedule` (e.g. Antigravity), arm a debounced 15-minute watchdog timer (`schedule(DurationSeconds=900, Prompt="...", TimerCondition="any")`).
|
|
145
|
+
- Debouncer replaces (kills previous timer via `manage_task(Action='kill')` before arming a new one) on task dispatch, worker reports, and plan updates ("early and often"). Arriving worker traffic cancels the timer for free with 0 token overhead.
|
|
146
|
+
- When the timer fires, execute the short check: `rhizo watchdog check --agent <orchestrator> --json`. If `ACTION_REQUIRED: REARM_LISTENER`, revive `rhizo listen` in the background and debounce. When all tasks in the plan are complete (`- [x]`), stand down.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 5. Configuration & Swarm Manifest Reference
|
|
151
|
+
|
|
152
|
+
See [`docs/configuration.md`](../../docs/configuration.md) for full details on:
|
|
153
|
+
- **Environment Variables**: `GARDEN_SWARM_FILE`, `GARDEN_CONFIG`, `GARDEN_PROJECT_DIR`, and `GARDEN_TERMINAL_APP`.
|
|
154
|
+
- **`garden.toml`**: Project-level defaults (`name`, `preferred_terminal`, `session_prefix`, `default_triad`).
|
|
155
|
+
- **`garden-swarm.json`**: Swarm specification schema (`project`, `target_repo`, `orchestrator`, `shared_workspace`, `workers` array: `name`, `persona`, `role`, `harness`, `model`, `tags`, `system_prompt`, `opposing_priority`).
|
|
156
|
+
- **The 10-Backtick Protocol**: Clean raw markdown formatting for copy-paste worker bootstrap prompts.
|
|
157
|
+
|
|
158
|
+
|
|
@@ -79,13 +79,25 @@ If `garden-swarm.json` exists in the repository, Garden uses its configured pers
|
|
|
79
79
|
- `@implementer` (Elena Rostova - DevEx & Implementation Lead)
|
|
80
80
|
|
|
81
81
|
### Step 2: Present & Paste Prompts into Sessions
|
|
82
|
-
The
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
3.
|
|
88
|
-
|
|
82
|
+
The Orchestrator presents the generated prompt blocks to the operator with clear, structured guidance:
|
|
83
|
+
|
|
84
|
+
1. **Numbered Terminal Tab / Session Instructions**:
|
|
85
|
+
Provide a concise setup list instructing the operator on how many sessions to open and which harness/model to configure for each:
|
|
86
|
+
- **Session 1 (@architect)**: e.g. Antigravity or OpenCode with Gemini 3.8 Flash / Claude 3.5 Sonnet $\to$ Paste Card 1
|
|
87
|
+
- **Session 2 (@auditor)**: e.g. Claude Code CLI with Claude 3.5 Sonnet / Claude 3 Opus $\to$ Paste Card 2
|
|
88
|
+
- **Session 3 (@implementer)**: e.g. Antigravity or OpenCode with Gemini 3.8 Flash $\to$ Paste Card 3
|
|
89
|
+
2. **Harness & Model Agnostic Flexibility**:
|
|
90
|
+
Explicitly reassure the operator: *"Workers can run in ANY coding harness (Claude Code, OpenCode, Antigravity, Pi, Cursor) and use any equivalent model tier. Coordination occurs strictly over Rhizo (local Redis) and Vine (Rift strands)."*
|
|
91
|
+
3. **10-Backtick Raw Markdown Formatting**:
|
|
92
|
+
Ensure every prompt card is displayed inside ` ``````````markdown ` fences so the operator can copy the clean, unrendered text with a single click.
|
|
93
|
+
4. **Immediate Autonomous Onboarding**:
|
|
94
|
+
Each prompt instructs the pasted session to immediately:
|
|
95
|
+
- `cd "<project_dir>"`
|
|
96
|
+
- `export RHIZO_AGENT_NAME="<name>"`
|
|
97
|
+
- `rhizo open "<name>" "<tags>"`
|
|
98
|
+
- `rhizo listen "<name>"` (blocking foreground command with infinite wait)
|
|
99
|
+
5. **Readiness Prompt**:
|
|
100
|
+
Instruct the operator: *"Once you have pasted these prompts and the sessions are listening, tell me here (or I will automatically detect them online via `rhizo who`), and we will proceed to Phase 3 (Dialectical Deliberation)."*
|
|
89
101
|
|
|
90
102
|
### Step 3: Verify Cluster Readiness Gate
|
|
91
103
|
Before dispatching tasks, verify that every worker has registered in Redis and is showing active heartbeats:
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: orchestrate-swarm
|
|
3
|
-
description: "Directs live multi-agent swarm execution from the primary chat session acting as
|
|
3
|
+
description: "Directs live multi-agent swarm execution from the primary chat session acting as Lead Orchestrator. Dispatches tasks over the Rhizo Redis bus, monitors worker heartbeats with rhizo who, governs task leasing and dead-letter queues, ratifies emergent design addenda, verifies Two-Key Gate reports from workers, executes fast-forward trunk merges via vine weave, and dynamically maintains implementation plan checkboxes and harness To-Do tools. Triggers: 'orchestrate swarm', 'run implementation plan', 'execute swarm tasks', 'manage workers', 'drive plan'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# `orchestrate-swarm`: Main-Chat Swarm Governance & Trunk Integration
|
|
7
7
|
|
|
8
8
|
> **The Sovereign Conductor of Autonomous Execution**
|
|
9
|
-
> *The
|
|
9
|
+
> *The Lead Orchestrator does not write the low-level code lines; it directs the symphony. It dispatches work over Redis, unblocks dependencies, enforces the Two-Key Gate, and weaves clean strands into the trunk.*
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
## 1. The Role of the
|
|
13
|
+
## 1. The Role of the Lead Orchestrator
|
|
14
14
|
|
|
15
|
-
The main chat session assumes the role of **
|
|
15
|
+
The main chat session assumes the role of **Lead Orchestrator**:
|
|
16
16
|
- **Non-Interference**: Never perform massive multi-file edits directly when workers are active in isolated strands.
|
|
17
17
|
- **Strict Transport Discipline**: All task assignments, handoffs, and cancellation interrupts flow exclusively over the Rhizo Redis bus (`rhizo send`, `rhizo reply`, `rhizo enqueue`).
|
|
18
18
|
- **Gated Integration**: Never run `git merge` directly. Only weave branches that have passed both Key 1 (mechanical merge-tree) and Key 2 (live compiler/tests) inside their Vine strands.
|
|
@@ -23,7 +23,7 @@ Whenever context summarization or compaction occurs, the coding harness MUST pre
|
|
|
23
23
|
|
|
24
24
|
Maintain this exact block in the working context:
|
|
25
25
|
<!-- SWARM_RUNTIME_STATE: DO NOT DISCARD OR ABBREVIATE IN COMPACTION -->
|
|
26
|
-
- AGENT_NAME: <codename> (Role:
|
|
26
|
+
- AGENT_NAME: <codename> (Role: Lead Orchestrator)
|
|
27
27
|
- WORKSPACE_MODE: Root Trunk (/Users/eek/Development/<project>)
|
|
28
28
|
- ACTIVE_STRAND: canonical trunk
|
|
29
29
|
- ACTIVE_PEERS:
|
|
@@ -33,6 +33,38 @@ Maintain this exact block in the working context:
|
|
|
33
33
|
<!-- END_SWARM_RUNTIME_STATE -->
|
|
34
34
|
</CRITICAL>
|
|
35
35
|
|
|
36
|
+
<CRITICAL>
|
|
37
|
+
Orchestrator Turn-End Listener Invariant (GVR-014):
|
|
38
|
+
Coding harnesses (Antigravity, Claude Code, OpenCode) are event-driven: when the model yields a turn with text output, execution is completely suspended. Redis inbox state changes CANNOT wake an idle harness without an active child process registered in the task manager.
|
|
39
|
+
|
|
40
|
+
Whenever the Lead Orchestrator dispatches a task, broadcasts instructions, or awaits worker responses, THE FINAL ACTION OF THAT TURN MUST BE ARMING A BACKGROUND LISTENER:
|
|
41
|
+
`run_command(CommandLine="rhizo listen <orchestrator>", IsDaemon=false, WaitMsBeforeAsync=500)`
|
|
42
|
+
|
|
43
|
+
FORBIDDEN: Never yield the conversation turn to the operator after dispatching work without an active background listener running. Yielding a turn without a listener severs the swarm's physical lifeline, trapping worker replies in Redis and causing silent swarm stalls.
|
|
44
|
+
|
|
45
|
+
Safety Net (Scheduled Timer Watchdog & Debouncer Protocol):
|
|
46
|
+
In harnesses supporting `schedule` (e.g. Google Antigravity), arm a debounced watchdog timer to ensure an orchestrator session is never abandoned if a listener fails to arm or terminates prematurely.
|
|
47
|
+
- **Cadence**: 15 minutes (`DurationSeconds=900`, range 10m–30m / 600s–1800s). Defaulting to 15m avoids slurping token budgets while guaranteeing a 15m upper bound on any stall.
|
|
48
|
+
- **Replace, Never Stack Invariant**:
|
|
49
|
+
Harnesses prohibit concurrent timers with `TimerCondition="any"`. Before setting a timer, inspect running tasks with `manage_task(Action='list')`. If an existing watchdog task is active (`toolName == "schedule"` or prompt includes `[RHIZO WATCHDOG]`), cancel it via `manage_task(Action='kill', TaskId=...)`.
|
|
50
|
+
- **Debounce Triggers (Early and Often)**:
|
|
51
|
+
Run the debouncer subroutine on:
|
|
52
|
+
1. Task Dispatch (`rhizo send`, `rhizo enqueue`).
|
|
53
|
+
2. Worker Message / Gate Report receipt.
|
|
54
|
+
3. Implementation Plan updates (`implementation_plan.md` checkboxes).
|
|
55
|
+
4. Watchdog Wakeup turn (if tasks are still in flight).
|
|
56
|
+
- **Stand Down Invariant**:
|
|
57
|
+
When all tasks in `implementation_plan.md` are complete (`- [x]` 100%), kill any running watchdog timer and do not reschedule.
|
|
58
|
+
- **Zero-Token Happy Path**:
|
|
59
|
+
Because `TimerCondition="any"` is set, any arriving worker message or background task completion automatically cancels the timer early before it expires. The timer only fires if the orchestrator was silent and deaf for a full 15 minutes.
|
|
60
|
+
- **The Short Check (When Timer Fires)**:
|
|
61
|
+
Run `rhizo watchdog check --agent <name> --json`.
|
|
62
|
+
* If `ACTION_REQUIRED: REARM_LISTENER`: start `rhizo listen <name>` in background and debounce timer.
|
|
63
|
+
* If `ACTION_REQUIRED: UNREAD_MESSAGES`: drain messages with `rhizo drain 10 <name>`, start listener, and debounce.
|
|
64
|
+
* If `OK: LISTENING`: listener is healthy; debounce timer and return to sleep.
|
|
65
|
+
* If `STAND_DOWN: IDLE`: no tasks in flight; stand down.
|
|
66
|
+
</CRITICAL>
|
|
67
|
+
|
|
36
68
|
---
|
|
37
69
|
|
|
38
70
|
## 2. The Runtime Governance Loop
|
|
@@ -75,12 +107,30 @@ Depending on the task distribution model in `implementation_plan.md`:
|
|
|
75
107
|
--body '{"task_id": "task-test-harness", "strand": "strand/task-test-harness"}'
|
|
76
108
|
```
|
|
77
109
|
|
|
110
|
+
- **Mandatory Turn-End Listener Arming**:
|
|
111
|
+
Immediately after executing `rhizo send` or `rhizo enqueue`, arm your single-shot background listener before completing your turn:
|
|
112
|
+
```bash
|
|
113
|
+
run_command(CommandLine="rhizo listen orchestrator", IsDaemon=false, WaitMsBeforeAsync=500)
|
|
114
|
+
```
|
|
115
|
+
*(Never end your turn without this active background task; without it, worker gate reports cannot wake you up).*
|
|
116
|
+
|
|
78
117
|
### SOP 2: Monitoring Swarm Health, Watchdog & Escalation (GVR-011)
|
|
79
118
|
Check active workers and cluster status:
|
|
80
119
|
```bash
|
|
81
120
|
rhizo who --json
|
|
82
121
|
```
|
|
83
122
|
|
|
123
|
+
#### Orchestrator Self-Audit Watchdog
|
|
124
|
+
Verify that the orchestrator itself is actively listening while tasks are in-flight:
|
|
125
|
+
```bash
|
|
126
|
+
rhizo watchdog check [--agent <orchestrator>] [--json]
|
|
127
|
+
```
|
|
128
|
+
Returns:
|
|
129
|
+
- `status: OK (LISTENING)`: Listener process active and healthy.
|
|
130
|
+
- `status: ACTION_REQUIRED (REARM_LISTENER)`: In-flight tasks exist but listener is dead/missing. Re-arm immediately.
|
|
131
|
+
- `status: ACTION_REQUIRED (UNREAD_MESSAGES)`: Unconsumed inbox messages waiting. Drain immediately.
|
|
132
|
+
- `status: STAND_DOWN (IDLE)`: Zero in-flight tasks and zero unread messages. Stand down.
|
|
133
|
+
|
|
84
134
|
#### Responsiveness Watchdog & Health Probing
|
|
85
135
|
When waiting for a worker to finish an assigned task, run a health probe if no message is received within the expected window (e.g. 5–10 minutes):
|
|
86
136
|
```bash
|
|
@@ -93,7 +143,7 @@ The probe returns:
|
|
|
93
143
|
|
|
94
144
|
#### Operator Escalation Protocol
|
|
95
145
|
If `rhizo probe` indicates a stalled or dead worker (`NO_LISTENER` or `STALE` with unread inbox messages):
|
|
96
|
-
1. **Never Hang Silently**: The
|
|
146
|
+
1. **Never Hang Silently**: The Lead Orchestrator must immediately surface an escalation to the operator via `ask_question`.
|
|
97
147
|
2. **Present Diagnostic**:
|
|
98
148
|
- Alert: `⚠️ SWARM STALL DETECTED: @<worker> has not responded to <subject>`
|
|
99
149
|
- Diagnostic: `Inbox: N unread | Listener: NO_LISTENER | Status: STALE`
|