@axiomantic/garden 0.2.23 → 0.2.25

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/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: 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'."
3
+ description: "Master entrypoint and umbrella conductor for the Axiomantic Multi-Agent Swarm Triad (Garden + Rhizo + Vine). Activating Garden automatically coordinates Rhizo for transport/concurrency and Vine for Rift workspace virtualization. Guides the user through feature sowing (garden plant), deterministic germination (garden germinate dispatch|prompt|inline|status), conversational intake, persona selection, prompt-based worker fleet bootstrapping with 10-backtick copy-paste cards, 3-stage empirical dialectical pump (research, design, audit), master implementation planning, and Three-Key gate trunk weaving. Triggers: 'garden', 'swarm', 'multi-agent', 'agent team', 'coordinate agents', 'parallel agents', 'run swarm', 'start swarm', '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', 'garden plant', 'garden germinate', 'sow seed', 'germinate', 'roadmap'."
4
4
  ---
5
5
 
6
6
  # Garden: Multi-Agent Swarm Ceremony & Orchestration Engine
@@ -17,7 +17,13 @@ npm install -g @axiomantic/rhizo @axiomantic/vine @axiomantic/garden rift-snapsh
17
17
 
18
18
  ---
19
19
 
20
- ## 1. Architecture & Layering
20
+ ## 1. Architecture, Layering & The Master Umbrella Conductor
21
+
22
+ <CRITICAL>
23
+ Master Umbrella Conductor Invariant:
24
+ Garden is the capstone framework and single front-door of the Axiomantic Triad (Unix philosophy: Garden = Orchestration/Workflow, Rhizo = Transport/IPC, Vine = Git/Workspaces).
25
+ Whenever Garden is invoked (via 'garden', 'swarm', 'agent team', 'plant', 'germinate', or multi-agent feature requests), the agent MUST treat Garden as the parent umbrella. The operator NEVER needs to manually recite 'use garden/rhizo/vine'—activating Garden automatically mandates reading `garden`, `rhizo`, and `vine` skills.
26
+ </CRITICAL>
21
27
 
22
28
  Garden directs multi-agent swarms using Rhizo for transport and Vine for workspace virtualization:
23
29
 
@@ -25,7 +31,7 @@ Garden directs multi-agent swarms using Rhizo for transport and Vine for workspa
25
31
  flowchart TD
26
32
  subgraph Garden["Garden Layer (Methodology & Ceremonies)"]
27
33
  Phase0["Phase 0: Interactive Intake Interview (Scope, Team & Models)"]
28
- Phase1["Phase 1: choose-personas (Ratify garden-swarm.json)"]
34
+ Phase1["Phase 1: choose-personas (Synthesize Swarm Roles)"]
29
35
  Phase2["Phase 2: launch-workers (10-Backtick Prompt Cards & Sessions)"]
30
36
  Phase3["Phase 3: dialectical-pump (Research ➔ Design ➔ Audit)"]
31
37
  Phase4["Phase 4: plan-implementation (Locking & Strands)"]
@@ -34,7 +40,7 @@ flowchart TD
34
40
 
35
41
  subgraph Infrastructure["Coordination Infrastructure"]
36
42
  Rhizo["Rhizo (Redis Bus, Fencing Mutexes, Work Queues)"]
37
- Vine["Vine (Rift Strands, Two-Key Gate, Weaving)"]
43
+ Vine["Vine (Rift Strands, Three-Key Gate, Weaving)"]
38
44
  end
39
45
 
40
46
  Phase0 --> Phase1 --> Phase2 --> Phase3 --> Phase4 --> Phase5
@@ -46,30 +52,141 @@ flowchart TD
46
52
 
47
53
  ---
48
54
 
49
- ## 2. The End-to-End Ceremony Workflow
55
+ ## 2. Macro-Lifecycle: Sowing (`garden plant`) & Germination (`garden germinate`)
56
+
57
+ Before launching multi-agent ceremonies, features and roadmap items are captured organically as **Seeds** organized into roadmap **Seasons**:
58
+
59
+ ### A. Sowing Seeds (`garden plant`)
60
+ Add new roadmap items or feature requests to `.garden/seeds/<id>.toml`:
61
+ ```bash
62
+ garden plant "Real-time SSE event stream for cluster telemetry" \
63
+ --season "v0.3.0" \
64
+ --sunlight high \
65
+ --tags "telemetry,sse,web"
66
+ ```
67
+ Options:
68
+ - `--season <name>`: Target roadmap release or milestone (e.g. `v0.3.0`).
69
+ - `--sunlight <low|medium|high|blazing>`: Priority level.
70
+ - `--tags <csv>`: Domain classification tags.
71
+ - `--json`: Structured machine-parseable JSON output.
72
+ - `--list`: Displays all sown seeds and their dynamic lifecycle status.
73
+
74
+ ### B. Deterministic Germination (`garden germinate <subcommand> <seed>`)
75
+ To prevent LLM tool-calling omissions, germination uses dedicated positional subcommands:
76
+ 1. **`garden germinate dispatch <seed>`**: Enqueues the seed directly to Rhizo cluster work queues (`queue:<project>:tasks`) with dialectical pump specifications.
77
+ 2. **`garden germinate prompt <seed>`**: Emits copy-pasteable **10-backtick raw markdown prompt cards** for bootstrapping dedicated worker sessions.
78
+ 3. **`garden germinate inline <seed>`**: Runs the 3-stage dialectical pump (Research ➔ Design ➔ Audit) within the active chat session.
79
+ 4. **`garden germinate status <seed>`**: Inspects dynamic lifecycle progress (`SOWN` ➔ `DISPATCHED` ➔ `GERMINATED` ➔ `WOVEN`).
80
+
81
+ ---
82
+
83
+ ## 3. The End-to-End Ceremony Workflow
50
84
 
51
85
  Execute phases sequentially. Never skip phases or invert the order.
52
86
 
53
87
  | Phase | Sub-Skill / Step | Action | Quality Gate to Proceed |
54
88
  | :--- | :--- | :--- | :--- |
55
89
  | **Phase 0** | **Intake Gate** | Fast-path check (`rhizo who --json`) or single-question intake via `ask_question` calibrated to detected harness. | Active cluster workers confirmed or operator submits choice. |
56
- | **Phase 1** | [`choose-personas`](../choose-personas/SKILL.md) | Synthesize and write `garden-swarm.json` reflecting detected harness and chosen shape. | Valid JSON written to repo root. |
90
+ | **Phase 1** | [`choose-personas`](../choose-personas/SKILL.md) | Synthesize swarm configuration reflecting detected harness and chosen shape (zero on-disk JSON). | Swarm roles ratified. |
57
91
  | **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. |
