@axiomantic/garden 0.2.27 → 0.2.29

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.
@@ -89,8 +89,8 @@ Execute phases sequentially. Never skip phases or invert the order.
89
89
  | **Phase 0** | **Intake Gate** | Fast-path check (`rhizo who --json`) or single-question intake via `ask_question` calibrated to detected harness. | Active cluster workers confirmed or operator submits choice. |
90
90
  | **Phase 1** | [`choose-personas`](../choose-personas/SKILL.md) | Synthesize swarm configuration reflecting detected harness and chosen shape (zero on-disk JSON). | Swarm roles ratified. |
91
91
  | **Phase 2** | [`launch-workers`](../launch-workers/SKILL.md) | Output 10-backtick raw markdown prompt cards and numbered session instructions. | `rhizo who --json` confirms 100% of workers active & listening. |
92
- | **Phase 3** | [`dialectical-pump`](../dialectical-pump/SKILL.md) | Grounded triadic deliberation: research, design, adversarial audit. | Zero open `CRIT` or `BLOCKER` defects in `audit_report.md`. |
93
- | **Phase 4** | [`plan-implementation`](../plan-implementation/SKILL.md) | Author master implementation plan with locking schedules, strands, and Two-Point Diff contracts (Provider, Consumer, Replacement deletion). | Complete `implementation_plan.md` with task-locking matrix. |
92
+ | **Phase 3** | [`dialectical-pump`](../dialectical-pump/SKILL.md) | Grounded triadic deliberation: research (extracting codebase idioms), design (specifying exact types & interfaces), adversarial audit, and Stage 3.5 Pre-Plan Contract Skeleton Strand on `epic/<slug>`. | Zero open `CRIT` or `BLOCKER` defects in `audit_report.md` and contract skeleton committed. |
93
+ | **Phase 4** | [`plan-implementation`](../plan-implementation/SKILL.md) | Author master implementation plan anchored to committed skeleton symbols on `epic/<slug>`, locking schedules, parallel strands (`--parent epic/<slug>`), and Two-Point Diff contracts. | Complete `implementation_plan.md` with task-locking matrix and Contract Immutability. |
94
94
  | **Phase 5** | [`orchestrate-swarm`](../orchestrate-swarm/SKILL.md) | Main-chat governor: task dispatch, heartbeat monitoring, Closed-Circuit & Three-Key gate verification, trunk weaving. | All plan tasks woven via `vine weave` after passing Three-Key Gate (Mechanical, Semantic, Adversarial Audit). |
95
95
 
96
96
  ---
@@ -110,24 +110,24 @@ Instead, it acts as an **Intelligent Intake Concierge**:
110
110
  1. **Evaluate Request Scope & Blast Radius (Cold Start Only)**:
111
111
  - **High Complexity / Architectural Shifts / New Subsystems / Multi-File Migrations**: The request impacts foundational contracts, multiple modules, or shared abstractions. Requires empirical research, RFC design, adversarial review, and parallel strand isolation. Recommend **Option 1**.
112
112
  - **Medium Complexity / Well-Defined Features / Self-Contained Deliverables**: The scope is clear, boundaries are known, and it can be implemented without a 3-stage dialectical design cycle. Recommend **Option 2**.
113
- - **Low Complexity / Single-File Fixes / Documentation / Scratch Tweaks**: Trivial 1-file patch or config change. Recommend **Option 3**.
113
+ - **Low Complexity / Single-File Fixes / Documentation / Scratch Tweaks**: Even for single-file fixes or small tweaks, Single-Worker Direct Dispatch (`rhizo send` to 1 worker in a dedicated Vine strand) is strongly preferred to keep the orchestrator context window dedicated to planning and governance. Recommend **Option 2 (Single-Worker Dispatch)** or **Option 3 (Inline Execution - Non-Code / Scratch Only)**.
114
114
 
115
115
  2. **Present Interactive Triage Modal (`ask_question`)**:
116
116
  The orchestrator invokes `ask_question` with 3 mutually exclusive options clearly explaining the tradeoffs:
117
- - **Option 1 (Full Ceremony - RFE ➔ RFD ➔ RFC ➔ Swarm)**:
117
+ - **Option 1 (Full Ceremony - RFE ➔ RFD ➔ RFC ➔ Contract Skeleton Strand ➔ Swarm)**:
118
118
  *Scope*: Architectural shifts, new subsystems, major refactors, or cross-cutting migrations.
119
- *Process*: Sows the idea as a persistent roadmap seed (`garden plant`), authors the Research/RFD, System Architecture/RFC, and Adversarial Audit documents, schedules monotonic locks and isolated Vine strands, and writes worker prompts to `/tmp/garden-<project>/`.
119
+ *Process*: Sows the idea as a persistent roadmap seed (`garden plant`), authors the Research/RFD (extracting codebase idioms), System Architecture/RFC (defining exact types & interfaces), and Adversarial Audit documents, commits the Pre-Plan Contract Skeleton Strand on `epic/<slug>` with red contract tests, schedules monotonic locks and isolated Vine strands, and writes worker prompts to `/tmp/garden-<project>/`.
120
120
  - **Option 2 (Direct Swarm Dispatch)**:
121
- *Scope*: Well-defined, self-contained features, bugfixes, or bounded deliverables.
121
+ *Scope*: Well-defined, self-contained features, bugfixes, or bounded deliverables (including small or single-file changes via Single-Worker Direct Dispatch).
122
122
  *Process*: Bypasses heavy research/design documentation; enqueues tasks straight to cluster work queues (`rhizo enqueue queue:<project>:tasks`) or dispatches directly to active workers (`rhizo send <worker>`).
