@axiomantic/garden 0.2.29 → 0.2.31

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
@@ -176,17 +176,19 @@ Garden utilizes the **Active Swarm Fast-Path (First-Look Invariant)**:
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
- > **Universal Sovereign Sessions & Model Inheritance**:
180
- > - **Sovereign Sessions Only (Universal Subagent & Tmux Prohibition)**: Swarm workers are strictly independent sessions (separate terminal tabs or IDE windows) bootstrapped via 10-backtick prompt cards. Harness-internal subagents (e.g. Antigravity's `invoke_subagent`, Claude Code's `Task`, OpenCode subtasks) and terminal multiplexers (`tmux`) are **strictly prohibited**.
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.
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
- ### 3. Prompt-Based Swarm Bootstrapping (`launch-workers`)
184
- Garden writes `garden-swarm.json` and runs `garden prompts` to write prompt cards directly to temporary files (`/tmp/garden-<project>/<worker>.md`) rather than flooding the chat window with thousands of lines of raw text:
185
- - The Orchestrator displays concise session assignments with clickable file links:
186
- 1. Open **Tab 1 / Window 1**: Reference Prompt 1 (`/tmp/garden-<project>/<project>-auditor.md`)
187
- 2. Open **Tab 2 / Window 2**: Reference Prompt 2 (`/tmp/garden-<project>/<project>-architect.md`)
188
- 3. Open **Tab 3 / Window 3**: Reference Prompt 3 (`/tmp/garden-<project>/<project>-implementer.md`)
189
- - Each session enters the project directory, exports `RHIZO_AGENT_NAME`, registers on the Redis bus (`rhizo open`), and arms its single-shot listener (`rhizo listen`).
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.
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
+ - **In `prompts` mode (Codex Desktop & non-`tmux` CLI default)**: The Orchestrator displays concise session assignments with clickable file links:
188
+ 1. Open **Tab 1 / Window 1**: Reference Prompt 1 (`/tmp/garden-<project>/<worker-1>.md`)
189
+ 2. Open **Tab 2 / Window 2**: Reference Prompt 2 (`/tmp/garden-<project>/<worker-2>.md`)
190
+ 3. Open **Tab 3 / Window 3**: Reference Prompt 3 (`/tmp/garden-<project>/<worker-3>.md`)
191
+ - Each worker registers on the Redis bus (`rhizo open`), claims its task (`rhizo task claim`), isolates work 1:1 in a Vine strand (`vine new`), submits for independent Key 3 audit (`vine submit`), and (in CLI harnesses) arms its single-shot listener (`rhizo listen`).
190
192
  - The Orchestrator confirms all workers are live via `rhizo who --json` before dispatching tasks!
191
193
 
192
194
  ### 4. The Dialectical Pump (`dialectical-pump`)
package/SKILL.md CHANGED
@@ -167,8 +167,11 @@ When target project workers are needed and unassigned idle cluster peers exist,
167
167
  The recipient worker inspects its local toolchain, self-selects a compatible role, adds corresponding tags (`rhizo tag add <tags>`), and replies with `WORKER_READY`.
168
168
  - **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`).
169
169
 
170
- - **Pathway B (Fresh Session Bootstrapping via Prompt Cards)**:
171
- When zero unassigned cluster listeners exist (even if workers from other projects are online) or the operator prefers isolated fresh sessions, Garden generates self-contained 10-backtick prompt cards in `/tmp/garden-<project>/` via `garden prompts` (or `garden launch`). Dedicated prompt cards are the primary and intended mechanism for spinning up workers for a new project!
170
+ - **Pathway B (Fresh Session Bootstrapping via Capability-Aware Mode)**:
171
+ 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"`):
172
+ 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`.
173
+ 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`.
174
+ 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`).
172
175
 
173
176
  <CRITICAL>
174
177
  Operator-Named Worker Delegation Mandate:
@@ -191,37 +194,39 @@ Never Hijack or Kill Another Session's Active Listener: When 'rhizo listen <agen
191
194
 
192
195
  #### Cold-Start Intake Protocol (Zero Active Workers Only)
193
196
  When an operator initiates a fresh project or requests multi-agent coordination and NO active cluster workers exist, the session MUST NOT silently guess configuration.
194
- Because the coding harness is auto-detected from the session environment (`ANTIGRAVITY_APP_DIR` $\to$ Antigravity IDE, `CLAUDE_CODE` $\to$ Claude Code CLI, `OPENCODE_SESSION_ID` $\to$ OpenCode, `CODEX_SESSION_ID` $\to$ ChatGPT Desktop / Codex, `PI_SESSION_ID` $\to$ Pi), the orchestrator invokes `ask_question` to conduct a streamlined **Single-Question Intake Interview**:
197
+ Because the coding harness is auto-detected from the session environment (`ANTIGRAVITY_APP_DIR` $\to$ Antigravity IDE, `CLAUDE_CODE` $\to$ Claude Code CLI, `OPENCODE_DESKTOP` $\to$ OpenCode Desktop, `OPENCODE_SESSION_ID` $\to$ OpenCode, `CODEX_CLI` $\to$ Codex CLI, `CODEX_SESSION_ID` $\to$ ChatGPT Desktop / Codex, `PI_SESSION_ID` $\to$ Pi), the orchestrator invokes `ask_question` to conduct a streamlined **Single-Question Intake Interview**:
195
198
 
196
199
  1. **Single Question: Execution Mode & Swarm Shape in <Detected Harness>**:
197
- - *Option 1 (Recommended)*: Multi-Agent Swarm: Balanced Triad in <Detected Harness> (Systems Architect `@<project>-architect`, Adversarial Auditor `@<project>-auditor`, DevEx Lead `@<project>-implementer`).
198
- - *Option 2*: Multi-Agent Swarm: Focused Duo in <Detected Harness> (Implementation Lead `@<project>-implementer`, Adversarial Auditor `@<project>-auditor`).
200
+ - *Option 1 (Recommended)*: Multi-Agent Swarm: Balanced Triad in <Detected Harness> using the harness default (`subagents` on Antigravity IDE / OpenCode Desktop; `tmux` panes on Codex CLI in `tmux`; `prompts` on Codex Desktop / non-`tmux` CLI) — Systems Architect `@architect`, Adversarial Auditor `@auditor`, DevEx Lead `@implementer`; unique listener codenames allocated via `rhizo name <project>`.
201
+ - *Option 2*: Multi-Agent Swarm: Focused Duo in <Detected Harness> (Implementation Lead `@implementer`, Adversarial Auditor `@auditor`; unique listener codenames allocated via `rhizo name <project>`).
199
202
  - *Option 3 (Deprioritized)*: Single-Agent Inline (Execute sequentially within current chat session; strongly discouraged for code edits to preserve orchestrator context for governance).
200
- - *Option 4*: Custom Swarm (Operator specifies custom roles or cross-harness distribution).
203
+ - *Option 4*: Custom Swarm / Mode Override (Operator specifies custom roles, `--mode prompts`, `--tmux`, or cross-harness distribution).
201
204
 
202
205
  <CRITICAL>
203
- Sovereign Dedicated Sessions Only (Universal Subagent & Tmux Prohibition):
204
- Swarm workers are ALWAYS sovereign, independent interactive sessions (dedicated terminal tabs or IDE windows) bootstrapped via copy-paste prompt cards wrapped in 10 backticks. Harness-internal subagents (e.g. Antigravity's `invoke_subagent`, Claude Code's `Task`, OpenCode subtasks, Cursor sub-composers) are STRICTLY PROHIBITED as swarm workers across all harnesses. Internal subagents are ephemeral, cannot maintain continuous background listeners, and cause severe context poisoning. Terminal multiplexers (tmux) are unsupported. NEVER offer or present "subagents" or "tmux" as options during intake.
206
+ Capability-Aware Worker Execution & Opaque-Subagent Prohibition:
207
+ Match the execution mechanism to what the active harness makes live, inspectable, and directly chat-steerable for the operator:
208
+ - **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.
209
+ - **OpenCode CLI (TUI)**: Defaults to drillable child sessions (`subagents`) or opt-in `tmux` split panes (`--tmux`).
210
+ - **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`.
211
+ - **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`).
212
+ - **Opaque CLI Subagents Prohibited as Swarm Workers**: Headless/non-interactive subagent tools (such as Claude Code `Task` jobs where the user cannot drill in and chat mid-flight) MUST NEVER be used as swarm workers and remain restricted to transient read-only inspections.
205
213
  </CRITICAL>
206
214
 
207
215
  <CRITICAL>
208
216
  Session Default Models (Standalone Model Quizzes Prohibited):
209
- Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session (e.g., Gemini in Antigravity, Claude in Claude Code, configured workspace models in OpenCode). NEVER present a separate question asking the operator to choose "Foundation Model Pairings". In prompt cards, model configuration defaults to `"Session Default (active in window/tab)"`.
217
+ Swarm workers inherit whatever foundation model is active in that harness session (e.g., Gemini in Antigravity, Claude in Claude Code, configured workspace models in OpenCode). NEVER present a separate question asking the operator to choose "Foundation Model Pairings". In prompt cards and subagent briefs, model configuration defaults to `"Session Default (active in window/tab)"`.
210
218
  </CRITICAL>
211
219
 
212
- #### Automatic Fulfillment & 10-Backtick Prompt Generation:
220
+ #### Automatic Fulfillment & Worker Launch:
213
221
  Upon receiving the operator's response:
214
222
  1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
215
- 2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and session-default models (zero on-disk JSON).
216
- 3. Run `garden prompts` which writes individual prompt cards to `/tmp/garden-<project>/<worker>.md` and all cards to `/tmp/garden-<project>/all-workers.md`.
217
- 4. Present the operator with concise setup instructions with clickable prompt file paths (NEVER paste prompt cards inline in chat):
218
- ```text
219
- 1. Open X terminal tabs or windows in your detected coding harness.
220
- 2. Pass each worker's prompt card into its session (e.g. paste or reference /tmp/garden-<project>/<worker>.md).
221
- 3. Once launched, tell me here (or I will automatically detect them online via `rhizo who`).
222
- ```
223
- 5. Register the orchestrator's presence (`rhizo open <project>-orchestrator`) and arm the listener.
224
- 6. Poll or await cluster readiness gate (`rhizo who --json`) before proceeding to Phase 3.
223
+ 2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and resolved execution mode (`auto`, `subagents`, `tmux`, or `prompts`).
224
+ 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>/`.
225
+ 4. Launch or instruct based on the resolved mode:
226
+ - **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`.
227
+ - **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>`.
228
+ - **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.
229
+ 5. Verify cluster readiness (`rhizo who --json`) before proceeding to Phase 3.
225
230
 