58
92
  | **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`. |
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. |
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. |
93
+ | **Phase 4** | [`plan-implementation`](../plan-implementation/SKILL.md) | Author master implementation plan with locking schedules, strands, and Two-Point Diff contracts (Provider, Consumer, Replacement deletion). | Complete `implementation_plan.md` with task-locking matrix. |
94
+ | **Phase 5** | [`orchestrate-swarm`](../orchestrate-swarm/SKILL.md) | Main-chat governor: task dispatch, heartbeat monitoring, Closed-Circuit & Three-Key gate verification, trunk weaving. | All plan tasks woven via `vine weave` after passing Three-Key Gate (Mechanical, Semantic, Adversarial Audit). |
61
95
 
62
96
  ---
63
97
 
64
98
  ### Phase 0: Interactive Project Intake & Swarm Calibration
65
99
 
66
- #### Fast-Path: Re-using an Active / Existing Swarm (First-Look Invariant)
67
- Before asking ANY intake questions or presenting configuration modals, the orchestrator MUST run `rhizo who --json` to inspect the cluster.
68
- If active, healthy workers are ALREADY registered and listening on the Rhizo cluster:
69
- - **DO NOT** ask intake interview questions or prompt the operator for new sessions or models.
70
- - **DO NOT** display swarm composition or harness questions.
100
+ #### The Intelligent Concierge Protocol (`garden: <prompt>`)
101
+ When the operator prefixes a request with `garden: <prompt>` (or directs a feature, refactor, or project task to Garden):
102
+ The orchestrator MUST NOT immediately write code, edit files, or unilaterally launch massive multi-file changes.
103
+ Instead, it acts as an **Intelligent Intake Concierge**:
104
+
105
+ 0. **Fast-Path Check for Pre-Authorized Directives & Active Swarm**:
106
+ - **Pre-Authorized Directives & Autonomous Dispatch**: If the operator instructs "work on this with your workers" (or similar delegation phrases), or whenever active cluster workers already exist on the Rhizo cluster (`rhizo who`), the Orchestrator MUST NOT stop to ask routing questions. It is fully pre-authorized to act! It must immediately break down work, provision isolated Vine strands (`vine new <task>`), and dispatch directly over Rhizo (`rhizo send`) or enqueue to work queues (`rhizo enqueue`).
107
+ - **Fleet-First Mandate**: When online workers exist anywhere in the cluster, NEVER output copy-paste prompt cards to the human operator. Dispatch or repurpose existing workers over Rhizo (`rhizo send` / `garden repurpose`).
108
+ - **Mandatory `ask_question` Tool Discipline**: Only during a true cold start with 0 cluster workers online and no explicit delegation directive may the orchestrator solicit routing input. In that case, the orchestrator MUST invoke the interactive `ask_question` tool. Dumping numbered multiple-choice lists (1, 2, 3) or raw option text directly into the chat stream is STRICTLY PROHIBITED.
109
+
110
+ 1. **Evaluate Request Scope & Blast Radius (Cold Start Only)**:
111
+ - **High Complexity / Architectural Shifts / New Subsystems / Multi-File Migrations**: The request impacts foundational contracts, multiple modules, or shared abstractions. Requires empirical research, RFC design, adversarial review, and parallel strand isolation. Recommend **Option 1**.
112
+ - **Medium Complexity / Well-Defined Features / Self-Contained Deliverables**: The scope is clear, boundaries are known, and it can be implemented without a 3-stage dialectical design cycle. Recommend **Option 2**.
113
+ - **Low Complexity / Single-File Fixes / Documentation / Scratch Tweaks**: Trivial 1-file patch or config change. Recommend **Option 3**.
114
+
115
+ 2. **Present Interactive Triage Modal (`ask_question`)**:
116
+ The orchestrator invokes `ask_question` with 3 mutually exclusive options clearly explaining the tradeoffs:
117
+ - **Option 1 (Full Ceremony - RFE ➔ RFD ➔ RFC ➔ Swarm)**:
118
+ *Scope*: Architectural shifts, new subsystems, major refactors, or cross-cutting migrations.
119
+ *Process*: Sows the idea as a persistent roadmap seed (`garden plant`), authors the Research/RFD, System Architecture/RFC, and Adversarial Audit documents, schedules monotonic locks and isolated Vine strands, and writes worker prompts to `/tmp/garden-<project>/`.
120
+ - **Option 2 (Direct Swarm Dispatch)**:
121
+ *Scope*: Well-defined, self-contained features, bugfixes, or bounded deliverables.
122
+ *Process*: Bypasses heavy research/design documentation; enqueues tasks straight to cluster work queues (`rhizo enqueue queue:<project>:tasks`) or dispatches directly to active workers (`rhizo send <worker>`).
123
+ - **Option 3 (Inline Execution)**:
124
+ *Scope*: Trivial 1-file fixes, documentation, typo corrections, or quick scratch scripts.
125
+ *Process*: Executes directly within the main session without provisioning worker sessions or cluster overhead.
126
+
127
+ 3. **Execution Branching**:
128
+ - **If Option 1 selected**: Run `garden plant "<prompt>"`, then proceed to Cold-Start Swarm Calibration / Phase 1 `choose-personas` (or attach to active swarm via Fast-Path) and Phase 3 `dialectical-pump`.
129
+ - **If Option 2 selected**: Check `rhizo who --all --json`. If workers are online, dispatch via `rhizo send` or `rhizo enqueue`. If cold, run Cold-Start Swarm Calibration to spin up workers.
130
+ - **If Option 3 selected**: Execute inline in the current session.
131
+
132
+ #### Adaptive Swarm On-Ramp & Dynamic Worker Repurposing (First-Look Invariant)
133
+
134
+ Before asking ANY intake questions or presenting configuration modals, the designated orchestrator MUST run `rhizo who --all --json` to inspect the cluster across all projects.
135
+ Garden automatically categorizes cluster listeners into three operational pools:
136
+ 1. **`projectActive`**: Active listeners already registered on the target project.
137
+ 2. **`availableIdlePeers`**: Active idle listeners currently registered under other projects, immediately available for dynamic repurposing.
138
+ 3. **`busyClusterPeers`**: Active listeners executing in-flight tasks (`BUSY`), guarded from unintentional reassignment.
139
+
140
+ ##### Fast-Path: Re-using an Active / Existing Swarm
141
+ If active, healthy workers on the target project meet or exceed the target worker count (`projectActive >= targetWorkers`):
142
+ - **Fast-Path Activated**: Skip intake interview questions and avoid generating redundant prompt card files.
71
143
  - Automatically attach to the existing online workers (`@worker-1`, `@worker-2`, ...).
72
144
  - Confirm cluster readiness and proceed immediately to Phase 3 (Dialectical Pump / Task Breakdown) or Phase 5 (Task Dispatch).
145
+ - **Bypass**: To force prompt card regeneration despite active workers, pass `--force-prompts` to `garden prompts` or `garden launch`.
146
+
147
+ ##### Dual-Pathway Swarm On-Ramp (When Additional Workers Needed)
148
+ When target project workers are needed and idle cluster peers exist, Garden surfaces two distinct pathways:
149
+
150
+ - **Pathway A (Dynamic Repurposing via `garden repurpose`)**:
151
+ Repurpose existing idle cluster listeners directly into the target project without opening new terminal windows or copying prompt cards:
152
+ ```bash
153
+ garden repurpose <worker1> <worker2> \
154
+ --project <target-project> \
155
+ --role "<assigned-role>" \
156
+ [--tags "<t1,t2>"] \
157
+ [--force]
158
+ ```
159
+ - **Self-Tagging Capability Handshake (`--self-tag`)**: When cluster workers have heterogeneous environments (e.g. one tab has Nim/C, another Node/Playwright, another Python/uv), dispatch an authenticated `SWARM_REPURPOSE_OFFER` directive:
160
+ ```bash
161
+ garden repurpose <worker> \
162
+ --project <target-project> \
163
+ --self-tag \
164
+ --expected-tags "backend,frontend,qa,audit"
165
+ ```
166
+ The recipient worker inspects its local toolchain, self-selects a compatible role, adds corresponding tags (`rhizo tag add <tags>`), and replies with `WORKER_READY`.
167
+ - **Negative Control & Safety Guardrail**: Repurposing rejects workers that are actively `BUSY` on tasks to prevent disrupting active workflows. Repurposing a busy worker requires the explicit `--force` flag.
168
+
169
+ - **Pathway B (Fresh Session Bootstrapping)**:
170
+ When zero cluster listeners exist or the operator prefers isolated fresh sessions, Garden generates self-contained 10-backtick prompt cards in `/tmp/garden-<project>/` via `garden prompts` (or `garden launch`).
171
+
172
+ <CRITICAL>
173
+ Operator-Named Worker Delegation Mandate:
174
+ When the operator explicitly requests or names a worker or peer session (e.g. 'u + autopxd-architect' or 'assign to worker-1'), the Lead Orchestrator MUST dispatch directly to that named recipient over Rhizo (`rhizo send --to <worker> ...`). The orchestrator MUST NEVER gate delegation on whether that worker appears in local single-project `rhizo who`, and MUST NEVER fall back to internal subagents. When inspecting the cluster roster for active workers, an orchestrator MUST query `rhizo who --all --json` (or check specific peers via `rhizo who <worker>` / `rhizo probe <worker>`). Never assume the cluster is empty based solely on local single-project `rhizo who` output.
175
+ </CRITICAL>
176
+
177
+ > [!CAUTION]
178
+ > **Orchestrator Scope Restriction**: This fast-path applies **ONLY** to a session that was explicitly initialized or designated by the operator as the Lead Orchestrator. A fresh unbootstrapped session must NEVER assume it is the orchestrator simply because `<project>-orchestrator` appears in `rhizo who`!
179
+
180
+ <INVARIANT>
181
+ Unbootstrapped Session Identity: If a session was NOT explicitly bootstrapped with an identity in its conversation history (via a Garden bootstrap prompt card, an explicit operator assignment, or prior 'rhizo open <name>' in that same conversation), it MUST NEVER guess, adopt, or assume an existing identity from 'rhizo who --json' (especially NEVER '<project>-orchestrator'). If the operator commands '/rhizo listen' without arguments in an unbootstrapped session, the session MUST either:
182
+ 1. Run 'rhizo name' to allocate a fresh unique identity, followed by 'rhizo open <name>', OR
183
+ 2. Ask the operator via 'ask_question' which persona or role this window represents.
184
+ Never assume you are the orchestrator or an existing active worker simply because those names appear in the project directory.
185
+ </INVARIANT>
186
+
187
+ <FORBIDDEN>
188
+ Never Hijack or Kill Another Session's Active Listener: When 'rhizo listen <agent>' fails with "Error: Listener already active for agent ... (PID X)", an agent MUST NEVER kill that PID, run 'kill <pid>', or pass '--force' unless the agent has verified in its own conversation history that this agent name was explicitly opened and running in THIS session. In 'rhizo who', 'status: STALE' only indicates that no messages have been routed recently; it does NOT mean the blocking listener process in another window is dead or orphaned. Killing listener PIDs from other windows corrupts the cluster, severs peer communication, and hijacks sovereign sessions.
189
+ </FORBIDDEN>
73
190
 
74
191
  #### Cold-Start Intake Protocol (Zero Active Workers Only)
75
192
  When an operator initiates a fresh project or requests multi-agent coordination and NO active cluster workers exist, the session MUST NOT silently guess configuration.
@@ -88,18 +205,18 @@ Swarm workers are ALWAYS sovereign, independent interactive sessions (dedicated
88
205
 
89
206
  <CRITICAL>
90
207
  Session Default Models (Standalone Model Quizzes Prohibited):
91
- Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session (e.g., Gemini in Antigravity, Claude in Claude Code, configured workspace models in OpenCode). NEVER present a separate question asking the operator to choose "Foundation Model Pairings". In `garden-swarm.json` and prompt cards, model configuration defaults to `"Session Default (active in window/tab)"`.
208
+ Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session (e.g., Gemini in Antigravity, Claude in Claude Code, configured workspace models in OpenCode). NEVER present a separate question asking the operator to choose "Foundation Model Pairings". In prompt cards, model configuration defaults to `"Session Default (active in window/tab)"`.
92
209
  </CRITICAL>
93
210
 
94
211
  #### Automatic Fulfillment & 10-Backtick Prompt Generation:
95
212
  Upon receiving the operator's response:
96
213
  1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
97
- 2. Generate `garden-swarm.json` reflecting the chosen workers, roles, detected harness, and session-default models.
98
- 3. Run `garden prompts` to generate the raw markdown prompt cards wrapped in **10 backticks** (` ``````````markdown `).
99
- 4. Present the operator with clear, numbered instructions:
214
+ 2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and session-default models (zero on-disk JSON).
215
+ 3. Run `garden prompts` which writes individual prompt cards to `/tmp/garden-<project>/<worker>.md` and all cards to `/tmp/garden-<project>/all-workers.md`.
216
+ 4. Present the operator with concise setup instructions and copy commands (NEVER paste prompt cards inline in chat):
100
217
  ```text