123
- - **Option 3 (Inline Execution)**:
124
- *Scope*: Trivial 1-file fixes, documentation, typo corrections, or quick scratch scripts.
125
- *Process*: Executes directly within the main session without provisioning worker sessions or cluster overhead.
123
+ - **Option 3 (Inline Execution - Strongly Deprioritized / Non-Code Only)**:
124
+ *Scope*: High-level planning, architectural analysis, design discussions, or non-code scratch inspection.
125
+ *Process*: Strongly discouraged for code implementation. The orchestrator context window must remain dedicated to high-level planning, analysis, and governance. Even for small or single-file code changes, Single-Worker Direct Dispatch is strongly preferred. Direct inline coding in the orchestrator is strictly deprioritized.
126
126
 
127
127
  3. **Execution Branching**:
128
128
  - **If Option 1 selected**: Run `garden plant "<prompt>"`, then proceed to Cold-Start Swarm Calibration / Phase 1 `choose-personas` (or attach to active swarm via Fast-Path) and Phase 3 `dialectical-pump`.
129
129
  - **If Option 2 selected**: Check `rhizo who --all --json`. If workers are online, dispatch via `rhizo send` or `rhizo enqueue`. If cold, run Cold-Start Swarm Calibration to spin up workers.
130
- - **If Option 3 selected**: Execute inline in the current session.
130
+ - **If Option 3 selected**: Execute inline in the current session (reserved strictly for planning, analysis, and non-code tasks).
131
131
 
132
132
  #### Adaptive Swarm On-Ramp & Dynamic Worker Repurposing (First-Look Invariant)
133
133
 
@@ -196,7 +196,7 @@ Because the coding harness is auto-detected from the session environment (`ANTIG
196
196
  1. **Single Question: Execution Mode & Swarm Shape in <Detected Harness>**:
197
197
  - *Option 1 (Recommended)*: Multi-Agent Swarm: Balanced Triad in <Detected Harness> (Systems Architect `@<project>-architect`, Adversarial Auditor `@<project>-auditor`, DevEx Lead `@<project>-implementer`).
198
198
  - *Option 2*: Multi-Agent Swarm: Focused Duo in <Detected Harness> (Implementation Lead `@<project>-implementer`, Adversarial Auditor `@<project>-auditor`).
199
- - *Option 3*: Single-Agent Inline (Execute sequentially within current chat session).
199
+ - *Option 3 (Deprioritized)*: Single-Agent Inline (Execute sequentially within current chat session; strongly discouraged for code edits to preserve orchestrator context for governance).
200
200
  - *Option 4*: Custom Swarm (Operator specifies custom roles or cross-harness distribution).
201
201
 
202
202
  <CRITICAL>
@@ -214,11 +214,11 @@ Upon receiving the operator's response:
214
214
  1. Run `garden init` if `garden.toml` or `AGENTS.md` is not yet initialized.
215
215
  2. Synthesize swarm configuration reflecting the chosen workers, roles, detected harness, and session-default models (zero on-disk JSON).
216
216
  3. Run `garden prompts` which writes individual prompt cards to `/tmp/garden-<project>/<worker>.md` and all cards to `/tmp/garden-<project>/all-workers.md`.
217
- 4. Present the operator with concise setup instructions and copy commands (NEVER paste prompt cards inline in chat):
217
+ 4. Present the operator with concise setup instructions with clickable prompt file paths (NEVER paste prompt cards inline in chat):
218
218
  ```text
219
219
  1. Open X terminal tabs or windows in your detected coding harness.
220
- 2. Copy each worker's prompt card from its file (e.g. `pbcopy < /tmp/garden-<project>/<worker>.md`) and paste into its session.
221
- 3. Once pasted, tell me here (or I will automatically detect them online via `rhizo who`).
220
+ 2. Pass each worker's prompt card into its session (e.g. paste or reference /tmp/garden-<project>/<worker>.md).
221
+ 3. Once launched, tell me here (or I will automatically detect them online via `rhizo who`).
222
222
  ```
223
223
  5. Register the orchestrator's presence (`rhizo open <project>-orchestrator`) and arm the listener.
224
224
  6. Poll or await cluster readiness gate (`rhizo who --json`) before proceeding to Phase 3.
@@ -235,26 +235,22 @@ stateDiagram-v2
235
235
  [*] --> DRAFTED : rhizo task create <id>
236
236
  DRAFTED --> BLOCKED : Unmet DAG dependencies (depends_on)
237
237
  DRAFTED --> QUEUED : Zero unmet dependencies
238
- BLOCKED --> QUEUED : Parent task COMPLETED (Auto-promoted by Lua engine)
238
+ BLOCKED --> QUEUED : Parent task COMPLETED (Auto-promoted by vine weave)
239
239
 
240
- QUEUED --> DELIVERED : Listener pops message (Transport Receipt emitted)
241
- DELIVERED --> CLAIMED : Worker acknowledges (Acquires monotonic lease)
242
- DELIVERED --> ORPHANED : Receipt timeout (180s without claim)
243
-
244
- CLAIMED --> IN_PROGRESS : Worker provisions strand (vine new <id>)
240
+ QUEUED --> IN_PROGRESS : Task claimed / delivered (rhizo claim / rhizo task claim)
245
241
  IN_PROGRESS --> IN_PROGRESS : Progress reported (rhizo task progress, lease extended)
246
242
  IN_PROGRESS --> GATE_EVALUATING : Verification initiated (vine submit / vine gate)
247
243
  IN_PROGRESS --> YIELDED : rhizo task yield (Returned to pool)
248
244
  IN_PROGRESS --> ORPHANED : Lease expires without progress
249
245
 
250
246
  GATE_EVALUATING --> IN_PROGRESS : Gate failed (Tests red, changelog missing, or merge conflict)
251
- GATE_EVALUATING --> READY_FOR_AUDIT : Keys 1 & 2 PASSED (vine submit, gate token stamped)
247
+ GATE_EVALUATING --> READY_FOR_AUDIT : Keys 1 & 2 PASSED (vine submit, delivery ticket stamped)
252
248
 
253
- READY_FOR_AUDIT --> AUDIT_RATIFIED : Key 3 PASSED (vine audit approve, audit token stamped)
254
- READY_FOR_AUDIT --> AUDIT_REJECTED : Key 3 FAILED (vine audit reject)
249
+ READY_FOR_AUDIT --> AUDIT_RATIFIED : Key 3 PASSED (vine audit approve --ticket <hex>, audit token stamped)
250
+ READY_FOR_AUDIT --> AUDIT_REJECTED : Key 3 FAILED (vine audit reject --ticket <hex> --reason "...")
255
251
  AUDIT_REJECTED --> IN_PROGRESS : Remediate defects in strand
256
252
 
257
- AUDIT_RATIFIED --> COMPLETED : vine weave && rhizo task complete (Unblocks downstream DAG children)
253
+ AUDIT_RATIFIED --> COMPLETED : vine weave (Auto-completes task via rhizo task complete & unblocks DAG children)
258
254
 
259
255
  ORPHANED --> QUEUED : Re-queued for retry (attempts < 3)
260
256
  ORPHANED --> DEAD_LETTER : Max delivery retries exceeded (attempts >= 3)
@@ -273,51 +269,42 @@ stateDiagram-v2
273
269
  +---------+ Unmet deps
274
270
  | DRAFTED | ──────────────────► [ BLOCKED ]
275
271
  +---------+ │
276
- │ Zero deps │ Parent task COMPLETED
272
+ │ Zero deps │ Parent task COMPLETED (Auto-promoted by vine weave)
277
273
  ▼ ▼
278
274
  +---------+ ◄───────────────────────+
279
275
  | QUEUED |
280
276
  +---------+
281
277
  │
282
- │ rhizo listen pops task (Transport Receipt emitted)
283
- ▼
284
- +-----------+ 180s Receipt Timeout
285
- | DELIVERED | ─────────────────────────────────► [ ORPHANED ]
286
- +-----------+ │
287
- │ │ Attempts >= 3
288
- │ rhizo task claim / rhizo reply ▼
289
- ▼ [ DEAD_LETTER ]
290
- +---------+
291
- | CLAIMED |
292
- +---------+
293
- │
294
- │ vine new <task_id> (Provision strand)
278
+ │ Task claimed / delivered (rhizo claim / rhizo task claim / rhizo send)
279
+ │ Collapses DELIVERED ➔ CLAIMED ➔ IN_PROGRESS with monotonic lease
295
280
  ▼
296
281
  +-------------+ Lease expires
297
282
  | IN_PROGRESS | ────────────────────────────────► [ ORPHANED ]
298
- +-------------+
299
- │ ▲
300
- │ vine │ Gate fails
301
- │ submit │ (Tests red or conflict)
283
+ +-------------+ │
284
+ │ ▲ │ Attempts >= 3
285
+ │ vine │ Gate fails ▼
286
+ │ submit │ (Tests red or conflict) [ DEAD_LETTER ]
302
287
  ▼ │
303
288
  +-----------------+
304
289
  | GATE_EVALUATING |
305
290
  +-----------------+
306
291
  │
307
- │ Keys 1 & 2 PASSED (vine submit: merge-tree + live test suite green)
292
+ │ Keys 1 & 2 PASSED (vine submit: delivery ticket stamped)
308
293
  ▼
309
294
  +------------------+
310
- | READY_FOR_AUDIT | ◄──────────────────────┐
311
- +------------------+ │
312
- │ │ │
313
- │ approve │ reject │ Remediate
314
- ▼ ▼ │
315
- +------------+ +----------------+ │
316
- | AUDIT_ | | AUDIT_REJECTED | ──────────┘
295
+ | READY_FOR_AUDIT | ◄──────────────────────────────┐
296
+ +------------------+ │
297
+ │ │ │
298
+ │ approve │ reject │ Remediate
299
+ │ --ticket │ --ticket │
300
+ ▼ ▼ │
301
+ +------------+ +----------------+ │
302
+ | AUDIT_ | | AUDIT_REJECTED | ──────────────────┘
317
303
  | RATIFIED | +----------------+
318
304
  +------------+
319
305
  │
320
- │ vine weave && rhizo task complete
306
+ │ vine weave (Executed by Lead Orchestrator)
307
+ │ Auto-executes rhizo task complete & unblocks DAG children
321
308
  ▼
322
309
  +-----------+
323
310
  | COMPLETED | ──► Auto-promotes BLOCKED child tasks to QUEUED!
@@ -331,19 +318,13 @@ stateDiagram-v2
331
318
  | **`DRAFTED`** | `rhizo task create <id> --title <t>` | Creates immutable task contract hash `task:<id>` in Redis. | N/A |
332
319
  | **`BLOCKED`** | Evaluated on create | Stamped if `depends_on` contains incomplete tasks. Workers cannot claim. | N/A |
333
320
  | **`QUEUED`** | Auto on create or parent complete | Pushed to queue/inbox. Available for worker consumption. | N/A |
334
- | **`DELIVERED`** | `rhizo listen` consumes payload | **Atomically moves into `task:<id>` DELIVERED state**. Instant transport receipt emitted to orchestrator. Mirrored to local `~/.config/rhizo/current_task.json` for turn-end hook interlocks. | 180s Receipt Timeout $
335
- ightarrow$ `ORPHANED` |
336
- | **`CLAIMED`** | `rhizo task claim <id>` / `rhizo reply` | Worker acquires monotonic fencing lease. Isolated Vine strand provisioned (`vine new <id>`). Turn-end hook blocks until work starts. | Lease expires $
337
- ightarrow$ `ORPHANED` |
338
- | **`IN_PROGRESS`** | Worker coding in strand | Enforces single-active-lease invariant. Periodic `rhizo task progress` extends lease. | Lease expires $
339
- ightarrow$ `ORPHANED` |
321
+ | **`IN_PROGRESS`** | `rhizo task claim <id>` / `rhizo claim` / task delivery | **Collapsed claim & delivery**: Worker acquires monotonic fencing lease and enters isolated Vine strand (`vine new <id>`). Zero on-disk manifests; strand identity is stored in `.git/config` (`vine.taskId`, `vine.project`) and authoritative state in Redis. Periodic `rhizo task progress` extends lease. | Lease expires $\rightarrow$ `ORPHANED` |
340
322
  | **`GATE_EVALUATING`**| `vine submit` / `vine gate` | Key 1 (mechanical merge-tree) & Key 2 (live compiler/test suite + changelog) evaluated. | Exit 1 $\rightarrow$ `CONFLICTED`<br>Exit 2 $\rightarrow$ `GATE_FAILED` |
341
- | **`READY_FOR_AUDIT`**| `vine submit` | Keys 1 & 2 passed. Strand submitted for independent adversarial review. | N/A |
342
- | **`AUDIT_REJECTED`** | `vine audit reject` | Auditor rejected deliverable with recorded defect reasons. Worker returns to `IN_PROGRESS` for delta remediation. | N/A |
343
- | **`AUDIT_RATIFIED`** | `vine audit approve` | Key 3 passed! Cryptographic `audit_token` stamped. Auditor and author identities strictly decoupled (`auditor != author`). | N/A |
344
- | **`COMPLETED`** | `vine weave && rhizo task complete` | Fast-forward merged into canonical trunk. Strand pruned. Locks released. **Downstream DAG dependencies automatically unblocked (`BLOCKED` $\rightarrow$ `QUEUED`)!** | N/A |
345
- | **`ORPHANED`** | Receipt timeout or lease expired | Stalled worker detected. Increments `delivery_attempts`. If $\ge 3
346
- ightarrow$ `DEAD_LETTER`. Otherwise returns to `QUEUED`. | Escalates to operator if Dead-Lettered |
323
+ | **`READY_FOR_AUDIT`**| `vine submit` | Keys 1 & 2 passed. Cryptographic delivery ticket (`gate_token`) stamped into strand state. Strand submitted for independent adversarial review. | N/A |
324
+ | **`AUDIT_REJECTED`** | `vine audit reject <task_id> --auditor <name> --ticket <hex> --reason "..." --listen` | Auditor rejected deliverable with recorded defect reasons against delivery ticket. Worker returns to `IN_PROGRESS` for delta remediation. | N/A |
325
+ | **`AUDIT_RATIFIED`** | `vine audit approve <task_id> --auditor <name> --ticket <hex> --evidence "..." [--listen]` | Key 3 passed! Cryptographic delivery ticket verified and `audit_token` stamped. Auditor and author identities strictly decoupled (`auditor != author`). Auditor NEVER weaves. | N/A |
326
+ | **`COMPLETED`** | `vine weave` | Fast-forward merged into canonical trunk by the Lead Orchestrator. Strand pruned. Locks released. **`vine weave` automatically invokes `rhizo task complete`**, auto-promoting downstream DAG dependencies (`BLOCKED` $\rightarrow$ `QUEUED`)! | N/A |
327
+ | **`ORPHANED`** | Lease expired without progress | Stalled worker detected. Increments `delivery_attempts`. If $\ge 3 \rightarrow$ `DEAD_LETTER`. Otherwise returns to `QUEUED`. | Escalates to operator if Dead-Lettered |
347
328
  | **`YIELDED`** | `rhizo task yield <id>` | Worker gracefully steps aside. Task returned to `QUEUED`. | N/A |
348
329
  | **`DEAD_LETTER`** | Retries exhausted ($\ge 3$) | Moved to dead-letter queue. Alerts orchestrator and operator. | Requires manual operator triage |
349
330
 
@@ -357,15 +338,33 @@ The primary conversation session acts as the Lead Orchestrator. The orchestrator
357
338
 
358
339
  <CRITICAL>
359
340
  Orchestrator Intake Gate & Non-Implementation Invariant (GVR-016):
360
- The Lead Orchestrator is a CONDUCTOR, NOT A CODER.
341
+ The Lead Orchestrator is a CONDUCTOR, NOT A CODER. The orchestrator context window must remain dedicated to high-level planning, architectural analysis, and governance.
361
342
  Whenever the operator presents a task, feature request, bugfix, or asks to work on something:
362
343
  THE ORCHESTRATOR MUST NEVER DIRECTLY JUMP INTO CODE EDITING OR IMPLEMENTATION TOOLS (e.g. `write_to_file`, `replace_file_content`).
363
344
  Instead, it MUST STOP and ask the operator how they want the work routed using `ask_question`:
364
345
  - Option 1 (Recommended): Enqueue to Cluster Work Queue (`rhizo enqueue queue:<project>:tasks --subject "..." --body "..."`) for background cluster workers.
365
- - Option 2: Dispatch directly to an active cluster worker (`rhizo send <worker> --subject "..." --body "..."`).
366
- - Option 3: Execute inline in main chat (only if the operator explicitly selects/confirms this option).
346
+ - Option 2: Dispatch directly to an active cluster worker (`rhizo send <worker> --subject "..." --body "..."`). Single-Worker Direct Dispatch in a dedicated Vine strand is strongly preferred even for small or single-file changes.
347
+ - Option 3 (Strongly Deprioritized): Execute inline in main chat (strictly reserved for non-code planning/analysis, or only if the operator explicitly commands direct inline coding).
348
+
349
+ This intake gate applies to ANY request to "work on X", "build Y", "fix Z", or "implement feature W". Direct inline code editing is prohibited unless the operator explicitly directs the orchestrator to code it inline in the main session.
350
+ </CRITICAL>
367
351
 
368
- This intake gate applies to ANY request to "work on X", "build Y", "fix Z", or "implement feature W". Direct inline implementation is prohibited unless the operator explicitly directs the orchestrator to code it inline in the main session.
352
+ <INVARIANT>
353
+ Pre-Plan Contract Skeleton Ceremony (Option B):
354
+ 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>'.
355
+ </INVARIANT>
356
+
357
+ <CRITICAL>
358
+ Contract Immutability & Anti-Mock-Fallback:
359
+ Workers branching off '--parent epic/<slug>' MUST NOT alter exported contract signatures or weaken contract tests without an approved '[DESIGN ADDENDUM]'. Workers are strictly prohibited from implementing silent mock fallbacks (e.g. 'lesMockFallback'); missing dependencies require halting immediately with 'BLOCKER: MISSING_DEPENDENCY'.
360
+ </CRITICAL>
361
+
362
+ <CRITICAL>
363
+ Auditor Merge-Clerk Decoupling & Inverted Effort Gradient:
364
+ 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.
365
+ - Single-Strand Audit Isolation: Orchestrators MUST dispatch at most ONE strand per Key 3 audit request. Batching multiple strands into a single audit message is strictly prohibited.
366
+ - Inverted Effort Gradient: 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 "..."`).
367
+ - The independent 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.
369
368
  </CRITICAL>
