@axiomantic/garden 0.2.32 → 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>
@@ -406,18 +411,20 @@ They MUST immediately transition to active execution: claim the task, enter the
406
411
  </CRITICAL>
407
412
 
408
413
  <CRITICAL>
409
- Closed-Circuit Two-Point Diff, Literal Fidelity & Holistic Integration Invariant:
414
+ Closed-Circuit Two-Point Diff, Literal Fidelity, 3-Checkpoint Anti-Heuristic Quality Gate & Holistic Integration Invariant:
410
415
  1. Two-Point Diff Mandate: Never build isolated code in a vacuum. Every deliverable must exhibit a Two-Point Diff: the Provider (new capability) and the Consumer (live production call-site, router, UI canvas, or CLI entrypoint). Modules that are only imported by their own test suites are strictly prohibited as incomplete shelfware.
411
- 2. Holistic Integration (Anti-Stub / Anti-Toy): The implementation must holistically integrate into the live application—it must never be a toy, stub, mock, or hollow heuristic approximation.
412
- 3. Literal Fidelity & True-Fidelity Mandate (Anti-Approximation): When recreating, porting, reverse-engineering, duplicating functionality from an existing reference, or executing an operator directive where fidelity is expected:
413
- - "Approximate", "looks right", "heuristic shortcut", "gist-level", or "good enough for happy paths" implementations are STRICTLY REJECTED.
414
- - The implementation must be literally and precisely the thing that was asked for, matching all edge cases, type boundaries, flags, and error flows.
415
- 4. Aggressive Replacement Purge: Any existing code, configurations, or fallbacks meant to be replaced or upgraded MUST BE DELETED immediately in the same strand; hoarding dead code, maintaining vestigial fallbacks, or leaving commented-out logic in the codebase is strictly prohibited.
416
- 5. Structural Assertion Rigor: Partial or loose assertions ("loosey goosey" tests like `assert 'foo' in bar`) are strictly forbidden. Tests must assert complete object equality (`assert actual == expected`) and cover negative controls.
416
+ 2. Holistic Integration (Anti-Stub / Anti-Toy / Zero Silent Mock Fallbacks): The implementation must holistically integrate into the live application—it must never be a toy, stub, mock, or silent mock fallback (`BLOCKER: MISSING_DEPENDENCY` required instead).
417
+ 3. Three-Checkpoint Anti-Heuristic Quality Gate (Gates A, B, C — Pillar 6):
418
+ - **Gate A (Design / Task-Spec / Addendum Gate)**: Reject (`CRIT-HEURISTIC-SPEC`) any design doc, task spec, or addendum prescribing arbitrary "sufficiency" cutoffs, magic count/score/hop thresholds, word/substring/prefix matching to classify intent or decide control flow where structural AST/type/schema/state-machine/model evaluation belongs, hardcoded canned templates, or static word-blacklist pseudo-gates.
419
+ - **Gate B (Worker Decision-Mechanism Disclosure)**: Implementers must disclose every new conditional branch, classifier, or stopping condition and its structural invariant in Section 2.5 of their Deliverable Claim Bundle.
420
+ - **Gate C (Key 3 Six-Pillar Audit — Pillar 6 Overrides Pillar 3 Literal Fidelity)**: At Key 3 (`vine audit inspect` prints all Six Pillars), Pillar 6 (`CRIT-HEURISTIC-HANDWAVE` / `CRIT-HEURISTIC-SPEC`) strictly overrides Literal Fidelity if a task prompt/spec itself prescribed a heuristic.
421
+ 4. Literal Fidelity & True-Fidelity Mandate (Subordinate to Pillar 6): When recreating, porting, reverse-engineering, duplicating functionality from an existing reference, or executing an operator directive where fidelity is expected, the implementation must literally be the thing asked for across all edge cases, type boundaries, flags, and error flows—EXCEPT where Pillar 6 overrides a heuristic spec.
422
+ 5. Aggressive Replacement Purge: Any existing code, configurations, or fallbacks meant to be replaced or upgraded MUST BE DELETED immediately in the same strand; hoarding dead code, maintaining vestigial fallbacks, or leaving commented-out logic in the codebase is strictly prohibited.
423
+ 6. Structural Assertion Rigor: Partial or loose assertions ("loosey goosey" tests like `assert 'foo' in bar`) are strictly forbidden. Tests must assert complete object equality (`assert actual == expected`) and cover negative controls.
417
424
  </CRITICAL>
418
425
 
419
426
  <INVARIANT>
420
- Never merge code into the canonical trunk without passing the Three-Key Gate: Key 1 (mechanical merge-tree 'git merge-tree'), Key 2 (semantic test runner 'vine gate'), and Key 3 (Pre-Weave Adversarial Code Audit Pump with 0 open defects under the presumption of guilt) inside an isolated Rift strand.
427
+ Never merge code into the canonical trunk without passing the Three-Key Gate: Key 1 (mechanical merge-tree 'git merge-tree'), Key 2 (semantic test runner 'vine gate'), and Key 3 (Six-Pillar Pre-Weave Adversarial Code Audit Pump including Pillar 6 Anti-Heuristic with 0 open defects under the presumption of guilt) inside an isolated Rift strand.
421
428
  </INVARIANT>
422
429
 
423
430
  <FORBIDDEN>
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.32",
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": {
@@ -38,26 +38,27 @@ graph TD
38
38
  <CRITICAL>
39
39
  Mandatory Independent Auditor Role (Key 3 Invariant):
40
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
- 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>'.
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 Six Pillars (including Pillar 6: Anti-Heuristic & Non-Arbitrary Decision Logic), and execute 'vine audit approve --auditor <name>'.
42
42
  </CRITICAL>
43
43
 
44
44
  ---
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).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: dialectical-pump
3
- description: "Drives empirical multi-perspective deliberation and synthesis across agent personas. Enforces the strict invariant that dialectical exchanges are NOT theatrical dialogue: every turn must be grounded in tool calls (reading file lines, executing tests, running benchmarks, checking git history). Operates across four sequential stages: (1) Research & Understanding Doc with Codebase Idioms and Fact-Check Gate, (2) Product & System Architecture Design Doc, (3) Adversarial Design Review, (3.5) Pre-Plan Contract Skeleton Strand on epic/<slug>, and (4) Pre-Weave Adversarial Code Audit Pump with Contract Immutability (The Third Key Gate: Shelfware, Heuristic Hand-Waves, Literal Fidelity & Parity, Carcass Purge, Green Mirage elimination, and Delta Re-Pump). Triggers: 'dialectical pump', 'run dialectical pump', 'pump perspectives', 'triadic deliberation', 'adversarial code audit', 'code audit pump', 'pre-weave audit', 'literal fidelity audit', 'contract skeleton'."
3
+ description: "Drives empirical multi-perspective deliberation and synthesis across agent personas. Enforces the strict invariant that dialectical exchanges are NOT theatrical dialogue: every turn must be grounded in tool calls (reading file lines, executing tests, running benchmarks, checking git history). Operates across four sequential stages: (1) Research & Understanding Doc with Codebase Idioms and Fact-Check Gate, (2) Product & System Architecture Design Doc (Gate A Anti-Heuristic Design Gate), (3) Adversarial Design Review, (3.5) Pre-Plan Contract Skeleton Strand on epic/<slug>, and (4) Pre-Weave Six-Pillar Adversarial Code Audit Pump with Contract Immutability (The Third Key Gate: Shelfware, Gate B Decision-Mechanism Disclosure, Gate C Pillar 6 Anti-Heuristic overriding Literal Fidelity, Carcass Purge, Green Mirage elimination, and Delta Re-Pump). Triggers: 'dialectical pump', 'run dialectical pump', 'pump perspectives', 'triadic deliberation', 'adversarial code audit', 'code audit pump', 'pre-weave audit', 'literal fidelity audit', 'contract skeleton'."
4
4
  ---
5
5
 
6
6
  # `dialectical-pump`: Grounded Multi-Persona Deliberation Engine
@@ -109,6 +109,7 @@ The Purist Auditor stress-tests the proposal against concrete failure modes:
109
109
  The DevEx Lead resolves the dialectic:
110
110
  - Eliminates unnecessary abstractions that create ergonomics drag.
111
111
  - Hardens the API contracts: specifies exact public types, headers/interfaces, exported procedure/function signatures, and contract test cases adhering to discovered idioms.
112
+ - Enforces **Gate A (Design & Spec Anti-Heuristic Gate)**: ensures `design.md` never prescribes arbitrary "sufficiency" thresholds, magic count/score/hop cutoffs, word/substring/prefix matching to classify intent or decide control flow where structural AST/type/schema/state-machine/model evaluation belongs, hardcoded canned templates, or static word-blacklist pseudo-gates.
112
113
  - Produces the ratified **`design.md`**.
113
114
 
114
115
  ---
@@ -116,8 +117,9 @@ The DevEx Lead resolves the dialectic:
116
117
  ## 5. Stage 3: Adversarial Review & Audit Report
117
118
 
118
119
  ### Step 3.1: Forensic Audit Inspection
119
- An Auditor persona performs a line-by-line inspection of `design.md` against single-source truth and ISO standards, generating **`audit_report.md`**:
120
- - Defect codes: `CRIT-01`, `WARN-02`, `DOC-03`.
120
+ An Auditor persona performs a line-by-line inspection of `design.md` against single-source truth, ISO standards, and **Gate A (Anti-Heuristic Design & Spec Gate)**, generating **`audit_report.md`**:
121
+ - Defect codes: `CRIT-01`, `CRIT-HEURISTIC-SPEC`, `WARN-02`, `DOC-03`.
122
+ - Any design section, contract, or task spec that prescribes heuristic hand-waves (`CRIT-HEURISTIC-SPEC`) is rejected back to Stage 2 before entering Stage 3.5 or Stage 4.
121
123
  - Root cause analysis.
122
124
  - Specific non-prescriptive recommendation options.
123
125
 
@@ -206,6 +208,10 @@ The Thesis in a code review is neither a raw dump of files nor vague conversatio
206
208
  - Consumer Call-Sites: Live production callers (CLI parser, HTTP router, UI canvas, event loop)
207
209
  - Replacement Purge: Explicit list of obsolete files, functions, or fallbacks deleted in this diff
208
210
 
211
+ ## 2.5. Decision & Transition Mechanisms (Anti-Heuristic Disclosure — Gate B)
212
+ - Conditional Branches / Classifiers / Stopping Conditions: Every new branch, classifier, state transition, or loop exit added in this strand
213
+ - Structural / Invariant Mechanism: Exact AST/type/schema/state-machine/model evaluation backing each decision (confirming zero arbitrary "sufficiency" cutoffs, magic count thresholds, word/substring control-flow matching, canned templates, or static word-blacklist pseudo-gates)
214
+
209
215
  ## 3. Test Evidence & Assertion Rigor
210
216
  - Test Suite Executed: Exact command and execution time
211
217
  - Assertion Style: Complete structural equality (`assert actual == expected`) or tripwire snapshots
@@ -216,9 +222,9 @@ The Thesis in a code review is neither a raw dump of files nor vague conversatio
216
222
  - Unreleased Entry: Exact entry recorded under `## [Unreleased]` via `vine changelog`
217
223
  ```
218
224
 
219
- ### Step 4.2: The Five-Pillar Forensic Code Audit (Antithesis)
225
+ ### Step 4.2: The Six-Pillar Forensic Code Audit (Antithesis)
220
226
 
221
- The Auditor executes the following checks against the Claim Bundle and the strand diff (`git diff origin/main...HEAD`):
227
+ The Auditor executes the following checks against the Claim Bundle and the strand diff (`git diff origin/main...HEAD`, inspected via `vine audit inspect` which emits the Six-Pillar rubric):
222
228
 
223
229
  #### Pillar 0: Changelog Gate & Release Discipline
224
230
  - [ ] **Changelog Updated**: If the project contains a changelog (`CHANGELOG.md`, `changelog.md`, etc.), verify that the strand diff modifies it under `## [Unreleased]`.
@@ -230,21 +236,20 @@ The Auditor executes the following checks against the Claim Bundle and the stran
230
236
  - [ ] **Import Audit**: Is the provider module imported and exercised outside of its own unit test files?
231
237
  - [ ] **Hermetic Shelfware Rejection**: Code tested only by its own unit tests is rejected back to the worker as incomplete shelfware (unless explicitly contracted as `[STAGED - NOT WIRED]` in `implementation_plan.md`).
232
238
 
233
- #### Pillar 2: Holistic Integration vs. Heuristic Hand-Waves & Hollow Stubs
239
+ #### Pillar 2: Holistic Integration & Zero Silent Mock Fallbacks
234
240
  - [ ] **Anti-Stub & Anti-Toy Check**: Does the implementation handle real application state, real network/file I/O, and real concurrent events?
235
241
  - [ ] **No Hollow Mocks in Production**: Reject artificial `sleep()` calls, hardcoded success responses, or fake test doubles in production paths.
236
242
  - [ ] **Absolute Ban on Silent Mock Fallbacks (`BLOCKER: MISSING_DEPENDENCY`)**: Strictly prohibit inventing silent mock fallbacks (e.g. `lesMockFallback`, synthetic mock questionnaires, or dummy stub responses) when an external dependency, hardware target, API key, or neural model is unavailable. If a dependency cannot be satisfied, the worker MUST immediately halt execution and emit a formal blocker (`BLOCKER: MISSING_DEPENDENCY`). Sweeping missing dependencies under the rug with silent fake mocks is grounds for immediate audit rejection (`CRIT-MOCK-FALLBACK`).
237
- - [ ] **Anti-Defeat-Device & Anti-Theatrical Interceptor Mandate**: Strictly reject prompt keyword interceptors (e.g. `if 'flight game' in q or 'webworker' in q`) and theatrical mock questionnaires in generic runtimes that bypass genuine neural/radar/algorithmic pipelines to fake benchmark compliance. This is a critical `CRIT-DEFEAT-DEVICE` defect requiring complete elimination.
238
- - [ ] **Autonomous Intensive Audit Mandate**: Intensive audits are Standard Operating Procedure (SOP) and pre-authorized. Auditors must execute without requesting operator confirmation or input.
243
+ - [ ] **Autonomous Intensive Audit Mandate**: Intensive Six-Pillar audits are Standard Operating Procedure (SOP) and pre-authorized. Auditors must execute without requesting operator confirmation or input.
239
244
  - [ ] **Brittle String-Split Hacks**: Reject naive string splits (`str.split(" ")[0]`) pretending to parse structured protocols or payloads; compliant lexers/parsers must be used.
240
245
  - [ ] **Swallowed Exceptions**: Reject empty `except: pass` or `catch: discard` blocks that sweep real error conditions under the rug.
241
246
 
242
- #### Pillar 3: Literal Fidelity & Reference Parity Mandate (Anti-Approximation)
247
+ #### Pillar 3: Literal Fidelity & Reference Parity Mandate (Subordinate to Pillar 6)
243
248
  <CRITICAL>
244
- Literal Fidelity & True-Fidelity Mandate:
249
+ Literal Fidelity & True-Fidelity Mandate (Subordinate to Pillar 6):
245
250
  When a deliverable is recreating, porting, reverse-engineering, duplicating functionality from an existing reference, or executing an operator directive where fidelity is expected:
246
251
  1. Anti-Approximation Rule: "Approximate", "looks right", "heuristic shortcut", "gist-level", or "good enough for happy paths" implementations are STRICTLY REJECTED.
247
- 2. Literal Specification Adherence: The implementation must be literally and precisely the thing that was asked for. The auditor must verify compliance against every specified edge case, type boundary, flag interaction, return semantic, and error flow of the original reference or operator prompt.
252
+ 2. Literal Specification Adherence: The implementation must be literally and precisely the thing that was asked for—EXCEPT where the task prompt, spec, or addendum itself prescribed a heuristic hand-wave, in which case Pillar 6 (Anti-Heuristic) strictly overrides Literal Fidelity (`CRIT-HEURISTIC-SPEC`).
248
253
  3. Zero Corner-Cutting: Tedious, difficult, or complex cases cannot be hand-waved away or substituted with shallow shortcuts.
249
254
  4. Empirical Parity Testing: Wherever a reference implementation or specification exists, the audit requires characterization tests, golden file outputs, or structural round-trip comparisons proving exact functional parity.
250
255
  </CRITICAL>
@@ -266,6 +271,17 @@ Assertion Rigor & Anti-Green-Mirage Mandate:
266
271
  4. Zero Happy-Path-Only Testing: Boundary values (empty, 0, 1, max, unicode, timeout, disconnection) must be explicitly exercised.
267
272
  </CRITICAL>
268
273
 