101
218
  1. Open X terminal tabs or windows in your detected coding harness.
102
- 2. Copy the raw block inside each 10-backtick pre block below and paste it into its corresponding session.
219
+ 2. Copy each worker's prompt card from its file (e.g. `pbcopy < /tmp/garden-<project>/<worker>.md`) and paste into its session.
103
220
  3. Once pasted, tell me here (or I will automatically detect them online via `rhizo who`).
104
221
  ```
105
222
  5. Register the orchestrator's presence (`rhizo open <project>-orchestrator`) and arm the listener.
@@ -110,7 +227,7 @@ Upon receiving the operator's response:
110
227
 
111
228
  ## Unified Work Item State Machine (WISM)
112
229
 
113
- Rhizo, Garden, and Vine coordinate all multi-agent work through the formal **Work Item State Machine (WISM)**. Every task progresses through 10 deterministic states with atomic Redis transitions, automated DAG unblocking, and Two-Key integration gates.
230
+ Rhizo, Garden, and Vine coordinate all multi-agent work through the formal **Work Item State Machine (WISM)**. Every task progresses through deterministic states with atomic Redis transitions, automated DAG unblocking, and Three-Key integration gates.
114
231
 
115
232
  ```mermaid
116
233
  stateDiagram-v2
@@ -125,14 +242,18 @@ stateDiagram-v2
125
242
 
126
243
  CLAIMED --> IN_PROGRESS : Worker provisions strand (vine new <id>)
127
244
  IN_PROGRESS --> IN_PROGRESS : Progress reported (rhizo task progress, lease extended)
128
- IN_PROGRESS --> GATE_EVALUATING : Verification initiated (vine gate)
245
+ IN_PROGRESS --> GATE_EVALUATING : Verification initiated (vine submit / vine gate)
129
246
  IN_PROGRESS --> YIELDED : rhizo task yield (Returned to pool)
130
247
  IN_PROGRESS --> ORPHANED : Lease expires without progress
131
248
 
132
- GATE_EVALUATING --> IN_PROGRESS : Gate failed (Tests red or merge conflict)
133
- GATE_EVALUATING --> READY_TO_WEAVE : Two-Key Gate PASSED (Cryptographic gate token stamped)
249
+ GATE_EVALUATING --> IN_PROGRESS : Gate failed (Tests red, changelog missing, or merge conflict)
250
+ GATE_EVALUATING --> READY_FOR_AUDIT : Keys 1 & 2 PASSED (vine submit, gate token stamped)
251
+
252
+ READY_FOR_AUDIT --> AUDIT_RATIFIED : Key 3 PASSED (vine audit approve, audit token stamped)
253
+ READY_FOR_AUDIT --> AUDIT_REJECTED : Key 3 FAILED (vine audit reject)
254
+ AUDIT_REJECTED --> IN_PROGRESS : Remediate defects in strand
134
255
 
135
- READY_TO_WEAVE --> COMPLETED : vine weave && rhizo task complete (Unblocks downstream DAG children)
256
+ AUDIT_RATIFIED --> COMPLETED : vine weave && rhizo task complete (Unblocks downstream DAG children)
136
257
 
137
258
  ORPHANED --> QUEUED : Re-queued for retry (attempts < 3)
138
259
  ORPHANED --> DEAD_LETTER : Max delivery retries exceeded (attempts >= 3)
@@ -176,17 +297,24 @@ stateDiagram-v2
176
297
  +-------------+
177
298
  │ ▲
178
299
  │ vine │ Gate fails
179
- │ gate │ (Tests red or conflict)
300
+ │ submit │ (Tests red or conflict)
180
301
  ▼ │
181
302
  +-----------------+
182
303
  | GATE_EVALUATING |
183
304
  +-----------------+
184
305
  │
185
- │ Two-Key Gate PASSED (Key 1 merge-tree + Key 2 live test suite green)
306
+ │ Keys 1 & 2 PASSED (vine submit: merge-tree + live test suite green)
186
307
  ▼
187
- +----------------+
188
- | READY_TO_WEAVE |
189
- +----------------+
308
+ +------------------+
309
+ | READY_FOR_AUDIT | ◄──────────────────────┐
310
+ +------------------+ │
311
+ │ │ │
312
+ │ approve │ reject │ Remediate
313
+ ▼ ▼ │
314
+ +------------+ +----------------+ │
315
+ | AUDIT_ | | AUDIT_REJECTED | ──────────┘
316
+ | RATIFIED | +----------------+
317
+ +------------+
190
318
  │
191
319
  │ vine weave && rhizo task complete
192
320
  ▼
@@ -202,13 +330,19 @@ stateDiagram-v2
202
330
  | **`DRAFTED`** | `rhizo task create <id> --title <t>` | Creates immutable task contract hash `task:<id>` in Redis. | N/A |
203
331
  | **`BLOCKED`** | Evaluated on create | Stamped if `depends_on` contains incomplete tasks. Workers cannot claim. | N/A |
204
332
  | **`QUEUED`** | Auto on create or parent complete | Pushed to queue/inbox. Available for worker consumption. | N/A |
205
- | **`DELIVERED`** | `rhizo listen` consumes payload | **Atomically moves into `task:<id>` DELIVERED state**. Instant transport receipt emitted to orchestrator. Mirrored to local `~/.config/rhizo/current_task.json` for turn-end hook interlocks. | 180s Receipt Timeout $
206
- | **`CLAIMED`** | `rhizo task claim <id>` / `rhizo reply` | Worker acquires monotonic fencing lease. Isolated Vine strand provisioned (`vine new <id>`). Turn-end hook blocks until work starts. | Lease expires $
207
- | **`IN_PROGRESS`** | Worker coding in strand | Enforces single-active-lease invariant. Periodic `rhizo task progress` extends lease. | Lease expires $
208
- | **`GATE_EVALUATING`**| `vine gate` | Key 1 (mechanical merge-tree) & Key 2 (live compiler/test suite) evaluated. | Exit 1 $
209
- | **`READY_TO_WEAVE`** | Both keys pass 100% | Cryptographic gate token stamped (`gate_token`). Report sent to orchestrator. | N/A |
210
- | **`COMPLETED`** | `vine weave && rhizo task complete` | Fast-forward merged into canonical trunk. Strand pruned. Locks released. **Downstream DAG dependencies automatically unblocked (`BLOCKED` $
211
- | **`ORPHANED`** | Receipt timeout or lease expired | Stalled worker detected. Increments `delivery_attempts`. If $\ge 3
333
+ | **`DELIVERED`** | `rhizo listen` consumes payload | **Atomically moves into `task:<id>` DELIVERED state**. Instant transport receipt emitted to orchestrator. Mirrored to local `~/.config/rhizo/current_task.json` for turn-end hook interlocks. | 180s Receipt Timeout $
334
+ ightarrow$ `ORPHANED` |
335
+ | **`CLAIMED`** | `rhizo task claim <id>` / `rhizo reply` | Worker acquires monotonic fencing lease. Isolated Vine strand provisioned (`vine new <id>`). Turn-end hook blocks until work starts. | Lease expires $
336
+ ightarrow$ `ORPHANED` |
337
+ | **`IN_PROGRESS`** | Worker coding in strand | Enforces single-active-lease invariant. Periodic `rhizo task progress` extends lease. | Lease expires $
338
+ ightarrow$ `ORPHANED` |
339
+ | **`GATE_EVALUATING`**| `vine submit` / `vine gate` | Key 1 (mechanical merge-tree) & Key 2 (live compiler/test suite + changelog) evaluated. | Exit 1 $\rightarrow$ `CONFLICTED`<br>Exit 2 $\rightarrow$ `GATE_FAILED` |
340
+ | **`READY_FOR_AUDIT`**| `vine submit` | Keys 1 & 2 passed. Strand submitted for independent adversarial review. | N/A |
341
+ | **`AUDIT_REJECTED`** | `vine audit reject` | Auditor rejected deliverable with recorded defect reasons. Worker returns to `IN_PROGRESS` for delta remediation. | N/A |
342
+ | **`AUDIT_RATIFIED`** | `vine audit approve` | Key 3 passed! Cryptographic `audit_token` stamped. Auditor and author identities strictly decoupled (`auditor != author`). | N/A |
343
+ | **`COMPLETED`** | `vine weave && rhizo task complete` | Fast-forward merged into canonical trunk. Strand pruned. Locks released. **Downstream DAG dependencies automatically unblocked (`BLOCKED` $\rightarrow$ `QUEUED`)!** | N/A |
344
+ | **`ORPHANED`** | Receipt timeout or lease expired | Stalled worker detected. Increments `delivery_attempts`. If $\ge 3
345
+ ightarrow$ `DEAD_LETTER`. Otherwise returns to `QUEUED`. | Escalates to operator if Dead-Lettered |
212
346
  | **`YIELDED`** | `rhizo task yield <id>` | Worker gracefully steps aside. Task returned to `QUEUED`. | N/A |
213
347
  | **`DEAD_LETTER`** | Retries exhausted ($\ge 3$) | Moved to dead-letter queue. Alerts orchestrator and operator. | Requires manual operator triage |
214
348
 
@@ -249,11 +383,22 @@ Zero Theatrical Dialogue: Every dialectical assertion must be substantiated with
249
383
  Worker Autonomous Execution Invariant (GVR-017):
250
384
  Swarm workers are sovereign, autonomous implementers, not passive chatbots.
251
385
  When 'rhizo listen' delivers an incoming task and exits, workers MUST NOT wait for an operator prompt or ask "Shall I begin?".
252
- They MUST immediately transition to active execution: claim the task, enter the isolated Vine strand, perform the work, verify the Two-Key Gate, report results, and re-arm the single-shot listener before concluding their turn.
386
+ They MUST immediately transition to active execution: claim the task, enter the isolated Vine strand, perform the work, submit the strand for independent audit ('vine submit'), report results, and re-arm the single-shot listener before concluding their turn. Remember: THE WORKER IS NOT THE AUDITOR; an independent adversarial auditor must review and ratify Key 3 ('vine audit approve').
387
+ </CRITICAL>
388
+
389
+ <CRITICAL>
390
+ Closed-Circuit Two-Point Diff, Literal Fidelity & Holistic Integration Invariant:
391
+ 1. Two-Point Diff Mandate: Never build isolated code in a vacuum. Every deliverable must exhibit a Two-Point Diff: the Provider (new capability) and the Consumer (live production call-site, router, UI canvas, or CLI entrypoint). Modules that are only imported by their own test suites are strictly prohibited as incomplete shelfware.
392
+ 2. Holistic Integration (Anti-Stub / Anti-Toy): The implementation must holistically integrate into the live application—it must never be a toy, stub, mock, or hollow heuristic approximation.
393
+ 3. Literal Fidelity & True-Fidelity Mandate (Anti-Approximation): When recreating, porting, reverse-engineering, duplicating functionality from an existing reference, or executing an operator directive where fidelity is expected:
394
+ - "Approximate", "looks right", "heuristic shortcut", "gist-level", or "good enough for happy paths" implementations are STRICTLY REJECTED.
395
+ - The implementation must be literally and precisely the thing that was asked for, matching all edge cases, type boundaries, flags, and error flows.
396
+ 4. Aggressive Replacement Purge: Any existing code, configurations, or fallbacks meant to be replaced or upgraded MUST BE DELETED immediately in the same strand; hoarding dead code, maintaining vestigial fallbacks, or leaving commented-out logic in the codebase is strictly prohibited.
397
+ 5. Structural Assertion Rigor: Partial or loose assertions ("loosey goosey" tests like `assert 'foo' in bar`) are strictly forbidden. Tests must assert complete object equality (`assert actual == expected`) and cover negative controls.
253
398
  </CRITICAL>
254
399
 
255
400
  <INVARIANT>
256
- Never merge code into the canonical trunk without a verified Two-Key Gate pass ('vine gate' exit code 0) inside an isolated Rift strand.
401
+ Never merge code into the canonical trunk without passing the Three-Key Gate: Key 1 (mechanical merge-tree 'git merge-tree'), Key 2 (semantic test runner 'vine gate'), and Key 3 (Pre-Weave Adversarial Code Audit Pump with 0 open defects under the presumption of guilt) inside an isolated Rift strand.
257
402
  </INVARIANT>
258
403
 
259
404
  <FORBIDDEN>
@@ -314,15 +459,19 @@ To prevent silent deadlocks when workers stall, crash, or fail to re-arm listene
314
459
  - **Codex / ChatGPT Watchdog Only**: In OpenAI Codex Desktop / CLI where background processes cannot reactively wake the harness, arm a scheduled watchdog timer or cron job with stepped backoff (15m $\rightarrow$ 30m $\rightarrow$ 60m $\rightarrow$ 120m $\rightarrow$ Stand Down at check 4).
315
460
  - **Reset Invariant**: Resets immediately to base 15m (streak 0) on any listener failure, unread inbox backlog, outbound task dispatch (`rhizo send`/`enqueue`), worker reply, or user chat prompt.
316
461
  - When the timer fires in Codex, execute the short check: `rhizo watchdog check --agent <orchestrator> --json` and follow `next_action` (`SCHEDULE_TIMER` or `STAND_DOWN`).
462
+ 4. **Post-Push Remote CI Verification Timer (Loose Guideline)**:
463
+ - After weaving (`vine weave`) and pushing (`git push`) to a remote repository where CI workflows run, if the coding harness supports timers/scheduling (e.g., `schedule`), set a periodic timer to check CI status (`gh run list --limit 3`):
464
+ - **Default Cadence**: Every 5 minutes (`DurationSeconds=300` or `CronExpression="*/5 * * * *"`).
465
+ - **Max Checks**: Maximum 12 checks (1 hour total, `MaxIterations=12`), cancelling the timer early as soon as all CI workflows finish (pass or fail).
317
466
 
318
467
  ---
319
468
 
320
- ## 5. Configuration & Swarm Manifest Reference
469
+ ## 5. Configuration & Architecture Reference
321
470
 
322
471
  See [`docs/configuration.md`](../../docs/configuration.md) for full details on:
323
- - **Environment Variables**: `GARDEN_SWARM_FILE`, `GARDEN_CONFIG`, `GARDEN_PROJECT_DIR`, and `GARDEN_TERMINAL_APP`.
472
+ - **Environment Variables**: `GARDEN_CONFIG`, `GARDEN_PROJECT_DIR`, and `GARDEN_TERMINAL_APP`.
324
473
  - **`garden.toml`**: Project-level defaults (`name`, `preferred_terminal`, `session_prefix`, `default_triad`).
325
- - **`garden-swarm.json`**: Swarm specification schema (`project`, `target_repo`, `orchestrator`, `shared_workspace`, `workers` array: `name`, `persona`, `role`, `harness`, `model`, `tags`, `system_prompt`, `opposing_priority`).
474
+ - **Dynamic Swarm Synthesis**: Swarm specification schema (`project`, `target_repo`, `orchestrator`, `shared_workspace`, `workers` array: `name`, `persona`, `role`, `harness`, `model`, `tags`, `system_prompt`, `opposing_priority`) generated dynamically in-memory without on-disk JSON artifacts.
326
475
  - **The 10-Backtick Protocol**: Clean raw markdown formatting for copy-paste worker bootstrap prompts.
327
476
 
328
477
 
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiomantic/garden",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "description": "Multi-Agent Swarm Orchestration, Empirical Dialectics & Ceremonies on top of Rhizo & Vine",
5
5
  "main": "bin/run.js",
6
6
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "url": "git+https://github.com/axiomantic/garden.git"
31
31
  },