370
369
 
371
370
  <INVARIANT>
@@ -403,7 +402,7 @@ Never merge code into the canonical trunk without passing the Three-Key Gate: Ke
403
402
  </INVARIANT>
404
403
 
405
404
  <FORBIDDEN>
406
- Never stage coordination metadata (*.lock, .rhizo.*, .vine.json, workspaces/) into Git. Keep all agent state ignored.
405
+ Never stage coordination metadata (*.lock, .rhizo.*, 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). Keep all agent state ignored.
407
406
  </FORBIDDEN>
408
407
 
409
408
  <CRITICAL>
@@ -456,7 +455,7 @@ To prevent silent deadlocks when workers stall, crash, or fail to re-arm listene
456
455
  - **Escalate Immediately**: Prompt the operator via `ask_question` with the diagnostic status.
457
456
  - **Actionable Remediation**: Offer options to (1) re-arm the listener in the worker's terminal session (`rhizo listen <worker>`), (2) reboot the agent harness, or (3) reassign the task via `rhizo reroute <worker> <new_worker>`.
458
457
  3. **Orchestrator Self-Audit Watchdog (ONLY for OpenAI Codex / ChatGPT)**:
459
- - **Antigravity & OpenCode Exemption**: In Google Antigravity and OpenCode, DO NOT schedule timers or cron tasks (`schedule(...)`). Antigravity natively and reactively wakes up on background process completion when `rhizo listen` delivers a message.
458
+ - **Antigravity & OpenCode Exemption**: In Google Antigravity and OpenCode, DO NOT schedule timers or cron tasks (`schedule(...)`). Antigravity natively and reactively receives incoming messages via the continuous background ear (`--agy-ear`) and `agentapi send-message`.
460
459
  - **Codex / ChatGPT Watchdog Only**: In OpenAI Codex Desktop / CLI where background processes cannot reactively wake the harness, arm a scheduled watchdog timer or cron job with stepped backoff (15m $\rightarrow$ 30m $\rightarrow$ 60m $\rightarrow$ 120m $\rightarrow$ Stand Down at check 4).