274
+ #### Pillar 6: Anti-Heuristic & Non-Arbitrary Decision Logic (Gate C — Overrides Pillar 3 Literal Fidelity)
275
+ <CRITICAL>
276
+ Anti-Heuristic Quality Gate (Pillar 6 Overrides Pillar 3 Literal Fidelity):
277
+ Reject (`CRIT-HEURISTIC-HANDWAVE` for unrequested heuristics; `CRIT-HEURISTIC-SPEC` when a task prompt, design spec, or addendum itself prescribed a heuristic) any strand diff that relies on:
278
+ 1. **Arbitrary "Sufficiency" Concepts & Magic Thresholds**: Magic count, score, or hop cutoffs (`count >= N`, `score > X`, `hasSufficient...`) used as a proxy for structural or semantic completeness.
279
+ 2. **Word / Substring / Prefix Matching as Control-Flow Decision Logic**: Using `contains`, `startsWith`, regex keyword bags, or static keyword lists to classify intent, infer state, or route execution where structural AST/type/schema/state-machine/model evaluation belongs.
280
+ 3. **Hardcoded Canned Templates or Domain/Benchmark Spoofing**: Emitting static canned templates or domain-specific bypass branches instead of genuine data-driven synthesis.
281
+ 4. **Static Word-Blacklist Pseudo-Gates**: Hardcoded keyword blacklists masquerading as semantic quality verification.
282
+ Workers who discover a spec violates Gate A / Pillar 6 MUST halt or escalate via `[DESIGN ADDENDUM]` rather than implementing the heuristic verbatim.
283
+ </CRITICAL>
284
+
269
285
  #### Contract Immutability & Anti-Drift Invariant
270
286
  <CRITICAL>
271
287
  Contract Immutability on Feature Integration Branches (`epic/<slug>`):
@@ -289,7 +305,7 @@ sequenceDiagram
289
305
  Note over W: Worker finishes and runs 'vine submit'
290
306
  W->>A: Submit Deliverable Claim Bundle ('vine submit')
291
307
  Note over A: Step 4.3.0: Mandatory Inspection ('vine audit inspect <task_id>')
292
- A->>A: Five-Pillar Presumption-of-Guilt Audit (Antithesis)
308
+ A->>A: Six-Pillar Presumption-of-Guilt Audit (Antithesis + Gate C)
293
309
 
294
310
  alt Findings > 0 (CRIT / HIGH / MED)
295
311
  A->>G: 'vine audit reject --ticket <hex> --reason <text>'
@@ -371,6 +387,6 @@ At the conclusion of the Dialectical Pump:
371
387
  2. `design.md` (Stage 2: Debated, hardened, and synthesized with idiomatic types & interfaces).
372
388
  3. `design_audit_report.md` (Stage 3: Design findings addressed and closed).
373
389
  4. **Committed Contract Skeleton & Red Tests on `epic/<slug>`** (Stage 3.5: Public types, callable stubs with `UNIMPLEMENTED_CONTRACT`, and red contract test suites).
374
- 5. `code_audit_report.md` (Stage 4: Pre-weave Five-Pillar audit cleared with 0 open defects under Contract Immutability).
390
+ 5. `code_audit_report.md` (Stage 4: Pre-weave Six-Pillar audit cleared with 0 open defects under Contract Immutability and Gate C Anti-Heuristic).
375
391
 
376
392
  Proceed to [`orchestrate-swarm`](../orchestrate-swarm/SKILL.md) for trunk weaving.
@@ -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>
@@ -406,18 +411,20 @@ They MUST immediately transition to active execution: claim the task, enter the
406
411
  </CRITICAL>
407
412
 
408
413
  <CRITICAL>
409
- Closed-Circuit Two-Point Diff, Literal Fidelity & Holistic Integration Invariant:
414
+ Closed-Circuit Two-Point Diff, Literal Fidelity, 3-Checkpoint Anti-Heuristic Quality Gate & Holistic Integration Invariant:
410
415
  1. Two-Point Diff Mandate: Never build isolated code in a vacuum. Every deliverable must exhibit a Two-Point Diff: the Provider (new capability) and the Consumer (live production call-site, router, UI canvas, or CLI entrypoint). Modules that are only imported by their own test suites are strictly prohibited as incomplete shelfware.