226
231
 
227
232
  ---
@@ -368,11 +373,15 @@ The Adversarial Auditor ONLY inspects and ratifies/rejects Key 3 (`vine audit in
368
373
  </CRITICAL>
369
374
 
370
375
  <INVARIANT>
371
- Sovereign Session & Subagent Prohibition: Swarm workers are ALWAYS sovereign, independent interactive sessions (dedicated terminal tabs, CLI windows, or IDE sessions) bootstrapped via Garden 10-backtick prompt cards. Harness-internal subagents (e.g., Antigravity's 'invoke_subagent', Claude Code's 'Task', OpenCode subagents, Cursor sub-composers) are STRICTLY PROHIBITED from acting as cluster swarm workers across all harnesses. Internal subagents are ephemeral, terminate upon single-task completion, cannot maintain persistent blocking listeners ('rhizo listen'), corrupt workspace isolation, and cause severe context poisoning by dumping execution traces back into the parent prompt. When orchestrating or bootstrapping a swarm, an orchestrator must NEVER spawn internal subagents and must NEVER offer "subagents" as a worker execution option during intake.
376
+ 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:
377
+ 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).
378
+ 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`.
379
+ 3. Top-Level Prompt Cards (`prompts` — Default on Codex Desktop & non-`tmux` CLI): Independent interactive windows bootstrapped via Garden 10-backtick prompt cards.
380
+ Opaque, non-interactive CLI subagents (such as headless `Task` jobs that cannot be drilled into or steered) are STRICTLY PROHIBITED as cluster swarm workers.
372
381
  </INVARIANT>
373
382
 
374
383
  <INVARIANT>
375
- 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`). Harness-internal subagents (e.g. `invoke_subagent`, `Task`, `Agent`) must NEVER be used to fulfill cluster swarm roles; they are restricted solely to transient, single-turn ad-hoc inspections in non-swarm solo chats when the operator explicitly requests a "subagent" by name.
384
+ 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.
376
385
  </INVARIANT>
377
386
 
378
387
  <INVARIANT>
@@ -382,8 +391,8 @@ Zero Theatrical Dialogue: Every dialectical assertion must be substantiated with
382
391
  <CRITICAL>
383
392
  Worker Autonomous Execution Invariant (GVR-017):
384
393
  Swarm workers are sovereign, autonomous implementers, not passive chatbots.
385
- When 'rhizo listen' delivers an incoming task and exits, workers MUST NOT wait for an operator prompt or ask "Shall I begin?".
386
- They MUST immediately transition to active execution: claim the task, enter the isolated Vine strand, perform the work, submit the strand for independent audit ('vine submit'), report results, and re-arm the single-shot listener before concluding their turn. Remember: THE WORKER IS NOT THE AUDITOR; an independent adversarial auditor must review and ratify Key 3 ('vine audit approve').
394
+ When a directive is delivered (unblocking 'rhizo listen' in CLI harnesses, or streamed directly via the Multiplexed Router in Antigravity, OpenCode, and Pi), workers MUST NOT wait for an operator prompt or ask "Shall I begin?".
395
+ They MUST immediately transition to active execution: claim the task, enter the isolated Vine strand, perform the work, submit the strand for independent audit ('vine submit'), report results, and re-arm their single-shot listener (CLI harnesses) or resume listening via the Multiplexed Router before concluding their turn. Remember: THE WORKER IS NOT THE AUDITOR; an independent adversarial auditor must review and ratify Key 3 ('vine audit approve').
387
396
  </CRITICAL>
388
397
 
389
398
  <CRITICAL>
@@ -442,7 +451,7 @@ Context compaction purges detailed operational invariants, ceremony rules, and p
442
451
  <!-- END_SWARM_RUNTIME_STATE -->
443
452
 
444
453
  3. **Resurrected Agent Invariant**:
445
- Upon waking from compaction, the agent MUST immediately read the required skills, re-arm its single-shot listener (`rhizo listen <agent>`), check `implementation_plan.md`, and resume work under full ceremony discipline.
454
+ Upon waking from compaction, the agent MUST immediately read the required skills, verify its listener or session registration (`rhizo listen <agent>` in CLI harnesses or `rhizo open <agent>` in Multiplexed Router harnesses), check `implementation_plan.md`, and resume work under full ceremony discipline.
446
455
  </CRITICAL>
447
456
 
448
457
  ---
@@ -455,7 +464,7 @@ To prevent silent deadlocks when workers stall, crash, or fail to re-arm listene
455
464
  - **Escalate Immediately**: Prompt the operator via `ask_question` with the diagnostic status.
456
465
  - **Actionable Remediation**: Offer options to (1) re-arm the listener in the worker's terminal session (`rhizo listen <worker>`), (2) reboot the agent harness, or (3) reassign the task via `rhizo reroute <worker> <new_worker>`.
457
466
  3. **Orchestrator Self-Audit Watchdog (ONLY for OpenAI Codex / ChatGPT)**:
458
- - **Antigravity & OpenCode Exemption**: In Google Antigravity and OpenCode, DO NOT schedule timers or cron tasks (`schedule(...)`). Antigravity natively and reactively receives incoming messages via the continuous background ear (`--agy-ear`) and `agentapi send-message`.
467
+ - **Antigravity & OpenCode Exemption**: In Google Antigravity and OpenCode, DO NOT schedule timers or cron tasks (`schedule(...)`). Antigravity natively and reactively receives incoming messages via the host Multiplexed Router Service (`rhizo router`) and session registry (`agentapi send-message`).
459
468
  - **Codex / ChatGPT Watchdog Only**: In OpenAI Codex Desktop / CLI where background processes cannot reactively wake the harness, arm a scheduled watchdog timer or cron job with stepped backoff (15m $\rightarrow$ 30m $\rightarrow$ 60m $\rightarrow$ 120m $\rightarrow$ Stand Down at check 4).
460
469
  - **Reset Invariant**: Resets immediately to base 15m (streak 0) on any listener failure, unread inbox backlog, outbound task dispatch (`rhizo send`/`enqueue`), worker reply, or user chat prompt.
461
470
  - When the timer fires in Codex, execute the short check: `rhizo watchdog check --agent <orchestrator> --json` and follow `next_action` (`SCHEDULE_TIMER` or `STAND_DOWN`).
Binary file
Binary file
Binary file
Binary file
Binary file
package/bin/run.js CHANGED
@@ -81,7 +81,7 @@ function resolveBinary() {
81
81
  ? (process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local'))
82
82
  : path.join(os.homedir(), '.cache')
83
83
  );
84
- const cacheBinDir = path.join(cacheBase, PKG_NAME, 'bin');
84
+ const cacheBinDir = path.join(cacheBase, PKG_NAME, VERSION, 'bin');
85
85
  const cachedBin = path.join(cacheBinDir, `${PKG_NAME}${ext}`);
86
86
 
87
87
  if (isCompatibleBinary(cachedBin)) {
@@ -116,7 +116,8 @@ function resolveBinary() {
116
116
  const srcFile = path.join(__dirname, '..', 'src', `${PKG_NAME}.nim`);
117
117
  if (fs.existsSync(srcFile)) {
118
118
  try {
119
- execSync('which nim', { stdio: 'ignore' });
119
+ const whichCmd = process.platform === 'win32' ? 'where nim' : 'which nim';
120
+ execSync(whichCmd, { stdio: 'ignore' });
120
121
  process.stderr.write(`[@axiomantic/${PKG_NAME}] Building from source via Nim compiler...\n`);
121
122
  fs.mkdirSync(cacheBinDir, { recursive: true });
122
123
  execSync(`nim c -d:release --opt:speed -o:"${cachedBin}" "${srcFile}"`, { stdio: 'inherit' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiomantic/garden",
3
- "version": "0.2.29",
3
+ "version": "0.2.31",
4
4
  "description": "Multi-Agent Swarm Orchestration, Empirical Dialectics & Ceremonies on top of Rhizo & Vine",
5
5
  "main": "bin/run.js",
6
6
  "bin": {
@@ -37,7 +37,7 @@ graph TD
37
37
 
38
38
  <CRITICAL>
39
39
  Mandatory Independent Auditor Role (Key 3 Invariant):
40
- Swarm rosters MUST ALWAYS include a dedicated, independent Adversarial Auditor (@<project>-auditor).
40
+ Swarm rosters MUST ALWAYS include a dedicated, independent Adversarial Auditor (routable via `@auditor` capability tag, with unique listener codename allocated via `rhizo name <project>`).
41
41
  Workers who write code are strictly prohibited from auditing or ratifying their own deliverables. Vine's Key 3 gate mechanically rejects self-auditing (ExitGateAuditViolation = 6). The Adversarial Auditor must run in a dedicated, independent session to inspect submitted strands, enforce the Five Pillars, and execute 'vine audit approve --auditor <name>'.
42
42
  </CRITICAL>
43
43
 
@@ -45,22 +45,27 @@ 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 an INDEPENDENT, DEDICATED CODING SESSION (separate terminal tab or dedicated IDE window) bootstrapped via Garden 10-backtick prompt cards.
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).
49
49
 
50
50
  Workers inherit whatever foundation model is native or configured in that session:
51
- - In **Antigravity IDE**: Workers run on Antigravity's active session models (Gemini).
52
- - In **Claude Code CLI**: Workers run on Claude CLI's active models (Claude 3.7 Sonnet).
53
- - In **OpenCode Desktop**: Workers run on models configured in `opencode.json`.
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.
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`.
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.
54
55
  - In **Headless Terminal / Pi**: Workers run on provider CLI configuration.
55
56
 
56
57
  <CRITICAL>
57
- Sovereign Dedicated Sessions Only (Universal Subagent Prohibition):
58
- Swarm workers are ALWAYS sovereign, independent interactive sessions (separate terminal tabs or dedicated IDE windows) bootstrapped via Garden 10-backtick prompt cards. Harness-internal subagents (e.g. Antigravity's `invoke_subagent`, Claude Code's `Task`, OpenCode subtasks, Cursor sub-composers) are STRICTLY FORBIDDEN from acting as swarm workers. NEVER pair a persona with internal subagents.
58
+ Capability-Aware Worker Execution & Opaque Subagent Prohibition:
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).
61
+ - **Codex CLI (`tmux`) / OpenCode CLI (`--tmux`)**: Automated `tmux` windows/panes via `garden launch --tmux`.
62
+ - **Codex Desktop & Non-`tmux` CLI**: Top-level sessions via 10-backtick prompt cards.
63
+ - **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.
59
64
  </CRITICAL>