461
460
  - **Reset Invariant**: Resets immediately to base 15m (streak 0) on any listener failure, unread inbox backlog, outbound task dispatch (`rhizo send`/`enqueue`), worker reply, or user chat prompt.
462
461
  - When the timer fires in Codex, execute the short check: `rhizo watchdog check --agent <orchestrator> --json` and follow `next_action` (`SCHEDULE_TIMER` or `STAND_DOWN`).
@@ -19,7 +19,7 @@ description: "Generates and formats X distinct copy-pasteable bootstrap prompts
19
19
  <CRITICAL>
20
20
  `garden prompts` and `garden launch` automatically write worker prompt cards to `/tmp/garden-<project>/<worker-name>.md` and a combined roster to `/tmp/garden-<project>/all-workers.md`.
21
21
  Orchestrator agents MUST NEVER dump thousands of lines of prompt text inline into the chat conversation. Dumping cards inline exhausts token context budgets, causes scrolling fatigue, and triggers chat UI rendering bugs.
22
- Instead, orchestrators MUST output concise session assignments with clickable file links and OS-calibrated clipboard copy commands (e.g. `pbcopy < /tmp/garden-<project>/<worker>.md`).
22
+ Instead, orchestrators MUST output concise session assignments with clickable file links (e.g. `/tmp/garden-<project>/<worker>.md`).
23
23
  Inside the generated files and when `--inline` is passed, blocks are wrapped in 10 backticks (``````````markdown) to protect nested markdown and shell code blocks.