411
- 2. Holistic Integration (Anti-Stub / Anti-Toy): The implementation must holistically integrate into the live application—it must never be a toy, stub, mock, or hollow heuristic approximation.
412
- 3. Literal Fidelity & True-Fidelity Mandate (Anti-Approximation): When recreating, porting, reverse-engineering, duplicating functionality from an existing reference, or executing an operator directive where fidelity is expected:
413
- - "Approximate", "looks right", "heuristic shortcut", "gist-level", or "good enough for happy paths" implementations are STRICTLY REJECTED.
414
- - The implementation must be literally and precisely the thing that was asked for, matching all edge cases, type boundaries, flags, and error flows.
415
- 4. Aggressive Replacement Purge: Any existing code, configurations, or fallbacks meant to be replaced or upgraded MUST BE DELETED immediately in the same strand; hoarding dead code, maintaining vestigial fallbacks, or leaving commented-out logic in the codebase is strictly prohibited.
416
- 5. Structural Assertion Rigor: Partial or loose assertions ("loosey goosey" tests like `assert 'foo' in bar`) are strictly forbidden. Tests must assert complete object equality (`assert actual == expected`) and cover negative controls.
416
+ 2. Holistic Integration (Anti-Stub / Anti-Toy / Zero Silent Mock Fallbacks): The implementation must holistically integrate into the live application—it must never be a toy, stub, mock, or silent mock fallback (`BLOCKER: MISSING_DEPENDENCY` required instead).
417
+ 3. Three-Checkpoint Anti-Heuristic Quality Gate (Gates A, B, C — Pillar 6):
418
+ - **Gate A (Design / Task-Spec / Addendum Gate)**: Reject (`CRIT-HEURISTIC-SPEC`) any design doc, task spec, or addendum prescribing arbitrary "sufficiency" cutoffs, magic count/score/hop thresholds, word/substring/prefix matching to classify intent or decide control flow where structural AST/type/schema/state-machine/model evaluation belongs, hardcoded canned templates, or static word-blacklist pseudo-gates.
419
+ - **Gate B (Worker Decision-Mechanism Disclosure)**: Implementers must disclose every new conditional branch, classifier, or stopping condition and its structural invariant in Section 2.5 of their Deliverable Claim Bundle.
420
+ - **Gate C (Key 3 Six-Pillar Audit — Pillar 6 Overrides Pillar 3 Literal Fidelity)**: At Key 3 (`vine audit inspect` prints all Six Pillars), Pillar 6 (`CRIT-HEURISTIC-HANDWAVE` / `CRIT-HEURISTIC-SPEC`) strictly overrides Literal Fidelity if a task prompt/spec itself prescribed a heuristic.
421
+ 4. Literal Fidelity & True-Fidelity Mandate (Subordinate to Pillar 6): When recreating, porting, reverse-engineering, duplicating functionality from an existing reference, or executing an operator directive where fidelity is expected, the implementation must literally be the thing asked for across all edge cases, type boundaries, flags, and error flows—EXCEPT where Pillar 6 overrides a heuristic spec.
422
+ 5. Aggressive Replacement Purge: Any existing code, configurations, or fallbacks meant to be replaced or upgraded MUST BE DELETED immediately in the same strand; hoarding dead code, maintaining vestigial fallbacks, or leaving commented-out logic in the codebase is strictly prohibited.
423
+ 6. Structural Assertion Rigor: Partial or loose assertions ("loosey goosey" tests like `assert 'foo' in bar`) are strictly forbidden. Tests must assert complete object equality (`assert actual == expected`) and cover negative controls.
417
424
  </CRITICAL>
418
425
 
419
426
  <INVARIANT>
420
- Never merge code into the canonical trunk without passing the Three-Key Gate: Key 1 (mechanical merge-tree 'git merge-tree'), Key 2 (semantic test runner 'vine gate'), and Key 3 (Pre-Weave Adversarial Code Audit Pump with 0 open defects under the presumption of guilt) inside an isolated Rift strand.
427
+ Never merge code into the canonical trunk without passing the Three-Key Gate: Key 1 (mechanical merge-tree 'git merge-tree'), Key 2 (semantic test runner 'vine gate'), and Key 3 (Six-Pillar Pre-Weave Adversarial Code Audit Pump including Pillar 6 Anti-Heuristic with 0 open defects under the presumption of guilt) inside an isolated Rift strand.
421
428
  </INVARIANT>
422
429
 
423
430
  <FORBIDDEN>
@@ -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,13 +44,14 @@ 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>
51
- 7. **Closed-Circuit & Holistic Integration Invariant**:
52
+ 7. **Closed-Circuit, Holistic Integration & Anti-Heuristic Gate Invariant**:
52
53
  <CRITICAL>
53
- Swarm workers must never produce isolated shelfware or mock toys. Every task must implement both the Provider and an active Consumer call-site in live entrypoints, must holistically integrate with real application state and events, and must aggressively delete any legacy code it replaces in the same strand.
54
+ Swarm workers must never produce isolated shelfware, mock toys, or arbitrary heuristic hand-waves. Every task must implement both the Provider and an active Consumer call-site in live entrypoints, holistically integrate with real application state and events, aggressively delete any legacy code it replaces in the same strand, and pass the **3-Checkpoint Anti-Heuristic Quality Gate** (Gate A Design/Spec check, Gate B Worker Claim Bundle Decision-Mechanism Disclosure, and Gate C Key 3 Six-Pillar / Pillar 6 audit where Anti-Heuristic overrides Literal Fidelity).
54
55
  </CRITICAL>
55
56
 
56
57
  8. **Mutual Arrival Handshake Invariant**:
@@ -20,14 +20,15 @@ The main chat session assumes the role of **Lead Orchestrator**:
20
20
  <CRITICAL>
21
21
  The Worker is NOT the Auditor Invariant:
22
22
  Workers are autonomous implementers, NEVER their own auditors. When a worker completes their tasks and passes Keys 1 & 2, they MUST run 'vine submit' to mark the strand READY_FOR_AUDIT. The worker is strictly forbidden from executing 'vine audit approve' on their own work.
23
- The Lead Orchestrator provisions an independent Adversarial Auditor persona to inspect the strand, verify the Five Pillars, and run 'vine audit approve --auditor <name>'. Self-auditing is mechanically rejected by Vine (ExitGateAuditViolation = 6).
23
+ The Lead Orchestrator provisions an independent Adversarial Auditor persona to inspect the strand, verify the Six Pillars (including Pillar 6 Anti-Heuristic overriding Literal Fidelity), and run 'vine audit approve --auditor <name>'. Self-auditing is mechanically rejected by Vine (ExitGateAuditViolation = 6).
24
24
  </CRITICAL>
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,24 +43,26 @@ 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>
59
- Pre-Weave Adversarial Audit, Contract Immutability & Auditor Merge-Clerk Decoupling:
60
- The Lead Orchestrator is the final gatekeeper against hermetic shelfware, hollow mocks, superficial heuristics, benchmark defeat devices, and green mirages.
61
- Intensive Five-Pillar adversarial audits are Standard Operating Procedure (SOP). They are pre-authorized, mandatory, and autonomous across the Triad; the Orchestrator executes them automatically without prompting for human operator input.
60
+ Pre-Weave Adversarial Audit, 3-Checkpoint Anti-Heuristic Quality Gate, Contract Immutability & Auditor Merge-Clerk Decoupling:
61
+ The Lead Orchestrator is the final gatekeeper against hermetic shelfware, hollow mocks, arbitrary heuristic hand-waves, and green mirages.
62
+ Intensive Six-Pillar adversarial audits are Standard Operating Procedure (SOP). They are pre-authorized, mandatory, and autonomous across the Triad; the Orchestrator executes them automatically without prompting for human operator input.
62
63
 