60
65
 
61
66
  <CRITICAL>
62
67
  Session Default Models (No Cross-Harness Model Quizzes):
63
- Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session. NEVER present a separate question asking the operator to choose "Foundation Model Pairings", and NEVER present model options that do not correspond to the chosen harness. In prompt cards and swarm specifications, models default to `"Session Default (active in window/tab)"`.
68
+ Swarm workers operate in interactive sessions or inherited subagent sessions and inherit whatever foundation model is active in that harness session. NEVER present a separate question asking the operator to choose "Foundation Model Pairings", and NEVER present model options that do not correspond to the chosen harness. In prompt cards and swarm specifications, models default to `"Session Default (active in window/tab)"`.
64
69
  </CRITICAL>
65
70
 
66
71
  <CRITICAL>
@@ -69,12 +74,12 @@ Whimsical Non-Human Personas & Dynamic Invention Invariant (GVR-017):
69
74
  2. Dynamic Synthesis Mandate: When configuring or recommending swarm personas, NEVER draw from or reuse static, generic, or example lists. Dynamically synthesize completely original, inventive compound monikers ([Descriptor]-[Entity/Craft]) tailored specifically to the target project's domain.
70
75
  </CRITICAL>
71
76
 
72
- | Role Mandate | Recommended Harness | Model Alignment | Rationale |
77
+ | Role Mandate | Recommended Mode / Harness | Model Alignment | Rationale |
73
78
  | :--- | :--- | :--- | :--- |
74
- | **Architectural Design & Systems Modeling** | **Antigravity (Dedicated Window)** or **OpenCode (Dedicated Session)** | Session Default (Native in window) | Fast token throughput, deep reasoning, superior multi-file architectural comprehension, and native background ear support. |
75
- | **Adversarial Audit & Code Quality Purism** | **Claude Code CLI (Dedicated Tab)** or **Antigravity (Dedicated Window)** | Session Default (Native in tab/window) | Uncompromising adherence to instructions, meticulous attention to negative controls, zero tolerance for superficial green tests. |
76
- | **DevEx, Rapid Prototyping & Implementation** | **Antigravity (Dedicated Window)** or **OpenCode (Dedicated Session)** | Session Default (Native in window) | Native reactive tool execution (`run_command`), rapid file modification, direct terminal feedback. |
77
- | **Hermetic / Local Security Analysis** | **Headless Terminal Worker (Dedicated Tab)** | Ollama / Local DeepSeek-R1 | Air-gapped execution for proprietary credentials, licensing checks, or sensitive security audits. |
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`). |
82
+ | **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. |
78
83
 
79
84
  ---
80
85
 
@@ -116,11 +121,13 @@ Run `rhizo who --all --json` to triage cluster listener state:
116
121
 
117
122
  ### Step 2: Formulate Recommendation in Detected Harness
118
123
  Auto-detect the orchestrator's active harness from environment variables:
119
- - `ANTIGRAVITY_APP_DIR` $\to$ "Antigravity IDE"
120
- - `CLAUDE_CODE` $\to$ "Claude Code CLI"
121
- - `OPENCODE_SESSION_ID` $\to$ "OpenCode"
122
- - `CODEX_SESSION_ID` $\to$ "ChatGPT Desktop / Codex"
123
- - `PI_SESSION_ID` $\to$ "Pi"
124
+ - `ANTIGRAVITY_APP_DIR` $\to$ "Antigravity IDE" (`subagents` default)
125
+ - `CLAUDE_CODE` $\to$ "Claude Code CLI" (`tmux` in `$TMUX` / `prompts` default)
126
+ - `OPENCODE_DESKTOP` $\to$ "OpenCode Desktop" (`subagents` default)
127
+ - `OPENCODE_SESSION_ID` $\to$ "OpenCode" (`subagents` default)
128
+ - `CODEX_CLI` $\to$ "Codex CLI" (`tmux` default when available, else `prompts`)
129
+ - `CODEX_SESSION_ID` $\to$ "ChatGPT Desktop / Codex" (`prompts` default)
130
+ - `PI_SESSION_ID` $\to$ "Pi" (`tmux` in `$TMUX` / `prompts` default)
124
131
  - Default fallback $\to$ "Antigravity / Claude Code"
125
132
 
126
133
  Synthesize the primary triad targeting the detected harness with session-default models:
@@ -131,48 +138,56 @@ Synthesize the primary triad targeting the detected harness with session-default
131
138
 
132
139
  ### Step 3: Interactive Operator Ratification (`ask_question`)
133
140
  Invoke `ask_question` with a SINGLE concise question combining execution mode and swarm shape in the detected harness:
134
- - Option 1 (Recommended): Multi-Agent Swarm: Balanced Triad in <Detected Harness> (Architect, Auditor, Implementer with session-native models)
141
+ - Option 1 (Recommended): Multi-Agent Swarm: Balanced Triad in <Detected Harness> using harness default (`subagents` on Antigravity IDE / OpenCode Desktop, `tmux` on Codex CLI, `prompts` on Codex Desktop)
135
142
  - Option 2: Multi-Agent Swarm: Focused Duo in <Detected Harness> (Implementation Lead + Adversarial Auditor)
136
143
  - Option 3 (Deprioritized): Single-Agent Inline (Execute sequentially within current chat session; strongly discouraged for code edits to preserve orchestrator context for governance)
137
- - Option 4: Custom configuration (allows user write-in).
144
+ - Option 4: Custom configuration or mode override (`--mode prompts`, `--tmux`, `--subagent`).
138
145
 
139
146
  ### Step 4: Synthesize Swarm Specification
140
- Once ratified, Garden synthesizes the swarm configuration dynamically in memory (zero on-disk JSON). If inspectable output is needed, Garden emits to stdout or prompt cards in `/tmp/garden-<project>/`:
147
+ Once ratified, Garden synthesizes the swarm configuration dynamically in memory (zero on-disk JSON).
148
+
149
+ > [!NOTE]
150
+ > **Decoupling Triad Roles from Unique Listener IDs**: The Triad defines *roles* (`architect`, `auditor`, `implementer`) which are registered as capability tags in Rhizo (`--tags "<project>,<role>,..."`) for semantic multicast and routing (`@architect`, `@auditor`, `@implementer`). The unique listener IDs (`name` / `agent_id`) are collision-free codenames allocated dynamically via `rhizo name <project>` (e.g. `my-project-sequoia`, `my-project-kestrel`, `my-project-falcon`). Never assume static role names as unique listener IDs.
151
+
152
+ In Tier 1 harnesses (Google Antigravity, OpenCode, Pi), workers register with the host Multiplexed Router Service (`rhizo open <name>` / `rhizo session register <name>`), eliminating per-turn shell listeners. In CLI harnesses (Claude Code, Codex), workers arm single-shot listeners (`rhizo listen <name>`). If inspectable output is needed, Garden emits to stdout or prompt cards in `/tmp/garden-<project>/`:
141
153
 
142
154
  ```json
