@axiomantic/garden 0.2.33 → 0.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/SKILL.md +34 -13
- 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 +2 -2
- package/skills/choose-personas/SKILL.md +11 -10
- package/skills/garden/SKILL.md +34 -13
- package/skills/launch-workers/SKILL.md +5 -4
- package/skills/orchestrate-swarm/SKILL.md +25 -7
package/README.md
CHANGED
|
@@ -171,18 +171,18 @@ User: "garden: Implement high-throughput batch claim leases with Redis pipeline
|
|
|
171
171
|
### 2. Project Intake & Calibration (Phase 0)
|
|
172
172
|
|
|
173
173
|
Garden utilizes the **Active Swarm Fast-Path (First-Look Invariant)**:
|
|
174
|
-
- **Existing Cluster Online**: Before asking intake questions, Garden runs `rhizo who --json`. If active, healthy workers already exist on the cluster, Garden skips
|
|
174
|
+
- **Existing Cluster Online**: Before asking intake questions, Garden runs `rhizo who --all --json`. If active, healthy standing top-level/`tmux` workers already exist on the cluster (`prompts` / `tmux` mode), Garden skips setup questions and prompt cards, automatically attaching to the active standing workers to proceed straight to task planning or execution! (In `subagents` mode, completed task subagents are NEVER recycled across tasks — Garden always spawns a fresh subagent per task and per Key 3 audit.)
|
|
175
175
|
- **Cold Start (Zero Active Workers)**: If no workers are online, the Orchestrator auto-detects the active coding harness (`ANTIGRAVITY_APP_DIR`, `CLAUDE_CODE`, `OPENCODE_SESSION_ID`, `CODEX_SESSION_ID`, `PI_SESSION_ID`) and conducts a **single-question intake interview**:
|
|
176
176
|
1. **Execution Mode & Swarm Shape in <Detected Harness>**: Multi-Agent Swarm (Balanced Triad or Focused Duo in the detected harness) vs Single-Agent Inline.
|
|
177
177
|
|
|
178
178
|
> [!IMPORTANT]
|
|
179
179
|
> **Capability-Aware Execution Modes & Model Inheritance**:
|
|
180
|
-
> - **Adaptive Worker Modes (`execution_mode = "auto"`)**: First checks `rhizo who --all --json` to attach to existing project/pool workers. On cold starts, Antigravity IDE and OpenCode Desktop default to **
|
|
180
|
+
> - **Adaptive Worker Modes (`execution_mode = "auto"`)**: First checks `rhizo who --all --json` to attach to existing standing project/pool workers (`prompts` / `tmux` mode). On cold starts (or per task in `subagents` mode), Antigravity IDE and OpenCode Desktop default to **fresh task-scoped drillable subagents** (`subagents`, with clickable `conversation://<id>` / session-tree chat drill-down); Codex CLI defaults to automated **`tmux` panes** (`garden launch --tmux`); and Codex Desktop / non-`tmux` CLI defaults to **10-backtick Prompt Cards** (`prompts`). **Fresh Subagent Per Task (Zero Cross-Task Reuse — Context Hygiene)**: never reuse a subagent across different tasks or Key 3 audits; restrict `send_message` strictly to same-task follow-ups (e.g., Delta Re-Pump on that exact rejected strand), and close finished handles via `rhizo close <name>`. Opaque, non-interactive CLI subagents remain prohibited as swarm workers.
|
|
181
181
|
> - **Session-Native Model Inheritance**: Swarm workers inherit whatever foundation model is active in that harness window (`Session Default (active in window/tab)`). Disconnected model pairing quizzes are eliminated.
|
|
182
182
|
|
|
183
183
|
### 3. Capability-Aware Swarm Bootstrapping (`launch-workers`)
|
|
184
|
-
Garden runs `garden prompts` (or `garden launch --tmux` / `garden prompts --subagent --json`) to write prompt cards (`/tmp/garden-<project>/<worker>.md`) and subagent briefs (`/tmp/garden-<project>/subagent-<worker>.md`) directly to temporary files rather than flooding the chat window with thousands of lines of raw text:
|
|
185
|
-
- **In `subagents` mode (Antigravity IDE & OpenCode Desktop default)**: The orchestrator spawns
|
|
184
|
+
Garden runs `garden prompts` (or `garden launch --tmux` / `garden prompts --subagent --task <id> --json`) to write prompt cards (`/tmp/garden-<project>/<worker>.md`) and subagent briefs (`/tmp/garden-<project>/subagent-<worker>.md`) directly to temporary files rather than flooding the chat window with thousands of lines of raw text:
|
|
185
|
+
- **In `subagents` mode (Antigravity IDE & OpenCode Desktop default)**: The orchestrator spawns a **fresh** task-scoped drillable subagent per task and per Key 3 audit (`invoke_subagent` with a fresh `rhizo name` — zero cross-task reuse; `send_message` only for same-task follow-ups / Delta Re-Pump; `rhizo close <name>` on completion) and prints clickable session links (`conversation://<id>`) directly in chat.
|
|
186
186
|
- **In `tmux` mode (Codex CLI default / CLI `--tmux`)**: `garden launch --tmux` opens one `tmux` window per worker pointing at `/tmp/garden-<project>/<worker>.md`.
|
|
187
187
|
- **In `prompts` mode (Codex Desktop & non-`tmux` CLI default)**: The Orchestrator displays concise session assignments with clickable file links:
|
|
188
188
|
1. Open **Tab 1 / Window 1**: Reference Prompt 1 (`/tmp/garden-<project>/<worker-1>.md`)
|
package/SKILL.md
CHANGED
|
@@ -82,6 +82,22 @@ To prevent LLM tool-calling omissions, germination uses dedicated positional sub
|
|
|
82
82
|
3. **`garden germinate inline <seed>`**: Runs the 3-stage dialectical pump (Research ➔ Design ➔ Audit) within the active chat session.
|
|
83
83
|
4. **`garden germinate status <seed>`**: Inspects dynamic lifecycle progress (`SOWN` ➔ `DISPATCHED` ➔ `GERMINATED` ➔ `WOVEN`).
|
|
84
84
|
|
|
85
|
+
### C. Two-Wave Adversarial Review & Meta-Triage (`garden review`)
|
|
86
|
+
Orchestrates two-wave empirical code reviews for branch diffs or full repository audits without on-disk JSON:
|
|
87
|
+
```bash
|
|
88
|
+
# Branch / PR diff review (default: multi-lens Wave 1 across 100% of hunks + Wave 2 5-Gate Meta-Reviewer):
|
|
89
|
+
garden review [--diff] [--base <ref>] [--uncommitted] [--subagent|--tmux|--force-prompts] [--json]
|
|
90
|
+
|
|
91
|
+
# Deep repository or scoped audit (default: sharded Wave 1 by structural moduleGroup + Green-Mirage verifier):
|
|
92
|
+
garden review --audit [--paths src,tests] [-n 4] [--write review-report.md] [--json]
|
|
93
|
+
|
|
94
|
+
# Sow ratified findings (KEEP_HIGH_VALUE / REWRITE_FIX) directly as botanical seeds:
|
|
95
|
+
garden review --sow "Fix race condition in lease renewal" --season v0.3.0 --sunlight high
|
|
96
|
+
```
|
|
97
|
+
- **Wave 1 (Discovery)**: `rmDiff` defaults to `multi-lens` (Systems/Anti-Heuristic, Runtime/Failure-Mode, Green-Mirage Verifier across 100% of diff hunks); `rmAudit` defaults to `sharded` (disjoint structural `moduleGroup` shards + repo-wide Green-Mirage Verifier; zero magic line/file count thresholds).
|
|
98
|
+
- **Wave 2 (Adversarial Meta-Reviewer)**: Fresh 1:1 `@meta-reviewer` enforcing all 5 Empirical Triage Gates (`Gate 1` Ground-Truth, `Gate 2` Live Call-Graph Reachability, `Gate 3` Realistic Scale, `Gate 4` Minimal-Fix / Zero-API-Creep, `Gate 5` First-Do-No-Harm & Pillar 6 Anti-Heuristic) and classifying findings into `KEEP_HIGH_VALUE`, `REWRITE_FIX`, `DROP_FALSE_POSITIVE`, and `DROP_BLOAT`.
|
|
99
|
+
- Ephemeral prompt cards, subagent briefs, and report templates are written strictly as Markdown under `/tmp/garden-<project>/review/`.
|
|
100
|
+
|
|
85
101
|
---
|
|
86
102
|
|
|
87
103
|
## 3. The End-to-End Ceremony Workflow
|
|
@@ -136,18 +152,21 @@ Instead, it acts as an **Intelligent Intake Concierge**:
|
|
|
136
152
|
#### Adaptive Swarm On-Ramp & Dynamic Worker Repurposing (First-Look Invariant)
|
|
137
153
|
|
|
138
154
|
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.
|
|
155
|
+
> [!NOTE]
|
|
156
|
+
> **Standing Sessions vs. Task-Scoped Subagents**: Active-fleet reuse (`Fast-Path` and `garden repurpose`) from `rhizo who --all --json` applies strictly to **standing top-level window or `tmux` workers** (`prompts` / `tmux` mode). In **Subagent Orchestration Mode (`subagents`)**, prior-task subagents must **NEVER** be recycled for new tasks or new Key 3 audits — always spawn a fresh subagent per task (`invoke_subagent` with a fresh `rhizo name`) to keep context small and unpolluted.
|
|
157
|
+
|
|
139
158
|
Garden automatically categorizes cluster listeners into four operational pools:
|
|
140
|
-
1. **`projectActive`**: Active listeners already registered on the target project.
|
|
159
|
+
1. **`projectActive`**: Active standing listeners already registered on the target project (`prompts` / `tmux` mode).
|
|
141
160
|
2. **`availableIdlePeers`**: Active idle listeners in the unassigned pool (project is empty, `default`, or `unassigned`, or tagged `pool`/`float`/`shared`), immediately available for dynamic repurposing.
|
|
142
161
|
3. **`foreignProjectPeers`**: Active listeners registered to other named projects, **protected against cross-project poaching** (repurposing rejected unless `--allow-cross-project` is explicitly passed).
|
|
143
162
|
4. **`busyClusterPeers`**: Active listeners executing in-flight tasks (`BUSY`), guarded from unintentional reassignment (requires `--force`).
|
|
144
163
|
|
|
145
|
-
##### Fast-Path: Re-using an Active / Existing Swarm
|
|
146
|
-
If active, healthy workers on the target project meet or exceed the target worker count (`projectActive >= targetWorkers`):
|
|
164
|
+
##### Fast-Path: Re-using an Active / Existing Standing Swarm (`prompts` / `tmux` Mode)
|
|
165
|
+
If active, healthy standing workers on the target project meet or exceed the target worker count (`projectActive >= targetWorkers`) in `prompts` / `tmux` mode:
|
|
147
166
|
- **Fast-Path Activated**: Skip intake interview questions and avoid generating redundant prompt card files.
|
|
148
|
-
- Automatically attach to the existing online workers (`@worker-1`, `@worker-2`, ...).
|
|
167
|
+
- Automatically attach to the existing online standing workers (`@worker-1`, `@worker-2`, ...).
|
|
149
168
|
- Confirm cluster readiness and proceed immediately to Phase 3 (Dialectical Pump / Task Breakdown) or Phase 5 (Task Dispatch).
|
|
150
|
-
- **Bypass**: To force prompt card regeneration despite active workers, pass `--force-prompts` to `garden prompts` or `garden launch
|
|
169
|
+
- **Bypass**: To force prompt card regeneration despite active workers, pass `--force-prompts` to `garden prompts` or `garden launch` (and in `subagents` mode, always pass `--subagent --task <id>` to generate fresh per-task subagent briefs).
|
|
151
170
|
|
|
152
171
|
##### Dual-Pathway Swarm On-Ramp (When Additional Workers Needed)
|
|
153
172
|
When target project workers are needed and unassigned idle cluster peers exist, Garden surfaces two distinct pathways:
|
|
@@ -172,8 +191,8 @@ When target project workers are needed and unassigned idle cluster peers exist,
|
|
|
172
191
|
- **Negative Control & Tenancy Guardrail**: Repurposing rejects workers belonging to other named projects unless `--allow-cross-project` is specified. It also rejects workers that are actively `BUSY` on tasks (requires `--force`).
|
|
173
192
|
|
|
174
193
|
- **Pathway B (Fresh Session Bootstrapping via Capability-Aware Mode)**:
|
|
175
|
-
When zero unassigned cluster listeners exist (even if workers from other projects are online) or the operator prefers fresh sessions, Garden selects the execution mode based on detected harness capabilities (`execution_mode = "auto"`):
|
|
176
|
-
1. **`subagents` (Default on Antigravity IDE & OpenCode Desktop)**: Spawns
|
|
194
|
+
When zero unassigned cluster listeners exist (even if workers from other projects are online), when running in `subagents` mode, or when the operator prefers fresh sessions, Garden selects the execution mode based on detected harness capabilities (`execution_mode = "auto"`):
|
|
195
|
+
1. **`subagents` (Default on Antigravity IDE & OpenCode Desktop)**: Spawns a **fresh, task-scoped, drillable subagent per task and per Key 3 audit** (`invoke_subagent` + clickable `[Persona (@name)](conversation://<id>)` pills in Antigravity, or child sessions in OpenCode Desktop) using briefs generated by `garden prompts --subagent --task <id> --json`. **Zero Cross-Task Reuse (Context Hygiene)**: NEVER reuse a subagent across different tasks or across different Key 3 audits; restrict `send_message` strictly to same-task follow-ups (e.g., mid-task clarification or Key 3 Delta Re-Pump on that exact rejected strand), and close finished handles via `rhizo close <name>`.
|
|
177
196
|
2. **`tmux` (Default on Codex CLI in `tmux`; opt-in on OpenCode CLI / Claude Code CLI)**: Runs `garden launch --tmux` to spawn one `tmux` window/pane per worker running `codex` / `opencode` / `claude` against `/tmp/garden-<project>/<worker>.md`.
|
|
178
197
|
3. **`prompts` (Default on Codex Desktop & non-`tmux` CLI)**: Generates self-contained 10-backtick prompt cards in `/tmp/garden-<project>/` via `garden prompts` (or `garden prompts --force-prompts`).
|
|
179
198
|
|
|
@@ -209,7 +228,8 @@ Because the coding harness is auto-detected from the session environment (`ANTIG
|
|
|
209
228
|
<CRITICAL>
|
|
210
229
|
Capability-Aware Worker Execution & Opaque-Subagent Prohibition:
|
|
211
230
|
Match the execution mechanism to what the active harness makes live, inspectable, and directly chat-steerable for the operator:
|
|
212
|
-
- **Antigravity IDE & OpenCode Desktop (`subagents` default)**: Spawn
|
|
231
|
+
- **Antigravity IDE & OpenCode Desktop (`subagents` default)**: Spawn **fresh, task-scoped, drillable subagents** (`invoke_subagent` in Antigravity, or sidebar child sessions in OpenCode Desktop) via `garden prompts --subagent --task <id> --json`. Always print clickable session links (e.g. `[Systems Architect (@<name>)](conversation://<id>)`) at the top of the orchestrator response so the operator can click in and chat directly. Every subagent worker MUST follow the full worker procedure: fresh unique `rhizo name` + `rhizo open <name>`, explicit `--agent <name>`, 1:1 isolated Vine strand (`vine new <task_id>`), `vine submit`, and independent Key 3 audit by a separate fresh `@auditor` subagent.
|
|
232
|
+
- **Fresh Subagent Per Task (Zero Cross-Task Reuse — Context Hygiene)**: In `subagents` mode, **NEVER reuse a subagent across different tasks or across different Key 3 strand audits**. Always spawn a fresh `invoke_subagent` with a fresh `rhizo name` for each individual task and each Key 3 audit to save context and prevent attention degradation. Restrict `send_message` strictly to same-task follow-ups (such as in-flight clarification or a Key 3 Delta Re-Pump on that exact rejected strand), and deregister completed subagent handles via `rhizo close <name>`.
|
|
213
233
|
- **OpenCode CLI (TUI)**: Defaults to drillable child sessions (`subagents`) or opt-in `tmux` split panes (`--tmux`).
|
|
214
234
|
- **Codex CLI (Text)**: Defaults to automated `tmux` windows/panes (`garden launch --tmux`) when `tmux` is available, falling back to 10-backtick prompt cards outside `tmux`.
|
|
215
235
|
- **Codex Desktop & Claude Code CLI**: Default to top-level sessions via 10-backtick prompt cards in `/tmp/garden-<project>/<worker>.md` (or `--tmux` for Claude Code CLI inside `tmux`).
|
|
@@ -225,9 +245,9 @@ Swarm workers inherit whatever foundation model is active in that harness sessio
|
|
|
225
245
|
Upon receiving the operator's response:
|
|
226
246
|
1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
|
|
227
247
|
2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and resolved execution mode (`auto`, `subagents`, `tmux`, or `prompts`).
|
|
228
|
-
3. Run `garden prompts --json` (or `garden launch --tmux` when launching `tmux` panes, or `garden prompts --subagent --json` for drillable subagent briefs), which writes cards/briefs to `/tmp/garden-<project>/`.
|
|
248
|
+
3. Run `garden prompts --json` (or `garden launch --tmux` when launching `tmux` panes, or `garden prompts --subagent --task <id> --json` for task-scoped drillable subagent briefs), which writes cards/briefs to `/tmp/garden-<project>/`.
|
|
229
249
|
4. Launch or instruct based on the resolved mode:
|
|
230
|
-
- **If `subagents`**: Invoke
|
|
250
|
+
- **If `subagents`**: Invoke a **fresh** task-scoped drillable subagent (`invoke_subagent`) per task and per Key 3 audit using that task's brief (fresh `rhizo name` per spawn; never reuse across tasks or audits; `send_message` only for same-task follow-ups / Delta Re-Pump; `rhizo close <name>` on completion), print clickable `[Persona (@<name>)](conversation://<id>)` links in chat, and verify their registration via `rhizo who --json`.
|
|
231
251
|
- **If `tmux`**: `garden launch --tmux` opens one `tmux` window per worker pointing at `/tmp/garden-<project>/<worker>.md`, and the orchestrator arms `rhizo listen <orchestrator>`.
|
|
232
252
|
- **If `prompts`**: Present concise setup instructions with clickable `/tmp/garden-<project>/<worker>.md` paths (NEVER paste full prompt cards inline in chat), register the orchestrator (`rhizo open`), and arm the listener if in a CLI subprocess harness.
|
|
233
253
|
5. Verify cluster readiness (`rhizo who --json`) before proceeding to Phase 3.
|
|
@@ -383,15 +403,16 @@ The Adversarial Auditor ONLY inspects and ratifies/rejects Key 3 (`vine audit in
|
|
|
383
403
|
</CRITICAL>
|
|
384
404
|
|
|
385
405
|
<INVARIANT>
|
|
386
|
-
Capability-Aware Worker Execution & Subagent Policy: First check `rhizo who --all --json` and attach to active project or unassigned pool workers when available. On cold starts, execution mode matches harness visibility and direct chat interactivity:
|
|
387
|
-
1. Drillable
|
|
406
|
+
Capability-Aware Worker Execution & Subagent Policy: First check `rhizo who --all --json` and attach to active standing project or unassigned pool workers (`prompts` / `tmux` mode) when available. On cold starts, execution mode matches harness visibility and direct chat interactivity:
|
|
407
|
+
1. Task-Scoped Drillable Subagents (`subagents` — Default on Antigravity IDE & OpenCode Desktop): Child sessions where the user can click in and chat interactively (`conversation://<id>` pills in Antigravity; sidebar session tree in OpenCode Desktop) are valid swarm workers when they follow the full worker procedure (fresh unique Rhizo identity via `rhizo name` + `rhizo open <name>`, explicit `--agent <name>`, 1:1 isolated Vine strand `vine new <task_id>`, `vine submit`, and independent Key 3 audit by a separate fresh `@auditor` subagent).
|
|
408
|
+
- **Fresh Subagent Per Task (Zero Cross-Task Reuse — Context Hygiene)**: In `subagents` mode, NEVER reuse a subagent across different tasks or across different Key 3 audits. Always spawn a fresh `invoke_subagent` with a fresh `rhizo name` per task and per Key 3 audit to save context. Use `send_message` ONLY for same-task follow-ups (mid-task clarification or Key 3 Delta Re-Pump on that exact rejected strand), and close completed subagents via `rhizo close <name>`. Active-fleet reuse via `rhizo who --all --json` applies to standing top-level / `tmux` sessions, not completed task subagents.
|
|
388
409
|
2. Automated `tmux` Panes (`tmux` — Default on Codex CLI in `tmux`; opt-in for CLI harnesses): CLI sessions spawned via `garden launch --tmux` wired to `rhizo listen` and `/tmp/garden-<project>/<worker>.md`.
|
|
389
410
|
3. Top-Level Prompt Cards (`prompts` — Default on Codex Desktop & non-`tmux` CLI): Independent interactive windows bootstrapped via Garden 10-backtick prompt cards.
|
|
390
411
|
Opaque, non-interactive CLI subagents (such as headless `Task` jobs that cannot be drilled into or steered) are STRICTLY PROHIBITED as cluster swarm workers.
|
|
391
412
|
</INVARIANT>
|
|
392
413
|
|
|
393
414
|
<INVARIANT>
|
|
394
|
-
Delegation Precedence: When instructed to "delegate", "assign", or "dispatch" work, the Lead Orchestrator MUST route tasks to active cluster workers via Rhizo (`rhizo send <worker>`, `rhizo enqueue queue:<project>:tasks`, or `rhizo task assign/claim`). On cold starts with no online
|
|
415
|
+
Delegation Precedence: When instructed to "delegate", "assign", or "dispatch" work, the Lead Orchestrator MUST route tasks to active standing top-level / `tmux` cluster workers (`prompts` / `tmux` mode) via Rhizo (`rhizo send <worker>`, `rhizo enqueue queue:<project>:tasks`, or `rhizo task assign/claim`). In **Subagent Orchestration Mode (`subagents`)**, NEVER recycle prior-task subagents across new tasks or Key 3 audits — always spawn a fresh subagent per task and per Key 3 audit (`invoke_subagent` + fresh `rhizo name`), restrict `send_message` strictly to same-task follow-ups (e.g., Delta Re-Pump on the same rejected strand), and run `rhizo close <name>` once completed. On cold starts with no online standing workers, dispatch via the harness's capability-aware default (`subagents` with clickable session links on Antigravity IDE & OpenCode Desktop; `tmux` panes or 10-backtick prompt cards on CLI / Codex Desktop). Opaque non-interactive CLI subagents must NEVER fulfill cluster swarm roles and remain restricted solely to transient ad-hoc inspections.
|
|
395
416
|
</INVARIANT>
|
|
396
417
|
|
|
397
418
|
<INVARIANT>
|
|
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.
|
|
3
|
+
"version": "0.2.35",
|
|
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": "
|
|
33
|
+
"test": "nimble test",
|
|
34
34
|
"build": "nim c -d:release --threads:on --mm:orc -o:bin/garden src/garden.nim"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
@@ -45,19 +45,20 @@ Workers who write code are strictly prohibited from auditing or ratifying their
|
|
|
45
45
|
|
|
46
46
|
## 2. Harness & Model Alignment
|
|
47
47
|
|
|
48
|
-
Every recommended worker represents either a **
|
|
48
|
+
Every recommended worker represents either a **task-scoped drillable subagent** (default on Antigravity IDE and OpenCode Desktop, spawned fresh per task / per Key 3 audit so context stays unpolluted, where you can click into the child session and chat directly), an **automated `tmux` pane** (default on Codex CLI in `tmux`, opt-in on OpenCode CLI / Claude Code CLI), or a **top-level interactive session** bootstrapped via Garden 10-backtick prompt cards (default on Codex Desktop and non-`tmux` terminals).
|
|
49
49
|
|
|
50
50
|
Workers inherit whatever foundation model is native or configured in that session:
|
|
51
|
-
- In **Antigravity IDE**: Workers run as
|
|
51
|
+
- In **Antigravity IDE**: Workers run as **fresh, task-scoped subagents** (`invoke_subagent` with a fresh `rhizo name` per task / per Key 3 audit and clickable `conversation://<id>` links; `send_message` only for same-task follow-ups) or dedicated windows on Antigravity's active session models.
|
|
52
52
|
- In **Claude Code CLI**: Workers run in dedicated tabs or `tmux` panes on Claude CLI's active models.
|
|
53
|
-
- In **OpenCode Desktop**: Workers run as drillable child sessions (sidebar tree) or dedicated sessions on models configured in `opencode.json`.
|
|
53
|
+
- In **OpenCode Desktop**: Workers run as fresh, task-scoped drillable child sessions (sidebar tree) or dedicated sessions on models configured in `opencode.json`.
|
|
54
54
|
- In **Codex Desktop / Codex CLI**: Codex Desktop threads use top-level Prompt Cards; Codex CLI defaults to `garden launch --tmux` (when `tmux` is available) or Prompt Cards.
|
|
55
55
|
- In **Headless Terminal / Pi**: Workers run on provider CLI configuration.
|
|
56
56
|
|
|
57
57
|
<CRITICAL>
|
|
58
58
|
Capability-Aware Worker Execution & Opaque Subagent Prohibition:
|
|
59
59
|
Match worker execution to what the harness makes inspectable and interactively steerable:
|
|
60
|
-
- **Antigravity IDE & OpenCode Desktop**: Default to
|
|
60
|
+
- **Antigravity IDE & OpenCode Desktop**: Default to **task-scoped drillable subagents** (`subagents`) obeying the full worker procedure (fresh unique `rhizo name` + `rhizo open <name>`, explicit `--agent <name>`, 1:1 Vine strand, `vine submit`, independent Key 3 audit by a separate fresh `@auditor` subagent).
|
|
61
|
+
- **Fresh Subagent Per Task (Zero Cross-Task Reuse — Context Hygiene)**: In `subagents` mode, NEVER reuse a subagent across different tasks or across different Key 3 audits — always spawn a fresh `invoke_subagent` with a fresh `rhizo name` to save context. Use `send_message` ONLY for same-task follow-ups (e.g., mid-task clarification or Key 3 Delta Re-Pump on that exact rejected strand), and deregister finished handles via `rhizo close <name>`.
|
|
61
62
|
- **Codex CLI (`tmux`) / OpenCode CLI (`--tmux`)**: Automated `tmux` windows/panes via `garden launch --tmux`.
|
|
62
63
|
- **Codex Desktop & Non-`tmux` CLI**: Top-level sessions via 10-backtick prompt cards.
|
|
63
64
|
- **Opaque CLI Subagents Prohibited**: Non-interactive, headless subagent tools (where the operator cannot drill in and chat mid-flight) are STRICTLY FORBIDDEN as swarm workers.
|
|
@@ -76,9 +77,9 @@ Whimsical Non-Human Personas & Dynamic Invention Invariant (GVR-017):
|
|
|
76
77
|
|
|
77
78
|
| Role Mandate | Recommended Mode / Harness | Model Alignment | Rationale |
|
|
78
79
|
| :--- | :--- | :--- | :--- |
|
|
79
|
-
| **Architectural Design & Systems Modeling** | **Antigravity (`subagents`
|
|
80
|
-
| **Adversarial Audit & Code Quality Purism** | **Separate `@auditor` Subagent (`subagents`)** or **Codex / Claude Code (`tmux` / Tab)** | Session Default (Native in tab/window) | Strict separation (`auditor != author`), uncompromising negative controls, zero tolerance for superficial green tests. |
|
|
81
|
-
| **DevEx, Rapid Prototyping & Implementation** | **Antigravity (`subagents`
|
|
80
|
+
| **Architectural Design & Systems Modeling** | **Antigravity (fresh `subagents` per task / Window)** or **OpenCode Desktop (`subagents`)** | Session Default (Native in window) | Zero-setup drillable child sessions (`conversation://<id>`) spawned fresh per task, or top-level sessions with fast architectural comprehension. |
|
|
81
|
+
| **Adversarial Audit & Code Quality Purism** | **Fresh Separate `@auditor` Subagent per Audit (`subagents`)** or **Codex / Claude Code (`tmux` / Tab)** | Session Default (Native in tab/window) | Strict separation (`auditor != author`), zero cross-audit reuse, uncompromising negative controls, zero tolerance for superficial green tests. |
|
|
82
|
+
| **DevEx, Rapid Prototyping & Implementation** | **Antigravity (fresh `subagents` per task / Window)**, **OpenCode Desktop**, or **Codex CLI (`tmux`)** | Session Default (Native in window) | Isolated 1:1 Vine strand execution, fresh context per task, rapid file modification, direct verification (`vine gate` / `vine submit`). |
|
|
82
83
|
| **Hermetic / Local Security Analysis** | **Headless Terminal Worker (Dedicated Tab / `tmux`)** | Ollama / Local DeepSeek-R1 | Air-gapped execution for proprietary credentials, licensing checks, or sensitive security audits. |
|
|
83
84
|
|
|
84
85
|
---
|
|
@@ -107,9 +108,9 @@ sequenceDiagram
|
|
|
107
108
|
```
|
|
108
109
|
|
|
109
110
|
### Step 0: Pre-Flight Cluster Check & Adaptive Swarm On-Ramp
|
|
110
|
-
Run `rhizo who --all --json` to triage cluster listener state:
|
|
111
|
-
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).
|
|
112
|
-
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.
|
|
111
|
+
Run `rhizo who --all --json` to triage cluster listener state (for standing top-level/`tmux` sessions — in `subagents` mode, NEVER recycle completed task subagents across different tasks or audits; always spawn fresh per task):
|
|
112
|
+
1. **Target Project Active**: If active, healthy standing workers (`prompts` / `tmux` mode) already exist registered under the target project, skip persona selection and reuse the existing standing workers (Fast-Path).
|
|
113
|
+
2. **Available Idle Peers**: If active standing 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.
|
|
113
114
|
|
|
114
115
|
### Step 1: Codebase & Task Analysis (Cold Starts Only)
|
|
115
116
|
1. Inspect repository stack (e.g., Nim, Rust, Python, TypeScript, C).
|
package/skills/garden/SKILL.md
CHANGED
|
@@ -82,6 +82,22 @@ To prevent LLM tool-calling omissions, germination uses dedicated positional sub
|
|
|
82
82
|
3. **`garden germinate inline <seed>`**: Runs the 3-stage dialectical pump (Research ➔ Design ➔ Audit) within the active chat session.
|
|
83
83
|
4. **`garden germinate status <seed>`**: Inspects dynamic lifecycle progress (`SOWN` ➔ `DISPATCHED` ➔ `GERMINATED` ➔ `WOVEN`).
|
|
84
84
|
|
|
85
|
+
### C. Two-Wave Adversarial Review & Meta-Triage (`garden review`)
|
|
86
|
+
Orchestrates two-wave empirical code reviews for branch diffs or full repository audits without on-disk JSON:
|
|
87
|
+
```bash
|
|
88
|
+
# Branch / PR diff review (default: multi-lens Wave 1 across 100% of hunks + Wave 2 5-Gate Meta-Reviewer):
|
|
89
|
+
garden review [--diff] [--base <ref>] [--uncommitted] [--subagent|--tmux|--force-prompts] [--json]
|
|
90
|
+
|
|
91
|
+
# Deep repository or scoped audit (default: sharded Wave 1 by structural moduleGroup + Green-Mirage verifier):
|
|
92
|
+
garden review --audit [--paths src,tests] [-n 4] [--write review-report.md] [--json]
|
|
93
|
+
|
|
94
|
+
# Sow ratified findings (KEEP_HIGH_VALUE / REWRITE_FIX) directly as botanical seeds:
|
|
95
|
+
garden review --sow "Fix race condition in lease renewal" --season v0.3.0 --sunlight high
|
|
96
|
+
```
|
|
97
|
+
- **Wave 1 (Discovery)**: `rmDiff` defaults to `multi-lens` (Systems/Anti-Heuristic, Runtime/Failure-Mode, Green-Mirage Verifier across 100% of diff hunks); `rmAudit` defaults to `sharded` (disjoint structural `moduleGroup` shards + repo-wide Green-Mirage Verifier; zero magic line/file count thresholds).
|
|
98
|
+
- **Wave 2 (Adversarial Meta-Reviewer)**: Fresh 1:1 `@meta-reviewer` enforcing all 5 Empirical Triage Gates (`Gate 1` Ground-Truth, `Gate 2` Live Call-Graph Reachability, `Gate 3` Realistic Scale, `Gate 4` Minimal-Fix / Zero-API-Creep, `Gate 5` First-Do-No-Harm & Pillar 6 Anti-Heuristic) and classifying findings into `KEEP_HIGH_VALUE`, `REWRITE_FIX`, `DROP_FALSE_POSITIVE`, and `DROP_BLOAT`.
|
|
99
|
+
- Ephemeral prompt cards, subagent briefs, and report templates are written strictly as Markdown under `/tmp/garden-<project>/review/`.
|
|
100
|
+
|
|
85
101
|
---
|
|
86
102
|
|
|
87
103
|
## 3. The End-to-End Ceremony Workflow
|
|
@@ -136,18 +152,21 @@ Instead, it acts as an **Intelligent Intake Concierge**:
|
|
|
136
152
|
#### Adaptive Swarm On-Ramp & Dynamic Worker Repurposing (First-Look Invariant)
|
|
137
153
|
|
|
138
154
|
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.
|
|
155
|
+
> [!NOTE]
|
|
156
|
+
> **Standing Sessions vs. Task-Scoped Subagents**: Active-fleet reuse (`Fast-Path` and `garden repurpose`) from `rhizo who --all --json` applies strictly to **standing top-level window or `tmux` workers** (`prompts` / `tmux` mode). In **Subagent Orchestration Mode (`subagents`)**, prior-task subagents must **NEVER** be recycled for new tasks or new Key 3 audits — always spawn a fresh subagent per task (`invoke_subagent` with a fresh `rhizo name`) to keep context small and unpolluted.
|
|
157
|
+
|
|
139
158
|
Garden automatically categorizes cluster listeners into four operational pools:
|
|
140
|
-
1. **`projectActive`**: Active listeners already registered on the target project.
|
|
159
|
+
1. **`projectActive`**: Active standing listeners already registered on the target project (`prompts` / `tmux` mode).
|
|
141
160
|
2. **`availableIdlePeers`**: Active idle listeners in the unassigned pool (project is empty, `default`, or `unassigned`, or tagged `pool`/`float`/`shared`), immediately available for dynamic repurposing.
|
|
142
161
|
3. **`foreignProjectPeers`**: Active listeners registered to other named projects, **protected against cross-project poaching** (repurposing rejected unless `--allow-cross-project` is explicitly passed).
|
|
143
162
|
4. **`busyClusterPeers`**: Active listeners executing in-flight tasks (`BUSY`), guarded from unintentional reassignment (requires `--force`).
|
|
144
163
|
|
|
145
|
-
##### Fast-Path: Re-using an Active / Existing Swarm
|
|
146
|
-
If active, healthy workers on the target project meet or exceed the target worker count (`projectActive >= targetWorkers`):
|
|
164
|
+
##### Fast-Path: Re-using an Active / Existing Standing Swarm (`prompts` / `tmux` Mode)
|
|
165
|
+
If active, healthy standing workers on the target project meet or exceed the target worker count (`projectActive >= targetWorkers`) in `prompts` / `tmux` mode:
|
|
147
166
|
- **Fast-Path Activated**: Skip intake interview questions and avoid generating redundant prompt card files.
|
|
148
|
-
- Automatically attach to the existing online workers (`@worker-1`, `@worker-2`, ...).
|
|
167
|
+
- Automatically attach to the existing online standing workers (`@worker-1`, `@worker-2`, ...).
|
|
149
168
|
- Confirm cluster readiness and proceed immediately to Phase 3 (Dialectical Pump / Task Breakdown) or Phase 5 (Task Dispatch).
|
|
150
|
-
- **Bypass**: To force prompt card regeneration despite active workers, pass `--force-prompts` to `garden prompts` or `garden launch
|
|
169
|
+
- **Bypass**: To force prompt card regeneration despite active workers, pass `--force-prompts` to `garden prompts` or `garden launch` (and in `subagents` mode, always pass `--subagent --task <id>` to generate fresh per-task subagent briefs).
|
|
151
170
|
|
|
152
171
|
##### Dual-Pathway Swarm On-Ramp (When Additional Workers Needed)
|
|
153
172
|
When target project workers are needed and unassigned idle cluster peers exist, Garden surfaces two distinct pathways:
|
|
@@ -172,8 +191,8 @@ When target project workers are needed and unassigned idle cluster peers exist,
|
|
|
172
191
|
- **Negative Control & Tenancy Guardrail**: Repurposing rejects workers belonging to other named projects unless `--allow-cross-project` is specified. It also rejects workers that are actively `BUSY` on tasks (requires `--force`).
|
|
173
192
|
|
|
174
193
|
- **Pathway B (Fresh Session Bootstrapping via Capability-Aware Mode)**:
|
|
175
|
-
When zero unassigned cluster listeners exist (even if workers from other projects are online) or the operator prefers fresh sessions, Garden selects the execution mode based on detected harness capabilities (`execution_mode = "auto"`):
|
|
176
|
-
1. **`subagents` (Default on Antigravity IDE & OpenCode Desktop)**: Spawns
|
|
194
|
+
When zero unassigned cluster listeners exist (even if workers from other projects are online), when running in `subagents` mode, or when the operator prefers fresh sessions, Garden selects the execution mode based on detected harness capabilities (`execution_mode = "auto"`):
|
|
195
|
+
1. **`subagents` (Default on Antigravity IDE & OpenCode Desktop)**: Spawns a **fresh, task-scoped, drillable subagent per task and per Key 3 audit** (`invoke_subagent` + clickable `[Persona (@name)](conversation://<id>)` pills in Antigravity, or child sessions in OpenCode Desktop) using briefs generated by `garden prompts --subagent --task <id> --json`. **Zero Cross-Task Reuse (Context Hygiene)**: NEVER reuse a subagent across different tasks or across different Key 3 audits; restrict `send_message` strictly to same-task follow-ups (e.g., mid-task clarification or Key 3 Delta Re-Pump on that exact rejected strand), and close finished handles via `rhizo close <name>`.
|
|
177
196
|
2. **`tmux` (Default on Codex CLI in `tmux`; opt-in on OpenCode CLI / Claude Code CLI)**: Runs `garden launch --tmux` to spawn one `tmux` window/pane per worker running `codex` / `opencode` / `claude` against `/tmp/garden-<project>/<worker>.md`.
|
|
178
197
|
3. **`prompts` (Default on Codex Desktop & non-`tmux` CLI)**: Generates self-contained 10-backtick prompt cards in `/tmp/garden-<project>/` via `garden prompts` (or `garden prompts --force-prompts`).
|
|
179
198
|
|
|
@@ -209,7 +228,8 @@ Because the coding harness is auto-detected from the session environment (`ANTIG
|
|
|
209
228
|
<CRITICAL>
|
|
210
229
|
Capability-Aware Worker Execution & Opaque-Subagent Prohibition:
|
|
211
230
|
Match the execution mechanism to what the active harness makes live, inspectable, and directly chat-steerable for the operator:
|
|
212
|
-
- **Antigravity IDE & OpenCode Desktop (`subagents` default)**: Spawn
|
|
231
|
+
- **Antigravity IDE & OpenCode Desktop (`subagents` default)**: Spawn **fresh, task-scoped, drillable subagents** (`invoke_subagent` in Antigravity, or sidebar child sessions in OpenCode Desktop) via `garden prompts --subagent --task <id> --json`. Always print clickable session links (e.g. `[Systems Architect (@<name>)](conversation://<id>)`) at the top of the orchestrator response so the operator can click in and chat directly. Every subagent worker MUST follow the full worker procedure: fresh unique `rhizo name` + `rhizo open <name>`, explicit `--agent <name>`, 1:1 isolated Vine strand (`vine new <task_id>`), `vine submit`, and independent Key 3 audit by a separate fresh `@auditor` subagent.
|
|
232
|
+
- **Fresh Subagent Per Task (Zero Cross-Task Reuse — Context Hygiene)**: In `subagents` mode, **NEVER reuse a subagent across different tasks or across different Key 3 strand audits**. Always spawn a fresh `invoke_subagent` with a fresh `rhizo name` for each individual task and each Key 3 audit to save context and prevent attention degradation. Restrict `send_message` strictly to same-task follow-ups (such as in-flight clarification or a Key 3 Delta Re-Pump on that exact rejected strand), and deregister completed subagent handles via `rhizo close <name>`.
|
|
213
233
|
- **OpenCode CLI (TUI)**: Defaults to drillable child sessions (`subagents`) or opt-in `tmux` split panes (`--tmux`).
|
|
214
234
|
- **Codex CLI (Text)**: Defaults to automated `tmux` windows/panes (`garden launch --tmux`) when `tmux` is available, falling back to 10-backtick prompt cards outside `tmux`.
|
|
215
235
|
- **Codex Desktop & Claude Code CLI**: Default to top-level sessions via 10-backtick prompt cards in `/tmp/garden-<project>/<worker>.md` (or `--tmux` for Claude Code CLI inside `tmux`).
|
|
@@ -225,9 +245,9 @@ Swarm workers inherit whatever foundation model is active in that harness sessio
|
|
|
225
245
|
Upon receiving the operator's response:
|
|
226
246
|
1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
|
|
227
247
|
2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and resolved execution mode (`auto`, `subagents`, `tmux`, or `prompts`).
|
|
228
|
-
3. Run `garden prompts --json` (or `garden launch --tmux` when launching `tmux` panes, or `garden prompts --subagent --json` for drillable subagent briefs), which writes cards/briefs to `/tmp/garden-<project>/`.
|
|
248
|
+
3. Run `garden prompts --json` (or `garden launch --tmux` when launching `tmux` panes, or `garden prompts --subagent --task <id> --json` for task-scoped drillable subagent briefs), which writes cards/briefs to `/tmp/garden-<project>/`.
|
|
229
249
|
4. Launch or instruct based on the resolved mode:
|
|
230
|
-
- **If `subagents`**: Invoke
|
|
250
|
+
- **If `subagents`**: Invoke a **fresh** task-scoped drillable subagent (`invoke_subagent`) per task and per Key 3 audit using that task's brief (fresh `rhizo name` per spawn; never reuse across tasks or audits; `send_message` only for same-task follow-ups / Delta Re-Pump; `rhizo close <name>` on completion), print clickable `[Persona (@<name>)](conversation://<id>)` links in chat, and verify their registration via `rhizo who --json`.
|
|
231
251
|
- **If `tmux`**: `garden launch --tmux` opens one `tmux` window per worker pointing at `/tmp/garden-<project>/<worker>.md`, and the orchestrator arms `rhizo listen <orchestrator>`.
|
|
232
252
|
- **If `prompts`**: Present concise setup instructions with clickable `/tmp/garden-<project>/<worker>.md` paths (NEVER paste full prompt cards inline in chat), register the orchestrator (`rhizo open`), and arm the listener if in a CLI subprocess harness.
|
|
233
253
|
5. Verify cluster readiness (`rhizo who --json`) before proceeding to Phase 3.
|
|
@@ -383,15 +403,16 @@ The Adversarial Auditor ONLY inspects and ratifies/rejects Key 3 (`vine audit in
|
|
|
383
403
|
</CRITICAL>
|
|
384
404
|
|
|
385
405
|
<INVARIANT>
|
|
386
|
-
Capability-Aware Worker Execution & Subagent Policy: First check `rhizo who --all --json` and attach to active project or unassigned pool workers when available. On cold starts, execution mode matches harness visibility and direct chat interactivity:
|
|
387
|
-
1. Drillable
|
|
406
|
+
Capability-Aware Worker Execution & Subagent Policy: First check `rhizo who --all --json` and attach to active standing project or unassigned pool workers (`prompts` / `tmux` mode) when available. On cold starts, execution mode matches harness visibility and direct chat interactivity:
|
|
407
|
+
1. Task-Scoped Drillable Subagents (`subagents` — Default on Antigravity IDE & OpenCode Desktop): Child sessions where the user can click in and chat interactively (`conversation://<id>` pills in Antigravity; sidebar session tree in OpenCode Desktop) are valid swarm workers when they follow the full worker procedure (fresh unique Rhizo identity via `rhizo name` + `rhizo open <name>`, explicit `--agent <name>`, 1:1 isolated Vine strand `vine new <task_id>`, `vine submit`, and independent Key 3 audit by a separate fresh `@auditor` subagent).
|
|
408
|
+
- **Fresh Subagent Per Task (Zero Cross-Task Reuse — Context Hygiene)**: In `subagents` mode, NEVER reuse a subagent across different tasks or across different Key 3 audits. Always spawn a fresh `invoke_subagent` with a fresh `rhizo name` per task and per Key 3 audit to save context. Use `send_message` ONLY for same-task follow-ups (mid-task clarification or Key 3 Delta Re-Pump on that exact rejected strand), and close completed subagents via `rhizo close <name>`. Active-fleet reuse via `rhizo who --all --json` applies to standing top-level / `tmux` sessions, not completed task subagents.
|
|
388
409
|
2. Automated `tmux` Panes (`tmux` — Default on Codex CLI in `tmux`; opt-in for CLI harnesses): CLI sessions spawned via `garden launch --tmux` wired to `rhizo listen` and `/tmp/garden-<project>/<worker>.md`.
|
|
389
410
|
3. Top-Level Prompt Cards (`prompts` — Default on Codex Desktop & non-`tmux` CLI): Independent interactive windows bootstrapped via Garden 10-backtick prompt cards.
|
|
390
411
|
Opaque, non-interactive CLI subagents (such as headless `Task` jobs that cannot be drilled into or steered) are STRICTLY PROHIBITED as cluster swarm workers.
|
|
391
412
|
</INVARIANT>
|
|
392
413
|
|
|
393
414
|
<INVARIANT>
|
|
394
|
-
Delegation Precedence: When instructed to "delegate", "assign", or "dispatch" work, the Lead Orchestrator MUST route tasks to active cluster workers via Rhizo (`rhizo send <worker>`, `rhizo enqueue queue:<project>:tasks`, or `rhizo task assign/claim`). On cold starts with no online
|
|
415
|
+
Delegation Precedence: When instructed to "delegate", "assign", or "dispatch" work, the Lead Orchestrator MUST route tasks to active standing top-level / `tmux` cluster workers (`prompts` / `tmux` mode) via Rhizo (`rhizo send <worker>`, `rhizo enqueue queue:<project>:tasks`, or `rhizo task assign/claim`). In **Subagent Orchestration Mode (`subagents`)**, NEVER recycle prior-task subagents across new tasks or Key 3 audits — always spawn a fresh subagent per task and per Key 3 audit (`invoke_subagent` + fresh `rhizo name`), restrict `send_message` strictly to same-task follow-ups (e.g., Delta Re-Pump on the same rejected strand), and run `rhizo close <name>` once completed. On cold starts with no online standing workers, dispatch via the harness's capability-aware default (`subagents` with clickable session links on Antigravity IDE & OpenCode Desktop; `tmux` panes or 10-backtick prompt cards on CLI / Codex Desktop). Opaque non-interactive CLI subagents must NEVER fulfill cluster swarm roles and remain restricted solely to transient ad-hoc inspections.
|
|
395
416
|
</INVARIANT>
|
|
396
417
|
|
|
397
418
|
<INVARIANT>
|
|
@@ -13,9 +13,9 @@ description: "Generates and formats X distinct copy-pasteable bootstrap prompts
|
|
|
13
13
|
## 1. System Philosophy & Invariants
|
|
14
14
|
|
|
15
15
|
1. **Capability-Aware Swarm Launch Pathways**:
|
|
16
|
-
Before launching new workers, always check `rhizo who --all --json` first to reuse active project workers or repurpose idle unassigned peers (`garden repurpose`). On cold starts (`execution_mode = "auto"`), choose the pathway matching the harness's visibility and direct chat interactivity:
|
|
17
|
-
- **Pathway 1 (Default on Antigravity IDE & OpenCode Desktop):
|
|
18
|
-
Run `garden prompts --subagent --json` to generate per-worker briefs (`/tmp/garden-<project>/subagent-<worker>.md`), spawn
|
|
16
|
+
Before launching new standing workers, always check `rhizo who --all --json` first to reuse active standing project workers or repurpose idle unassigned peers (`garden repurpose` — applicable to standing top-level/`tmux` sessions only, NEVER completed task subagents). On cold starts (`execution_mode = "auto"`), choose the pathway matching the harness's visibility and direct chat interactivity:
|
|
17
|
+
- **Pathway 1 (Default on Antigravity IDE & OpenCode Desktop): Task-Scoped Drillable Subagents (`subagents` — Fresh Subagent Per Task)**:
|
|
18
|
+
Run `garden prompts --subagent --task <id> --json` to generate per-worker task briefs (`/tmp/garden-<project>/subagent-<worker>.md`), spawn a **fresh** drillable child session (`invoke_subagent` in Antigravity; child sessions in OpenCode Desktop) with a fresh `rhizo name` for EACH individual task and EACH Key 3 audit, and surface clickable `[Persona (@name)](conversation://<id>)` links in chat so the operator can drill in and steer directly. **Zero Cross-Task Reuse (Context Hygiene)**: NEVER reuse a subagent across different tasks or Key 3 audits; use `send_message` ONLY for same-task follow-ups (e.g., clarification or Key 3 Delta Re-Pump on that exact rejected strand), and close completed handles via `rhizo close <name>`.
|
|
19
19
|
- **Pathway 2 (Default on Codex CLI in `tmux`; opt-in on OpenCode CLI / Claude Code CLI): Automated `tmux` Split-Pane / Window Factory (`tmux`)**:
|
|
20
20
|
Run `garden launch --tmux` to spawn one `tmux` window/pane per worker running `codex` / `opencode` / `claude` pointed at `/tmp/garden-<project>/<worker>.md`.
|
|
21
21
|
- **Pathway 3 (Default on Codex Desktop & Non-`tmux` CLI): 10-Backtick Prompt Cards (`prompts`)**:
|
|
@@ -44,7 +44,8 @@ description: "Generates and formats X distinct copy-pasteable bootstrap prompts
|
|
|
44
44
|
- Never stage coordination state (`.rhizo.*`, `*.lock`, `workspaces/`) into Git. Vine stores strand identity in `.git/config` (`vine.taskId`, `vine.project`) and authoritative state in Redis (zero state files in the working tree).
|
|
45
45
|
6. **Capability-Aware Subagent & Session Invariant**:
|
|
46
46
|
<CRITICAL>
|
|
47
|
-
- **Drillable
|
|
47
|
+
- **Task-Scoped Drillable Subagents (Antigravity IDE & OpenCode Desktop)**: Allowed and recommended as first-class swarm workers when spawned fresh per task / per Key 3 audit from `garden prompts --subagent --task <id> --json`, provided each subagent follows the full worker procedure: fresh unique Rhizo identity (`rhizo name` + `rhizo open <name>`), explicit `--agent <name>`, 1:1 isolated Vine strand (`vine new <task_id>`), `vine submit`, and independent Key 3 audit by a separate fresh `@auditor` subagent. Always display clickable session links (`conversation://<id>`) in chat.
|
|
48
|
+
- **Fresh Subagent Per Task (Zero Cross-Task Reuse — Context Hygiene)**: In `subagents` mode, NEVER reuse a subagent across different tasks or across different Key 3 audits (spawning fresh saves context and prevents attention degradation). Restrict `send_message` strictly to same-task follow-ups (e.g., mid-task clarification or a Key 3 Delta Re-Pump on that exact rejected strand), and deregister finished handles via `rhizo close <name>`. Active-fleet reuse via `rhizo who --all --json` applies to standing top-level/`tmux` sessions only, not completed task subagents.
|
|
48
49
|
- **Top-Level / `tmux` Interactive Sessions (Codex Desktop, Codex CLI, Claude Code CLI)**: Bootstrapped via `/tmp/garden-<project>/<worker>.md` (manually pasted or spawned via `garden launch --tmux`).
|
|
49
50
|
- **Opaque Ephemeral Subagents Prohibited**: Non-interactive CLI subagents (such as headless `Task` jobs that the user cannot click into and chat with) are STRICTLY FORBIDDEN from acting as swarm workers.
|
|
50
51
|
</CRITICAL>
|
|
@@ -25,9 +25,10 @@ The Lead Orchestrator provisions an independent Adversarial Auditor persona to i
|
|
|
25
25
|
|
|
26
26
|
<CRITICAL>
|
|
27
27
|
Delegation Precedence & Operator-Named Worker Mandate:
|
|
28
|
-
Whenever instructed to "delegate", "assign", or "dispatch" work, the Lead Orchestrator MUST route tasks to active cluster workers via Rhizo (`rhizo send <worker>`, `rhizo enqueue queue:<project>:tasks`, or `rhizo task assign/claim`).
|
|
29
|
-
On cold starts with zero active cluster workers, dispatch via the harness's capability-aware default (`execution_mode = "auto"`):
|
|
30
|
-
- **Antigravity IDE & OpenCode Desktop (`subagents`)**: Spawn
|
|
28
|
+
Whenever instructed to "delegate", "assign", or "dispatch" work, the Lead Orchestrator MUST route tasks to active standing top-level / `tmux` cluster workers (`prompts` / `tmux` mode) via Rhizo (`rhizo send <worker>`, `rhizo enqueue queue:<project>:tasks`, or `rhizo task assign/claim`).
|
|
29
|
+
On cold starts with zero active standing cluster workers, or whenever running in **Subagent Orchestration Mode (`subagents`)**, dispatch via the harness's capability-aware default (`execution_mode = "auto"`):
|
|
30
|
+
- **Antigravity IDE & OpenCode Desktop (`subagents`)**: Spawn **fresh, task-scoped, drillable subagents** (`invoke_subagent` in Antigravity, or OpenCode child sessions) using `garden prompts --subagent --task <id> --json`, print clickable `[Persona (@name)](conversation://<id>)` links in chat, and strictly enforce 1:1 Vine strand isolation plus independent Key 3 audit by a separate fresh `@auditor` subagent.
|
|
31
|
+
- **Fresh Subagent Per Task (Zero Cross-Task Reuse — Context Hygiene)**: In `subagents` mode, **NEVER reuse a subagent across different tasks or across different Key 3 strand audits**. Always spawn a fresh subagent (`invoke_subagent`) with a fresh `rhizo name` for each individual task and each Key 3 audit to save context and prevent attention degradation. Use `send_message` ONLY for same-task follow-ups (e.g., mid-task clarification or a Key 3 Delta Re-Pump on that exact same rejected strand), and deregister finished subagent handles via `rhizo close <name>`. Active-fleet reuse via `rhizo who --all --json` applies to standing top-level / `tmux` workers, NEVER to completed task subagents.
|
|
31
32
|
- **Codex CLI (`tmux`) / CLI with `--tmux`**: Spawn `tmux` windows via `garden launch --tmux`.
|
|
32
33
|
- **Codex Desktop & Non-`tmux` CLI (`prompts`)**: Bootstrap top-level sessions via 10-backtick prompt cards in `/tmp/garden-<project>/`.
|
|
33
34
|
Opaque, non-interactive CLI subagents (such as headless `Task` jobs that the user cannot drill into and steer mid-flight) must NEVER act as cluster swarm workers and remain restricted to transient read-only inspections.
|
|
@@ -42,17 +43,17 @@ THE ORCHESTRATOR MUST NEVER DIRECTLY JUMP INTO CODE EDITING OR IMPLEMENTATION TO
|
|
|
42
43
|
|
|
43
44
|
The orchestrator inspects the cluster state via `rhizo who --all --json`:
|
|
44
45
|
1. **Pre-Authorized Directives & Active Fleet Fast-Path**:
|
|
45
|
-
If the operator has already directed "work on this with your workers", "delegate", or "dispatch", OR if active cluster workers/queues already exist:
|
|
46
|
+
If the operator has already directed "work on this with your workers", "delegate", or "dispatch", OR if active standing top-level / `tmux` cluster workers/queues already exist (`prompts` / `tmux` mode):
|
|
46
47
|
DO NOT STOP TO ASK ROUTING QUESTIONS. The routing is already decided.
|
|
47
|
-
The orchestrator MUST immediately provision strands (`vine new`), break down the work, and dispatch directly to available cluster workers (`rhizo send <worker>`)
|
|
48
|
-
*Single-Worker Direct Dispatch Preference*: Even for small or single-file code changes, Single-Worker Direct Dispatch (`rhizo send` to 1 worker in a dedicated Vine strand) is strongly preferred over Orchestrator Inline Execution to preserve the conductor's context window.
|
|
48
|
+
The orchestrator MUST immediately provision strands (`vine new`), break down the work, and dispatch directly to available standing cluster workers (`rhizo send <worker>`), enqueue to `queue:<project>:tasks`, or — in `subagents` mode — spawn a fresh task-scoped subagent per task (`invoke_subagent` + fresh `rhizo name`; never reuse across tasks).
|
|
49
|
+
*Single-Worker Direct Dispatch Preference*: Even for small or single-file code changes, Single-Worker Direct Dispatch (`rhizo send` to 1 standing worker or 1 fresh task-scoped subagent in a dedicated Vine strand) is strongly preferred over Orchestrator Inline Execution to preserve the conductor's context window.
|
|
49
50
|
2. **Mandatory `ask_question` Tool Discipline (Zero Conversational Multiple-Choice)**:
|
|
50
51
|
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:
|
|
51
52
|
The orchestrator MUST invoke the interactive `ask_question` tool to solicit the operator's preference (Swarm vs Inline).
|
|
52
53
|
Dumping multiple-choice numbered lists (`1, 2, 3`) or routing questionnaires in raw chat text is STRICTLY PROHIBITED.
|
|
53
54
|
Inline execution in the orchestrator is strictly discouraged for code implementation and reserved for non-code planning, analysis, or design discussions.
|
|
54
55
|
3. **Project-Scoped Fleet Mandate & Anti-Hijacking Invariant**:
|
|
55
|
-
When active or idle workers exist FOR THIS PROJECT (or in the unassigned pool: project 'unassigned'/'default' or tagged 'pool'/'float'/'shared'), the orchestrator must automatically dispatch or repurpose them over Rhizo without prompt cards. However, workers assigned to other named projects are protected; cross-project worker hijacking is strictly prohibited. If only foreign project workers exist, the orchestrator MUST NOT hijack them, but must instead bootstrap dedicated workers via prompt cards (`garden prompts` / `garden launch`).
|
|
56
|
+
When active or idle standing workers (`prompts` / `tmux` mode) exist FOR THIS PROJECT (or in the unassigned pool: project 'unassigned'/'default' or tagged 'pool'/'float'/'shared'), the orchestrator must automatically dispatch or repurpose them over Rhizo without prompt cards (in `subagents` mode, always spawn a fresh subagent per task instead of recycling prior-task subagents). However, workers assigned to other named projects are protected; cross-project worker hijacking is strictly prohibited. If only foreign project workers exist, the orchestrator MUST NOT hijack them, but must instead bootstrap dedicated workers via prompt cards (`garden prompts` / `garden launch`).
|
|
56
57
|
</CRITICAL>
|
|
57
58
|
|
|
58
59
|
<CRITICAL>
|
|
@@ -365,6 +366,7 @@ When a worker finishes implementation in their strand, they run `vine submit --a
|
|
|
365
366
|
|
|
366
367
|
> [!CRITICAL]
|
|
367
368
|
> **THE WORKER IS NOT THE AUDITOR**: Workers cannot audit or approve their own strands (`vine audit approve` strictly enforces `auditor != author`).
|
|
369
|
+
> **FRESH SUBAGENT PER TASK & PER AUDIT (`subagents` Mode — Zero Cross-Task Reuse)**: In Subagent Orchestration Mode (`subagents`), NEVER reuse a subagent across different tasks or across different Key 3 strand audits. Always spawn a **fresh** `@implementer` subagent per task and a **fresh** `@auditor` subagent per Key 3 strand audit (with a fresh `rhizo name` each time) to save context and prevent attention degradation. Restrict `send_message` strictly to same-task follow-ups (e.g., mid-task clarification or a Key 3 Delta Re-Pump on that exact same rejected strand), and deregister finished subagent handles via `rhizo close <name>` once woven or ratified.
|
|
368
370
|
> **PRE-SUBMIT AUDITOR REGISTRATION INVARIANT & ZERO-`--force` RECOVERY**: `vine submit` mints per-auditor cryptographic `audit_ticket`s (`audit_ticket_hash:<agent_id>`) via `STRAND_SUBMITTED` delivery only for agents already registered on the project in Rhizo at submit time (a manual `rhizo send` from an orchestrator does **not** mint a `vine` `audit_ticket`). Therefore, `@auditor` MUST register (`rhizo open <auditor_id> --tags "<project>,auditor"`) **before** any worker runs `vine submit`. If an auditor registers late, never bypass with `--force` (`--force` is banned on `vine audit approve`); once `<auditor_id>` is online in `rhizo who`, have the worker re-run `vine submit --author <author_id> ...` (or dispatch an updated `STRAND_SUBMITTED` ticket generated after registration).
|
|
369
371
|
> **CANONICAL TRUNK `ROADMAP.md` HANDLING RULE**: Because `garden plant` and `rhizo task create` (`autoSowGardenTask`) automatically mutate canonical `ROADMAP.md` (and `.garden/seeds/<id>.toml`), the Lead Orchestrator MUST commit updated `ROADMAP.md` (and tracked seed files) on `main` **before** running `vine new` or `vine weave`, and harvest post-weave `ROADMAP.md` updates exclusively in the Lead Orchestrator (never delegated to `@auditor`).
|
|
370
372
|
> **SINGLE-STRAND AUDIT ISOLATION**: The Lead Orchestrator dispatches an audit request for at most ONE strand at a time (batching multiple strands into a single audit message is strictly prohibited):
|
|
@@ -445,6 +447,22 @@ When cluster capacity needs adjustment, or idle listeners from other projects ar
|
|
|
445
447
|
4. **Negative Controls & Safety**:
|
|
446
448
|
`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.
|
|
447
449
|
|
|
450
|
+
### SOP 7: Two-Wave Adversarial Code Review & Meta-Triage (`garden review`)
|
|
451
|
+
When orchestrating a branch/diff review or a deep codebase audit:
|
|
452
|
+
1. **Generate Two-Wave Review Plan**:
|
|
453
|
+
Run `garden review [--diff|--audit] [--paths <csv>] [--subagent|--tmux|--force-prompts] [--json]` (never write `.json` state to disk; artifacts live in `/tmp/garden-<project>/review/`).
|
|
454
|
+
- Diff mode defaults to `multi-lens` (100% hunk coverage across Systems/Anti-Heuristic, Runtime/Failure-Mode, and Green-Mirage Verification).
|
|
455
|
+
- Audit mode defaults to `sharded` (disjoint structural `moduleGroup` shards + repo-wide Green-Mirage Verifier; zero magic line/file count thresholds).
|
|
456
|
+
2. **Execute Wave 1 (Discovery)**:
|
|
457
|
+
In `subagents` mode, spawn a fresh 1:1 drillable subagent per Wave 1 reviewer brief, collect empirical findings (`file:line`, symbol, command output, call-path reachability), and close each handle with `rhizo close <name>`.
|
|
458
|
+
3. **Execute Wave 2 (5-Gate Adversarial Meta-Reviewer)**:
|
|
459
|
+
Spawn a fresh 1:1 `@meta-reviewer` subagent (or bootstrap card) with all Wave 1 findings, enforcing `Gate 1` (Ground-Truth), `Gate 2` (Live Call-Graph Reachability), `Gate 3` (Realistic Scale), `Gate 4` (Minimal-Fix / Zero-API-Creep), and `Gate 5` (First-Do-No-Harm & Pillar 6 Anti-Heuristic) to triage every item into `KEEP_HIGH_VALUE`, `REWRITE_FIX`, `DROP_FALSE_POSITIVE`, or `DROP_BLOAT`, then run `rhizo close <meta_reviewer>`.
|
|
460
|
+
4. **Sow Ratified Fixes**:
|
|
461
|
+
Sow `KEEP_HIGH_VALUE` and `REWRITE_FIX` items directly into `.garden/seeds/*.toml` via:
|
|
462
|
+
```bash
|
|
463
|
+
garden review --sow "<finding_title>" --season <season> --sunlight <level>
|
|
464
|
+
```
|
|
465
|
+
|
|
448
466
|
---
|
|
449
467
|
|
|
450
468
|
## 4. Swarm Conclusion & Teardown
|