64
+ 0. **Gate A (Orchestrator Task-Dispatch & Addendum Anti-Heuristic Gate — `CRIT-HEURISTIC-SPEC`)**:
65
+ Before dispatching any task spec or ratifying any `[DESIGN ADDENDUM]`, verify that the specification relies on structural AST/type/schema/state-machine/model invariants rather than arbitrary "sufficiency" cutoffs, magic count/score/hop thresholds, word/substring/prefix matching for control flow, hardcoded canned templates, or static word-blacklist pseudo-gates.
63
66
  1. Pre-Plan Contract Skeleton Ceremony (Option B):
64
67
  Before authoring `implementation_plan.md` and dispatching parallel workers, the Triad commits idiomatic public types, callable stubs (`UNIMPLEMENTED_CONTRACT`), and red contract test suites onto the feature integration branch `epic/<slug>` via `vine new task-<slug>-skeleton --parent epic/<slug>`, `vine submit --skeleton`, and Key 3 audit. Parallel implementation strands branch off `--parent epic/<slug>`.
65
68
  2. Contract Immutability:
@@ -70,14 +73,15 @@ Intensive Five-Pillar adversarial audits are Standard Operating Procedure (SOP).
70
73
  - **Auditor Merge-Clerk Decoupling**: The Adversarial Auditor ONLY inspects and ratifies/rejects Key 3 (`vine audit inspect` + `vine audit approve/reject`). The Lead Orchestrator is solely responsible for running `vine weave` after Key 3 ratification. The Orchestrator is strictly forbidden from delegating weaving (`--weave`), merge conflict resolution, `ROADMAP.md` updates, or release chores to the Adversarial Auditor. Turning the Auditor into a merge clerk biases the LLM toward rubber-stamping audits just to finish its administrative checklist.
71
74
  - **Single-Strand Audit Isolation (Anti-Batching Invariant)**: Orchestrators MUST dispatch at most ONE strand per Key 3 audit request. Batching multiple strands into a single audit message ("Audit tasks 3.1, 3.2, 3.3, 3.5") collapses LLM attention, blinds the auditor to edge cases, and causes rubber-stamping. Every strand must be audited independently in its own focused turn.
72
75
  - **Inverted Effort Gradient & Evidence Mandate**: Rejection is the fast path whenever ANY doubt or defect exists (`vine audit reject <task_id> --ticket <hex> --reason "..."`). Approval is evidence-bound and strictly requires `--evidence "..."` citing specific changed file basenames, provider->consumer call-sites, and negative control assertions from the diff (`vine audit approve <task_id> --ticket <hex> --evidence "..."`).
73
- - The independent Adversarial Auditor MUST run `vine audit inspect <task_id>` before approving. Using `--force` on audit approvals is strictly prohibited. Auditors are adversarial verifiers, NOT release or merge clerks (auditors never edit `ROADMAP.md` or resolve `CHANGELOG.md` merge conflicts on behalf of workers).
76
+ - The independent Adversarial Auditor MUST run `vine audit inspect <task_id>` before approving (which outputs the Six-Pillar rubric). Using `--force` on audit approvals is strictly prohibited. Auditors are adversarial verifiers, NOT release or merge clerks (auditors never edit `ROADMAP.md` or resolve `CHANGELOG.md` merge conflicts on behalf of workers).
74
77
 
75
- Before executing `vine weave` on any worker strand, the Orchestrator MUST enforce the Five-Pillar Pre-Weave Adversarial Audit (Key 3 of the Three-Key Gate):
78
+ Before executing `vine weave` on any worker strand, the Orchestrator MUST enforce the **Six-Pillar Pre-Weave Adversarial Audit** (Key 3 of the Three-Key Gate) plus Gate B Worker Decision-Mechanism Disclosure:
76
79
  1. Two-Point Diff: The branch modifies both a Provider and an active Consumer call-site (live router, CLI command dispatcher, UI, or event loop). Unwired modules tested solely by their own test suites are strictly rejected back to the worker as incomplete shelfware.
77
- 2. Holistic Integration & Anti-Defeat-Device: Real system behavior, state, and errors must be handled; no placeholder toys, stubs, mocks, naive string splits, or prompt keyword interceptors (e.g. 'if flight game in q'). Any prompt-matching defeat device that bypasses genuine pipelines to fake benchmark compliance is mechanically rejected at Key 2 (`ExitGateDefeatDeviceViolation` = 7) and Key 3.
78
- 3. Literal Fidelity & Reference Parity Mandate (Anti-Approximation): If the task ports, reverse-engineers, duplicates functionality from a reference, or executes a specific operator directive, it must exhibit literal, true fidelity. Approximations ("looks right", "good enough for happy paths") are strictly rejected. All edge cases, flags, type boundaries, and error flows must match the specification precisely.
80
+ 2. Holistic Integration & Zero Silent Mock Fallbacks: Real system behavior, state, and errors must be handled; no placeholder toys, stubs, mocks, naive string splits, or silent mock fallbacks (`BLOCKER: MISSING_DEPENDENCY` required instead).
81
+ 3. Literal Fidelity & Reference Parity Mandate (Subordinate to Pillar 6): If the task ports, reverse-engineers, duplicates functionality from a reference, or executes a specific operator directive, it must exhibit literal, true fidelity—EXCEPT where the prompt/spec/addendum itself prescribed a heuristic hand-wave, in which case Pillar 6 overrides Literal Fidelity (`CRIT-HEURISTIC-SPEC`).
79
82
  4. Replacement Purge: All legacy or obsolete code targeted for replacement is completely deleted in the strand diff. Preserving dead code as "fallbacks" or leaving commented-out blocks is prohibited.
80
83
  5. Structural Assertion Rigor (Anti-Green-Mirage): Reject tests relying on partial/loose assertions (`assert "foo" in bar` or `assert len(x) > 0`). Require full structural equality (`assert actual == expected`) and mandatory negative controls.
84
+ 6. Anti-Heuristic & Non-Arbitrary Decision Logic (Gate C — Overrides Pillar 3 Literal Fidelity): Reject (`CRIT-HEURISTIC-HANDWAVE` / `CRIT-HEURISTIC-SPEC`) arbitrary "sufficiency" cutoffs or magic count/score/hop thresholds, word/substring/prefix matching to classify intent or decide control flow where structural/model evaluation belongs, hardcoded canned templates, and static word-blacklist pseudo-gates. Static word-matching pseudo-gates in `vine gate` are removed; heuristic prevention operates across Gates A, B, and C.
81
85
  Contract Exception: Only foundational tasks explicitly contracted as `[STAGED - NOT WIRED]` in `implementation_plan.md` may defer consumer wiring to a scheduled follow-up wiring task in the subsequent wave.
82
86
  </CRITICAL>
83
87
 
@@ -362,6 +366,7 @@ When a worker finishes implementation in their strand, they run `vine submit --a
362
366
 
363
367
  > [!CRITICAL]
364
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.
365
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).
366
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`).
367
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):
@@ -369,14 +374,15 @@ When a worker finishes implementation in their strand, they run `vine submit --a
369
374
 
370
375
  The independent Auditor initiates **Key 3: The Pre-Weave Adversarial Code Audit Pump** under the **Presumption of Guilt**:
371
376
 
372
- 1. **Thesis Intake**: Demand the worker's **Deliverable Claim Bundle** (task contract, Two-Point Diff mapping, test evidence, negative controls, delivery ticket).
373
- 2. **Five-Pillar Presumption-of-Guilt Audit**:
377
+ 1. **Thesis Intake**: Demand the worker's **Deliverable Claim Bundle** (task contract, Two-Point Diff mapping, **Gate B Decision & Transition Mechanisms disclosure**, test evidence, negative controls, delivery ticket).
378
+ 2. **Six-Pillar Presumption-of-Guilt Audit (Gate C)**:
374
379
  - **Changelog Gate (Key 2 Interlock)**: If the repository contains a changelog (`CHANGELOG.md`, `changelog.md`, etc.), verify that changes are documented under `## [Unreleased]`. Confirm `vine gate` passed without changelog violations (or verify worker ran `vine changelog "..."`). Reject if an existing changelog is untouched unless `--allow-no-changelog` was explicitly approved.
375
380
  - **Pillar 1 (Closed-Circuit Two-Point Diff)**: Inspect strand diff against `origin/main` (`git -C "$strand_path" diff --name-only origin/main...HEAD`). Confirm both Provider and live Consumer call-sites are modified. Reject hermetic shelfware lacking a live consumer.
376
- - **Pillar 2 (Holistic Integration)**: Verify real production integration (no hollow mocks, stubs, naive string splits, or swallowed exceptions).
377
- - **Pillar 3 (Literal Fidelity & Reference Parity)**: When duplicating functionality, porting, or executing specific operator directives, demand literal true fidelity. Reject approximations ("looks right", "good enough for happy paths") and verify edge case parity against reference specifications.
381
+ - **Pillar 2 (Holistic Integration & Zero Silent Mock Fallbacks)**: Verify real production integration (no hollow mocks, stubs, naive string splits, swallowed exceptions, or silent mock fallbacks).
382
+ - **Pillar 3 (Literal Fidelity & Reference Parity — Subordinate to Pillar 6)**: When duplicating functionality, porting, or executing specific operator directives, demand literal true fidelity—EXCEPT where the task prompt/spec/addendum itself prescribed a heuristic hand-wave, in which case Pillar 6 overrides Literal Fidelity (`CRIT-HEURISTIC-SPEC`).
378
383
  - **Pillar 4 (Aggressive Replacement Purge)**: Ensure all superseded legacy code, fallbacks, and commented-out blocks are deleted in the strand.
379
384
  - **Pillar 5 (Structural Assertion Rigor)**: Reject partial/loose assertions (`assert "foo" in bar`). Mandate complete structural equality (`assert actual == expected`) and negative controls.
385
+ - **Pillar 6 (Anti-Heuristic & Non-Arbitrary Decision Logic — Overrides Pillar 3 Literal Fidelity)**: Reject (`CRIT-HEURISTIC-HANDWAVE` / `CRIT-HEURISTIC-SPEC`) any diff relying on arbitrary "sufficiency" cutoffs or magic count/score/hop thresholds, word/substring/prefix matching to classify intent or decide control flow where structural/model evaluation belongs, hardcoded canned templates, or static word-blacklist pseudo-gates.
380
386
  3. **Audit Ratification or Delta Re-Pump Loop**:
381
387
  - **Step 3.0: Mandatory Inspection & Merge-Clerk Decoupling**: The Auditor MUST run `vine audit inspect <task_id>` to review the Deliverable Claim Bundle, test results, and git diff. Blind approvals are forbidden, and `--force` is strictly prohibited. The Auditor is strictly decoupled from merge/release duties: auditors NEVER run `--weave`, NEVER edit `ROADMAP.md`, and NEVER resolve merge conflicts. Any conflict or missing changelog must be rejected back to the worker.