143
155
  {
144
156
  "project": "my-project",
145
157
  "created_at": "2026-09-28T12:00:00Z",
146
158
  "target_repo": "/Users/eek/Development/my-project",
147
- "orchestrator": "my-project-orchestrator",
159
+ "orchestrator": "@orchestrator",
148
160
  "workers": [
149
161
  {
150
- "name": "my-project-architect",
162
+ "name": "my-project-sequoia",
163
+ "role_slug": "architect",
151
164
  "persona": "Bramblestitch",
152
165
  "role": "Staff Systems Architect",
153
166
  "harness": "Antigravity IDE",
154
167
  "model": "Session Default (active in window/tab)",
155
- "tags": ["my-project", "systems", "architecture", "invariants"],
168
+ "tags": ["my-project", "architect", "systems", "architecture", "invariants"],
156
169
  "system_prompt": "You are Bramblestitch, Staff Systems Architect for project my-project...",
157
170
  "opposing_priority": "Structural purity, invariant guarantees, and long-term maintainability over hasty quick fixes."
158
171
  },
159
172
  {
160
- "name": "my-project-auditor",
173
+ "name": "my-project-kestrel",
174
+ "role_slug": "auditor",
161
175
  "persona": "Prickle-Thistle",
162
176
  "role": "Verification & Adversarial Auditor",
163
177
  "harness": "Claude Code CLI / Antigravity",
164
178
  "model": "Session Default (active in window/tab)",
165
- "tags": ["my-project", "qa", "audit", "verifier", "purist"],
179
+ "tags": ["my-project", "auditor", "qa", "audit", "verifier", "purist"],
166
180
  "system_prompt": "You are Prickle-Thistle, Verification & Adversarial Auditor for project my-project...",
167
181
  "opposing_priority": "Adversarial skepticism, rigorous negative controls, and proof over convenience."
168
182
  },
169
183
  {
170
- "name": "my-project-implementer",
184
+ "name": "my-project-falcon",
185
+ "role_slug": "implementer",
171
186
  "persona": "Moss-Weaver",
172
187
  "role": "DevEx & Implementation Lead",
173
188
  "harness": "Antigravity / OpenCode",
174
189
  "model": "Session Default (active in window/tab)",
175
- "tags": ["my-project", "dev", "devex", "build", "implementation"],
190
+ "tags": ["my-project", "implementer", "dev", "devex", "build", "implementation"],
176
191
  "system_prompt": "You are Moss-Weaver, DevEx & Implementation Lead for project my-project...",
177
192
  "opposing_priority": "High-velocity implementation, pragmatic delivery, and developer ergonomics."
178
193
  }
@@ -327,6 +327,9 @@ Rejection is the low-friction fast path whenever ANY doubt, defect, green mirage
327
327
  Approval is intentionally high-friction and evidence-bound. Running `vine audit approve` strictly requires `--evidence "..."` citing specific changed file basenames, provider->consumer call-sites, and negative control assertions from the diff:
328
328
  `vine audit approve <task_id> --auditor <name> --ticket <hex> --evidence "<changed files, provider->consumer call-sites, negative controls>" --listen`
329
329
  Passing vague praise or empty justifications without empirical diff citations is mechanically and procedurally rejected.
330
+
331
+ > [!NOTE]
332
+ > **Multiplexed Router vs CLI Subprocesses**: In CLI subprocess harnesses (Claude Code, Codex), `--listen` re-arms the single-shot listener upon delivering the audit decision. In Multiplexed Router harnesses (Google Antigravity, OpenCode, Pi), the session is continuously connected to the host router, so per-turn listener re-arming is not required.
330
333
  </CRITICAL>
331
334
 
332
335
  1. **Mandatory Inspection (`vine audit inspect <task_id>`)**: Before issuing any audit decision (`approve` or `reject`), the Auditor MUST execute `vine audit inspect <task_id>` to inspect the deliverable claim bundle, delivery ticket, strand git diff, and test evidence. Approving an audit blindly without inspection is strictly prohibited.
@@ -167,8 +167,11 @@ When target project workers are needed and unassigned idle cluster peers exist,
167
167
  The recipient worker inspects its local toolchain, self-selects a compatible role, adds corresponding tags (`rhizo tag add <tags>`), and replies with `WORKER_READY`.
168
168
  - **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`).
169
169
 
170
- - **Pathway B (Fresh Session Bootstrapping via Prompt Cards)**:
171
- When zero unassigned cluster listeners exist (even if workers from other projects are online) or the operator prefers isolated fresh sessions, Garden generates self-contained 10-backtick prompt cards in `/tmp/garden-<project>/` via `garden prompts` (or `garden launch`). Dedicated prompt cards are the primary and intended mechanism for spinning up workers for a new project!
170
+ - **Pathway B (Fresh Session Bootstrapping via Capability-Aware Mode)**:
171
+ 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"`):
172
+ 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`.
173
+ 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`.
174
+ 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`).
172
175
 
173
176
  <CRITICAL>
174
177
  Operator-Named Worker Delegation Mandate:
@@ -191,37 +194,39 @@ Never Hijack or Kill Another Session's Active Listener: When 'rhizo listen <agen
191
194
 
192
195
  #### Cold-Start Intake Protocol (Zero Active Workers Only)
193
196
  When an operator initiates a fresh project or requests multi-agent coordination and NO active cluster workers exist, the session MUST NOT silently guess configuration.
194
- Because the coding harness is auto-detected from the session environment (`ANTIGRAVITY_APP_DIR` $\to$ Antigravity IDE, `CLAUDE_CODE` $\to$ Claude Code CLI, `OPENCODE_SESSION_ID` $\to$ OpenCode, `CODEX_SESSION_ID` $\to$ ChatGPT Desktop / Codex, `PI_SESSION_ID` $\to$ Pi), the orchestrator invokes `ask_question` to conduct a streamlined **Single-Question Intake Interview**:
197
+ Because the coding harness is auto-detected from the session environment (`ANTIGRAVITY_APP_DIR` $\to$ Antigravity IDE, `CLAUDE_CODE` $\to$ Claude Code CLI, `OPENCODE_DESKTOP` $\to$ OpenCode Desktop, `OPENCODE_SESSION_ID` $\to$ OpenCode, `CODEX_CLI` $\to$ Codex CLI, `CODEX_SESSION_ID` $\to$ ChatGPT Desktop / Codex, `PI_SESSION_ID` $\to$ Pi), the orchestrator invokes `ask_question` to conduct a streamlined **Single-Question Intake Interview**:
195
198
 
196
199
  1. **Single Question: Execution Mode & Swarm Shape in <Detected Harness>**:
197
- - *Option 1 (Recommended)*: Multi-Agent Swarm: Balanced Triad in <Detected Harness> (Systems Architect `@<project>-architect`, Adversarial Auditor `@<project>-auditor`, DevEx Lead `@<project>-implementer`).
198
- - *Option 2*: Multi-Agent Swarm: Focused Duo in <Detected Harness> (Implementation Lead `@<project>-implementer`, Adversarial Auditor `@<project>-auditor`).
200
+ - *Option 1 (Recommended)*: Multi-Agent Swarm: Balanced Triad in <Detected Harness> using the harness default (`subagents` on Antigravity IDE / OpenCode Desktop; `tmux` panes on Codex CLI in `tmux`; `prompts` on Codex Desktop / non-`tmux` CLI) — Systems Architect `@architect`, Adversarial Auditor `@auditor`, DevEx Lead `@implementer`; unique listener codenames allocated via `rhizo name <project>`.
201
+ - *Option 2*: Multi-Agent Swarm: Focused Duo in <Detected Harness> (Implementation Lead `@implementer`, Adversarial Auditor `@auditor`; unique listener codenames allocated via `rhizo name <project>`).
199
202
  - *Option 3 (Deprioritized)*: Single-Agent Inline (Execute sequentially within current chat session; strongly discouraged for code edits to preserve orchestrator context for governance).
200
- - *Option 4*: Custom Swarm (Operator specifies custom roles or cross-harness distribution).
203
+ - *Option 4*: Custom Swarm / Mode Override (Operator specifies custom roles, `--mode prompts`, `--tmux`, or cross-harness distribution).
201
204
 
202
205
  <CRITICAL>
203
- Sovereign Dedicated Sessions Only (Universal Subagent & Tmux Prohibition):
204
- Swarm workers are ALWAYS sovereign, independent interactive sessions (dedicated terminal tabs or IDE windows) bootstrapped via copy-paste prompt cards wrapped in 10 backticks. Harness-internal subagents (e.g. Antigravity's `invoke_subagent`, Claude Code's `Task`, OpenCode subtasks, Cursor sub-composers) are STRICTLY PROHIBITED as swarm workers across all harnesses. Internal subagents are ephemeral, cannot maintain continuous background listeners, and cause severe context poisoning. Terminal multiplexers (tmux) are unsupported. NEVER offer or present "subagents" or "tmux" as options during intake.
206
+ Capability-Aware Worker Execution & Opaque-Subagent Prohibition:
207
+ Match the execution mechanism to what the active harness makes live, inspectable, and directly chat-steerable for the operator:
208
+ - **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.
209
+ - **OpenCode CLI (TUI)**: Defaults to drillable child sessions (`subagents`) or opt-in `tmux` split panes (`--tmux`).
210
+ - **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`.
211
+ - **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`).
212
+ - **Opaque CLI Subagents Prohibited as Swarm Workers**: Headless/non-interactive subagent tools (such as Claude Code `Task` jobs where the user cannot drill in and chat mid-flight) MUST NEVER be used as swarm workers and remain restricted to transient read-only inspections.
205
213
  </CRITICAL>
206
214
 
207
215
  <CRITICAL>
208
216
  Session Default Models (Standalone Model Quizzes Prohibited):
209
- Swarm workers operate in sovereign interactive sessions and inherit whatever foundation model is active in that harness session (e.g., Gemini in Antigravity, Claude in Claude Code, configured workspace models in OpenCode). NEVER present a separate question asking the operator to choose "Foundation Model Pairings". In prompt cards, model configuration defaults to `"Session Default (active in window/tab)"`.
217
+ Swarm workers inherit whatever foundation model is active in that harness session (e.g., Gemini in Antigravity, Claude in Claude Code, configured workspace models in OpenCode). NEVER present a separate question asking the operator to choose "Foundation Model Pairings". In prompt cards and subagent briefs, model configuration defaults to `"Session Default (active in window/tab)"`.
210
218
  </CRITICAL>
211
219
 
212
- #### Automatic Fulfillment & 10-Backtick Prompt Generation:
220
+ #### Automatic Fulfillment & Worker Launch:
213
221
  Upon receiving the operator's response:
214
222
  1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
215
- 2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and session-default models (zero on-disk JSON).
216
- 3. Run `garden prompts` which writes individual prompt cards to `/tmp/garden-<project>/<worker>.md` and all cards to `/tmp/garden-<project>/all-workers.md`.
217
- 4. Present the operator with concise setup instructions with clickable prompt file paths (NEVER paste prompt cards inline in chat):
218
- ```text
219
- 1. Open X terminal tabs or windows in your detected coding harness.
220
- 2. Pass each worker's prompt card into its session (e.g. paste or reference /tmp/garden-<project>/<worker>.md).
221
- 3. Once launched, tell me here (or I will automatically detect them online via `rhizo who`).
222
- ```
223
- 5. Register the orchestrator's presence (`rhizo open <project>-orchestrator`) and arm the listener.
224
- 6. Poll or await cluster readiness gate (`rhizo who --json`) before proceeding to Phase 3.
223
+ 2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and resolved execution mode (`auto`, `subagents`, `tmux`, or `prompts`).
224
+ 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>/`.
225
+ 4. Launch or instruct based on the resolved mode:
226
+ - **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`.
227
+ - **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>`.
228
+ - **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.
229
+ 5. Verify cluster readiness (`rhizo who --json`) before proceeding to Phase 3.
225
230
 
226
231
 
227
232
  ---
@@ -368,11 +373,15 @@ The Adversarial Auditor ONLY inspects and ratifies/rejects Key 3 (`vine audit in
368
373
  </CRITICAL>
369
374
 
370
375
  <INVARIANT>
371
- Sovereign Session & Subagent Prohibition: Swarm workers are ALWAYS sovereign, independent interactive sessions (dedicated terminal tabs, CLI windows, or IDE sessions) bootstrapped via Garden 10-backtick prompt cards. Harness-internal subagents (e.g., Antigravity's 'invoke_subagent', Claude Code's 'Task', OpenCode subagents, Cursor sub-composers) are STRICTLY PROHIBITED from acting as cluster swarm workers across all harnesses. Internal subagents are ephemeral, terminate upon single-task completion, cannot maintain persistent blocking listeners ('rhizo listen'), corrupt workspace isolation, and cause severe context poisoning by dumping execution traces back into the parent prompt. When orchestrating or bootstrapping a swarm, an orchestrator must NEVER spawn internal subagents and must NEVER offer "subagents" as a worker execution option during intake.
376
+ 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:
377
+ 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).
378
+ 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`.
379
+ 3. Top-Level Prompt Cards (`prompts` — Default on Codex Desktop & non-`tmux` CLI): Independent interactive windows bootstrapped via Garden 10-backtick prompt cards.
380
+ Opaque, non-interactive CLI subagents (such as headless `Task` jobs that cannot be drilled into or steered) are STRICTLY PROHIBITED as cluster swarm workers.
372
381
  </INVARIANT>
373
382
 
374
383
  <INVARIANT>
375
- 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`). Harness-internal subagents (e.g. `invoke_subagent`, `Task`, `Agent`) must NEVER be used to fulfill cluster swarm roles; they are restricted solely to transient, single-turn ad-hoc inspections in non-swarm solo chats when the operator explicitly requests a "subagent" by name.
384
+ 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.
376
385
  </INVARIANT>
377
386
 
378
387
  <INVARIANT>
@@ -382,8 +391,8 @@ Zero Theatrical Dialogue: Every dialectical assertion must be substantiated with
382
391
  <CRITICAL>
383
392
  Worker Autonomous Execution Invariant (GVR-017):
384
393
  Swarm workers are sovereign, autonomous implementers, not passive chatbots.
385
- When 'rhizo listen' delivers an incoming task and exits, workers MUST NOT wait for an operator prompt or ask "Shall I begin?".
386
- They MUST immediately transition to active execution: claim the task, enter the isolated Vine strand, perform the work, submit the strand for independent audit ('vine submit'), report results, and re-arm the single-shot listener before concluding their turn. Remember: THE WORKER IS NOT THE AUDITOR; an independent adversarial auditor must review and ratify Key 3 ('vine audit approve').
394
+ When a directive is delivered (unblocking 'rhizo listen' in CLI harnesses, or streamed directly via the Multiplexed Router in Antigravity, OpenCode, and Pi), workers MUST NOT wait for an operator prompt or ask "Shall I begin?".
395
+ They MUST immediately transition to active execution: claim the task, enter the isolated Vine strand, perform the work, submit the strand for independent audit ('vine submit'), report results, and re-arm their single-shot listener (CLI harnesses) or resume listening via the Multiplexed Router before concluding their turn. Remember: THE WORKER IS NOT THE AUDITOR; an independent adversarial auditor must review and ratify Key 3 ('vine audit approve').
387
396
  </CRITICAL>
388
397
 
389
398
  <CRITICAL>
@@ -442,7 +451,7 @@ Context compaction purges detailed operational invariants, ceremony rules, and p
442
451
  <!-- END_SWARM_RUNTIME_STATE -->
443
452
 
444
453
  3. **Resurrected Agent Invariant**:
445
- Upon waking from compaction, the agent MUST immediately read the required skills, re-arm its single-shot listener (`rhizo listen <agent>`), check `implementation_plan.md`, and resume work under full ceremony discipline.
454
+ Upon waking from compaction, the agent MUST immediately read the required skills, verify its listener or session registration (`rhizo listen <agent>` in CLI harnesses or `rhizo open <agent>` in Multiplexed Router harnesses), check `implementation_plan.md`, and resume work under full ceremony discipline.
446
455
  </CRITICAL>
447
456
 
448
457
  ---
@@ -455,7 +464,7 @@ To prevent silent deadlocks when workers stall, crash, or fail to re-arm listene
455
464
  - **Escalate Immediately**: Prompt the operator via `ask_question` with the diagnostic status.
456
465
  - **Actionable Remediation**: Offer options to (1) re-arm the listener in the worker's terminal session (`rhizo listen <worker>`), (2) reboot the agent harness, or (3) reassign the task via `rhizo reroute <worker> <new_worker>`.
457
466
  3. **Orchestrator Self-Audit Watchdog (ONLY for OpenAI Codex / ChatGPT)**:
458
- - **Antigravity & OpenCode Exemption**: In Google Antigravity and OpenCode, DO NOT schedule timers or cron tasks (`schedule(...)`). Antigravity natively and reactively receives incoming messages via the continuous background ear (`--agy-ear`) and `agentapi send-message`.
467
+ - **Antigravity & OpenCode Exemption**: In Google Antigravity and OpenCode, DO NOT schedule timers or cron tasks (`schedule(...)`). Antigravity natively and reactively receives incoming messages via the host Multiplexed Router Service (`rhizo router`) and session registry (`agentapi send-message`).
459
468
  - **Codex / ChatGPT Watchdog Only**: In OpenAI Codex Desktop / CLI where background processes cannot reactively wake the harness, arm a scheduled watchdog timer or cron job with stepped backoff (15m $\rightarrow$ 30m $\rightarrow$ 60m $\rightarrow$ 120m $\rightarrow$ Stand Down at check 4).
460
469
  - **Reset Invariant**: Resets immediately to base 15m (streak 0) on any listener failure, unread inbox backlog, outbound task dispatch (`rhizo send`/`enqueue`), worker reply, or user chat prompt.
461
470
  - When the timer fires in Codex, execute the short check: `rhizo watchdog check --agent <orchestrator> --json` and follow `next_action` (`SCHEDULE_TIMER` or `STAND_DOWN`).
@@ -12,33 +12,41 @@ description: "Generates and formats X distinct copy-pasteable bootstrap prompts
12
12
 
13
13
  ## 1. System Philosophy & Invariants
14
14
 
15
- 1. **Human-in-the-Loop Sovereign Session Autonomy**:
16
- - Terminal multiplexers (tmux) are unsupported. We do not blindly spawn tmux background processes or attempt to drive terminal multiplexers with fragile subshell scripting.
17
- - Workers run in sovereign, independent interactive sessions (dedicated terminal tabs or IDE windows) in the operator's active coding harness.
18
- 2. **Prompt Card Temp File Delivery (Zero Chat Flooding)**:
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.
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
+ Run `garden launch --tmux` to spawn one `tmux` window/pane per worker running `codex` / `opencode` / `claude` pointed at `/tmp/garden-<project>/<worker>.md`.
21
+ - **Pathway 3 (Default on Codex Desktop & Non-`tmux` CLI): 10-Backtick Prompt Cards (`prompts`)**:
22
+ Workers run in top-level interactive sessions bootstrapped from 10-backtick prompt cards in `/tmp/garden-<project>/<worker>.md`.
23
+ 2. **Prompt Card & Subagent Brief Temp File Delivery (Zero Chat Flooding)**:
19
24
  <CRITICAL>
20
- `garden prompts` and `garden launch` automatically write worker prompt cards to `/tmp/garden-<project>/<worker-name>.md` and a combined roster to `/tmp/garden-<project>/all-workers.md`.
25
+ `garden prompts` and `garden launch` automatically write worker prompt cards to `/tmp/garden-<project>/<worker-name>.md`, subagent briefs to `/tmp/garden-<project>/subagent-<worker-name>.md`, and a combined roster to `/tmp/garden-<project>/all-workers.md`.
21
26
  Orchestrator agents MUST NEVER dump thousands of lines of prompt text inline into the chat conversation. Dumping cards inline exhausts token context budgets, causes scrolling fatigue, and triggers chat UI rendering bugs.
22
- Instead, orchestrators MUST output concise session assignments with clickable file links (e.g. `/tmp/garden-<project>/<worker>.md`).
27
+ Instead, orchestrators MUST output concise session assignments with clickable file links (e.g. `/tmp/garden-<project>/<worker>.md` or `[Persona (@name)](conversation://<id>)`).
23
28
  Inside the generated files and when `--inline` is passed, blocks are wrapped in 10 backticks (``````````markdown) to protect nested markdown and shell code blocks.
24
29
  </CRITICAL>
25
- 3. **Single-Shot Listener Discipline**:
30
+ 3. **Listener Discipline & Multiplexed Router**:
26
31
  <CRITICAL>
27
- Inside worker prompts, `rhizo listen <name>` must always be presented as a single-shot, blocking foreground command with zero timeout (infinite wait).
28
- NEVER wrap `rhizo listen` in a shell loop (`while true; do rhizo listen; done` or `until rhizo listen; do ...`). Loops trap message payloads inside unmonitored subshell logs and hang coordination.
32
+ Coordination operates in two harness-specific listener models:
33
+ - **Multiplexed Router Harnesses (Google Antigravity, OpenCode, Pi)**: Sessions register via `rhizo open <name> "<tags>"` or `rhizo session register <name> --tags "<tags>"`. One singleton `rhizo router` service listens for all agents on the machine and routes messages directly to the right session/conversation ID, while hooks and CLI commands automatically update `rhizo:agent:<name>` and `rhizo:agy_host:<machine_id>` whenever the language server address or CSRF token changes. Agents in these harnesses DO NOT need to run blocking `rhizo listen <name>` subprocesses every turn!
34
+ - **CLI Subprocess Harnesses (Claude Code, Codex, Generic Shells)**: Inside worker prompts, `rhizo listen <name>` must always be presented as a single-shot, blocking foreground command with zero timeout (infinite wait). NEVER wrap `rhizo listen` in a shell loop (`while true; do rhizo listen; done` or `until rhizo listen; do ...`). Loops trap message payloads inside unmonitored subshell logs and hang coordination.
29
35
  </CRITICAL>
30
36
  4. **Worker Autonomous Execution Invariant (GVR-017)**:
31
37
  <CRITICAL>
32
38
  Swarm workers operate as sovereign, autonomous implementers, not passive chatbots.
33
- When 'rhizo listen' unblocks and exits, a directive has been delivered!
39
+ When a directive arrives (unblocking 'rhizo listen' in CLI harnesses, or streamed directly via the Multiplexed Router in Antigravity, OpenCode, and Pi), a directive has been delivered!
34
40
  Workers MUST NOT wait for operator intervention or ask "Shall I start?".
35
- They MUST immediately inspect the delivered directive, claim the task, switch to their isolated Vine strand, execute the requested work, submit the strand for independent audit ('vine submit'), report results, and re-arm their single-shot listener. Remember: THE WORKER IS NOT THE AUDITOR; an independent adversarial auditor must review and ratify Key 3 ('vine audit approve').
41
+ They MUST immediately inspect the delivered directive, claim the task, switch to their isolated Vine strand, execute the requested work, submit the strand for independent audit ('vine submit'), report results, and re-arm their single-shot listener (CLI harnesses) or resume listening via the Multiplexed Router. Remember: THE WORKER IS NOT THE AUDITOR; an independent adversarial auditor must review and ratify Key 3 ('vine audit approve').
36
42
  </CRITICAL>
37
43
  5. **Zero Dirty Commits**:
38
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).
39
- 6. **Sovereign Dedicated Session Invariant (Universal Subagent Prohibition)**:
45
+ 6. **Capability-Aware Subagent & Session Invariant**:
40
46
  <CRITICAL>
41
- Swarm workers are ALWAYS sovereign, independent interactive sessions (separate terminal tabs or IDE windows) bootstrapped via Garden 10-backtick prompt cards. Harness-internal subagents (e.g. Antigravity's `invoke_subagent`, Claude Code's `Task`, OpenCode subtasks, Cursor sub-composers) are STRICTLY FORBIDDEN from acting as swarm workers. Prompt cards are generated strictly for human operators to paste into separate sessions. The orchestrator must NEVER attempt to automate prompt cards by feeding them into internal subagents.
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.
48
+ - **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
+ - **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.
42
50
  </CRITICAL>
43
51
  7. **Closed-Circuit & Holistic Integration Invariant**:
44
52
  <CRITICAL>
@@ -47,11 +55,11 @@ description: "Generates and formats X distinct copy-pasteable bootstrap prompts
47
55
 
48
56
  8. **Mutual Arrival Handshake Invariant**:
49
57
  <CRITICAL>
50
- Swarm workers MUST NEVER boot into silent, passive blocking listeners.
58
+ Swarm workers MUST NEVER boot into silent, passive states.
51
59
  Turn 1 of every worker prompt card mandates executing the Mutual Arrival Handshake:
52
60
  `rhizo send --to "@<orchestrator>" --subject "WORKER_READY" --body "..."`
53
- This broadcast guarantees that the Orchestrator's background listener is immediately woken upon session initialization.
54
- Conversely, the Lead Orchestrator MUST arm its background listener (`rhizo listen <orchestrator>`) in the exact turn that prompt cards are emitted to prevent bootstrap deadlocks.
61
+ This broadcast guarantees that the Orchestrator is immediately notified upon session initialization.
62
+ Conversely, in CLI subprocess harnesses, the Lead Orchestrator MUST arm its background listener (`rhizo listen <orchestrator>`) in the exact turn that prompt cards are emitted to prevent bootstrap deadlocks. In Multiplexed Router harnesses (Antigravity, OpenCode, Pi), the orchestrator session is automatically registered via `rhizo open` / `rhizo session register` with the host `rhizo router` service.
55
63
  </CRITICAL>
56
64
 
57
65
  ---
@@ -96,38 +104,41 @@ Run `garden prompts` (or `garden launch`) from the project root:
96
104
  # Output all worker prompts to terminal (and optionally write to file):
97
105
  garden prompts --write garden-prompts.md
98
106
 
99
- # Or generate for a specific worker:
100
- garden prompts --worker <project>-architect # (or suffix shorthand: --worker architect)
107
+ # Or generate for a specific worker or role:
108
+ garden prompts --role architect # Filter by triad role
109
+ garden prompts --worker <unique_id> # Or filter by unique codename
101
110
  ```
102
111
 
103
- Garden automatically synthesizes the standard balanced triad with procedurally generated whimsical entities (e.g. botanical spirits, clockwork automatons, mythical cryptids):
104
- - `@<project>-architect` (e.g. Bramblestitch / Cogswell Pendulum - Staff Systems Architect)
105
- - `@<project>-auditor` (e.g. Prickle-Thistle / Grumblewick Snark - Verification & Adversarial Auditor)
106
- - `@<project>-implementer` (e.g. Moss-Weaver / Sprocket-Hop - DevEx & Implementation Lead)
112
+ Garden automatically synthesizes the standard balanced triad with procedurally generated whimsical entities and unique listener codenames (e.g. botanical spirits, clockwork automatons, mythical cryptids):
113
+ - `@architect` tag (e.g. Bramblestitch - Staff Systems Architect; unique listener ID: `<project>-sequoia`)
114
+ - `@auditor` tag (e.g. Prickle-Thistle - Verification & Adversarial Auditor; unique listener ID: `<project>-kestrel`)
115
+ - `@implementer` tag (e.g. Moss-Weaver - DevEx & Implementation Lead; unique listener ID: `<project>-falcon`)
107
116
 
108
117
  ### Step 2: Present & Paste Prompts into Sessions
109
118
  The Orchestrator presents the generated prompt blocks to the operator with clear, structured guidance:
110
119
 
111
120
  1. **Numbered Terminal Tab / Session Instructions**:
112
121
  Provide a concise setup list instructing the operator on how many sessions to open and which harness/model to configure for each:
113
- - **Session 1 (@<project>-architect)**: e.g. Antigravity IDE (Window 1) or Claude Code CLI (Tab 1) $\to$ Paste Card 1
114
- - **Session 2 (@<project>-auditor)**: e.g. Claude Code CLI (Tab 2) or Antigravity IDE (Window 2) $\to$ Paste Card 2
115
- - **Session 3 (@<project>-implementer)**: e.g. Antigravity IDE (Window 3) or OpenCode $\to$ Paste Card 3
122
+ - **Session 1 (@architect / <unique_id>)**: e.g. Antigravity IDE (Window 1) or Claude Code CLI (Tab 1) $\to$ Paste Card 1
123
+ - **Session 2 (@auditor / <unique_id>)**: e.g. Claude Code CLI (Tab 2) or Antigravity IDE (Window 2) $\to$ Paste Card 2
124
+ - **Session 3 (@implementer / <unique_id>)**: e.g. Antigravity IDE (Window 3) or OpenCode $\to$ Paste Card 3
116
125
  2. **Harness & Model Agnostic Flexibility**:
117
126
  Explicitly reassure the operator: *"Workers can run in ANY coding harness (Antigravity, Claude Code, OpenCode, Pi, Cursor) and inherit the active model configured in that window/session. Coordination occurs strictly over Rhizo (local Redis) and Vine (Rift strands)."*
118
127
  3. **Temp File Links (Zero Inline Chat Flooding)**:
119
- NEVER paste the multi-page prompt card bodies inline into chat. Output the concise list of workers with clickable file links:
120
- - **@<project>-architect**: `/tmp/garden-<project>/<project>-architect.md`
121
- - **@<project>-auditor**: `/tmp/garden-<project>/<project>-auditor.md`
122
- - **@<project>-implementer**: `/tmp/garden-<project>/<project>-implementer.md`
128
+ NEVER paste the multi-page prompt card bodies inline into chat. Output the concise list of workers with clickable file links (written with both role slug and unique ID):
129
+ - **Architect**: `/tmp/garden-<project>/architect-<unique_id>.md` and `/tmp/garden-<project>/<unique_id>.md`
130
+ - **Auditor**: `/tmp/garden-<project>/auditor-<unique_id>.md` and `/tmp/garden-<project>/<unique_id>.md`
131
+ - **Implementer**: `/tmp/garden-<project>/implementer-<unique_id>.md` and `/tmp/garden-<project>/<unique_id>.md`
123
132
  - **All Combined**: `/tmp/garden-<project>/all-workers.md`
124
133
  4. **Immediate Autonomous Onboarding**:
125
134
  Each prompt instructs the pasted session to immediately:
126
135
  - `cd "<project_dir>"`
127
- - `export RHIZO_AGENT_NAME="<name>"`
128
- - `rhizo open "<name>" "<tags>"`
129
- - `rhizo hook install --codex --agent "<name>"` (if running in Codex CLI/Desktop)
130
- - `rhizo listen "<name>"` (blocking foreground command with infinite wait)
136
+ - `export RHIZO_AGENT_ID="<unique_id>"`
137
+ - `export RHIZO_AGENT_NAME="<unique_id>"`
138
+ - `rhizo open "<unique_id>" "<tags>"` (registers session in Redis registry with host Multiplexed Router)
139
+ - `rhizo hook install --antigravity --agent "<unique_id>"` (if running in Antigravity IDE)
140
+ - `rhizo hook install --codex --agent "<unique_id>"` (if running in Codex CLI/Desktop)
141
+ - `rhizo listen "<unique_id>"` (ONLY in CLI harnesses: Claude Code, Codex, Generic Shells)
131
142
  5. **Scheduled Health Check Template (ONLY for OpenAI Codex / ChatGPT CLI)**:
132
143
  In Google Antigravity (using the continuous ambient ear and hooks) and OpenCode (using background ear), DO NOT configure scheduled tasks; reactive event/hook streams handle wakeups natively.
133
144
  In Codex Desktop / CLI where sessions cannot wake from background process exits without external stimulation, prompts include the bulletproof 4-step template:
@@ -26,7 +26,11 @@ The Lead Orchestrator provisions an independent Adversarial Auditor persona to i
26
26
  <CRITICAL>
27
27
  Delegation Precedence & Operator-Named Worker Mandate:
28
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
- Cluster workers operate exclusively in dedicated, sovereign sessions bootstrapped via 10-backtick prompt cards. NEVER spawn harness-internal subagents (e.g. `invoke_subagent`, `Task`, OpenCode subtasks) to act as cluster workers. Internal subagents are ephemeral, cannot maintain persistent blocking listeners, and cause severe context poisoning. Harness-internal subagents are restricted solely to transient, single-turn ad-hoc inspections in non-swarm solo chats when the operator explicitly specifies the word "subagent".
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.
31
+ - **Codex CLI (`tmux`) / CLI with `--tmux`**: Spawn `tmux` windows via `garden launch --tmux`.
32
+ - **Codex Desktop & Non-`tmux` CLI (`prompts`)**: Bootstrap top-level sessions via 10-backtick prompt cards in `/tmp/garden-<project>/`.
33
+ 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.
30
34
  Furthermore, when the operator explicitly requests or names a worker or peer session (e.g. 'u + autopxd-architect' or 'assign to worker-1'), the Lead Orchestrator MUST dispatch directly to that named recipient over Rhizo (`rhizo send --to <worker> ...`). The orchestrator MUST NEVER gate delegation on whether that worker appears in local single-project `rhizo who`, and MUST NEVER fall back to internal subagents. When inspecting the cluster roster for active workers, an orchestrator MUST query `rhizo who --all --json` (or check specific peers via `rhizo who <worker>` / `rhizo probe <worker>`). Never assume the cluster is empty based solely on local single-project `rhizo who` output.
31
35
  </CRITICAL>
32
36
 
@@ -114,17 +118,22 @@ Context compaction purges detailed operational invariants, ceremony rules, and p
114
118
  <!-- END_SWARM_RUNTIME_STATE -->
115
119
 
116
120
  3. **Resurrected Agent Invariant**:
117
- Upon waking from compaction, the agent MUST immediately read the required skills, re-arm its single-shot listener (`rhizo listen <agent>`), check `implementation_plan.md`, and resume work under full ceremony discipline.
121
+ Upon waking from compaction, the agent MUST immediately read the required skills, verify its listener or session registration (`rhizo listen <agent>` in CLI harnesses or `rhizo open <agent>` in Multiplexed Router harnesses), check `implementation_plan.md`, and resume work under full ceremony discipline.
118
122
  </CRITICAL>
119
123
 
120
124
  <CRITICAL>
121
125
  Orchestrator Turn-End Listener Invariant (GVR-014):
122
- Coding harnesses (Antigravity, Claude Code, OpenCode) are event-driven: when the model yields a turn with text output, execution is completely suspended. Redis inbox state changes CANNOT wake an idle harness without an active child process registered in the task manager.
123
-
124
- Whenever the Lead Orchestrator dispatches a task, broadcasts instructions, awaits worker responses, or emits worker prompt cards ('garden prompts' / 'garden launch'), THE FINAL ACTION OF THAT TURN MUST BE ARMING A BACKGROUND LISTENER:
125
- `run_command(CommandLine="rhizo listen <orchestrator>", IsDaemon=false, WaitMsBeforeAsync=500)`
126
-
127
- FORBIDDEN: Never yield the conversation turn to the operator after dispatching work or emitting prompt cards without an active background listener running. Yielding a turn without a listener severs the swarm's physical lifeline, trapping worker replies and mutual arrival handshakes ('WORKER_READY') in Redis and causing silent swarm deadlocks.
126
+ Coding harnesses operate in two distinct coordination modes:
127
+ 1. **Multiplexed Router Harnesses (Google Antigravity, OpenCode, Pi)**:
128
+ The orchestrator session registers its identity via `rhizo open <orchestrator>` or `rhizo session register <orchestrator>`.
129
+ A single singleton host Multiplexed Router Service (`rhizo router`) manages all message listening and routing on the host, directing worker arrival handshakes (`WORKER_READY`), gate reports, and task replies directly to the orchestrator's session/conversation ID.
130
+ Hooks (`rhizo hook install --antigravity`) and CLI calls automatically refresh the token and address registry (`rhizo:agent:<name>`, `rhizo:agy_host:<machine_id>`) whenever the language server address or CSRF token changes.
131
+ Orchestrators in these harnesses DO NOT need to spawn blocking `rhizo listen` subprocesses at the end of every turn!
132
+ 2. **CLI Subprocess Harnesses (Claude Code, Codex, Generic Shells)**:
133
+ Coding harnesses are event-driven: when the model yields a turn with text output, execution is completely suspended. Redis inbox state changes CANNOT wake an idle harness without an active child process registered in the task manager.
134
+ Whenever the Lead Orchestrator in a CLI subprocess harness dispatches a task, broadcasts instructions, awaits worker responses, or emits worker prompt cards ('garden prompts' / 'garden launch'), THE FINAL ACTION OF THAT TURN MUST BE ARMING A BACKGROUND LISTENER:
135
+ `run_command(CommandLine="rhizo listen <orchestrator>", IsDaemon=false, WaitMsBeforeAsync=500)`
136
+ FORBIDDEN: Never yield the conversation turn to the operator after dispatching work or emitting prompt cards without an active background listener running in CLI subprocess harnesses. Yielding a turn without a listener severs the swarm's physical lifeline, trapping worker replies and mutual arrival handshakes ('WORKER_READY') in Redis and causing silent swarm deadlocks.
128
137
 
129
138
  Safety Net (In-Flight Task Liveness Probe & Watchdog Protocol):
130
139
  - **Antigravity & OpenCode Idle Exemption**: When idle or waiting for routine replies in Google Antigravity (using background `run_command(CommandLine="rhizo listen <orchestrator>", IsDaemon=false, WaitMsBeforeAsync=500)`) and OpenCode (using background ear), DO NOT schedule recurring cron timers. Antigravity's task manager natively and reactively resumes execution on process exit when `rhizo listen` delivers a message.
@@ -267,9 +276,10 @@ Depending on the task distribution model in `implementation_plan.md`:
267
276
 
268
277
  - **Direct Assignment (O2O)**:
269
278
  ```bash
270
- rhizo send --to <project>-architect \
279
+ rhizo send --to @architect \
271
280
  --subject "Task 1.1: Core Data Structures" \
272
281
  --body '{"task_id": "task-core-ds", "instructions": "Implement AST node kinds and message serializers. Use vine strand.", "strand": "strand/task-core-ds"}'
282
+ # (Can also address worker by unique listener codename: rhizo send --to <unique_id> ...)
273
283
  ```
274
284
 
275
285
  - **Competing-Consumers Work Queue**:
@@ -279,12 +289,13 @@ Depending on the task distribution model in `implementation_plan.md`:
279
289
  --body '{"task_id": "task-test-harness", "strand": "strand/task-test-harness"}'
280
290
  ```
281
291
 
282
- - **Mandatory Turn-End Listener Arming**:
283
- Immediately after executing `rhizo send` or `rhizo enqueue`, arm your single-shot background listener before completing your turn:
284
- ```bash
285
- run_command(CommandLine="rhizo listen <project>-orchestrator", IsDaemon=false, WaitMsBeforeAsync=500)
286
- ```
287
- *(Never end your turn without this active background task; without it, worker gate reports cannot wake you up).*
292
+ - **Mandatory Turn-End Listener Arming / Router Verification**:
293
+ - In **Multiplexed Router Harnesses** (Google Antigravity, OpenCode, Pi): Your session is already registered with the singleton `rhizo router` via `rhizo open <orchestrator>` or `rhizo session register`. Incoming worker responses, arrival handshakes, and gate reports stream directly into your context. Spawning per-turn blocking `rhizo listen` subprocesses is NOT required.
294
+ - In **CLI Subprocess Harnesses** (Claude Code, Codex, Generic Shells): Immediately after executing `rhizo send` or `rhizo enqueue`, arm your single-shot background listener before completing your turn:
295
+ ```bash
296
+ run_command(CommandLine="rhizo listen <project>-orchestrator", IsDaemon=false, WaitMsBeforeAsync=500)
297
+ ```
298
+ *(Never end your turn in CLI harnesses without this active background task; without it, worker gate reports cannot wake you up).*
288
299
 
289
300
  ### SOP 2: Monitoring Swarm Health, Watchdog & Escalation (GVR-011)
290
301
  Check active workers and cluster status:
@@ -34,22 +34,22 @@ The generated implementation plan must follow this exact template:
34
34
  # Implementation Plan: [Feature / Project Name]
35
35
 
36
36
  ## 1. Swarm Roster & Role Mapping
37
- | Worker Name | Persona | Role | Assigned Subsystems |
38
- | :--- | :--- | :--- | :--- |
39
- | `<project>-architect` | Bramblestitch (or topical spirit) | Staff Systems Architect | Core data structures, API contracts |
40
- | `<project>-auditor` | Prickle-Thistle (or topical spirit) | Refactoring Purist | Unit tests, negative controls, linter |
41
- | `<project>-implementer` | Moss-Weaver (or topical spirit) | DevEx & Implementation Lead | CLI commands, adapters, docs |
37
+ | Swarm Role (@tag) | Unique Listener Codename | Persona | Role Title | Assigned Subsystems |
38
+ | :--- | :--- | :--- | :--- | :--- |
39
+ | `@architect` | `<project>-sequoia` | Bramblestitch (or topical spirit) | Staff Systems Architect | Core data structures, API contracts |
40
+ | `@auditor` | `<project>-kestrel` | Prickle-Thistle (or topical spirit) | Verification & Adversarial Auditor | Unit tests, negative controls, Key 3 audit |
41
+ | `@implementer` | `<project>-falcon` | Moss-Weaver (or topical spirit) | DevEx & Implementation Lead | CLI commands, adapters, docs |
42
42
 
43
43
  ---
44
44
 
45
45
  ## 2. Distributed Locking & Concurrency Schedule
46
46
  Before modifying any shared or non-mergeable file, the designated worker must obtain an atomic lease:
47
47
  - **Lock Target**: `file:src/config.nim`
48
- - *Owner*: `<project>-architect`
48
+ - *Owner*: `@architect` (`<project>-sequoia`)
49
49
  - *Command*: `rhizo lock file:src/config.nim 600 --fencing`
50
50
  - *Monotonic Fencing Counter*: Record token in task execution log.
51
51
  - **Lock Target**: `file:migrations/001_schema.sql`
52
- - *Owner*: `<project>-implementer`
52
+ - *Owner*: `@implementer` (`<project>-falcon`)
53
53
  - *Command*: `rhizo lock file:migrations/001_schema.sql 300 --fencing`
54
54
 
55
55
  ---
@@ -77,6 +77,7 @@ For all parallel development tracks:
77
77
  # Or to reject if defects are found:
78
78
  vine audit reject <task_id> --auditor <auditor> --ticket <hex> --reason "<findings>" --listen
79
79
  ```
80
+ *(Note: In Multiplexed Router harnesses such as Google Antigravity, OpenCode, and Pi, per-turn `--listen` re-arming is handled automatically by the host `rhizo router` service).*
80
81
  Remember: THE WORKER IS NOT THE AUDITOR. Auditors NEVER use `--force` and NEVER act as release/merge clerks (no editing `ROADMAP.md`, no resolving `CHANGELOG.md` merge conflicts, and no weaving on behalf of workers).
81
82
  4. **Trunk Weaving & DAG Cascading (Lead Orchestrator Role)**:
82
83
  *Fast-forwards ratified branch into epic/<slug> or main, automatically calls `rhizo task complete <task_id>`, and unblocks downstream DAG child tasks (`BLOCKED` $\rightarrow$ `QUEUED`):*
@@ -89,14 +90,14 @@ For all parallel development tracks:
89
90
  ## 4. Phase-by-Phase Task Checklist
90
91
 
91
92
  ### Phase 0: Contract Skeleton (Pre-Plan Stage 3.5 on `epic/<slug>`)
92
- - [x] **Task 0.1: Contract Skeleton Strand & Red Tests** (`<project>-architect`)
93
+ - [x] **Task 0.1: Contract Skeleton Strand & Red Tests** (`@architect`)
93
94
  - *Strand*: `strand/task-<slug>-skeleton` (`--parent epic/<slug>`)
94
95
  - *Committed Deliverables*: Idiomatic types, interfaces, and callable stubs with `UNIMPLEMENTED_CONTRACT` in `src/types.nim`, `src/api.nim`
95
96
  - *Committed Contract Tests*: `tests/test_contract.nim` asserting contract compliance (failing red against stubs)
96
97
  - *Weave*: `vine submit --skeleton && vine audit inspect task-<slug>-skeleton && vine audit approve task-<slug>-skeleton && vine weave`
97
98
 
98
99
  ### Phase 1: Core Engine Primitives (Branching off `epic/<slug>`)
99
- - [ ] **Task 1.1: Core Data Structures** (`<project>-architect`)
100
+ - [ ] **Task 1.1: Core Data Structures** (`@architect`)
100
101
  - *Strand*: `strand/task-core-ds` (`--parent epic/<slug>`)
101
102
  - *Anchored Skeleton Symbols*: `src/types.nim:15-80` (`ASTNode`, `NodeKind`, `serializeNode`)
102
103
  - *Contract Test Suite*: `tests/test_contract.nim` (must turn from red to green)
@@ -107,7 +108,7 @@ For all parallel development tracks:
107
108
  - *Holistic Verification*: Real AST nodes evaluate in full parser pipeline (no dummy mocks)
108
109
  - *Weave*: `vine submit && vine audit inspect task-core-ds && vine audit approve && vine weave && rhizo unlock file:src/types.nim`
109
110
 
110
- - [ ] **Task 1.2: Test Harness & Negative Controls** (`<project>-auditor`)
111
+ - [ ] **Task 1.2: Test Harness & Negative Controls** (`@auditor`)
111
112
  - *Strand*: `strand/task-test-harness` (`--parent epic/<slug>`)
112
113
  - *Provider*: `tests/test_harness.py`
113
114
  - *Consumer / Call-Site*: Wire test runner into CI workflow and `tests/all.py`