24
24
  </CRITICAL>
25
25
  3. **Single-Shot Listener Discipline**:
@@ -35,7 +35,7 @@ description: "Generates and formats X distinct copy-pasteable bootstrap prompts
35
35
  They MUST immediately inspect the delivered directive, claim the task, switch to their isolated Vine strand, execute the requested work, submit the strand for independent audit ('vine submit'), report results, and re-arm their single-shot listener. Remember: THE WORKER IS NOT THE AUDITOR; an independent adversarial auditor must review and ratify Key 3 ('vine audit approve').
36
36
  </CRITICAL>
37
37
  5. **Zero Dirty Commits**:
38
- - Never stage coordination state (`.rhizo.*`, `*.lock`, `.vine.json`, `workspaces/`) into Git.
38
+ - Never stage coordination state (`.rhizo.*`, `*.lock`, `workspaces/`) into Git. Vine stores strand identity in `.git/config` (`vine.taskId`, `vine.project`) and authoritative state in Redis (zero state files in the working tree).
39
39
  6. **Sovereign Dedicated Session Invariant (Universal Subagent Prohibition)**:
40
40
  <CRITICAL>
41
41
  Swarm workers are ALWAYS sovereign, independent interactive sessions (separate terminal tabs or IDE windows) bootstrapped via Garden 10-backtick prompt cards. Harness-internal subagents (e.g. Antigravity's `invoke_subagent`, Claude Code's `Task`, OpenCode subtasks, Cursor sub-composers) are STRICTLY FORBIDDEN from acting as swarm workers. Prompt cards are generated strictly for human operators to paste into separate sessions. The orchestrator must NEVER attempt to automate prompt cards by feeding them into internal subagents.
@@ -115,11 +115,11 @@ The Orchestrator presents the generated prompt blocks to the operator with clear
115
115
  - **Session 3 (@<project>-implementer)**: e.g. Antigravity IDE (Window 3) or OpenCode $\to$ Paste Card 3
116
116
  2. **Harness & Model Agnostic Flexibility**:
117
117
  Explicitly reassure the operator: *"Workers can run in ANY coding harness (Antigravity, Claude Code, OpenCode, Pi, Cursor) and inherit the active model configured in that window/session. Coordination occurs strictly over Rhizo (local Redis) and Vine (Rift strands)."*
118
- 3. **Temp File Links & Clipboard Copy Commands (Zero Inline Chat Flooding)**:
119
- NEVER paste the multi-page prompt card bodies inline into chat. Output the concise list of workers with clickable file links and OS-calibrated clipboard copy commands:
120
- - **@<project>-architect**: `pbcopy < /tmp/garden-<project>/<project>-architect.md`
121
- - **@<project>-auditor**: `pbcopy < /tmp/garden-<project>/<project>-auditor.md`
122
- - **@<project>-implementer**: `pbcopy < /tmp/garden-<project>/<project>-implementer.md`
118
+ 3. **Temp File Links (Zero Inline Chat Flooding)**:
119
+ NEVER paste the multi-page prompt card bodies inline into chat. Output the concise list of workers with clickable file links:
120
+ - **@<project>-architect**: `/tmp/garden-<project>/<project>-architect.md`
121
+ - **@<project>-auditor**: `/tmp/garden-<project>/<project>-auditor.md`
122
+ - **@<project>-implementer**: `/tmp/garden-<project>/<project>-implementer.md`
123
123
  - **All Combined**: `/tmp/garden-<project>/all-workers.md`
124
124
  4. **Immediate Autonomous Onboarding**:
125
125
  Each prompt instructs the pasted session to immediately:
@@ -129,7 +129,7 @@ The Orchestrator presents the generated prompt blocks to the operator with clear
129
129
  - `rhizo hook install --codex --agent "<name>"` (if running in Codex CLI/Desktop)
130
130
  - `rhizo listen "<name>"` (blocking foreground command with infinite wait)
131
131
  5. **Scheduled Health Check Template (ONLY for OpenAI Codex / ChatGPT CLI)**:
132
- In Google Antigravity (using background `run_command`) and OpenCode (using background ear), DO NOT configure scheduled tasks; reactive background process completion handles wakeups natively.
132
+ In Google Antigravity (using the continuous ambient ear and hooks) and OpenCode (using background ear), DO NOT configure scheduled tasks; reactive event/hook streams handle wakeups natively.
133
133
  In Codex Desktop / CLI where sessions cannot wake from background process exits without external stimulation, prompts include the bulletproof 4-step template:
134
134
  - STEP 1: Inspect completed background listener processes / hooks for unhandled delivered tasks and execute them immediately (never stay quiet with pending work).
135
135
  - STEP 2: Inspect active tasks to verify a listener is currently running, and re-arm if missing.
@@ -179,26 +179,22 @@ stateDiagram-v2
179
179
  [*] --> DRAFTED : rhizo task create <id>
180
180
  DRAFTED --> BLOCKED : Unmet DAG dependencies (depends_on)
181
181
  DRAFTED --> QUEUED : Zero unmet dependencies
182
- BLOCKED --> QUEUED : Parent task COMPLETED (Auto-promoted by Lua engine)
182
+ BLOCKED --> QUEUED : Parent task COMPLETED (Auto-promoted by vine weave)
183
183
 