32
32
  "scripts": {
33
- "test": "nim c -r tests/test_garden.nim && nim c -r tests/test_seed.nim && nim c -r tests/test_germinate.nim && nim c -r tests/test_update.nim && node tests/test_riders.js",
33
+ "test": "nim c -r tests/test_garden.nim && nim c -r tests/test_seed.nim && nim c -r tests/test_germinate.nim && nim c -r tests/test_roadmap.nim && nim c -r tests/test_update.nim && node tests/test_riders.js",
34
34
  "build": "nim c -d:release --threads:on --mm:orc -o:bin/garden src/garden.nim"
35
35
  },
36
36
  "keywords": [
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "homepage": "https://github.com/axiomantic/garden#readme",
52
52
  "dependencies": {
53
- "@axiomantic/rhizo": "^0.2.25",
54
- "@axiomantic/vine": "^0.2.13",
53
+ "@axiomantic/rhizo": "^0.2.27",
54
+ "@axiomantic/vine": "^0.2.15",
55
55
  "rift-snapshot": "^0.0.13"
56
56
  }
57
57
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: choose-personas
3
- description: "Selects, balances, and configures specialized agent personas for a Garden swarm task. Analyzes codebase context, domain complexity, and task requirements to formulate a triad of complementary personas with opposing priorities. Auto-detects the active coding harness and aligns worker harnesses and session-default models with operator preferences via a single intake question. Outputs garden-swarm.json. Triggers: 'choose personas', 'select personas', 'set up agent team', 'assemble personas for this task', 'recommend agents'."
3
+ description: "Selects, balances, and configures specialized agent personas for a Garden swarm task. Analyzes codebase context, domain complexity, and task requirements to formulate a triad of complementary personas with opposing priorities. Auto-detects the active coding harness and aligns worker harnesses and session-default models with operator preferences via a single intake question. Synthesizes dynamic swarm configurations. Triggers: 'choose personas', 'select personas', 'set up agent team', 'assemble personas for this task', 'recommend agents'."
4
4
  ---
5
5
 
6
6
  # `choose-personas`: Dynamic Swarm Persona Selection & Auto-Detected Harness Intake
@@ -60,7 +60,7 @@ Swarm workers are ALWAYS sovereign, independent interactive sessions (separate t
60
60
 
61
61
  <CRITICAL>
62
62
  Session Default Models (No Cross-Harness Model Quizzes):
63
- Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session. NEVER present a separate question asking the operator to choose "Foundation Model Pairings", and NEVER present model options that do not correspond to the chosen harness. In `garden-swarm.json` and prompt cards, models default to `"Session Default (active in window/tab)"`.
63
+ Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session. NEVER present a separate question asking the operator to choose "Foundation Model Pairings", and NEVER present model options that do not correspond to the chosen harness. In prompt cards and swarm specifications, models default to `"Session Default (active in window/tab)"`.
64
64
  </CRITICAL>
65
65
 
66
66
  <CRITICAL>
@@ -97,12 +97,14 @@ sequenceDiagram
97
97
  Note over Orch: Formulates primary triad + harness pairing
98
98
  Orch->>User: Renders unified ask_question modal (Team shape + Harness)
99
99
  User-->>Orch: Submits chosen triad
100
- Orch->>Repo: Writes garden-swarm.json manifest
100
+ Orch->>Garden: Synthesizes dynamic swarm configuration
101
101
  end
102
102
  ```
103
103
 
104
- ### Step 0: Pre-Flight Cluster Check
105
- Run `rhizo who --json` and inspect `garden-swarm.json`. If active, healthy workers already exist in the cluster, skip persona selection and reuse the existing workers.
104
+ ### Step 0: Pre-Flight Cluster Check & Adaptive Swarm On-Ramp
105
+ Run `rhizo who --all --json` to triage cluster listener state:
106
+ 1. **Target Project Active**: If active, healthy workers already exist registered under the target project, skip persona selection and reuse the existing workers (Fast-Path).
107
+ 2. **Available Idle Peers**: If active listeners exist under other projects or unassigned, note their presence. Once personas are ratified, these peers can be dynamically repurposed into the project via `garden repurpose` without requiring manual prompt copying into new windows.
106
108
 
107
109
  ### Step 1: Codebase & Task Analysis (Cold Starts Only)
108
110
  1. Inspect repository stack (e.g., Nim, Rust, Python, TypeScript, C).
@@ -134,8 +136,8 @@ Invoke `ask_question` with a SINGLE concise question combining execution mode an
134
136
  - Option 3: Single-Agent Inline (Execute sequentially within current chat session)
135
137
  - Option 4: Custom configuration (allows user write-in).
136
138
 
137
- ### Step 4: Generate Swarm Manifest (`garden-swarm.json`)
138
- Once ratified, write `garden-swarm.json` to the target project directory with worker harnesses set to the detected harness:
139
+ ### Step 4: Synthesize Swarm Specification
140
+ Once ratified, Garden synthesizes the swarm configuration dynamically in memory (zero on-disk JSON). If inspectable output is needed, Garden emits to stdout or prompt cards in `/tmp/garden-<project>/`:
139
141
 
140
142
  ```json
141
143
  {
@@ -183,9 +185,7 @@ Once ratified, write `garden-swarm.json` to the target project directory with wo
183
185
  ## 4. Verification & Automatic Prompt Generation Handoff
184
186
 
185
187
  Before concluding:
186
- 1. Verify `garden-swarm.json` is syntactically valid JSON.
187
- 2. Confirm each worker has unique `name` and non-empty `tags`.
188
- 3. Proceed directly to [`launch-workers`](../launch-workers/SKILL.md):
189
- - Call `garden prompts` to generate the 10-backtick raw markdown blocks.
190
- - Present the operator with numbered terminal tab setup instructions.
191
- - Await cluster readiness verification via `rhizo who --json`.
188
+ 1. Confirm each worker has unique `name` and non-empty `tags`.
189
+ 2. Proceed to Worker On-Ramp ([`launch-workers`](../launch-workers/SKILL.md)):
190
+ - **Pathway A (Dynamic Repurposing)**: If idle cluster peers were detected, run `garden repurpose` to reassign them to the chosen personas/roles without manual session setup.
191
+ - **Pathway B (Fresh Session Bootstrapping)**: Call `garden prompts` to generate the 10-backtick raw markdown blocks in `/tmp/garden-<project>/`, present tab setup instructions, and await cluster readiness via `rhizo who --all --json`.
@@ -31,7 +31,7 @@ Garden directs multi-agent swarms using Rhizo for transport and Vine for workspa
31
31
  flowchart TD
32
32
  subgraph Garden["Garden Layer (Methodology & Ceremonies)"]
33
33
  Phase0["Phase 0: Interactive Intake Interview (Scope, Team & Models)"]
34
- Phase1["Phase 1: choose-personas (Ratify garden-swarm.json)"]
34
+ Phase1["Phase 1: choose-personas (Synthesize Swarm Roles)"]
35
35
  Phase2["Phase 2: launch-workers (10-Backtick Prompt Cards & Sessions)"]
36
36
  Phase3["Phase 3: dialectical-pump (Research ➔ Design ➔ Audit)"]
37
37
  Phase4["Phase 4: plan-implementation (Locking & Strands)"]
@@ -87,7 +87,7 @@ Execute phases sequentially. Never skip phases or invert the order.
87
87
  | Phase | Sub-Skill / Step | Action | Quality Gate to Proceed |
88
88
  | :--- | :--- | :--- | :--- |
89
89
  | **Phase 0** | **Intake Gate** | Fast-path check (`rhizo who --json`) or single-question intake via `ask_question` calibrated to detected harness. | Active cluster workers confirmed or operator submits choice. |
90
- | **Phase 1** | [`choose-personas`](../choose-personas/SKILL.md) | Synthesize and write `garden-swarm.json` reflecting detected harness and chosen shape. | Valid JSON written to repo root. |
90
+ | **Phase 1** | [`choose-personas`](../choose-personas/SKILL.md) | Synthesize swarm configuration reflecting detected harness and chosen shape (zero on-disk JSON). | Swarm roles ratified. |
91
91
  | **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. |
92
92
  | **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`. |
93
93
  | **Phase 4** | [`plan-implementation`](../plan-implementation/SKILL.md) | Author master implementation plan with locking schedules, strands, and Two-Point Diff contracts (Provider, Consumer, Replacement deletion). | Complete `implementation_plan.md` with task-locking matrix. |
@@ -102,7 +102,12 @@ When the operator prefixes a request with `garden: <prompt>` (or directs a featu
102
102
  The orchestrator MUST NOT immediately write code, edit files, or unilaterally launch massive multi-file changes.
103
103
  Instead, it acts as an **Intelligent Intake Concierge**:
104
104
 
105
- 1. **Evaluate Request Scope & Blast Radius**:
105
+ 0. **Fast-Path Check for Pre-Authorized Directives & Active Swarm**:
106
+ - **Pre-Authorized Directives & Autonomous Dispatch**: If the operator instructs "work on this with your workers" (or similar delegation phrases), or whenever active cluster workers already exist on the Rhizo cluster (`rhizo who`), the Orchestrator MUST NOT stop to ask routing questions. It is fully pre-authorized to act! It must immediately break down work, provision isolated Vine strands (`vine new <task>`), and dispatch directly over Rhizo (`rhizo send`) or enqueue to work queues (`rhizo enqueue`).
107
+ - **Fleet-First Mandate**: When online workers exist anywhere in the cluster, NEVER output copy-paste prompt cards to the human operator. Dispatch or repurpose existing workers over Rhizo (`rhizo send` / `garden repurpose`).
108
+ - **Mandatory `ask_question` Tool Discipline**: Only during a true cold start with 0 cluster workers online and no explicit delegation directive may the orchestrator solicit routing input. In that case, the orchestrator MUST invoke the interactive `ask_question` tool. Dumping numbered multiple-choice lists (1, 2, 3) or raw option text directly into the chat stream is STRICTLY PROHIBITED.
109
+
110
+ 1. **Evaluate Request Scope & Blast Radius (Cold Start Only)**:
106
111
  - **High Complexity / Architectural Shifts / New Subsystems / Multi-File Migrations**: The request impacts foundational contracts, multiple modules, or shared abstractions. Requires empirical research, RFC design, adversarial review, and parallel strand isolation. Recommend **Option 1**.
107
112
  - **Medium Complexity / Well-Defined Features / Self-Contained Deliverables**: The scope is clear, boundaries are known, and it can be implemented without a 3-stage dialectical design cycle. Recommend **Option 2**.
108
113
  - **Low Complexity / Single-File Fixes / Documentation / Scratch Tweaks**: Trivial 1-file patch or config change. Recommend **Option 3**.
@@ -124,13 +129,45 @@ Instead, it acts as an **Intelligent Intake Concierge**:
124
129
  - **If Option 2 selected**: Check `rhizo who --all --json`. If workers are online, dispatch via `rhizo send` or `rhizo enqueue`. If cold, run Cold-Start Swarm Calibration to spin up workers.
125
130
  - **If Option 3 selected**: Execute inline in the current session.
126
131
 
127
- #### Fast-Path: Re-using an Active / Existing Swarm (First-Look Invariant)
132
+ #### Adaptive Swarm On-Ramp & Dynamic Worker Repurposing (First-Look Invariant)
133
+
128
134
  Before asking ANY intake questions or presenting configuration modals, the designated orchestrator MUST run `rhizo who --all --json` to inspect the cluster across all projects.
129
- If active, healthy workers are ALREADY registered and listening on the Rhizo cluster:
130
- - **DO NOT** ask intake interview questions or prompt the operator for new sessions or models.
131
- - **DO NOT** display swarm composition or harness questions.
135
+ Garden automatically categorizes cluster listeners into three operational pools:
136
+ 1. **`projectActive`**: Active listeners already registered on the target project.
137
+ 2. **`availableIdlePeers`**: Active idle listeners currently registered under other projects, immediately available for dynamic repurposing.
138
+ 3. **`busyClusterPeers`**: Active listeners executing in-flight tasks (`BUSY`), guarded from unintentional reassignment.
139
+
140
+ ##### Fast-Path: Re-using an Active / Existing Swarm
141
+ If active, healthy workers on the target project meet or exceed the target worker count (`projectActive >= targetWorkers`):
142
+ - **Fast-Path Activated**: Skip intake interview questions and avoid generating redundant prompt card files.
132
143
  - Automatically attach to the existing online workers (`@worker-1`, `@worker-2`, ...).
133
144
  - Confirm cluster readiness and proceed immediately to Phase 3 (Dialectical Pump / Task Breakdown) or Phase 5 (Task Dispatch).
145
+ - **Bypass**: To force prompt card regeneration despite active workers, pass `--force-prompts` to `garden prompts` or `garden launch`.
146
+
147
+ ##### Dual-Pathway Swarm On-Ramp (When Additional Workers Needed)
148
+ When target project workers are needed and idle cluster peers exist, Garden surfaces two distinct pathways:
149
+
150
+ - **Pathway A (Dynamic Repurposing via `garden repurpose`)**:
151
+ Repurpose existing idle cluster listeners directly into the target project without opening new terminal windows or copying prompt cards:
152
+ ```bash
153
+ garden repurpose <worker1> <worker2> \
154
+ --project <target-project> \
155
+ --role "<assigned-role>" \
156
+ [--tags "<t1,t2>"] \
157
+ [--force]
158
+ ```
159
+ - **Self-Tagging Capability Handshake (`--self-tag`)**: When cluster workers have heterogeneous environments (e.g. one tab has Nim/C, another Node/Playwright, another Python/uv), dispatch an authenticated `SWARM_REPURPOSE_OFFER` directive:
160
+ ```bash
161
+ garden repurpose <worker> \
162
+ --project <target-project> \
163
+ --self-tag \
164
+ --expected-tags "backend,frontend,qa,audit"
165
+ ```
166
+ The recipient worker inspects its local toolchain, self-selects a compatible role, adds corresponding tags (`rhizo tag add <tags>`), and replies with `WORKER_READY`.
167
+ - **Negative Control & Safety Guardrail**: Repurposing rejects workers that are actively `BUSY` on tasks to prevent disrupting active workflows. Repurposing a busy worker requires the explicit `--force` flag.
168
+
169
+ - **Pathway B (Fresh Session Bootstrapping)**:
170
+ When zero cluster listeners exist or the operator prefers isolated fresh sessions, Garden generates self-contained 10-backtick prompt cards in `/tmp/garden-<project>/` via `garden prompts` (or `garden launch`).
134
171
 
135
172
  <CRITICAL>
136
173
  Operator-Named Worker Delegation Mandate:
@@ -141,7 +178,7 @@ When the operator explicitly requests or names a worker or peer session (e.g. 'u
141
178
  > **Orchestrator Scope Restriction**: This fast-path applies **ONLY** to a session that was explicitly initialized or designated by the operator as the Lead Orchestrator. A fresh unbootstrapped session must NEVER assume it is the orchestrator simply because `<project>-orchestrator` appears in `rhizo who`!
142
179
 
143
180
  <INVARIANT>
144
- Unbootstrapped Session Identity: If a session was NOT explicitly bootstrapped with an identity in its conversation history (via a Garden bootstrap prompt card, an explicit operator assignment, or prior 'rhizo open <name>' in that same conversation), it MUST NEVER guess, adopt, or assume an existing identity from 'rhizo who --json' or 'garden-swarm.json' (especially NEVER '<project>-orchestrator'). If the operator commands '/rhizo listen' without arguments in an unbootstrapped session, the session MUST either:
181
+ Unbootstrapped Session Identity: If a session was NOT explicitly bootstrapped with an identity in its conversation history (via a Garden bootstrap prompt card, an explicit operator assignment, or prior 'rhizo open <name>' in that same conversation), it MUST NEVER guess, adopt, or assume an existing identity from 'rhizo who --json' (especially NEVER '<project>-orchestrator'). If the operator commands '/rhizo listen' without arguments in an unbootstrapped session, the session MUST either:
145
182
  1. Run 'rhizo name' to allocate a fresh unique identity, followed by 'rhizo open <name>', OR
146
183
  2. Ask the operator via 'ask_question' which persona or role this window represents.
147
184
  Never assume you are the orchestrator or an existing active worker simply because those names appear in the project directory.
@@ -168,13 +205,13 @@ Swarm workers are ALWAYS sovereign, independent interactive sessions (dedicated
168
205
 
169
206
  <CRITICAL>
170
207
  Session Default Models (Standalone Model Quizzes Prohibited):
171
- Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session (e.g., Gemini in Antigravity, Claude in Claude Code, configured workspace models in OpenCode). NEVER present a separate question asking the operator to choose "Foundation Model Pairings". In `garden-swarm.json` and prompt cards, model configuration defaults to `"Session Default (active in window/tab)"`.
208
+ Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session (e.g., Gemini in Antigravity, Claude in Claude Code, configured workspace models in OpenCode). NEVER present a separate question asking the operator to choose "Foundation Model Pairings". In prompt cards, model configuration defaults to `"Session Default (active in window/tab)"`.
172
209
  </CRITICAL>
173
210
 
174
211
  #### Automatic Fulfillment & 10-Backtick Prompt Generation:
175
212
  Upon receiving the operator's response:
176
213
  1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
177
- 2. Generate `garden-swarm.json` reflecting the chosen workers, roles, detected harness, and session-default models.
214
+ 2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and session-default models (zero on-disk JSON).
178
215
  3. Run `garden prompts` which writes individual prompt cards to `/tmp/garden-<project>/<worker>.md` and all cards to `/tmp/garden-<project>/all-workers.md`.
179
216
  4. Present the operator with concise setup instructions and copy commands (NEVER paste prompt cards inline in chat):
180
217
  ```text
@@ -429,12 +466,12 @@ To prevent silent deadlocks when workers stall, crash, or fail to re-arm listene
429
466
 
430
467
  ---
431
468
 
432
- ## 5. Configuration & Swarm Manifest Reference
469
+ ## 5. Configuration & Architecture Reference
433
470
 
434
471
  See [`docs/configuration.md`](../../docs/configuration.md) for full details on:
435
- - **Environment Variables**: `GARDEN_SWARM_FILE`, `GARDEN_CONFIG`, `GARDEN_PROJECT_DIR`, and `GARDEN_TERMINAL_APP`.
472
+ - **Environment Variables**: `GARDEN_CONFIG`, `GARDEN_PROJECT_DIR`, and `GARDEN_TERMINAL_APP`.
436
473
  - **`garden.toml`**: Project-level defaults (`name`, `preferred_terminal`, `session_prefix`, `default_triad`).
437
- - **`garden-swarm.json`**: Swarm specification schema (`project`, `target_repo`, `orchestrator`, `shared_workspace`, `workers` array: `name`, `persona`, `role`, `harness`, `model`, `tags`, `system_prompt`, `opposing_priority`).
474
+ - **Dynamic Swarm Synthesis**: Swarm specification schema (`project`, `target_repo`, `orchestrator`, `shared_workspace`, `workers` array: `name`, `persona`, `role`, `harness`, `model`, `tags`, `system_prompt`, `opposing_priority`) generated dynamically in-memory without on-disk JSON artifacts.
438
475
  - **The 10-Backtick Protocol**: Clean raw markdown formatting for copy-paste worker bootstrap prompts.
439
476
 
440
477
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: launch-workers
3
- description: "Generates and formats X distinct copy-pasteable bootstrap prompts for new agent sessions (Claude Code, Pi, OpenCode, Antigravity, etc.) to join the Garden work group on Rhizo and Vine. Reads garden-swarm.json, configures identities, environment setup (RHIZO_AGENT_NAME, cd, rhizo open), single-shot listener discipline, task claiming, and Vine strand isolation. Spits out prompt blocks wrapped in 10 backticks for clean, unrendered raw markdown copying, and verifies cluster heartbeat readiness via rhizo who --json before handing off. Triggers: 'launch workers', 'spin up workers', 'start worker swarm', 'generate worker prompts', 'bootstrap swarm', 'launch fleet'."
3
+ description: "Generates and formats X distinct copy-pasteable bootstrap prompts for new agent sessions (Claude Code, Pi, OpenCode, Antigravity, etc.) to join the Garden work group on Rhizo and Vine. Synthesizes balanced triads dynamically, configures identities, environment setup (RHIZO_AGENT_NAME, cd, rhizo open), single-shot listener discipline, task claiming, and Vine strand isolation. Spits out prompt blocks wrapped in 10 backticks for clean, unrendered raw markdown copying, and verifies cluster heartbeat readiness via rhizo who --json before handing off. Triggers: 'launch workers', 'spin up workers', 'start worker swarm', 'generate worker prompts', 'bootstrap swarm', 'launch fleet'."
4
4
  ---
5
5
 
6
6
  # `launch-workers`: Prompt-Based Swarm Bootstrapping & Work Group Onboarding
@@ -100,7 +100,7 @@ garden prompts --write garden-prompts.md
100
100
  garden prompts --worker <project>-architect # (or suffix shorthand: --worker architect)
101
101
  ```
102
102
 
103
- If `garden-swarm.json` exists in the repository, Garden uses its configured personas, mandates, harnesses, and models. If missing, Garden automatically synthesizes the standard balanced triad with procedurally generated whimsical entities (e.g. botanical spirits, clockwork automatons, mythical cryptids):
103
+ Garden automatically synthesizes the standard balanced triad with procedurally generated whimsical entities (e.g. botanical spirits, clockwork automatons, mythical cryptids):
104
104
  - `@<project>-architect` (e.g. Bramblestitch / Cogswell Pendulum - Staff Systems Architect)
105
105
  - `@<project>-auditor` (e.g. Prickle-Thistle / Grumblewick Snark - Verification & Adversarial Auditor)
106
106
  - `@<project>-implementer` (e.g. Moss-Weaver / Sprocket-Hop - DevEx & Implementation Lead)
@@ -161,9 +161,9 @@ When the swarm mission is completed, or when canceling a run:
161
161
  garden teardown
162
162
  ```
163
163
 
164
- Or manually:
164
+ Or dynamically querying the project workers:
165
165
  ```bash
166
- for worker in $(python3 -c "import json; [print(w['name']) for w in json.load(open('garden-swarm.json'))['workers']]"); do
166
+ for worker in $(rhizo who --all --json | jq -r '.active_agents[] | select(.tags | contains(["<project>"])) | .name'); do
167
167
  rhizo close "$worker" 2>/dev/null || true
168
168
  done
169
169
  ```
@@ -31,16 +31,22 @@ Furthermore, when the operator explicitly requests or names a worker or peer ses
31
31
  </CRITICAL>
32
32
 
33
33
  <CRITICAL>
34
- Orchestrator Intake Gate & Non-Implementation Invariant (GVR-016):
34
+ Orchestrator Intake Gate & Autonomous Dispatch Invariant (GVR-016):
35
35
  The Lead Orchestrator is a CONDUCTOR, NOT A CODER.
36
36
  Whenever the operator presents a task, feature request, bugfix, or asks to work on something (including "garden: <prompt>"):
37
37
  THE ORCHESTRATOR MUST NEVER DIRECTLY JUMP INTO CODE EDITING OR IMPLEMENTATION TOOLS (e.g. `write_to_file`, `replace_file_content`).
38
- Instead, it acts as an Intelligent Concierge, evaluates request scope, and MUST STOP to ask the operator how they want the work routed using `ask_question`:
39
- - **Option 1 (Full Ceremony - RFE ➔ RFD ➔ RFC ➔ Swarm)**: For architectural shifts, new subsystems, major refactors, or cross-cutting migrations. Sows the idea as a persistent roadmap seed (`garden plant`), authors the Research/RFD, System Architecture/RFC, and Adversarial Audit documents, schedules monotonic locks and isolated Vine strands, and writes worker prompts to `/tmp/garden-<project>/`.
40
- - **Option 2 (Direct Swarm Dispatch)**: For well-defined, self-contained features. Bypasses long design ceremonies; enqueues tasks straight to cluster work queues (`rhizo enqueue queue:<project>:tasks`) or dispatches directly to active cluster workers (`rhizo send <worker>`).
41
- - **Option 3 (Inline Execution)**: For trivial 1-file fixes, documentation, or quick scratch tweaks executed directly in the main session (only if the operator explicitly selects/confirms this option).
42
38
 
43
- This intake gate applies to ANY request to "work on X", "build Y", "fix Z", or "implement feature W". Direct inline implementation is prohibited unless the operator explicitly directs the orchestrator to code it inline in the main session.
39
+ The orchestrator inspects the cluster state via `rhizo who --all --json`:
40
+ 1. **Pre-Authorized Directives & Active Fleet Fast-Path**:
41
+ If the operator has already directed "work on this with your workers", "delegate", or "dispatch", OR if active cluster workers/queues already exist:
42
+ DO NOT STOP TO ASK ROUTING QUESTIONS. The routing is already decided.
43
+ The orchestrator MUST immediately provision strands (`vine new`), break down the work, and dispatch directly to available cluster workers (`rhizo send <worker>`) or enqueue to `queue:<project>:tasks`.
44
+ 2. **Mandatory `ask_question` Tool Discipline (Zero Conversational Multiple-Choice)**:
45
+ If and ONLY if the cluster is completely cold (0 active workers online across the machine) AND the operator has not specified an execution mode:
46
+ The orchestrator MUST invoke the interactive `ask_question` tool to solicit the operator's preference (Swarm vs Inline).
47
+ Dumping multiple-choice numbered lists (`1, 2, 3`) or routing questionnaires in raw chat text is STRICTLY PROHIBITED.
48
+ 3. **Fleet-First Mandate (Zero Prompt-Card Overhead When Workers Are Online)**:
49
+ When active or idle workers exist on the cluster (`rhizo who --all`), the orchestrator is strictly forbidden from printing copy-paste prompt cards into chat or asking the operator to open new terminal tabs. It must automatically dispatch or repurpose the existing fleet over Rhizo.
44
50
  </CRITICAL>
45
51
 
46
52
  <CRITICAL>
@@ -396,6 +402,24 @@ If an incoming message contains `[DESIGN ADDENDUM]`:
396
402
  4. If rejected:
397
403
  - Reply with counter-guidance and instruct the worker to remain aligned with original specs.
398
404
 
405
+ ### SOP 6: Dynamic Worker Repurposing & Self-Tagging Capability Handshake
406
+ When cluster capacity needs adjustment, or idle listeners from other projects are available:
407
+ 1. **Triage Cluster Listeners**:
408
+ Query active listeners across all projects with `rhizo who --all --json` to classify `projectActive`, `availableIdlePeers`, and `busyClusterPeers`.
409
+ 2. **Execute Repurposing**:
410
+ Reassign workers into the target project using `garden repurpose`:
411
+ ```bash
412
+ garden repurpose <worker> --project <target-project> --role "<role>" --tags "<tag1,tag2>"
413
+ ```
414
+ 3. **Self-Tagging Capability Handshake**:
415
+ When workers operate in heterogeneous environments (different compilers, runtimes, or test harnesses), dispatch a self-tagging offer:
416
+ ```bash
417
+ garden repurpose <worker> --project <target-project> --self-tag --expected-tags "backend,frontend,qa,audit"
418
+ ```
419
+ This sends an authenticated `SWARM_REPURPOSE_OFFER` directive payload. The recipient worker inspects its local environment, claims matching tags via `rhizo tag add`, and responds with `WORKER_READY`.
420
+ 4. **Negative Controls & Safety**:
421
+ `garden repurpose` automatically halts if a worker is currently executing an in-flight task (`BUSY`), returning exit code 1. Repurposing a busy worker requires explicit `--force` override.
422
+
399
423
  ---
400
424
 
401
425
  ## 4. Swarm Conclusion & Teardown