@axiomantic/garden 0.2.23 → 0.2.24
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 +182 -33
- 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 +7 -6
- package/skills/garden/SKILL.md +42 -5
- package/skills/orchestrate-swarm/SKILL.md +30 -6
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: garden
|
|
3
|
-
description: "Master entrypoint and
|
|
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 &
|
|
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
|
|
|
@@ -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,
|
|
43
|
+
Vine["Vine (Rift Strands, Three-Key Gate, Weaving)"]
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
Phase0 --> Phase1 --> Phase2 --> Phase3 --> Phase4 --> Phase5
|
|
@@ -46,7 +52,35 @@ flowchart TD
|
|
|
46
52
|
|
|
47
53
|
---
|
|
48
54
|
|
|
49
|
-
## 2.
|
|
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
|
|
|
@@ -56,20 +90,103 @@ Execute phases sequentially. Never skip phases or invert the order.
|
|
|
56
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. |
|
|
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
|
|
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
|
|
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
|
-
####
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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' or 'garden-swarm.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.
|
|
@@ -95,11 +212,11 @@ Swarm workers operate in sovereign interactive sessions and inherit whatever fou
|
|
|
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
214
|
2. Generate `garden-swarm.json` reflecting the chosen workers, roles, detected harness, and session-default models.
|
|
98
|
-
3. Run `garden prompts`
|
|
99
|
-
4. Present the operator with
|
|
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
|
|
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
|
|
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 -->
|
|
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
|
-
|
|
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
|
-
│
|
|
300
|
+
│ submit │ (Tests red or conflict)
|
|
180
301
|
▼ │
|
|
181
302
|
+-----------------+
|
|
182
303
|
| GATE_EVALUATING |
|
|
183
304
|
+-----------------+
|
|
184
305
|
│
|
|
185
|
-
│
|
|
306
|
+
│ Keys 1 & 2 PASSED (vine submit: merge-tree + live test suite green)
|
|
186
307
|
▼
|
|
187
|
-
|
|
188
|
-
|
|
|
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
|
-
|
|
207
|
-
| **`
|
|
208
|
-
|
|
209
|
-
| **`
|
|
210
|
-
|
|
211
|
-
| **`
|
|
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,
|
|
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
|
|
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,6 +459,10 @@ 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
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -101,8 +101,10 @@ sequenceDiagram
|
|
|
101
101
|
end
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
### Step 0: Pre-Flight Cluster Check
|
|
105
|
-
Run `rhizo who --json`
|
|
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).
|
|
@@ -185,7 +187,6 @@ Once ratified, write `garden-swarm.json` to the target project directory with wo
|
|
|
185
187
|
Before concluding:
|
|
186
188
|
1. Verify `garden-swarm.json` is syntactically valid JSON.
|
|
187
189
|
2. Confirm each worker has unique `name` and non-empty `tags`.
|
|
188
|
-
3. Proceed
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
- Await cluster readiness verification via `rhizo who --json`.
|
|
190
|
+
3. Proceed to Worker On-Ramp ([`launch-workers`](../launch-workers/SKILL.md)):
|
|
191
|
+
- **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.
|
|
192
|
+
- **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`.
|
package/skills/garden/SKILL.md
CHANGED
|
@@ -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
|
-
|
|
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
|
-
####
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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:
|
|
@@ -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 &
|
|
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
|
-
|
|
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
|