184
- QUEUED --> DELIVERED : Listener pops message (Transport Receipt emitted)
185
- DELIVERED --> CLAIMED : Worker acknowledges (Acquires monotonic lease)
186
- DELIVERED --> ORPHANED : Receipt timeout (180s without claim)
187
-
188
- CLAIMED --> IN_PROGRESS : Worker provisions strand (vine new <id>)
184
+ QUEUED --> IN_PROGRESS : Task claimed / delivered (rhizo claim / rhizo task claim)
189
185
  IN_PROGRESS --> IN_PROGRESS : Progress reported (rhizo task progress, lease extended)
190
186
  IN_PROGRESS --> GATE_EVALUATING : Verification initiated (vine submit / vine gate)
191
187
  IN_PROGRESS --> YIELDED : rhizo task yield (Returned to pool)
192
188
  IN_PROGRESS --> ORPHANED : Lease expires without progress
193
189
 
194
190
  GATE_EVALUATING --> IN_PROGRESS : Gate failed (Tests red, changelog missing, or merge conflict)
195
- GATE_EVALUATING --> READY_FOR_AUDIT : Keys 1 & 2 PASSED (vine submit, gate token stamped)
191
+ GATE_EVALUATING --> READY_FOR_AUDIT : Keys 1 & 2 PASSED (vine submit, delivery ticket stamped)
196
192
 
197
- READY_FOR_AUDIT --> AUDIT_RATIFIED : Key 3 PASSED (vine audit approve, audit token stamped)
198
- READY_FOR_AUDIT --> AUDIT_REJECTED : Key 3 FAILED (vine audit reject)
193
+ READY_FOR_AUDIT --> AUDIT_RATIFIED : Key 3 PASSED (vine audit approve --ticket <hex>, audit token stamped)
194
+ READY_FOR_AUDIT --> AUDIT_REJECTED : Key 3 FAILED (vine audit reject --ticket <hex> --reason "...")
199
195
  AUDIT_REJECTED --> IN_PROGRESS : Remediate defects in strand
200
196
 
201
- AUDIT_RATIFIED --> COMPLETED : vine weave && rhizo task complete (Unblocks downstream DAG children)
197
+ AUDIT_RATIFIED --> COMPLETED : vine weave (Auto-completes task via rhizo task complete & unblocks DAG children)
202
198
 
203
199
  ORPHANED --> QUEUED : Re-queued for retry (attempts < 3)
204
200
  ORPHANED --> DEAD_LETTER : Max delivery retries exceeded (attempts >= 3)
@@ -217,51 +213,42 @@ stateDiagram-v2
217
213
  +---------+ Unmet deps
218
214
  | DRAFTED | ──────────────────► [ BLOCKED ]
219
215
  +---------+ │
220
- │ Zero deps │ Parent task COMPLETED
216
+ │ Zero deps │ Parent task COMPLETED (Auto-promoted by vine weave)
221
217
  ▼ ▼
222
218
  +---------+ ◄───────────────────────+
223
219
  | QUEUED |
224
220
  +---------+
225
221
  │
226
- │ rhizo listen pops task (Transport Receipt emitted)
227
- ▼
228
- +-----------+ 180s Receipt Timeout
229
- | DELIVERED | ─────────────────────────────────► [ ORPHANED ]
230
- +-----------+ │
231
- │ │ Attempts >= 3
232
- │ rhizo task claim / rhizo reply ▼
233
- ▼ [ DEAD_LETTER ]
234
- +---------+
235
- | CLAIMED |
236
- +---------+
237
- │
238
- │ vine new <task_id> (Provision strand)
222
+ │ Task claimed / delivered (rhizo claim / rhizo task claim / rhizo send)
223
+ │ Collapses DELIVERED ➔ CLAIMED ➔ IN_PROGRESS with monotonic lease
239
224
  ▼
240
225
  +-------------+ Lease expires
241
226
  | IN_PROGRESS | ────────────────────────────────► [ ORPHANED ]
242
- +-------------+
243
- │ ▲
244
- │ vine │ Gate fails
245
- │ submit │ (Tests red or conflict)
227
+ +-------------+ │
228
+ │ ▲ │ Attempts >= 3
229
+ │ vine │ Gate fails ▼
230
+ │ submit │ (Tests red or conflict) [ DEAD_LETTER ]
246
231
  ▼ │
247
232
  +-----------------+
248
233
  | GATE_EVALUATING |
249
234
  +-----------------+
250
235
  │
251
- │ Keys 1 & 2 PASSED (vine submit: merge-tree + live test suite green)
236
+ │ Keys 1 & 2 PASSED (vine submit: delivery ticket stamped)
252
237
  ▼
253
238
  +------------------+
254
- | READY_FOR_AUDIT | ◄──────────────────────┐
255
- +------------------+ │
256
- │ │ │
257
- │ approve │ reject │ Remediate
258
- ▼ ▼ │
259
- +------------+ +----------------+ │
260
- | AUDIT_ | | AUDIT_REJECTED | ──────────┘
239
+ | READY_FOR_AUDIT | ◄──────────────────────────────┐
240
+ +------------------+ │
241
+ │ │ │
242
+ │ approve │ reject │ Remediate
243
+ │ --ticket │ --ticket │
244
+ ▼ ▼ │
245
+ +------------+ +----------------+ │
246
+ | AUDIT_ | | AUDIT_REJECTED | ──────────────────┘
261
247
  | RATIFIED | +----------------+
262
248
  +------------+
263
249
  │
264
- │ vine weave && rhizo task complete
250
+ │ vine weave (Executed by Lead Orchestrator)
251
+ │ Auto-executes rhizo task complete & unblocks DAG children
265
252
  ▼
