opencode-orchestrator 1.0.22 → 1.0.24

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.
Files changed (3) hide show
  1. package/README.md +89 -152
  2. package/dist/index.js +62 -14
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,194 +1,131 @@
1
1
  <div align="center">
2
- <img src="assets/logo.png" alt="logo" width="280" />
2
+ <img src="assets/logo.png" alt="logo" width="200" />
3
3
  <h1>OpenCode Orchestrator</h1>
4
4
 
5
- <p><b>Next-Gen Autonomous Mastery: Powered by HPFA™ & MSVP™</b></p>
6
- <p><i>Redefining Scalability with Fractal Swarm Intelligence and Multi-Stage Integrity</i></p>
5
+ <p>Autonomous Multi-Agent Orchestration Engine for Software Engineering</p>
7
6
 
8
- [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+ [![MIT License](https://img.shields.io/badge/license-MIT-gray.svg)](LICENSE)
9
8
  [![npm](https://img.shields.io/npm/v/opencode-orchestrator.svg)](https://www.npmjs.com/package/opencode-orchestrator)
10
- [![Tests](https://img.shields.io/badge/tests-216%20passed-brightgreen.svg)]()
11
9
  </div>
12
10
 
13
11
  ---
14
12
 
13
+ ## Overview
14
+
15
+ OpenCode Orchestrator is a framework designed to manage complex software engineering tasks through parallel multi-agent execution. It extends the capabilities of standard AI agents by introducing a hierarchical delegation model and a multi-stage verification pipeline.
16
+
17
+ ### Key Characteristics
18
+ * **Parallel Execution**: Manages multiple concurrent agent sessions to accelerate development.
19
+ * **Hierarchical Delegation**: Supports recursive task decomposition (Fractal Spawning) for complex requirements.
20
+ * **Integrated Verification**: Employs a multi-stage pipeline (Unit & Integration) to ensure code quality.
21
+ * **Persistent State**: Uses structured logging to maintain state and recover from interruptions.
22
+
23
+ ---
24
+
15
25
  ## ⚡ Quick Start
16
26
 
17
27
  ```bash
18
28
  npm install -g opencode-orchestrator
19
29
  ```
20
30
 
21
- Then in OpenCode, launch your mission:
31
+ In an OpenCode environment:
22
32
  ```bash
23
- /task "Architect and Build a Diablo-like Web Game"
33
+ /task "Implement a real-time collaborative editor using WebSocket"
24
34
  ```
25
35
 
26
- ### 🌌 **The End of Sequential Limits. The Era of Fractal Mastery.**
27
-
28
- Where traditional agents hit a sequential wall, we deploy a fractal swarm. OpenCode Orchestrator is the world's most advanced autonomous engineering platform—a **Titan-Class Execution Engine** designed to conquer missions that break conventional AI.
29
-
30
- By fusing **Fractal Swarm Intelligence (HPFA™)** with **Continuous Multi-Stage Verification Pipeline (MSVP™)**, it delivers a level of scale, velocity, and architectural absolute previously considered impossible. Welcome to the final form of autonomous development. No bottlenecks. No limits. Only pure execution.
36
+ ---
31
37
 
38
+ ## 🏗️ Architecture
32
39
 
33
- ## 💎 The Four Pillars of Excellence
40
+ The system is built upon two core mechanisms that handle scaling and quality control.
34
41
 
35
- We’ve combined industrial-grade reliability with cutting-edge parallel intelligence to redefine what’s possible in AI coding.
42
+ ### HPFA (Hyper-Parallel Fractal Architecture)
43
+ HPFA is a parallel execution model that enables task decomposition at scale.
44
+ * **Managed Concurrency**: Orchestrates up to 50 parallel agent sessions simultaneously.
45
+ * **Recursive Scaling**: Allows "Worker" agents to spawn sub-workers for modular tasks, ensuring deep architectural coverage.
36
46
 
37
- * **⚡ Velocity**: Parallelize up to 50 concurrent sessions. What takes hours for others is finished in minutes through **Cognitive Elasticity**.
38
- * **🧬 Scale**: **Fractal Delegation** allows workers to recursively spawn their own sub-agents. No task is too big for a system that can replicate its own intelligence.
39
- * **🛡️ Safety**: Our **MSVP (Multi-Stage Verification Pipeline)** reviews every line of code in parallel "Shadow Sessions" before it ever touches your build.
40
- * **♾️ Trust**: **Iron-Clad Reliability** via Write-Ahead Logging (WAL). Even after a crash, the system replays its history to resume exactly where it was.
47
+ ### MSVP (Multi-Stage Verification Pipeline)
48
+ MSVP is a structured verification process that decouples implementation from quality assurance.
49
+ * **Stage 1 (Unit Verification)**: Reviewers validate individual module changes and run local tests immediately after implementation.
50
+ * **Stage 2 (Integration Review)**: A master reviewer verifies cross-module consistency and system integrity after all individual units are completed.
41
51
 
42
52
  ---
43
53
 
44
- ## Core Philosophy
45
-
46
- ```
47
- ┌───────────────────────────────────────────────────┐
48
- 🔍 EXPLORE → 📝 LEARN → 🔄 ADAPT → ⚡ ACT │
49
- │ Scan Document Adjust Execute │
50
- └───────────────────────────────────────────────────┘
54
+ ## 📊 Workflow Diagram
55
+
56
+ ```text
57
+ [User Task Input]
58
+
59
+ ┌─────────▼─────────┐
60
+ │ COMMANDER │ (Orchestration context)
61
+ └─────────┬─────────┘
62
+
63
+ ┌────────────────▼────────────────┐
64
+ │ Phase 0: Parallel Discovery │ (Structure, Tech Stack, Docs, Infra)
65
+ └────────────────┬────────────────┘
66
+
67
+ ┌─────────▼─────────┐
68
+ │ PLANNER │ (Create Hierarchical Plan)
69
+ └─────────┬─────────┘
70
+
71
+ ┌────────────────▼────────────────┐
72
+ │ Phase 1: Parallel Execution │ (HPFA Implementation Grid)
73
+ └──────┬─────────┬─────────┬──────┘
74
+ │ │ │
75
+ ┌──────▼──┐ ┌────▼───┐ ┌───▼────┐
76
+ │ WORKER │ │ WORKER │ │ WORKER │ (Fractal Spawning)
77
+ └──────┬──┘ └────┬───┘ └───┬────┘
78
+ │ │ │
79
+ ┌──────▼──┐ ┌────▼───┐ ┌───▼────┐
80
+ │ REVIEWER│ │ REVIEWER│ │ REVIEWER│ (Stage 1: Unit Verification)
81
+ └──────┬──┘ └────┬───┘ └───┬────┘
82
+ │ │ │
83
+ ───────▼─────────▼─────────▼───────
84
+ │ Sync Barrier │ (Wait for all units)
85
+ ─────────────────┬─────────────────
86
+
87
+ ┌─────────▼─────────┐
88
+ │ MASTER REVIEWER │ (Stage 2: System Integration)
89
+ └─────────┬─────────┘
90
+
91
+ ┌─────────▼─────────┐
92
+ │ Mission Sealed? │
93
+ └─────────┬─────────┘
94
+ No ↙ ↘ Yes
95
+ [Loop] [Complete]
51
96
  ```
52
97
 
98
+ ---
53
99
 
54
- ## 🚀 The Agents
55
-
56
- | Agent | Role | What It Does |
57
- |:------|:-----|:-------------|
58
- | 🎯 **Commander** | Orchestrator | Leads the task, delegates work to other agents, ensures completion |
59
- | 📋 **Planner** | Researcher | Analyzes the project, creates the plan, documents findings |
60
- | 🔨 **Worker** | Implementer | Writes code, modifies files, follows the project's patterns |
61
- | ✅ **Reviewer** | Verifier | Tests changes, checks for errors, confirms quality |
62
-
63
-
64
-
65
- ## 📖 Principles
66
-
67
- | Principle | What It Means |
68
- |:----------|:--------------|
69
- | 🔍 **Never Assume** | Always check the actual code and config files first |
70
- | 📝 **Document Everything** | Record patterns and findings for future tasks |
71
- | 📚 **Verify with Evidence** | Run tests, cite sources, complete with proof |
72
- | 🔄 **Adapt to the Project** | Match the project's existing style and patterns |
73
- | 🤝 **Specialized Roles** | Each agent has a clear, focused responsibility |
74
-
100
+ ## 🚀 System Roles
75
101
 
76
- ## 🏛️ Hyper-Parallel Architecture: HPFA & MSVP
102
+ | Role | Responsibility | Key Actions |
103
+ |:-----|:---------------|:------------|
104
+ | **Commander** | Mission Control | Task assignment, conflict resolution, global synchronization |
105
+ | **Planner** | Architecture | Environment analysis, dependency mapping, TODO generation |
106
+ | **Worker** | Implementation | Code writing, file modification, unit test creation |
107
+ | **Reviewer** | Quality Control| Static analysis, build verification, integration testing |
77
108
 
78
- The orchestrator eliminates the linear reasoning bottleneck of conventional AI agents by shifting from sequential execution to a **Distributed Runtime Unit** paradigm.
109
+ ---
79
110
 
80
- ### 🧬 **HPFA™ (Hyper-Parallel Fractal Architecture)**
81
- HPFA defines a recursive problem-solving model that decomposes massive codebases into atomic task units through a fractal hierarchy.
82
- * **Fractal Delegation**: Workers are instantiated as autonomous controllers with localized `TaskLauncher` contexts. This enables recursive spawning of sub-agents up to 8 levels deep, mapping complex architectural hierarchies into a parallel execution grid.
83
- * **Cognitive Concurrency Control**: A dedicated state-machine manages up to 50 concurrent sessions. It monitors success/failure trajectories to dynamically scale concurrency slots, ensuring maximum throughput while maintaining strict rate-limit compliance.
111
+ ## 🛠️ Features
84
112
 
85
- ### 🛡️ **MSVP™ (Multi-Stage Verification Pipeline)**
86
- MSVP ensures continuous integration integrity by decoupling verification from the implementation lifecycle, treating code review as a parallel background-thread.
87
- * **Shadow Review Pipeline**: Upon every file-write operation, a parallel reviewer session is instantly snapshotted (Unit-level Verification). This zero-latency audit identifies defects the millisecond they are introduced, without blocking the primary implementation thread.
88
- * **Global Barrier-Sync Protocol**: Implements a synchronized verification gate. The system enforces a blocking "Barrier" that requires consistency across all distributed units before transitioning to the final Master Review (E2E Integration) and Mission Sealing.
89
-
90
- ```
91
- /task "Build Diablo Game"
92
-
93
- ╔═══════════════════════════════════════╗
94
- ║ 🎯 COMMANDER — Orchestrator ║
95
- ║ (Main Session - Single) ║
96
- ╚═══════════════════╤═══════════════════╝
97
-
98
- ══════════════════════════▼══════════════════════════
99
- ║ 🚀 PHASE 0: DISCOVERY SWARM (Parallel) ║
100
- ═════════════════════════════════════════════════════
101
- │ │ │ │
102
- ▼ Scout ▼ Scout ▼ Scout ▼ Scout
103
- [Structure] [Stack] [Docs] [Infra]
104
- └───────────────┬───────────────┬───────────────┘
105
- │ Consolidate & Sync
106
- ┌────────▼───────────────────┐
107
- │ 📋 PLANNER — Create Plan │
108
- │ → Outputs: Architectural Grid │
109
- └───────────────────┬───────────────────┘
110
-
111
- ══════════════════════════╧══════════════════════════
112
- ║ 🔥 HPFA PARALLEL GRID (MSVP) ║
113
- ══════════════════════════════════════════════════════
114
- │ │ │ │
115
- ▼ ▼ ▼ ▼
116
- ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
117
- │🔨 WORKER │ │🔨 WORKER │ │🔨 WORKER │ │🔨 WORKER │ <-- Fractal Spawning
118
- │ Module A │ │ Module B │ │ Module C │ │ Module D │
119
- └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
120
- │ ⚡ Instant │ ⚡ Instant │ ⚡ Instant │ ⚡ Instant
121
- ▼ Review ▼ Review ▼ Review ▼ Review
122
- ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
123
- │✅ REVIEWR│ │✅ REVIEWR│ │✅ REVIEWR│ │✅ REVIEWR│ <-- Stage 1: Unit
124
- │ (Unit-A) │ │ (Unit-B) │ │ (Unit-C) │ │ (Unit-D) │ Verification
125
- └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
126
- │ │ │ │
127
- ═▼═══════════════▼═══════════════▼═══════════════▼════
128
- ║ ⏳ SYNC BARRIER ║
129
- ══════════════════════════════════════════════════════
130
-
131
- ┌───────────────────▼───────────────────┐
132
- │ ✅ MASTER REVIEWER — Final Pass │
133
- │ (Cross-module Integration) │
134
- │ → Stage 2: E2E & System Integrity │
135
- └───────────────────┬───────────────────┘
136
-
137
- ┌─────────┴─────────┐
138
- │ Seal Conditions │
139
- │ Verified? │
140
- └─────────┬─────────┘
141
- No ↙ ↘ Yes
142
- ♻️ LOOP 🎖️ MISSION
143
- (Adaptive) SEALED
144
- ```
145
-
146
- ### Execution Model (MSVP)
147
-
148
- | Phase | Agent | Parallelism | Verification Level |
149
- |:------|:------|:------------|:-------------------|
150
- | 1️⃣ Plan | Planner | **Single** | Static Analysis |
151
- | 2️⃣ Implement | Workers | **HPFA Parallel** | Direct Coding |
152
- | 3️⃣ Unit Pass | Reviewers | **Shadow Parallel** | **1차 리뷰**: Unit Tests (Async) |
153
- | 4️⃣ Final Sync | Barrier | **Blocking** | All Units Verified |
154
- | 5️⃣ Integration | Master Reviewer | **Single** | **2차 리뷰**: Full E2E & Sync |
155
-
156
- ## Features
157
-
158
- | Feature | What It Does |
159
- |:---------|:-------------|
160
- | 🚀 **MSVP™ Pipeline** | Zero-latency unit reviews triggered the millisecond code is written |
161
- | 🧬 **Fractal Spawning** | Workers recursively spawn sub-agents for infinite structural depth |
162
- | ⚡ **50 Parallel Tasks** | Titan-class density—run massive swarms without breaking a sweat |
163
- | 🔄 **Non-Stop Recovery** | WAL-powered cognitive persistence; resumes instantly after any crash |
164
- | 🔥 **Multi-File Ops** | Massive parallel edits with cross-file context integrity |
165
- | 🛡️ **Self-Scaling** | Dynamic AI-driven concurrency management based on success velocity |
166
- | 🩹 **Memory Integrity** | 100% reclamation; engineered for sessions with 10k+ iterations |
167
- | 🏗️ **Clean-Code Engine**| Enforces industrial modularity and clean architectural patterns |
113
+ * **Concurrent Task Management**: Efficiently handles up to 50 background agent sessions.
114
+ * **Automated Context Synthesis**: Parallel scouters gather environment intelligence (Structure, Stack, Docs) instantly.
115
+ * **Synchronized Verification**: Ensures all distributed tasks pass Stage 1 review before final integration.
116
+ * **Fault Tolerance**: Automatically resumes progress from checkpoints in case of tool or session failure.
117
+ * **Context Optimization**: Monitors context window limits and performs automated compaction for long sessions.
168
118
 
169
119
  ---
170
120
 
121
+ ## Piano Developer's Note
171
122
 
172
- ## Error Handling
173
-
174
- | Error | What Happens |
175
- |:------|:-------------|
176
- | 💥 Tool crash | Inject recovery prompt and retry |
177
- | 🚦 Rate limit hit | Wait and retry with exponential backoff |
178
- | 📦 Context overflow | Compact the context automatically |
179
- | ⏱️ Session timeout | Resume from the last checkpoint |
180
- | 🔨 Build failure | Fix the issue and retry |
123
+ OpenCode Orchestrator was developed to solve the "sequential bottleneck" in AI-assisted coding. By treating agents as distributed processing units rather than just chat interfaces, we aim to provide a more reliable and scalable autonomous engineering experience.
181
124
 
125
+ [Full Developer's Note →](docs/DEVELOPERS_NOTE.md)
182
126
 
183
127
  ---
184
128
 
185
- ## 🎹 Developer's Words
186
-
187
- > "We are not just building a tool; we are building an autonomous engineer that can evolve with the project. HPFA and MSVP are the heart of this evolution—turning AI from a chatbot into a high-performance execution engine."
188
- >
189
- > [Read the full Developer's Note →](docs/DEVELOPERS_NOTE.md)
190
-
191
-
192
129
  ## 📄 License
193
130
 
194
- MIT License. [LICENSE](LICENSE)
131
+ MIT License. See [LICENSE](LICENSE) for details.
package/dist/index.js CHANGED
@@ -15219,40 +15219,88 @@ ${PROMPT_TAGS.ASYNC_MONITORING.close}`;
15219
15219
 
15220
15220
  // src/agents/prompts/reviewer/integration-testing.ts
15221
15221
  var REVIEWER_INTEGRATION_TESTING = `${PROMPT_TAGS.INTEGRATION_TESTING.open}
15222
- ## E2E INTEGRATION TESTING (Master Mode)
15222
+ ## E2E INTEGRATION TESTING RULES
15223
15223
 
15224
- ### Step 1: Ingest Parallel Scout Findings
15224
+ ### 1. Timing
15225
+ Start when **${PATHS.TODO} \u2265 80%** (some Workers still active).
15226
+
15227
+ ### 2. Pre-integration Checklist
15228
+ Before running integration tests, all merged files must:
15229
+ - [ ] Have clean lsp_diagnostics
15230
+ - [ ] Have unit test passing records in ${PATHS.UNIT_TESTS}/
15231
+ - [ ] Be listed in ${PATHS.WORK_LOG} "Pending Integration"
15232
+
15233
+ ### Integration Workflow (Master Mode)
15234
+
15235
+ #### Step 0: Ingest Parallel Scout Findings
15225
15236
  Read the output of the **[${SCOUT_INTEGRATION.NAME}]** swarm. Locate:
15226
15237
  - Cross-module interface changes
15227
15238
  - Shared constant modifications
15228
15239
  - Potential synchronization bottlenecks
15229
15240
 
15230
- ### Step 2: Global Consistency Check
15241
+ #### Step 1: Check ${PATHS.TODO} Status
15242
+ \`\`\`bash
15243
+ cat ${PATHS.TODO}
15244
+ # If incomplete items exist, wait for E2E
15245
+ \`\`\`
15246
+
15247
+ #### Step 2: Global Consistency Check
15231
15248
  - Do all modules agree on shared types?
15232
15249
  - Are imports/exports correctly synchronized across files?
15233
15250
  - Record results in ${PATHS.SYNC_ISSUES}
15234
15251
 
15235
- ### Step 3: Global Build Verification
15236
- - Run the project's BUILD command (from ${PATHS.CONTEXT})
15237
- - Must pass without errors
15252
+ #### Step 3: Run Build (language-appropriate)
15253
+ \`\`\`bash
15254
+ # Run project build command (from ${PATHS.CONTEXT})
15255
+ # If failed, record in ${PATHS.SYNC_ISSUES}
15256
+ \`\`\`
15238
15257
 
15239
- ### Step 4: System-wide Test Verification
15240
- - Run the project's TEST command (from ${PATHS.CONTEXT})
15241
- - ALL tests must pass
15258
+ #### Step 4: Run Full Tests
15259
+ \`\`\`bash
15260
+ # Run project test command (from ${PATHS.CONTEXT})
15261
+ # Check for regressions
15262
+ \`\`\`
15263
+
15264
+ #### Step 5: Write E2E Integration Test (if needed)
15265
+ - Write integration test in appropriate format
15266
+ - Verify multiple files work together
15267
+ - Unlike isolated tests, DO NOT delete
15268
+
15269
+ #### Step 6: Record Results
15270
+ Write to ${PATHS.INTEGRATION_STATUS}:
15271
+ \`\`\`markdown
15272
+ # Integration Status
15273
+
15274
+ ## Last Integration
15275
+ - Timestamp: [ISO timestamp]
15276
+
15277
+ ## Result
15278
+ - Build: ${STATUS_LABEL.PASS}/${WORK_STATUS.TEST_RESULT.FAIL}
15279
+ - E2E Test: ${STATUS_LABEL.PASS}/${WORK_STATUS.TEST_RESULT.FAIL}
15280
+
15281
+ ## Sync Issues Found
15282
+ - (omit if none)
15283
+ \`\`\`
15242
15284
 
15243
15285
  ---
15244
15286
 
15245
- ## Loop & Seal Logic (Reviewer Verdict)
15287
+ ## Loop Condition Check (Reviewer verifies)
15246
15288
 
15247
15289
  ### SEALED Conditions (all must be true)
15248
15290
  - [ ] ${PATHS.TODO} all items [x]
15249
15291
  - [ ] ${PATHS.SYNC_ISSUES} is EMPTY
15250
- - [ ] Build & System Tests pass
15292
+ - [ ] Build passes
15293
+ - [ ] E2E test passes
15251
15294
 
15252
15295
  ### LOOP BACK Conditions
15253
- - Missing items or unresolved issues \u2192 Record in ${PATHS.SYNC_ISSUES} \u2192 Trigger LOOP
15254
-
15255
- **CRITICAL**: As Master Reviewer, you are the final authority. Use the parallel intelligence from scouts to ensure 100% mission integrity.
15296
+ - ${PATHS.TODO} has incomplete items \u2192 LOOP
15297
+ - ${PATHS.SYNC_ISSUES} has unresolved issues \u2192 LOOP
15298
+ - Build/test fails \u2192 record in ${PATHS.SYNC_ISSUES} \u2192 LOOP
15299
+
15300
+ **CRITICAL**:
15301
+ - E2E only at ${PATHS.TODO} completion time!
15302
+ - Use the parallel intelligence from **[${SCOUT_INTEGRATION.NAME}]** to ensure 100% mission integrity.
15303
+ - All ${PATHS.TODO} [x] + no issues = SEALED!
15256
15304
  ${PROMPT_TAGS.INTEGRATION_TESTING.close}`;
15257
15305
 
15258
15306
  // src/agents/prompts/reviewer/sync-verification.ts
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "opencode-orchestrator",
3
3
  "displayName": "OpenCode Orchestrator",
4
4
  "description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
5
- "version": "1.0.22",
5
+ "version": "1.0.24",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {