@axiomantic/garden 0.2.33 → 0.2.34

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 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 all setup questions and prompt cards, automatically attaching to the active workers to proceed straight to task planning or execution!
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 **persistent 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`). Opaque, non-interactive CLI subagents remain prohibited as swarm workers.
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 persistent drillable subagents with each worker's brief and prints clickable session links (`conversation://<id>`) directly in chat.
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
@@ -136,18 +136,21 @@ Instead, it acts as an **Intelligent Intake Concierge**:
136
136
  #### Adaptive Swarm On-Ramp & Dynamic Worker Repurposing (First-Look Invariant)
137
137
 
138
138
  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.
139
+ > [!NOTE]
140
+ > **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.
141
+
139
142
  Garden automatically categorizes cluster listeners into four operational pools:
140
- 1. **`projectActive`**: Active listeners already registered on the target project.
143
+ 1. **`projectActive`**: Active standing listeners already registered on the target project (`prompts` / `tmux` mode).
141
144
  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
145
  3. **`foreignProjectPeers`**: Active listeners registered to other named projects, **protected against cross-project poaching** (repurposing rejected unless `--allow-cross-project` is explicitly passed).
143
146
  4. **`busyClusterPeers`**: Active listeners executing in-flight tasks (`BUSY`), guarded from unintentional reassignment (requires `--force`).
144
147
 
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`):
148
+ ##### Fast-Path: Re-using an Active / Existing Standing Swarm (`prompts` / `tmux` Mode)
149
+ If active, healthy standing workers on the target project meet or exceed the target worker count (`projectActive >= targetWorkers`) in `prompts` / `tmux` mode:
147
150
  - **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`, ...).