382
388
  - **If findings exist**: Auditor executes rejection against the delivery ticket:
@@ -415,7 +421,7 @@ Immediately after weaving:
415
421
  ### SOP 5: Handling Emergent Design Addenda
416
422
  If an incoming message contains `[DESIGN ADDENDUM]`:
417
423
  1. Read the drafted addendum: `view_file(AbsolutePath="docs/addenda/addendum_<topic>.md")`.
418
- 2. Evaluate trade-offs (performance, API impact, scope).
424
+ 2. Evaluate trade-offs (performance, API impact, scope) AND enforce **Gate A (Anti-Heuristic Addendum Gate)** (`CRIT-HEURISTIC-SPEC` if the addendum proposes arbitrary "sufficiency" cutoffs, magic thresholds, word/substring control-flow matching, canned templates, or static word-blacklist pseudo-gates).
419
425
  3. If approved:
420
426
  - Append addendum section to `design.md`.
421
427
  - Adjust downstream tasks in `implementation_plan.md`.
@@ -23,6 +23,7 @@ The Orchestrator authors `implementation_plan.md` adhering to four core invarian
23
23
  5. **Auditor Merge-Clerk Decoupling & Inverted Effort Gradient**: The independent Adversarial Auditor ONLY inspects and ratifies Key 3 (`vine audit inspect` + `vine audit approve/reject`). Rejection is the fast path for any defect (`vine audit reject`); approval requires `--evidence "..."` citing changed files, call-sites, and negative controls. Using `--force` on audit approvals is strictly prohibited. The Auditor NEVER runs `vine weave`, NEVER edits `ROADMAP.md`, and NEVER resolves `CHANGELOG.md` merge conflicts on behalf of workers. Weaving is strictly the Lead Orchestrator's role.
24
24
  6. **Zero Silent Architectural Drift**: If an implementer encounters an unforeseen constraint during coding, it cannot unilaterally alter the architecture. It must submit a formal design addendum.
25
25
  7. **Closed-Circuit Two-Point Diff & Holistic Integration**: Every task specification must declare both the **Provider** (new capability) and the active **Consumer Call-Site** (runtime entrypoint, router, UI canvas, or CLI loop). Modules tested only by isolated unit tests are strictly prohibited as incomplete shelfware. The implementation must holistically integrate with real application state and live events (no toys, stubs, mocks, or hollow approximations). Any code intended to be replaced must be explicitly scheduled for **immediate deletion** in the same strand—never kept as a vestigial fallback or commented-out logic.
26
+ 8. **Gate A: Anti-Heuristic Task-Spec & Addendum Gate (`CRIT-HEURISTIC-SPEC`)**: Every task specification and emergent design addendum in `implementation_plan.md` must specify structural AST/type/schema/state-machine/model invariants rather than arbitrary "sufficiency" concepts, magic count/score/hop thresholds, word/substring/prefix matching to decide control flow, hardcoded canned templates, or static word-blacklist pseudo-gates. Workers must disclose every new decision/transition mechanism in their Claim Bundle (Gate B), and Pillar 6 overrides Literal Fidelity at Key 3 if any spec prescribes a heuristic (Gate C).
26
27
 
27
28
  ---
28
29
 
@@ -68,7 +69,7 @@ For all parallel development tracks:
68
69
  - Run local unit tests and formatters.
69
70
  3. **Three-Key Gate Verification**:
70
71
  - **Worker**: Runs `vine submit --author <worker>` (evaluates Key 1 mechanical merge-tree + Key 2 live compiler/test suite + changelog, and stamps cryptographic delivery ticket / `gate_token`).
71
- - **Independent Auditor**: Inspects Five Pillars and runs:
72
+ - **Independent Auditor**: Inspects Six Pillars (including Pillar 6 Anti-Heuristic overriding Literal Fidelity) via `vine audit inspect <task_id>` and runs:
72
73
  ```bash
73
74
  # Step 1: Mandatory forensic inspection
74
75
  vine audit inspect <task_id>
@@ -105,6 +106,7 @@ For all parallel development tracks:
105
106
  - *Provider*: `src/types.nim` (AST node kinds and serializers)
106
107
  - *Consumer / Call-Site*: Wire into `src/parser.nim` parse loop and `src/eval.nim`
107
108
  - *Replacement Deletion*: Delete deprecated ad-hoc string tuples in `src/legacy_types.nim`
109
+ - *Decision / Transition Invariant*: Structural AST/state-machine transitions only (no arbitrary count cutoffs or word/substring matching; disclose in Claim Bundle Section 2.5)
108
110
  - *Holistic Verification*: Real AST nodes evaluate in full parser pipeline (no dummy mocks)
109
111
  - *Weave*: `vine submit && vine audit inspect task-core-ds && vine audit approve && vine weave && rhizo unlock file:src/types.nim`
110
112
 
@@ -145,7 +147,7 @@ If a worker discovers that an assumption in `design.md` is flawed or impossible
145
147
  - *Proposed Deviation*: Exact technical changes.
146
148
  - *Tradeoff Analysis*: Performance, ergonomics, backwards compatibility.
147
149
  3. Submit notification to Orchestrator via `rhizo send --to orchestrator --subject "Design Addendum: <topic>"`.
148
- 4. Orchestrator reviews and ratifies the addendum, updates `design.md`, updates `implementation_plan.md`, and replies with approval before implementation resumes.
150
+ 4. Orchestrator reviews the addendum against **Gate A (Anti-Heuristic Spec Gate)** (`CRIT-HEURISTIC-SPEC`), ratifies if clean, updates `design.md`, updates `implementation_plan.md`, and replies with approval before implementation resumes.
149
151
  ```
150
152
 
151
153
  ---