266
253
  +-----------+
267
254
  | COMPLETED | ──► Auto-promotes BLOCKED child tasks to QUEUED!
@@ -275,19 +262,22 @@ stateDiagram-v2
275
262
  | **`DRAFTED`** | `rhizo task create <id> --title <t>` | Creates immutable task contract hash `task:<id>` in Redis. | N/A |
276
263
  | **`BLOCKED`** | Evaluated on create | Stamped if `depends_on` contains incomplete tasks. Workers cannot claim. | N/A |
277
264
  | **`QUEUED`** | Auto on create or parent complete | Pushed to queue/inbox. Available for worker consumption. | N/A |
278
- | **`DELIVERED`** | `rhizo listen` consumes payload | **Atomically moves into `task:<id>` DELIVERED state**. Instant transport receipt emitted to orchestrator. Mirrored to local `~/.config/rhizo/current_task.json` for turn-end hook interlocks. | 180s Receipt Timeout $
279
- ightarrow$ `ORPHANED` |
280
- | **`CLAIMED`** | `rhizo task claim <id>` / `rhizo reply` | Worker acquires monotonic fencing lease. Isolated Vine strand provisioned (`vine new <id>`). Turn-end hook blocks until work starts. | Lease expires $
281
- ightarrow$ `ORPHANED` |
282
- | **`IN_PROGRESS`** | Worker coding in strand | Enforces single-active-lease invariant. Periodic `rhizo task progress` extends lease. | Lease expires $
283
- ightarrow$ `ORPHANED` |
265
+ | **`IN_PROGRESS`** | `rhizo task claim <id>` / `rhizo claim` / task delivery | **Collapsed claim & delivery**: Worker acquires monotonic fencing lease and enters isolated Vine strand (`vine new <id>`). Zero on-disk manifests; strand identity is stored in `.git/config` (`vine.taskId`, `vine.project`) and authoritative state in Redis. Periodic `rhizo task progress` extends lease. | Lease expires $\rightarrow$ `ORPHANED` |
284
266
  | **`GATE_EVALUATING`**| `vine submit` / `vine gate` | Key 1 (mechanical merge-tree) & Key 2 (live compiler/test suite + changelog) evaluated. | Exit 1 $\rightarrow$ `CONFLICTED`<br>Exit 2 $\rightarrow$ `GATE_FAILED` |
285
- | **`READY_FOR_AUDIT`**| `vine submit` | Keys 1 & 2 passed. Strand submitted for independent adversarial review. | N/A |
286
- | **`AUDIT_REJECTED`** | `vine audit reject` | Auditor rejected deliverable with recorded defect reasons. Worker returns to `IN_PROGRESS` for delta remediation. | N/A |
287
- | **`AUDIT_RATIFIED`** | `vine audit approve` | Key 3 passed! Cryptographic `audit_token` stamped. Auditor and author identities strictly decoupled (`auditor != author`). | N/A |
288
- | **`COMPLETED`** | `vine weave && rhizo task complete` | Fast-forward merged into canonical trunk. Strand pruned. Locks released. **Downstream DAG dependencies automatically unblocked (`BLOCKED` $\rightarrow$ `QUEUED`)!** | N/A |
289
- | **`ORPHANED`** | Receipt timeout or lease expired | Stalled worker detected. Increments `delivery_attempts`. If $\ge 3
290
- ightarrow$ `DEAD_LETTER`. Otherwise returns to `QUEUED`. | Escalates to operator if Dead-Lettered |
267
+ | **`READY_FOR_AUDIT`**| `vine submit` | Keys 1 & 2 passed. Cryptographic delivery ticket (`gate_token`) stamped into strand state. Strand submitted for independent adversarial review. | N/A |
268
+ | **`AUDIT_REJECTED`** | `vine audit reject <task_id> --auditor <name> --ticket <hex> --reason "..." --listen` | Auditor rejected deliverable with recorded defect reasons against delivery ticket. Worker returns to `IN_PROGRESS` for delta remediation. | N/A |
269
+ | **`AUDIT_RATIFIED`** | `vine audit approve <task_id> --auditor <name> --ticket <hex> --evidence "..." [--listen]` | Key 3 passed! Cryptographic delivery ticket verified and `audit_token` stamped. Auditor and author identities strictly decoupled (`auditor != author`). Auditor NEVER weaves. | N/A |
270
+ | **`COMPLETED`** | `vine weave` | Fast-forward merged into canonical trunk by the Lead Orchestrator. Strand pruned. Locks released. **`vine weave` automatically invokes `rhizo task complete`**, auto-promoting downstream DAG dependencies (`BLOCKED` $\rightarrow$ `QUEUED`)! | N/A |
271
+ | **`ORPHANED`** | Lease expired without progress | Stalled worker detected. Increments `delivery_attempts`. If $\ge 3 \rightarrow$ `DEAD_LETTER`. Otherwise returns to `QUEUED`. | Escalates to operator if Dead-Lettered |
291
272
  | **`YIELDED`** | `rhizo task yield <id>` | Worker gracefully steps aside. Task returned to `QUEUED`. | N/A |
292
273
  | **`DEAD_LETTER`** | Retries exhausted ($\ge 3$) | Moved to dead-letter queue. Alerts orchestrator and operator. | Requires manual operator triage |
293
274
 
275
+ ---
276
+
277
+ ## 4. Key 3 Auditor Merge-Clerk Decoupling Invariant
278
+
279
+ <CRITICAL>
280
+ Auditor Merge-Clerk Decoupling Invariant:
281
+ 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.
282
+ </CRITICAL>
283
+