151
+ - Automatically attach to the existing online standing workers (`@worker-1`, `@worker-2`, ...).
149
152
  - 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`.
153
+ - **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
154
 
152
155
  ##### Dual-Pathway Swarm On-Ramp (When Additional Workers Needed)
153
156
  When target project workers are needed and unassigned idle cluster peers exist, Garden surfaces two distinct pathways:
@@ -172,8 +175,8 @@ When target project workers are needed and unassigned idle cluster peers exist,
172
175
  - **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
176
 
174
177
  - **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 persistent, drillable subagents (`invoke_subagent` + `send_message` with clickable `[Persona (@name)](conversation://<id>)` pills in Antigravity, or child sessions in OpenCode Desktop) using briefs generated by `garden prompts --subagent --json`.
178
+ 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"`):
179
+ 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
180
  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
181
  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
182
 
@@ -209,7 +212,8 @@ Because the coding harness is auto-detected from the session environment (`ANTIG
209
212
  <CRITICAL>
210
213
  Capability-Aware Worker Execution & Opaque-Subagent Prohibition:
211
214
  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 persistent drillable subagents (`invoke_subagent` + `send_message` in Antigravity, or sidebar child sessions in OpenCode Desktop) via `garden prompts --subagent --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: 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 `@auditor` subagent.
215
+ - **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.
216
+ - **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
217
  - **OpenCode CLI (TUI)**: Defaults to drillable child sessions (`subagents`) or opt-in `tmux` split panes (`--tmux`).
214
218
  - **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
219
  - **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 +229,9 @@ Swarm workers inherit whatever foundation model is active in that harness sessio
225
229
  Upon receiving the operator's response:
226
230
  1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
227
231
  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>/`.
232
+ 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
233
  4. Launch or instruct based on the resolved mode:
230
- - **If `subagents`**: Invoke persistent drillable subagents with each worker's brief, print clickable `[Persona (@<name>)](conversation://<id>)` links in chat, and verify their registration via `rhizo who --json`.
234
+ - **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
235
  - **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
236
  - **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
237
  5. Verify cluster readiness (`rhizo who --json`) before proceeding to Phase 3.
@@ -383,15 +387,16 @@ The Adversarial Auditor ONLY inspects and ratifies/rejects Key 3 (`vine audit in
383
387
  </CRITICAL>
384
388
 
385
389
  <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 Persistent Subagents (`subagents` — Default on Antigravity IDE & OpenCode Desktop): Persistent 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 (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 `@auditor` subagent).
390
+ 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:
391
+ 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).
392
+ - **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
393
  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
394
  3. Top-Level Prompt Cards (`prompts` — Default on Codex Desktop & non-`tmux` CLI): Independent interactive windows bootstrapped via Garden 10-backtick prompt cards.
390
395
  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
396
  </INVARIANT>
392
397
 
393
398
  <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 cluster 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.
399
+ 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
400
  </INVARIANT>
396
401
 
397
402
  <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.33",
3
+ "version": "0.2.34",
4
4
  "description": "Multi-Agent Swarm Orchestration, Empirical Dialectics & Ceremonies on top of Rhizo & Vine",
5
5
  "main": "bin/run.js",
6
6
  "bin": {
@@ -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 **persistent drillable subagent** (default on Antigravity IDE and OpenCode Desktop, 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).
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 persistent subagents (`invoke_subagent` + `send_message` with clickable `conversation://<id>` links) or dedicated windows on Antigravity's active session models.
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 persistent drillable subagents (`subagents`) obeying the full worker procedure (unique Rhizo ID, explicit `--agent <name>`, 1:1 Vine strand, `vine submit`, independent Key 3 audit).
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` default / Window)** or **OpenCode Desktop (`subagents`)** | Session Default (Native in window) | Zero-setup drillable child sessions (`conversation://<id>`) or top-level sessions with fast architectural comprehension. |
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` default / Window)**, **OpenCode Desktop**, or **Codex CLI (`tmux`)** | Session Default (Native in window) | Isolated 1:1 Vine strand execution, rapid file modification, direct verification (`vine gate` / `vine submit`). |
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).
@@ -136,18 +136,21 @@ Instead, it acts as an **Intelligent Intake Concierge**:
136
136
  #### Adaptive Swarm On-Ramp & Dynamic Worker Repurposing (First-Look Invariant)
137
137
 
138
138
  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.
139
+ > [!NOTE]
140
+ > **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.
141
+
139
142
  Garden automatically categorizes cluster listeners into four operational pools:
140
- 1. **`projectActive`**: Active listeners already registered on the target project.
143
+ 1. **`projectActive`**: Active standing listeners already registered on the target project (`prompts` / `tmux` mode).
141
144
  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
145
  3. **`foreignProjectPeers`**: Active listeners registered to other named projects, **protected against cross-project poaching** (repurposing rejected unless `--allow-cross-project` is explicitly passed).
143
146
  4. **`busyClusterPeers`**: Active listeners executing in-flight tasks (`BUSY`), guarded from unintentional reassignment (requires `--force`).
144
147
 
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`):
148
+ ##### Fast-Path: Re-using an Active / Existing Standing Swarm (`prompts` / `tmux` Mode)
149
+ If active, healthy standing workers on the target project meet or exceed the target worker count (`projectActive >= targetWorkers`) in `prompts` / `tmux` mode:
147
150
  - **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`, ...).
151
+ - Automatically attach to the existing online standing workers (`@worker-1`, `@worker-2`, ...).
149
152
  - 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`.
153
+ - **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
154
 
152
155
  ##### Dual-Pathway Swarm On-Ramp (When Additional Workers Needed)
153
156
  When target project workers are needed and unassigned idle cluster peers exist, Garden surfaces two distinct pathways:
@@ -172,8 +175,8 @@ When target project workers are needed and unassigned idle cluster peers exist,
172
175
  - **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
176
 
174
177
  - **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 persistent, drillable subagents (`invoke_subagent` + `send_message` with clickable `[Persona (@name)](conversation://<id>)` pills in Antigravity, or child sessions in OpenCode Desktop) using briefs generated by `garden prompts --subagent --json`.
178
+ 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"`):
179
+ 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
180
  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
181
  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
182
 
@@ -209,7 +212,8 @@ Because the coding harness is auto-detected from the session environment (`ANTIG
209
212
  <CRITICAL>
210
213
  Capability-Aware Worker Execution & Opaque-Subagent Prohibition:
211
214
  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 persistent drillable subagents (`invoke_subagent` + `send_message` in Antigravity, or sidebar child sessions in OpenCode Desktop) via `garden prompts --subagent --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: 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 `@auditor` subagent.
215
+ - **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.
216
+ - **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
217
  - **OpenCode CLI (TUI)**: Defaults to drillable child sessions (`subagents`) or opt-in `tmux` split panes (`--tmux`).
214
218
  - **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
219
  - **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 +229,9 @@ Swarm workers inherit whatever foundation model is active in that harness sessio
225
229
  Upon receiving the operator's response:
226
230
  1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
227
231
  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>/`.
232
+ 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
233
  4. Launch or instruct based on the resolved mode:
230
- - **If `subagents`**: Invoke persistent drillable subagents with each worker's brief, print clickable `[Persona (@<name>)](conversation://<id>)` links in chat, and verify their registration via `rhizo who --json`.
234
+ - **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
235
  - **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
236
  - **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
237
  5. Verify cluster readiness (`rhizo who --json`) before proceeding to Phase 3.
@@ -383,15 +387,16 @@ The Adversarial Auditor ONLY inspects and ratifies/rejects Key 3 (`vine audit in
383
387
  </CRITICAL>
384
388
 
385
389
  <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 Persistent Subagents (`subagents` — Default on Antigravity IDE & OpenCode Desktop): Persistent 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 (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 `@auditor` subagent).
390
+ 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:
391
+ 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).
392
+ - **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
393
  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
394
  3. Top-Level Prompt Cards (`prompts` — Default on Codex Desktop & non-`tmux` CLI): Independent interactive windows bootstrapped via Garden 10-backtick prompt cards.
390
395
  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
396
  </INVARIANT>
392
397
 
393
398
  <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 cluster 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.
399
+ 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
400
  </INVARIANT>
396
401
 
397
402
  <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): Persistent Drillable Subagents (`subagents`)**:
18
- Run `garden prompts --subagent --json` to generate per-worker briefs (`/tmp/garden-<project>/subagent-<worker>.md`), spawn persistent child sessions (`invoke_subagent` + `send_message` in Antigravity; child sessions in OpenCode Desktop), and surface clickable `[Persona (@name)](conversation://<id>)` links in chat so the operator can drill in and steer directly.
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 Persistent Subagents (Antigravity IDE & OpenCode Desktop)**: Allowed and recommended as first-class swarm workers when spawned from `garden prompts --subagent --json`, provided each subagent follows the full worker procedure: unique Rhizo identity (`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 `@auditor` subagent. Always display clickable session links (`conversation://<id>`) in chat.
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 persistent drillable subagents (`invoke_subagent` + `send_message`, or OpenCode child sessions) using `garden prompts --subagent --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 `@auditor` subagent.
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>`) or enqueue to `queue:<project>:tasks`.
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):