@axiomantic/garden 0.2.28 → 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.
- package/README.md +3 -3
- package/SKILL.md +36 -18
- package/bin/binaries/garden-darwin-arm64 +0 -0
- package/bin/binaries/garden-darwin-x64 +0 -0
- package/bin/binaries/garden-linux-arm64 +0 -0
- package/bin/binaries/garden-linux-x64 +0 -0
- package/bin/binaries/garden-win32-x64.exe +0 -0
- package/package.json +1 -1
- package/skills/choose-personas/SKILL.md +1 -1
- package/skills/dialectical-pump/SKILL.md +126 -21
- package/skills/garden/SKILL.md +36 -18
- package/skills/launch-workers/SKILL.md +12 -3
- package/skills/orchestrate-swarm/SKILL.md +27 -11
- package/skills/plan-implementation/SKILL.md +34 -17
package/README.md
CHANGED
|
@@ -202,7 +202,7 @@ Garden authors `implementation_plan.md`:
|
|
|
202
202
|
- Sets up dynamic progress checkboxes and harness To-Do tracking.
|
|
203
203
|
|
|
204
204
|
### 6. Live Orchestration & Trunk Weaving (`orchestrate-swarm`)
|
|
205
|
-
The main chat orchestrator dispatches work over Redis. Workers code in isolated strands (where Vine tracks identity in `.git/config` and state in Redis with zero on-disk manifests), run unit tests, and verify Keys 1 & 2 via `vine submit` (which generates a cryptographic delivery ticket). An independent adversarial auditor reviews and ratifies Key 3 (`vine audit approve <task_id> --auditor <name> --ticket <hex> --
|
|
205
|
+
The main chat orchestrator dispatches work over Redis. Workers code in isolated strands (where Vine tracks identity in `.git/config` and state in Redis with zero on-disk manifests), run unit tests, and verify Keys 1 & 2 via `vine submit` (which generates a cryptographic delivery ticket). An independent adversarial auditor reviews and ratifies Key 3 (`vine audit approve <task_id> --auditor <name> --ticket <hex> --evidence "<files, call-sites, negative controls>" --listen`). When ratified, the Lead Orchestrator runs `vine weave` to fast-forward verified code into `main` with zero merge conflicts, automatically calling `rhizo task complete` and promoting downstream DAG child tasks!
|
|
206
206
|
|
|
207
207
|
---
|
|
208
208
|
|
|
@@ -281,8 +281,8 @@ The main chat orchestrator dispatches work over Redis. Workers code in isolated
|
|
|
281
281
|
The main chat session coordinates, reviews, and integrates. Intensive multi-file edits are executed by the worker fleet in isolated strands.
|
|
282
282
|
2. **Empirical Grounding Protocol (Zero Theatrical Dialogue)**:
|
|
283
283
|
Dialectical deliberations must cite hard evidence from real tool calls (line citations, test outputs, compiler errors). Theatrical roleplay is strictly banned.
|
|
284
|
-
3. **Three-Key Gate Verification**:
|
|
285
|
-
No code is merged into the trunk without passing Key 1 (in-memory `git merge-tree` mechanical check), Key 2 (live semantic compiler and test suite run), and Key 3 (independent adversarial audit ratification via `vine audit approve <task_id> --auditor <name> --ticket <hex> --
|
|
284
|
+
3. **Three-Key Gate Verification & Auditor Decoupling**:
|
|
285
|
+
No code is merged into the trunk without passing Key 1 (in-memory `git merge-tree` mechanical check), Key 2 (live semantic compiler and test suite run), and Key 3 (independent adversarial audit ratification via `vine audit approve <task_id> --auditor <name> --ticket <hex> --evidence "..." --listen`). Workers submit strands with `vine submit` (which generates a delivery ticket) and CANNOT audit their own work. The Adversarial Auditor ONLY inspects and ratifies Key 3; the Lead Orchestrator executes `vine weave`, which automatically invokes `rhizo task complete` and unblocks downstream DAG child tasks.
|
|
286
286
|
4. **Zero Dirty Commits**:
|
|
287
287
|
All agent identity files, session state, and temporary lockfiles are strictly ignored in `.gitignore`.
|
|
288
288
|
|
package/SKILL.md
CHANGED
|
@@ -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
|
|
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**:
|
|
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*:
|
|
125
|
-
*Process*:
|
|
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>
|
|
@@ -303,7 +303,7 @@ stateDiagram-v2
|
|
|
303
303
|
| RATIFIED | +----------------+
|
|
304
304
|
+------------+
|
|
305
305
|
│
|
|
306
|
-
│ vine weave (
|
|
306
|
+
│ vine weave (Executed by Lead Orchestrator)
|
|
307
307
|
│ Auto-executes rhizo task complete & unblocks DAG children
|
|
308
308
|
▼
|
|
309
309
|
+-----------+
|
|
@@ -322,8 +322,8 @@ stateDiagram-v2
|
|
|
322
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` |
|
|
323
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
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>
|
|
326
|
-
| **`COMPLETED`** | `vine weave`
|
|
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
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 |
|
|
328
328
|
| **`YIELDED`** | `rhizo task yield <id>` | Worker gracefully steps aside. Task returned to `QUEUED`. | N/A |
|
|
329
329
|
| **`DEAD_LETTER`** | Retries exhausted ($\ge 3$) | Moved to dead-letter queue. Alerts orchestrator and operator. | Requires manual operator triage |
|
|
@@ -338,15 +338,33 @@ The primary conversation session acts as the Lead Orchestrator. The orchestrator
|
|
|
338
338
|
|
|
339
339
|
<CRITICAL>
|
|
340
340
|
Orchestrator Intake Gate & Non-Implementation Invariant (GVR-016):
|
|
341
|
-
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.
|
|
342
342
|
Whenever the operator presents a task, feature request, bugfix, or asks to work on something:
|
|
343
343
|
THE ORCHESTRATOR MUST NEVER DIRECTLY JUMP INTO CODE EDITING OR IMPLEMENTATION TOOLS (e.g. `write_to_file`, `replace_file_content`).
|
|
344
344
|
Instead, it MUST STOP and ask the operator how they want the work routed using `ask_question`:
|
|
345
345
|
- Option 1 (Recommended): Enqueue to Cluster Work Queue (`rhizo enqueue queue:<project>:tasks --subject "..." --body "..."`) for background cluster workers.
|
|
346
|
-
- Option 2: Dispatch directly to an active cluster worker (`rhizo send <worker> --subject "..." --body "..."`).
|
|
347
|
-
- Option 3: Execute inline in main chat (only if the operator explicitly
|
|
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
348
|
|
|
349
|
-
This intake gate applies to ANY request to "work on X", "build Y", "fix Z", or "implement feature W". Direct inline
|
|
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>
|
|
351
|
+
|
|
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.
|
|
350
368
|
</CRITICAL>
|
|
351
369
|
|
|
352
370
|
<INVARIANT>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -133,7 +133,7 @@ Synthesize the primary triad targeting the detected harness with session-default
|
|
|
133
133
|
Invoke `ask_question` with a SINGLE concise question combining execution mode and swarm shape in the detected harness:
|
|
134
134
|
- Option 1 (Recommended): Multi-Agent Swarm: Balanced Triad in <Detected Harness> (Architect, Auditor, Implementer with session-native models)
|
|
135
135
|
- Option 2: Multi-Agent Swarm: Focused Duo in <Detected Harness> (Implementation Lead + Adversarial Auditor)
|
|
136
|
-
- Option 3: Single-Agent Inline (Execute sequentially within current chat session)
|
|
136
|
+
- Option 3 (Deprioritized): Single-Agent Inline (Execute sequentially within current chat session; strongly discouraged for code edits to preserve orchestrator context for governance)
|
|
137
137
|
- Option 4: Custom configuration (allows user write-in).
|
|
138
138
|
|
|
139
139
|
### Step 4: Synthesize Swarm Specification
|
|
@@ -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
|
|
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'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# `dialectical-pump`: Grounded Multi-Persona Deliberation Engine
|
|
@@ -29,17 +29,18 @@ Every turn taken by a persona in the Dialectical Pump must follow the **Empirica
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
## 2. The
|
|
32
|
+
## 2. The Dialectical Stages & Contract Skeleton Ceremony
|
|
33
33
|
|
|
34
|
-
The Dialectical Pump executes across
|
|
34
|
+
The Dialectical Pump executes across five distinct project gates adhering to Option B (`RFD -> RFC -> Contract Skeleton Strand on epic/<slug> -> Implementation Plan -> Parallel Strands`):
|
|
35
35
|
|
|
36
36
|
```mermaid
|
|
37
37
|
flowchart TD
|
|
38
38
|
subgraph DesignPhase["Design Dialectics (Pre-Implementation)"]
|
|
39
|
-
Stage1["Stage 1: Grounded Research (understanding.md + Fact-Check Gate)"]
|
|
39
|
+
Stage1["Stage 1: Grounded Research (understanding.md + Idioms + Fact-Check Gate)"]
|
|
40
40
|
Stage2["Stage 2: Architecture & Design (design.md)"]
|
|
41
41
|
Stage3["Stage 3: Adversarial Design Audit (audit_report.md)"]
|
|
42
|
-
|
|
42
|
+
Stage35["Stage 3.5: Pre-Plan Contract Skeleton Strand on epic/slug"]
|
|
43
|
+
Stage1 --> Stage2 --> Stage3 --> Stage35
|
|
43
44
|
end
|
|
44
45
|
|
|
45
46
|
subgraph ImplementationPhase["Implementation Dialectics (Pre-Weave)"]
|
|
@@ -52,7 +53,7 @@ flowchart TD
|
|
|
52
53
|
Stage4D -.->|"Findings > 0"| Stage4B
|
|
53
54
|
end
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
Stage35 --> ImplementationPhase
|
|
56
57
|
Stage4D -->|"0 Findings"| Weave["vine weave (Trunk Fast-Forward)"]
|
|
57
58
|
```
|
|
58
59
|
|
|
@@ -72,6 +73,11 @@ Workers read actual files, verify test suites, and map domain structures.
|
|
|
72
73
|
### Step 1.3: Generate Understanding Document (`understanding.md`)
|
|
73
74
|
The triad synthesizes their findings into `understanding.md` containing:
|
|
74
75
|
- Domain Glossary & Invariants.
|
|
76
|
+
- **Existing Codebase Idioms, Type Conventions & Test Patterns**:
|
|
77
|
+
- *Naming Conventions*: Module, type, procedure/function, and variable casing conventions (e.g. `camelCase` procs vs `PascalCase` types in Nim; `snake_case` in Python/Rust; private symbol prefixes).
|
|
78
|
+
- *Error-Handling Styles*: Result types (`Result[T, E]`), optional types (`Option[T]`), error return codes, or language-specific exception hierarchies.
|
|
79
|
+
- *Header, Type & Module Layout*: How public types, constants, interfaces, and exported symbols are structured across files.
|
|
80
|
+
- *Test Harness & Assertion Patterns*: Test runner conventions (`unittest`, `tripwire`, `pytest-tripwire`), golden file strategies, and negative control idioms.
|
|
75
81
|
- Data Flow Diagrams.
|
|
76
82
|
- Identified Constraints & Technical Debt.
|
|
77
83
|
|
|
@@ -89,7 +95,7 @@ Once research is fact-checked, the pump shifts to product and technical design:
|
|
|
89
95
|
|
|
90
96
|
### Step 2.1: The Thesis (Systems Architect)
|
|
91
97
|
The Systems Architect proposes the macro architecture:
|
|
92
|
-
- Module decomposition.
|
|
98
|
+
- Module decomposition adhering to discovered codebase idioms.
|
|
93
99
|
- Data structures and wire formats.
|
|
94
100
|
- Concurrency model and lifecycle states.
|
|
95
101
|
|
|
@@ -102,7 +108,7 @@ The Purist Auditor stress-tests the proposal against concrete failure modes:
|
|
|
102
108
|
### Step 2.3: The Synthesis (DevEx & Implementation Lead)
|
|
103
109
|
The DevEx Lead resolves the dialectic:
|
|
104
110
|
- Eliminates unnecessary abstractions that create ergonomics drag.
|
|
105
|
-
- Hardens the API contracts.
|
|
111
|
+
- Hardens the API contracts: specifies exact public types, headers/interfaces, exported procedure/function signatures, and contract test cases adhering to discovered idioms.
|
|
106
112
|
- Produces the ratified **`design.md`**.
|
|
107
113
|
|
|
108
114
|
---
|
|
@@ -122,6 +128,56 @@ The triad meets to address every finding in `audit_report.md`:
|
|
|
122
128
|
|
|
123
129
|
---
|
|
124
130
|
|
|
131
|
+
## 5.5. Stage 3.5: Pre-Plan Contract Skeleton Strand on `epic/<slug>`
|
|
132
|
+
|
|
133
|
+
Before authoring `implementation_plan.md` and dispatching parallel workers, the Triad commits the idiomatic public contracts, callable stubs, and red contract tests onto the feature integration branch `epic/<slug>`:
|
|
134
|
+
|
|
135
|
+
```mermaid
|
|
136
|
+
sequenceDiagram
|
|
137
|
+
autonumber
|
|
138
|
+
participant A as Architect (Lead)
|
|
139
|
+
participant S as Skeleton Strand (epic/slug)
|
|
140
|
+
participant V as Auditor (Key 3)
|
|
141
|
+
participant P as Implementation Plan (Stage 4)
|
|
142
|
+
|
|
143
|
+
A->>S: vine new task-<slug>-skeleton --parent epic/<slug>
|
|
144
|
+
Note over S: Commit idiomatic types, headers & callable stubs (UNIMPLEMENTED_CONTRACT)
|
|
145
|
+
Note over S: Commit red contract test suites (asserting contract compliance)
|
|
146
|
+
S->>V: vine submit --skeleton (evaluates Keys 1 & 2)
|
|
147
|
+
Note over V: vine audit inspect task-<slug>-skeleton
|
|
148
|
+
V->>S: vine audit approve --ticket <hex> --evidence "<files, types, red tests>"
|
|
149
|
+
Note over S: Lead Orchestrator runs vine weave into epic/<slug>
|
|
150
|
+
S->>P: Stage 4 anchors implementation_plan.md to committed skeleton files & lines
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Step 3.5.1: Provision the Skeleton Strand
|
|
154
|
+
```bash
|
|
155
|
+
vine new task-<slug>-skeleton --parent epic/<slug>
|
|
156
|
+
```
|
|
157
|
+
*Creates the feature integration branch `epic/<slug>` if not already present, isolating foundational contracts from canonical `main`.*
|
|
158
|
+
|
|
159
|
+
### Step 3.5.2: Commit Idiomatic Contracts & Red Stubs
|
|
160
|
+
Inside the strand, the Architect implements:
|
|
161
|
+
1. **Public Types & Interfaces**: Concrete types, enums, structs/objects matching the discovered idioms from Stage 1 and Stage 2.
|
|
162
|
+
2. **Exported Callable Stubs**: Exported procedures/functions that compile cleanly but return an explicit `UNIMPLEMENTED_CONTRACT` defect or error code (or throw a structured `NotImplementedDefect` / exception).
|
|
163
|
+
3. **Red Contract Test Suites**: Rigorous contract tests that call the exported stubs. Under test execution, these tests must run and fail deterministically with `UNIMPLEMENTED_CONTRACT` (proving that tests genuinely invoke the contract and do not pass vacuously).
|
|
164
|
+
|
|
165
|
+
### Step 3.5.3: Submit and Audit the Skeleton Strand
|
|
166
|
+
- The worker executes `vine submit --skeleton` (evaluating Key 1 merge-tree and Key 2 compilation/contract tests).
|
|
167
|
+
- The Adversarial Auditor runs `vine audit inspect task-<slug>-skeleton` to forensic-check type signatures and error semantics against `design.md`.
|
|
168
|
+
- Upon verification, the auditor ratifies Key 3 (evidence-bound approval without weaving):
|
|
169
|
+
```bash
|
|
170
|
+
vine audit approve task-<slug>-skeleton --auditor <auditor_name> --ticket <hex> --evidence "Committed idiomatic types in src/types.nim, stubs in src/api.nim, and red contract tests in tests/test_contract.nim" --listen
|
|
171
|
+
```
|
|
172
|
+
- The Lead Orchestrator then weaves the verified skeleton into `epic/<slug>`:
|
|
173
|
+
```bash
|
|
174
|
+
vine weave
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Proceed to [`plan-implementation`](../plan-implementation/SKILL.md) to author `implementation_plan.md` anchored to the committed skeleton symbols, and spawn parallel worker strands branching off `--parent epic/<slug>`.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
125
181
|
## 6. Stage 4: Pre-Weave Adversarial Code Audit Pump (The Third Key Gate)
|
|
126
182
|
|
|
127
183
|
Before any strand is woven into canonical trunk (`vine weave`), it must pass the **Adversarial Code Audit Pump**. Passing Key 1 (mechanical merge-tree) and Key 2 (semantic test runner) is necessary but insufficient: tests may be green mirages, and code may be disconnected shelfware or heuristic hand-waves.
|
|
@@ -177,6 +233,7 @@ The Auditor executes the following checks against the Claim Bundle and the stran
|
|
|
177
233
|
#### Pillar 2: Holistic Integration vs. Heuristic Hand-Waves & Hollow Stubs
|
|
178
234
|
- [ ] **Anti-Stub & Anti-Toy Check**: Does the implementation handle real application state, real network/file I/O, and real concurrent events?
|
|
179
235
|
- [ ] **No Hollow Mocks in Production**: Reject artificial `sleep()` calls, hardcoded success responses, or fake test doubles in production paths.
|
|
236
|
+
- [ ] **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`).
|
|
180
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.
|
|
181
238
|
- [ ] **Autonomous Intensive Audit Mandate**: Intensive audits are Standard Operating Procedure (SOP) and pre-authorized. Auditors must execute without requesting operator confirmation or input.
|
|
182
239
|
- [ ] **Brittle String-Split Hacks**: Reject naive string splits (`str.split(" ")[0]`) pretending to parse structured protocols or payloads; compliant lexers/parsers must be used.
|
|
@@ -209,6 +266,15 @@ Assertion Rigor & Anti-Green-Mirage Mandate:
|
|
|
209
266
|
4. Zero Happy-Path-Only Testing: Boundary values (empty, 0, 1, max, unicode, timeout, disconnection) must be explicitly exercised.
|
|
210
267
|
</CRITICAL>
|
|
211
268
|
|
|
269
|
+
#### Contract Immutability & Anti-Drift Invariant
|
|
270
|
+
<CRITICAL>
|
|
271
|
+
Contract Immutability on Feature Integration Branches (`epic/<slug>`):
|
|
272
|
+
When parallel implementation strands branch off `--parent epic/<slug>` following the Stage 3.5 Skeleton Ceremony:
|
|
273
|
+
1. Exported Contract Immutability: Workers MUST NOT alter exported type declarations, procedure/function signatures, error types, or CLI options established in the committed contract skeleton. If an implementation constraint requires modifying an exported signature, the worker MUST NOT unilaterally drift code; it MUST draft a formal `docs/addenda/addendum_<topic>.md` and await Orchestrator ratification.
|
|
274
|
+
2. Contract Test Protection: Workers MUST NOT weaken, disable, comment out, or delete contract tests committed during Stage 3.5. Contract tests define the acceptance criteria; all tests must turn from red to green under genuine production logic.
|
|
275
|
+
3. Anti-Mock-Fallback: If an external dependency or hardware environment cannot be satisfied, workers MUST NOT invent fake fallbacks (e.g. `lesMockFallback`); they MUST halt and report `BLOCKER: MISSING_DEPENDENCY`.
|
|
276
|
+
</CRITICAL>
|
|
277
|
+
|
|
212
278
|
### Step 4.3: The Delta Re-Pump Loop (Iterative until Zero Findings)
|
|
213
279
|
|
|
214
280
|
A single review pass is never sufficient. The Adversarial Code Audit executes as an **iterative dialectical pump**:
|
|
@@ -222,17 +288,18 @@ sequenceDiagram
|
|
|
222
288
|
|
|
223
289
|
Note over W: Worker finishes and runs 'vine submit'
|
|
224
290
|
W->>A: Submit Deliverable Claim Bundle ('vine submit')
|
|
291
|
+
Note over A: Step 4.3.0: Mandatory Inspection ('vine audit inspect <task_id>')
|
|
225
292
|
A->>A: Five-Pillar Presumption-of-Guilt Audit (Antithesis)
|
|
226
293
|
|
|
227
294
|
alt Findings > 0 (CRIT / HIGH / MED)
|
|
228
|
-
A->>G: 'vine audit reject --reason <text>'
|
|
295
|
+
A->>G: 'vine audit reject --ticket <hex> --reason <text>'
|
|
229
296
|
A-->>W: Emit audit_report.md with empirical citations
|
|
230
297
|
Note over W: Worker remediates findings inside Strand
|
|
231
298
|
W->>A: Re-pump: 'vine submit' (Delta Claim Bundle + git diff against last audit commit)
|
|
232
299
|
A->>A: Delta Audit: Verify fix + full test regression sweep
|
|
233
300
|
Note over A,W: Loop repeats until 0 open defects
|
|
234
301
|
else Findings == 0
|
|
235
|
-
A->>G: 'vine audit approve --
|
|
302
|
+
A->>G: 'vine audit approve --ticket <hex>' (Stamps audit_token)
|
|
236
303
|
G->>G: Execute vine weave (Trunk Fast-Forward)
|
|
237
304
|
end
|
|
238
305
|
```
|
|
@@ -240,29 +307,67 @@ sequenceDiagram
|
|
|
240
307
|
> [!CRITICAL]
|
|
241
308
|
> **THE WORKER IS NOT THE AUDITOR**: Workers cannot audit or approve their own strands (`vine audit approve` strictly enforces `auditor != author`). The audit MUST be performed by an independent Adversarial Auditor session.
|
|
242
309
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
310
|
+
#### Key 3 Auditor Discipline, Single-Strand Isolation & Forensic Standards
|
|
311
|
+
|
|
312
|
+
<CRITICAL>
|
|
313
|
+
Auditor Merge-Clerk Decoupling Invariant:
|
|
314
|
+
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.
|
|
315
|
+
</CRITICAL>
|
|
316
|
+
|
|
317
|
+
<CRITICAL>
|
|
318
|
+
Single-Strand Audit Isolation (Anti-Batching Invariant):
|
|
319
|
+
Orchestrators MUST dispatch at most ONE strand per Key 3 audit request. Batching multiple strands into a single audit message (e.g. "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.
|
|
320
|
+
</CRITICAL>
|
|
321
|
+
|
|
322
|
+
<CRITICAL>
|
|
323
|
+
Inverted Approval vs Rejection Effort Gradient (`--evidence` Mandate):
|
|
324
|
+
Rejection is the low-friction fast path whenever ANY doubt, defect, green mirage, or missing negative control exists:
|
|
325
|
+
`vine audit reject <task_id> --auditor <name> --ticket <hex> --reason "<findings>" --listen`
|
|
326
|
+
|
|
327
|
+
Approval is intentionally high-friction and evidence-bound. Running `vine audit approve` strictly requires `--evidence "..."` citing specific changed file basenames, provider->consumer call-sites, and negative control assertions from the diff:
|
|
328
|
+
`vine audit approve <task_id> --auditor <name> --ticket <hex> --evidence "<changed files, provider->consumer call-sites, negative controls>" --listen`
|
|
329
|
+
Passing vague praise or empty justifications without empirical diff citations is mechanically and procedurally rejected.
|
|
330
|
+
</CRITICAL>
|
|
331
|
+
|
|
332
|
+
1. **Mandatory Inspection (`vine audit inspect <task_id>`)**: Before issuing any audit decision (`approve` or `reject`), the Auditor MUST execute `vine audit inspect <task_id>` to inspect the deliverable claim bundle, delivery ticket, strand git diff, and test evidence. Approving an audit blindly without inspection is strictly prohibited.
|
|
333
|
+
2. **Strict Prohibition on `--force` on Approvals**: Auditors MUST NEVER pass `--force` to bypass failing tests, uncommitted dirty files, or mismatched delivery tickets. If verification fails, the auditor MUST reject (`vine audit reject`) back to the worker.
|
|
334
|
+
3. **Auditors Are NOT Release or Merge Clerks**: Auditors are adversarial verifiers of code correctness, NOT administrative clerks.
|
|
335
|
+
- Auditors MUST NEVER edit `ROADMAP.md` or update roadmap statuses on behalf of workers.
|
|
336
|
+
- Auditors MUST NEVER resolve `CHANGELOG.md` or code merge conflicts on behalf of workers.
|
|
337
|
+
- If a strand has merge conflicts or a missing/conflicted changelog entry, the Auditor rejects the deliverable with a defect code (`REJECT: MERGE_CONFLICT` or `REJECT: CHANGELOG_VIOLATION`); the worker must resolve it cleanly inside the strand.
|
|
338
|
+
4. **Defect Issuance**: If defects are discovered, the Auditor runs `vine audit reject <task_id> --auditor <auditor_name> --ticket <hex> --reason "<defects>" --listen` and records findings in `audit_report.md` with defect codes (`CRIT-XX`, `HIGH-XX`, `FIDELITY-XX`, `MIRAGE-XX`), exact file lines, and failure proof.
|
|
339
|
+
5. **In-Strand Remediation**: The worker fixes findings strictly inside the isolated Vine strand.
|
|
340
|
+
6. **The Delta Re-Pump**: When resubmitting with `vine submit` (which generates a refreshed delivery ticket), the auditor audits the **exact delta** (`git diff <audit_commit>...HEAD`) to ensure fixes do not introduce secondary defects, while re-running the full project test suite (`vine gate`) to guarantee no regressions.
|
|
341
|
+
7. **Exit Condition**: The pump loops until **ZERO open defects of severity CRIT, HIGH, or MED remain**, and all low/nit items are resolved or empirically justified.
|
|
247
342
|
|
|
248
343
|
### Step 4.4: Gate Clearance & Cryptographic Token
|
|
249
344
|
|
|
250
|
-
When all findings reach 0, the independent auditor ratifies Key 3:
|
|
345
|
+
When all findings reach 0, the independent auditor ratifies Key 3 (evidence-bound approval, with `--weave` removed):
|
|
251
346
|
```bash
|
|
252
|
-
|
|
347
|
+
# 1. Mandatory inspection
|
|
348
|
+
vine audit inspect <task_id>
|
|
349
|
+
|
|
350
|
+
# 2. Ratify Key 3 with empirical evidence citations (Auditor NEVER runs --weave):
|
|
351
|
+
vine audit approve <task_id> --auditor <auditor_name> --ticket <hex> --evidence "Provider in src/provider.nim, Consumer in src/consumer.nim:42, negative control in tests/test_cases.nim:88" --listen
|
|
253
352
|
```
|
|
254
|
-
This mechanically verifies Keys 1 & 2 against the delivery ticket, checks that the strand has zero uncommitted changes, ensures `auditor != author`, and stamps a cryptographic `audit_token`. Vine stores strand identity in `.git/config` (`vine.taskId`, `vine.project`) and authoritative state in Redis (zero on-disk state files).
|
|
353
|
+
This mechanically verifies Keys 1 & 2 against the delivery ticket, checks that the strand has zero uncommitted changes, ensures `auditor != author`, verifies that `--evidence` is provided, and stamps a cryptographic `audit_token`. Vine stores strand identity in `.git/config` (`vine.taskId`, `vine.project`) and authoritative state in Redis (zero on-disk state files).
|
|
255
354
|
|
|
256
|
-
Only strands in `AUDIT_RATIFIED` state with a valid cryptographic audit token are permitted to weave into trunk
|
|
355
|
+
Only strands in `AUDIT_RATIFIED` state with a valid cryptographic audit token are permitted to weave into trunk. **The Lead Orchestrator then executes trunk weaving**:
|
|
356
|
+
```bash
|
|
357
|
+
# Executed by Lead Orchestrator upon receiving Key 3 ratification:
|
|
358
|
+
vine weave
|
|
359
|
+
```
|
|
360
|
+
*(This automatically invokes `rhizo task complete` and promotes downstream DAG child tasks from `BLOCKED` to `QUEUED`).*
|
|
257
361
|
|
|
258
362
|
---
|
|
259
363
|
|
|
260
364
|
## 7. Output Artifacts
|
|
261
365
|
|
|
262
366
|
At the conclusion of the Dialectical Pump:
|
|
263
|
-
1. `understanding.md` (Stage 1: Grounded and fact-checked).
|
|
264
|
-
2. `design.md` (Stage 2: Debated, hardened, and synthesized).
|
|
367
|
+
1. `understanding.md` (Stage 1: Grounded, idioms extracted, and fact-checked).
|
|
368
|
+
2. `design.md` (Stage 2: Debated, hardened, and synthesized with idiomatic types & interfaces).
|
|
265
369
|
3. `design_audit_report.md` (Stage 3: Design findings addressed and closed).
|
|
266
|
-
4. `
|
|
370
|
+
4. **Committed Contract Skeleton & Red Tests on `epic/<slug>`** (Stage 3.5: Public types, callable stubs with `UNIMPLEMENTED_CONTRACT`, and red contract test suites).
|
|
371
|
+
5. `code_audit_report.md` (Stage 4: Pre-weave Five-Pillar audit cleared with 0 open defects under Contract Immutability).
|
|
267
372
|
|
|
268
373
|
Proceed to [`orchestrate-swarm`](../orchestrate-swarm/SKILL.md) for trunk weaving.
|
package/skills/garden/SKILL.md
CHANGED
|
@@ -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
|
|
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**:
|
|
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*:
|
|
125
|
-
*Process*:
|
|
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>
|
|
@@ -303,7 +303,7 @@ stateDiagram-v2
|
|
|
303
303
|
| RATIFIED | +----------------+
|
|
304
304
|
+------------+
|
|
305
305
|
│
|
|
306
|
-
│ vine weave (
|
|
306
|
+
│ vine weave (Executed by Lead Orchestrator)
|
|
307
307
|
│ Auto-executes rhizo task complete & unblocks DAG children
|
|
308
308
|
▼
|
|
309
309
|
+-----------+
|
|
@@ -322,8 +322,8 @@ stateDiagram-v2
|
|
|
322
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` |
|
|
323
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
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>
|
|
326
|
-
| **`COMPLETED`** | `vine weave`
|
|
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
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 |
|
|
328
328
|
| **`YIELDED`** | `rhizo task yield <id>` | Worker gracefully steps aside. Task returned to `QUEUED`. | N/A |
|
|
329
329
|
| **`DEAD_LETTER`** | Retries exhausted ($\ge 3$) | Moved to dead-letter queue. Alerts orchestrator and operator. | Requires manual operator triage |
|
|
@@ -338,15 +338,33 @@ The primary conversation session acts as the Lead Orchestrator. The orchestrator
|
|
|
338
338
|
|
|
339
339
|
<CRITICAL>
|
|
340
340
|
Orchestrator Intake Gate & Non-Implementation Invariant (GVR-016):
|
|
341
|
-
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.
|
|
342
342
|
Whenever the operator presents a task, feature request, bugfix, or asks to work on something:
|
|
343
343
|
THE ORCHESTRATOR MUST NEVER DIRECTLY JUMP INTO CODE EDITING OR IMPLEMENTATION TOOLS (e.g. `write_to_file`, `replace_file_content`).
|
|
344
344
|
Instead, it MUST STOP and ask the operator how they want the work routed using `ask_question`:
|
|
345
345
|
- Option 1 (Recommended): Enqueue to Cluster Work Queue (`rhizo enqueue queue:<project>:tasks --subject "..." --body "..."`) for background cluster workers.
|
|
346
|
-
- Option 2: Dispatch directly to an active cluster worker (`rhizo send <worker> --subject "..." --body "..."`).
|
|
347
|
-
- Option 3: Execute inline in main chat (only if the operator explicitly
|
|
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
348
|
|
|
349
|
-
This intake gate applies to ANY request to "work on X", "build Y", "fix Z", or "implement feature W". Direct inline
|
|
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>
|
|
351
|
+
|
|
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.
|
|
350
368
|
</CRITICAL>
|
|
351
369
|
|
|
352
370
|
<INVARIANT>
|
|
@@ -247,7 +247,7 @@ stateDiagram-v2
|
|
|
247
247
|
| RATIFIED | +----------------+
|
|
248
248
|
+------------+
|
|
249
249
|
│
|
|
250
|
-
│ vine weave (
|
|
250
|
+
│ vine weave (Executed by Lead Orchestrator)
|
|
251
251
|
│ Auto-executes rhizo task complete & unblocks DAG children
|
|
252
252
|
▼
|
|
253
253
|
+-----------+
|
|
@@ -266,9 +266,18 @@ stateDiagram-v2
|
|
|
266
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` |
|
|
267
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
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>
|
|
270
|
-
| **`COMPLETED`** | `vine weave`
|
|
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
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 |
|
|
272
272
|
| **`YIELDED`** | `rhizo task yield <id>` | Worker gracefully steps aside. Task returned to `QUEUED`. | N/A |
|
|
273
273
|
| **`DEAD_LETTER`** | Retries exhausted ($\ge 3$) | Moved to dead-letter queue. Alerts orchestrator and operator. | Requires manual operator triage |
|
|
274
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
|
+
|
|
@@ -32,7 +32,7 @@ Furthermore, when the operator explicitly requests or names a worker or peer ses
|
|
|
32
32
|
|
|
33
33
|
<CRITICAL>
|
|
34
34
|
Orchestrator Intake Gate & Autonomous Dispatch Invariant (GVR-016):
|
|
35
|
-
The Lead Orchestrator is a CONDUCTOR, NOT A CODER.
|
|
35
|
+
The Lead Orchestrator is a CONDUCTOR, NOT A CODER. The orchestrator context window must remain dedicated to high-level planning, architectural analysis, and governance.
|
|
36
36
|
Whenever the operator presents a task, feature request, bugfix, or asks to work on something (including "garden: <prompt>"):
|
|
37
37
|
THE ORCHESTRATOR MUST NEVER DIRECTLY JUMP INTO CODE EDITING OR IMPLEMENTATION TOOLS (e.g. `write_to_file`, `replace_file_content`).
|
|
38
38
|
|
|
@@ -41,18 +41,33 @@ The orchestrator inspects the cluster state via `rhizo who --all --json`:
|
|
|
41
41
|
If the operator has already directed "work on this with your workers", "delegate", or "dispatch", OR if active cluster workers/queues already exist:
|
|
42
42
|
DO NOT STOP TO ASK ROUTING QUESTIONS. The routing is already decided.
|
|
43
43
|
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`.
|
|
44
|
+
*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.
|
|
44
45
|
2. **Mandatory `ask_question` Tool Discipline (Zero Conversational Multiple-Choice)**:
|
|
45
46
|
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:
|
|
46
47
|
The orchestrator MUST invoke the interactive `ask_question` tool to solicit the operator's preference (Swarm vs Inline).
|
|
47
48
|
Dumping multiple-choice numbered lists (`1, 2, 3`) or routing questionnaires in raw chat text is STRICTLY PROHIBITED.
|
|
49
|
+
Inline execution in the orchestrator is strictly discouraged for code implementation and reserved for non-code planning, analysis, or design discussions.
|
|
48
50
|
3. **Project-Scoped Fleet Mandate & Anti-Hijacking Invariant**:
|
|
49
51
|
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`).
|
|
50
52
|
</CRITICAL>
|
|
51
53
|
|
|
52
54
|
<CRITICAL>
|
|
53
|
-
Pre-Weave Adversarial Audit,
|
|
55
|
+
Pre-Weave Adversarial Audit, Contract Immutability & Auditor Merge-Clerk Decoupling:
|
|
54
56
|
The Lead Orchestrator is the final gatekeeper against hermetic shelfware, hollow mocks, superficial heuristics, benchmark defeat devices, and green mirages.
|
|
55
57
|
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.
|
|
58
|
+
|
|
59
|
+
1. Pre-Plan Contract Skeleton Ceremony (Option B):
|
|
60
|
+
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>`.
|
|
61
|
+
2. Contract Immutability:
|
|
62
|
+
Parallel implementation strands branching off `--parent epic/<slug>` MUST NOT alter exported contract signatures or weaken contract tests without an approved `[DESIGN ADDENDUM]`.
|
|
63
|
+
3. Anti-Mock-Fallback:
|
|
64
|
+
Workers are strictly prohibited from implementing silent mock fallbacks (e.g. `lesMockFallback`); missing dependencies require halting immediately with `BLOCKER: MISSING_DEPENDENCY`.
|
|
65
|
+
4. Key 3 Auditor Merge-Clerk Decoupling & Invariants:
|
|
66
|
+
- **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.
|
|
67
|
+
- **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.
|
|
68
|
+
- **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 "..."`).
|
|
69
|
+
- 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).
|
|
70
|
+
|
|
56
71
|
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):
|
|
57
72
|
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.
|
|
58
73
|
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.
|
|
@@ -217,7 +232,7 @@ stateDiagram-v2
|
|
|
217
232
|
| RATIFIED | +----------------+
|
|
218
233
|
+------------+
|
|
219
234
|
│
|
|
220
|
-
│ vine weave (
|
|
235
|
+
│ vine weave (Executed by Lead Orchestrator)
|
|
221
236
|
│ Auto-executes rhizo task complete & unblocks DAG children
|
|
222
237
|
▼
|
|
223
238
|
+-----------+
|
|
@@ -236,8 +251,8 @@ stateDiagram-v2
|
|
|
236
251
|
| **`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` |
|
|
237
252
|
| **`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 |
|
|
238
253
|
| **`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 |
|
|
239
|
-
| **`AUDIT_RATIFIED`** | `vine audit approve <task_id> --auditor <name> --ticket <hex>
|
|
240
|
-
| **`COMPLETED`** | `vine weave`
|
|
254
|
+
| **`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 |
|
|
255
|
+
| **`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 |
|
|
241
256
|
| **`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 |
|
|
242
257
|
| **`YIELDED`** | `rhizo task yield <id>` | Worker gracefully steps aside. Task returned to `QUEUED`. | N/A |
|
|
243
258
|
| **`DEAD_LETTER`** | Retries exhausted ($\ge 3$) | Moved to dead-letter queue. Alerts orchestrator and operator. | Requires manual operator triage |
|
|
@@ -332,7 +347,7 @@ When a worker finishes implementation in their strand, they run `vine submit --a
|
|
|
332
347
|
|
|
333
348
|
> [!CRITICAL]
|
|
334
349
|
> **THE WORKER IS NOT THE AUDITOR**: Workers cannot audit or approve their own strands (`vine audit approve` strictly enforces `auditor != author`).
|
|
335
|
-
> The Lead Orchestrator dispatches an audit request
|
|
350
|
+
> **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):
|
|
336
351
|
> `rhizo send @auditor --subject "Audit Request: task-core-ds" --body '{"strand_path": "...", "author": "implementer", "ticket": "<64-char-hex-delivery-ticket>"}'`
|
|
337
352
|
|
|
338
353
|
The independent Auditor initiates **Key 3: The Pre-Weave Adversarial Code Audit Pump** under the **Presumption of Guilt**:
|
|
@@ -346,20 +361,21 @@ The independent Auditor initiates **Key 3: The Pre-Weave Adversarial Code Audit
|
|
|
346
361
|
- **Pillar 4 (Aggressive Replacement Purge)**: Ensure all superseded legacy code, fallbacks, and commented-out blocks are deleted in the strand.
|
|
347
362
|
- **Pillar 5 (Structural Assertion Rigor)**: Reject partial/loose assertions (`assert "foo" in bar`). Mandate complete structural equality (`assert actual == expected`) and negative controls.
|
|
348
363
|
3. **Audit Ratification or Delta Re-Pump Loop**:
|
|
364
|
+
- **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.
|
|
349
365
|
- **If findings exist**: Auditor executes rejection against the delivery ticket:
|
|
350
366
|
```bash
|
|
351
367
|
vine audit reject <task_id> --auditor <auditor_name> --ticket <hex> --reason "<defects>" --listen
|
|
352
368
|
```
|
|
353
369
|
and reports findings to the worker. Worker remediates inside the strand and re-submits with `vine submit` (obtaining a fresh delivery ticket).
|
|
354
370
|
- **The Delta Re-Pump Loop**: Auditor reviews the git delta against the previous audit commit (`git diff <audit_sha>...HEAD`) and verifies clean tests. The pump repeats until **ZERO open defects of severity CRIT, HIGH, or MED remain**.
|
|
355
|
-
- **When 0 defects remain**: Auditor
|
|
371
|
+
- **When 0 defects remain**: Auditor ratifies Key 3 with mandatory `--evidence`:
|
|
356
372
|
```bash
|
|
357
|
-
vine audit approve <task_id> --auditor <auditor_name> --ticket <hex> --
|
|
373
|
+
vine audit approve <task_id> --auditor <auditor_name> --ticket <hex> --evidence "Provider in src/provider.nim, Consumer in src/consumer.nim:42, negative control in tests/test_cases.nim:88" --listen
|
|
358
374
|
```
|
|
359
|
-
This verifies the delivery ticket, stamps a cryptographic `audit_token`, and marks the strand `AUDIT_RATIFIED
|
|
360
|
-
4. **Weave & Auto-Complete (
|
|
375
|
+
This verifies the delivery ticket, stamps a cryptographic `audit_token`, and marks the strand `AUDIT_RATIFIED`. Auditor notifies orchestrator.
|
|
376
|
+
4. **Weave & Auto-Complete (Executed Exclusively by Lead Orchestrator)**:
|
|
361
377
|
```bash
|
|
362
|
-
# 1. Weave the verified, ratified strand into main:
|
|
378
|
+
# 1. Weave the verified, ratified strand into main (Lead Orchestrator role):
|
|
363
379
|
# Mechanically verifies audit_token, fast-forward merges, prunes strand,
|
|
364
380
|
# and automatically triggers 'rhizo task complete' to unblock downstream DAG children!
|
|
365
381
|
vine weave
|
|
@@ -16,9 +16,13 @@ The Orchestrator authors `implementation_plan.md` adhering to four core invarian
|
|
|
16
16
|
|
|
17
17
|
1. **Deterministic Assignment**: Every subtask has exactly one primary persona owner.
|
|
18
18
|
2. **Resource Fencing Before Mutation**: Any non-mergeable resource (e.g. database schemas, configuration files, migration scripts) must have an explicit `rhizo lock file:<path> --fencing` lease scheduled before modification begins.
|
|
19
|
-
3. **Workspace Isolation via Vine**: Complex, multi-file changes must occur in isolated Rift strands (`vine new <task_id>`). Strands cannot be woven until passing the Three-Key Gate (`vine submit`, `vine audit approve`, `vine weave`).
|
|
20
|
-
4. **
|
|
21
|
-
|
|
19
|
+
3. **Workspace Isolation via Vine & Feature Integration Branch (`epic/<slug>`)**: Complex, multi-file changes must occur in isolated Rift strands branching off the feature integration branch (`vine new <task_id> --parent epic/<slug>`). Strands cannot be woven until passing the Three-Key Gate (`vine submit`, `vine audit inspect`, `vine audit approve`, `vine weave`).
|
|
20
|
+
4. **Contract Skeleton Anchoring & Immutability**: Every implementation plan must anchor tasks directly to the committed types, interfaces, callable stubs (`UNIMPLEMENTED_CONTRACT`), and red contract test suites established during Stage 3.5 on `epic/<slug>`.
|
|
21
|
+
- *Contract Immutability*: Workers branching off `--parent epic/<slug>` MUST NOT alter exported type declarations or signatures, nor weaken contract tests, without an approved `[DESIGN ADDENDUM]`.
|
|
22
|
+
- *Anti-Mock-Fallback*: Workers must NEVER implement silent mock fallbacks (e.g. `lesMockFallback`); missing dependencies require immediately halting with `BLOCKER: MISSING_DEPENDENCY`.
|
|
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
|
+
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
|
+
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.
|
|
22
26
|
|
|
23
27
|
---
|
|
24
28
|
|
|
@@ -52,26 +56,30 @@ Before modifying any shared or non-mergeable file, the designated worker must ob
|
|
|
52
56
|
|
|
53
57
|
## 3. Vine Strand Lifecycle & Verification Matrix
|
|
54
58
|
For all parallel development tracks:
|
|
55
|
-
1. **Provision Strand**:
|
|
59
|
+
1. **Provision Strand Branching off Feature Integration Branch (`epic/<slug>`)**:
|
|
56
60
|
```bash
|
|
57
|
-
vine new <task_id> --
|
|
61
|
+
vine new <task_id> --parent epic/<slug> --worktree
|
|
58
62
|
```
|
|
59
63
|
*Note: Vine stores strand identity in `.git/config` (`vine.taskId`, `vine.project`) and authoritative state in Redis (zero on-disk `.vine.json` state files).*
|
|
60
|
-
2. **Execute Work Inside Strand**:
|
|
61
|
-
- Implement code
|
|
64
|
+
2. **Execute Work Inside Strand Under Contract Immutability**:
|
|
65
|
+
- Implement real provider logic turning committed red contract stubs into green passing code.
|
|
66
|
+
- Do NOT modify exported contract signatures or weaken contract tests without an approved `[DESIGN ADDENDUM]`.
|
|
67
|
+
- Never implement fake mock fallbacks (`lesMockFallback`); halt with `BLOCKER: MISSING_DEPENDENCY` if dependencies are unavailable.
|
|
62
68
|
- Run local unit tests and formatters.
|
|
63
69
|
3. **Three-Key Gate Verification**:
|
|
64
70
|
- **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`).
|
|
65
71
|
- **Independent Auditor**: Inspects Five Pillars and runs:
|
|
66
72
|
```bash
|
|
67
|
-
#
|
|
68
|
-
vine audit
|
|
73
|
+
# Step 1: Mandatory forensic inspection
|
|
74
|
+
vine audit inspect <task_id>
|
|
75
|
+
# Step 2: To ratify approval with evidence (Auditor NEVER weaves):
|
|
76
|
+
vine audit approve <task_id> --auditor <auditor> --ticket <hex> --evidence "<files, call-sites, negative controls>" --listen
|
|
69
77
|
# Or to reject if defects are found:
|
|
70
78
|
vine audit reject <task_id> --auditor <auditor> --ticket <hex> --reason "<findings>" --listen
|
|
71
79
|
```
|
|
72
|
-
Remember: THE WORKER IS NOT THE AUDITOR.
|
|
73
|
-
4. **Trunk Weaving & DAG Cascading**:
|
|
74
|
-
*Fast-forwards ratified branch into main, automatically calls `rhizo task complete <task_id>`, and unblocks downstream DAG child tasks (`BLOCKED` $\rightarrow$ `QUEUED`):*
|
|
80
|
+
Remember: THE WORKER IS NOT THE AUDITOR. Auditors NEVER use `--force` and NEVER act as release/merge clerks (no editing `ROADMAP.md`, no resolving `CHANGELOG.md` merge conflicts, and no weaving on behalf of workers).
|
|
81
|
+
4. **Trunk Weaving & DAG Cascading (Lead Orchestrator Role)**:
|
|
82
|
+
*Fast-forwards ratified branch into epic/<slug> or main, automatically calls `rhizo task complete <task_id>`, and unblocks downstream DAG child tasks (`BLOCKED` $\rightarrow$ `QUEUED`):*
|
|
75
83
|
```bash
|
|
76
84
|
vine weave
|
|
77
85
|
```
|
|
@@ -80,22 +88,31 @@ For all parallel development tracks:
|
|
|
80
88
|
|
|
81
89
|
## 4. Phase-by-Phase Task Checklist
|
|
82
90
|
|
|
83
|
-
### Phase
|
|
91
|
+
### Phase 0: Contract Skeleton (Pre-Plan Stage 3.5 on `epic/<slug>`)
|
|
92
|
+
- [x] **Task 0.1: Contract Skeleton Strand & Red Tests** (`<project>-architect`)
|
|
93
|
+
- *Strand*: `strand/task-<slug>-skeleton` (`--parent epic/<slug>`)
|
|
94
|
+
- *Committed Deliverables*: Idiomatic types, interfaces, and callable stubs with `UNIMPLEMENTED_CONTRACT` in `src/types.nim`, `src/api.nim`
|
|
95
|
+
- *Committed Contract Tests*: `tests/test_contract.nim` asserting contract compliance (failing red against stubs)
|
|
96
|
+
- *Weave*: `vine submit --skeleton && vine audit inspect task-<slug>-skeleton && vine audit approve task-<slug>-skeleton && vine weave`
|
|
97
|
+
|
|
98
|
+
### Phase 1: Core Engine Primitives (Branching off `epic/<slug>`)
|
|
84
99
|
- [ ] **Task 1.1: Core Data Structures** (`<project>-architect`)
|
|
85
|
-
- *Strand*: `strand/task-core-ds`
|
|
100
|
+
- *Strand*: `strand/task-core-ds` (`--parent epic/<slug>`)
|
|
101
|
+
- *Anchored Skeleton Symbols*: `src/types.nim:15-80` (`ASTNode`, `NodeKind`, `serializeNode`)
|
|
102
|
+
- *Contract Test Suite*: `tests/test_contract.nim` (must turn from red to green)
|
|
86
103
|
- *Lock*: `rhizo lock file:src/types.nim 300 --fencing`
|
|
87
104
|
- *Provider*: `src/types.nim` (AST node kinds and serializers)
|
|
88
105
|
- *Consumer / Call-Site*: Wire into `src/parser.nim` parse loop and `src/eval.nim`
|
|
89
106
|
- *Replacement Deletion*: Delete deprecated ad-hoc string tuples in `src/legacy_types.nim`
|
|
90
107
|
- *Holistic Verification*: Real AST nodes evaluate in full parser pipeline (no dummy mocks)
|
|
91
|
-
- *Weave*: `vine submit && vine audit approve && vine weave && rhizo unlock file:src/types.nim`
|
|
108
|
+
- *Weave*: `vine submit && vine audit inspect task-core-ds && vine audit approve && vine weave && rhizo unlock file:src/types.nim`
|
|
92
109
|
|
|
93
110
|
- [ ] **Task 1.2: Test Harness & Negative Controls** (`<project>-auditor`)
|
|
94
|
-
- *Strand*: `strand/task-test-harness`
|
|
111
|
+
- *Strand*: `strand/task-test-harness` (`--parent epic/<slug>`)
|
|
95
112
|
- *Provider*: `tests/test_harness.py`
|
|
96
113
|
- *Consumer / Call-Site*: Wire test runner into CI workflow and `tests/all.py`
|
|
97
114
|
- *Verification*: `pytest tests/test_harness.py` (proves negative controls catch malformed JSON)
|
|
98
|
-
- *Weave*: `vine submit && vine audit approve && vine weave`
|
|
115
|
+
- *Weave*: `vine submit && vine audit inspect task-test-harness && vine audit approve && vine weave`
|
|
99
116
|
|
|
100
117
|
### Phase 2: High-Level CLI & Integration
|
|
101
118
|
- [ ] **Task 2.1: CLI Subcommand Wiring** (`implementer`)
|