opencode-orchestrator 1.2.62 β†’ 1.2.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,8 +8,12 @@
8
8
 
9
9
  [![MIT License](https://img.shields.io/badge/license-MIT-red.svg)](LICENSE)
10
10
  [![npm](https://img.shields.io/npm/v/opencode-orchestrator.svg)](https://www.npmjs.com/package/opencode-orchestrator)
11
+ <!-- VERSION:START -->
12
+ **Version:** `1.2.66`
13
+ <!-- VERSION:END -->
11
14
  </div>
12
15
 
16
+
13
17
  ---
14
18
 
15
19
  ## ⚑ Quick Start
@@ -18,61 +22,184 @@
18
22
  npm install -g opencode-orchestrator
19
23
  ```
20
24
 
25
+ Install hooks are source-checkout safe, prefer `opencode.jsonc` when present, preserve sibling plugin entries, and skip automatic config mutation in CI environments.
26
+
21
27
  Inside an OpenCode environment:
22
28
  ```bash
23
29
  /task "Implement a new authentication module with JWT and audit logs"
24
30
  ```
25
31
 
32
+
26
33
  ---
27
34
 
28
35
  ## πŸš€ Engine Workflow
29
36
 
30
- OpenCode Orchestrator utilizes a **Hub-and-Spoke Topology** with **Work-Stealing Queues** to execute complex engineering tasks through parallel, context-isolated sessions.
31
-
32
- ```text
33
- [ User Task ]
34
- β”‚
35
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
36
- β”‚ COMMANDER │◄───────────┐ (Loop Phase)
37
- β”‚ [Work-Stealing] β”‚ β”‚
38
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
39
- β”‚ β”‚
40
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
41
- β”‚ PLANNER β”‚ (Todo.md) β”‚
42
- β”‚ [Session Pool] β”‚ β”‚
43
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
44
- β”‚ β”‚ (MVCC Atomic Sync)
45
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
46
- β–Ό (Isolated Session Pool)β–Ό β”‚
47
- [ Session A ] [ Session B ] [ Session C ] β”‚
48
- [ Worker ] [ Worker ] [ Reviewer ] β”‚
49
- β”‚ [Memory ] β”‚ [Memory ] β”‚ [Memory β”‚ β”‚
50
- β”‚ Pooling] β”‚ β”‚ Pooling] β”‚ β”‚ Pooling] β”‚ β”‚
51
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
52
- β”‚ β”‚
53
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
54
- β”‚ MSVP MONITOR β”‚β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
55
- β”‚ [Adaptive Poll] β”‚
56
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
57
- β”‚
58
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
59
- β”‚ QUALITY ASSURANCE β”‚
60
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
61
- β”‚
62
- [ ✨COMPLETED ]
37
+ **Hub-and-Spoke Architecture** with Work-Stealing Queues for parallel, context-isolated task execution.
38
+ ```
39
+ ╔══════════════════════════════════════════════════════════════════════════════╗
40
+ β•‘ USER INPUT /task "..." β•‘
41
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
42
+ β”‚
43
+ β–Ό
44
+ ╔══════════════════════════════════════════════════════════════════════════════╗
45
+ β•‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β•‘
46
+ β•‘ β”‚ C O M M A N D E R β”‚ β•‘
47
+ β•‘ β”‚ [ Mission Analysis & Delegation ] β”‚ β•‘
48
+ β•‘ β”‚ β”‚ β•‘
49
+ β•‘ β”‚ β€’ Interprets user intent β€’ Coordinates multi-agent workflow β”‚ β•‘
50
+ β•‘ β”‚ β€’ Monitors progress β€’ Manages work-stealing queues β”‚ β•‘
51
+ β•‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β•‘
52
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
53
+ β”‚
54
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
55
+ β–Ό β–Ό β–Ό
56
+ ╔═════════════════╗ ╔═════════════════╗ ╔═════════════════╗
57
+ β•‘ P L A N N E R β•‘ β•‘ W O R K E R β•‘ β•‘ W O R K E R β•‘
58
+ β•‘ [Architect] β•‘ β•‘ [Implementer] β•‘ β•‘ [Implementer] β•‘
59
+ β•‘ β•‘ β•‘ β•‘ β•‘ β•‘
60
+ β•‘ β€’ Dependency β•‘ β•‘ β€’ File coding β•‘ β•‘ β€’ File coding β•‘
61
+ β•‘ analysis β•‘ β•‘ β€’ TDD workflow β•‘ β•‘ β€’ TDD workflow β•‘
62
+ β•‘ β€’ Roadmap gen β•‘ β•‘ β€’ Documentationβ•‘ β•‘ β€’ Documentationβ•‘
63
+ β•‘ β€’ TODO.md β•‘ β•‘ β•‘ β•‘ β•‘
64
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
65
+ β”‚ β”‚ β”‚
66
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
67
+ β”‚ β”‚ β”‚
68
+ β–Ό β–Ό β–Ό
69
+ ╔══════════════════════════════════════╗
70
+ β•‘ SESSION POOL (MVCC Sync) β•‘
71
+ β•‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β•‘
72
+ β•‘ β”‚ Object Pool β”‚ Buffer Pool β”‚ β•‘
73
+ β•‘ β”‚ String Pool β”‚ Connection Pool β”‚ β•‘
74
+ β•‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β•‘
75
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
76
+ β”‚
77
+ β–Ό
78
+ ╔══════════════════════════════════════╗
79
+ β•‘ MSVP MONITOR / REVIEWER β•‘
80
+ β•‘ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β•‘
81
+ β•‘ β”‚ β€’ Adaptive polling (500ms-5s) β”‚ β•‘
82
+ β•‘ β”‚ β€’ Stability detection β”‚ β•‘
83
+ β•‘ β”‚ β€’ Unit test verification β”‚ β•‘
84
+ β•‘ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β•‘
85
+ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
86
+ β”‚
87
+ β–Ό
88
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
89
+ β”‚ ✨ COMPLETED β”‚
90
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
91
+ ```
92
+
93
+ ---
94
+
95
+ ## πŸ—οΈ Architecture Layers
96
+
97
+ ```
98
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
99
+ β”‚ PRESENTATION LAYER β”‚
100
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
101
+ β”‚ β”‚ Task Toast β”‚ β”‚ Progress β”‚ β”‚ Notificationβ”‚ β”‚ Mission Summary β”‚ β”‚
102
+ β”‚ β”‚ Manager β”‚ β”‚ Notifier β”‚ β”‚ Manager β”‚ β”‚ Display β”‚ β”‚
103
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
104
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
105
+ β”‚ BUSINESS LOGIC LAYER β”‚
106
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
107
+ β”‚ β”‚ Parallel Agent Orchestration β”‚ β”‚
108
+ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
109
+ β”‚ β”‚ β”‚ Commander β”‚ β”‚ Planner β”‚ β”‚ Worker β”‚ β”‚ Reviewer β”‚ β”‚ β”‚
110
+ β”‚ β”‚ β”‚ Agent β”‚ β”‚ Agent β”‚ β”‚ Agent β”‚ β”‚ Agent β”‚ β”‚ β”‚
111
+ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
112
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
113
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
114
+ β”‚ β”‚ Concurrency β”‚ β”‚ Task Store β”‚ β”‚ Hook System β”‚β”‚
115
+ β”‚ β”‚ Controller β”‚ β”‚ (In-Memory) β”‚ β”‚ [Early/Normal/Late Phases] β”‚β”‚
116
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
117
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
118
+ β”‚ INFRASTRUCTURE LAYER β”‚
119
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
120
+ β”‚ β”‚ Session Pool β”‚ β”‚ Work-Stealing β”‚ β”‚ Memory Pools β”‚ β”‚
121
+ β”‚ β”‚ [5 per agent] β”‚ β”‚ [Chase-Lev] β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”β”‚ β”‚
122
+ β”‚ β”‚ [10 reuse max] β”‚ β”‚ [LIFO/FIFO] β”‚ β”‚ β”‚Objectβ”‚ β”‚Stringβ”‚ β”‚Bufferβ”‚β”‚ β”‚
123
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ 200 β”‚ β”‚ internβ”‚ β”‚ 4KB β”‚β”‚ β”‚
124
+ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜β”‚ β”‚
125
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
126
+ β”‚ β”‚ MVCC State β”‚ β”‚ Circuit Breaker β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
127
+ │ │ [Atomic Sync] │ │ [5 failures→open│ │ Rust Connection Pool │ │
128
+ │ │ │ │ [2 success→close│ │ [4 processes, 30s idle] │ │
129
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
130
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
131
+ β”‚ SAFETY LAYER β”‚
132
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
133
+ β”‚ β”‚ RAII Pattern β”‚ β”‚ Shutdown β”‚ β”‚ Auto-Recovery β”‚ β”‚
134
+ β”‚ β”‚ [Zero Leaks] β”‚ β”‚ Manager β”‚ β”‚ [Exponential Backoff] β”‚ β”‚
135
+ β”‚ β”‚ β”‚ β”‚ [5s timeout] β”‚ β”‚ [Rate limit handling] β”‚ β”‚
136
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
137
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
138
+ ```
139
+
140
+ ---
141
+
142
+ ## πŸ§ͺ Test Harness System
143
+
144
+ **Production-grade test infrastructure** inspired by modern testing practices:
145
+
146
+ ```
147
+ tests/harness/
148
+ β”œβ”€β”€ fixture.ts Disposable tmpdir utilities
149
+ β”‚ β”œβ”€β”€ tmpdir() async disposable with cleanup
150
+ β”‚ β”œβ”€β”€ tmpdirSync() sync disposable with cleanup
151
+ β”‚ β”œβ”€β”€ createMockFs() In-memory fs mock
152
+ β”‚ └── waitFor() Async condition waiter
153
+ β”‚
154
+ β”œβ”€β”€ builders.ts Factory functions for test objects
155
+ β”‚ β”œβ”€β”€ createParallelTask() Build ParallelTask instances
156
+ β”‚ β”œβ”€β”€ createBackgroundTask() Build BackgroundTask instances
157
+ β”‚ └── createTodo() Build Todo instances
158
+ β”‚
159
+ β”œβ”€β”€ mocks.ts Mock utilities
160
+ β”‚ β”œβ”€β”€ mockConsole() Spy on console.log/error
161
+ β”‚ β”œβ”€β”€ mockProcessExit() Mock process.exit
162
+ β”‚ β”œβ”€β”€ useFakeTimers() Time manipulation
163
+ β”‚ └── createMockEmitter() EventEmitter spy
164
+ β”‚
165
+ └── index.ts Unified exports
166
+ ```
167
+
168
+ ### Usage Example
169
+
170
+ ```typescript
171
+ import { tmpdir, createParallelTask, mockConsole } from "@/tests/harness";
172
+
173
+ describe("My test", () => {
174
+ let consoleMock;
175
+
176
+ beforeEach(() => {
177
+ consoleMock = mockConsole();
178
+ consoleMock.setup();
179
+ });
180
+
181
+ afterEach(() => {
182
+ consoleMock.restore();
183
+ });
184
+
185
+ it("should work", async () => {
186
+ await using tmp = await tmpdir({ git: true });
187
+ const task = createParallelTask({ description: "Test" });
188
+ expect(task.status).toBe("pending");
189
+ });
190
+ });
63
191
  ```
64
192
 
65
193
  ---
66
194
 
67
195
  ## ⚑ Elite Multi-Agent Swarm
68
196
 
69
- | Agent | Expertise | Capability |
70
- |:------|:----------|:-----------|
71
- | **Commander** | Mission Hub | Session pooling, parallel thread control, state rehydration, work-stealing coordination |
72
- | **Planner** | Architect | Symbolic mapping, dependency research, roadmap generation, file-level planning |
197
+ | Agent | Role | Core Responsibilities |
198
+ |:------|:-----|:------------------------|
199
+ | **Commander** | Mission Hub | Task decomposition, agent coordination, work-stealing orchestration, final mission seal |
200
+ | **Planner** | Architect | Dependency analysis, roadmap generation, TODO.md creation via MVCC, file-level planning |
73
201
  | **Worker** | Implementer | High-throughput coding, TDD workflow, documentation, isolated file execution |
74
- | **Reviewer** | Auditor | Rigid verification, LSP/Lint authority, integration testing, final mission seal |
75
-
202
+ | **Reviewer** | Auditor | Unit test verification, LSP/Lint validation, integration testing, quality gate |
76
203
  ---
77
204
 
78
205
  ## πŸ› οΈ Core Capabilities
@@ -153,6 +280,9 @@ The installation process is **production-safe** with multiple protection layers:
153
280
  3. βœ… **Atomic writes** β€” temp file + rename (OS-level atomic)
154
281
  4. βœ… **Automatic rollback** β€” restores from backup on any failure
155
282
  5. βœ… **Cross-platform** β€” Windows (native, Git Bash, WSL2), macOS, Linux
283
+ 6. βœ… **CI-aware** β€” skips non-essential operations in CI environments
284
+ 7. βœ… **Timeout protection** β€” 30s timeout prevents hanging
285
+ 8. βœ… **Graceful degradation** β€” exits 0 on non-critical failures
156
286
 
157
287
  ### Configuration Logs
158
288
  - Unix: `/tmp/opencode-orchestrator.log`
@@ -160,11 +290,36 @@ The installation process is **production-safe** with multiple protection layers:
160
290
 
161
291
  ---
162
292
 
293
+ ## πŸ§ͺ Testing & Stability
294
+
295
+ ### Test Harness System
296
+ A production-grade test harness (`tests/harness/`) provides:
297
+ - **Disposable tmpdir**: Automatic cleanup with `Symbol.asyncDispose` / `Symbol.dispose`
298
+ - **Test builders**: Factory functions for `ParallelTask`, `BackgroundTask`, `Todo`
299
+ - **Mock utilities**: Console, process, timers, file system, event emitter mocks
300
+
301
+ ```typescript
302
+ import { tmpdir, createParallelTask, mockConsole } from "@/tests/harness";
303
+
304
+ await using tmp = await tmpdir({ git: true });
305
+ const task = createParallelTask({ description: "Test" });
306
+ ```
307
+
308
+ ### TUI Stability
309
+ - **Cleanup guarantees**: `initToastClient()` returns a cleanup function
310
+ - **Timeout protection**: AbortController-based 2-10s timeout for async toast operations
311
+ - **Error isolation**: Try/catch around all toast operations prevents cascade failures
312
+
313
+ ### Cross-Platform Reliability
314
+ - **Windows guard**: Proper handling of WSL2, Git Bash, native Windows paths
315
+ - **Signal handling**: Graceful shutdown on SIGINT/SIGTERM
316
+ - **Process isolation**: Child process cleanup with timeout
317
+
318
+ ---
319
+
163
320
  ## πŸ“š Documentation
164
321
 
165
- - [Why We Built a Custom Orchestrator β†’](docs/WHY_CUSTOM_ORCHESTRATOR.md)
166
322
  - [System Architecture Deep-Dive β†’](docs/SYSTEM_ARCHITECTURE.md)
167
- - [Windows Configuration Guide β†’](docs/WINDOWS_CONFIGURATION.md)
168
323
  - [Developer Notes β†’](docs/DEVELOPERS_NOTE.md)
169
324
 
170
325
  ---
@@ -1,21 +1,2 @@
1
- /**
2
- * TASK_STATUS - Task status constants (for parallel tasks)
3
- */
4
- export declare const TASK_STATUS: {
5
- readonly PENDING: "pending";
6
- readonly RUNNING: "running";
7
- readonly COMPLETED: "completed";
8
- readonly FAILED: "failed";
9
- readonly ERROR: "error";
10
- readonly TIMEOUT: "timeout";
11
- readonly CANCELLED: "cancelled";
12
- };
13
- /**
14
- * TODO_STATUS - Todo item status constants
15
- */
16
- export declare const TODO_STATUS: {
17
- readonly PENDING: "pending";
18
- readonly IN_PROGRESS: "in_progress";
19
- readonly COMPLETED: "completed";
20
- readonly CANCELLED: "cancelled";
21
- };
1
+ export { TASK_STATUS } from "../../../shared/loop/constants/task-status.js";
2
+ export { TODO_STATUS } from "../../../shared/loop/constants/todo-status.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Circuit Breaker - Loop Detection and Prevention
3
+ *
4
+ * Detects repetitive patterns and trips the circuit to prevent
5
+ * infinite loops. Uses tool call history for pattern detection.
6
+ */
7
+ export interface CircuitBreakerState {
8
+ lastAccessedAt: number;
9
+ lastTrippedAt: number;
10
+ isOpen: boolean;
11
+ toolCallHistory: string[];
12
+ }
13
+ export declare function isCircuitOpen(sessionID: string): boolean;
14
+ export declare function detectRepetitiveToolUse(sessionID: string): string | null;
15
+ export declare function shouldTripCircuit(sessionID: string): boolean;
16
+ export declare function recordToolCall(sessionID: string, toolName: string): void;
17
+ export declare function clearCircuitState(sessionID: string): void;
18
+ export declare function getCircuitState(sessionID: string): CircuitBreakerState | undefined;
19
+ export declare function shutdownCircuitBreaker(): void;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Compaction Guard - Prevents post-compaction Resume Errors
3
+ *
4
+ * After session compaction, continuation prompts may reference deleted context.
5
+ * This guard ensures continuation only happens after a newer compaction epoch.
6
+ */
7
+ export interface CompactionGuardState {
8
+ compactionEpoch: number;
9
+ lastAccessedAt: number;
10
+ }
11
+ export declare function armCompactionGuard(sessionID: string, timestamp: number): number;
12
+ export declare function isCompactionSafe(sessionID: string, currentEpoch: number): boolean;
13
+ export declare function clearCompactionState(sessionID: string): void;
14
+ export declare function getCompactionState(sessionID: string): CompactionGuardState | undefined;
15
+ export declare function shutdownCompactionGuard(): void;
@@ -3,23 +3,14 @@
3
3
  *
4
4
  * Monitors session events and ensures the mission loop continues
5
5
  * until all verification requirements are met.
6
+ *
7
+ * Integrates: ProgressTracker, SessionStateStore, CompactionGuard, CircuitBreaker
6
8
  */
7
9
  import type { PluginInput } from "@opencode-ai/plugin";
8
10
  type OpencodeClient = PluginInput["client"];
9
- /**
10
- * Handle session.idle event for mission loop
11
- */
12
11
  export declare function handleMissionIdle(client: OpencodeClient, directory: string, sessionID: string, mainSessionID?: string): Promise<void>;
13
- /**
14
- * Handle user message - cancel countdown
15
- */
16
12
  export declare function handleUserMessage(sessionID: string): void;
17
- /**
18
- * Handle abort
19
- */
20
13
  export declare function handleAbort(sessionID: string): void;
21
- /**
22
- * Clean up session state
23
- */
24
14
  export declare function cleanupSession(sessionID: string): void;
15
+ export declare function handleSessionCompacted(sessionID: string): void;
25
16
  export {};
@@ -42,7 +42,3 @@ export declare function generateMissionContinuationPrompt(state: MissionLoopStat
42
42
  * Generate completion notification
43
43
  */
44
44
  export declare function generateCompletionNotification(state: MissionLoopState): string;
45
- /**
46
- * Generate max iterations reached notification
47
- */
48
- export declare function generateMaxIterationsNotification(state: MissionLoopState): string;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Progress Tracker - Snapshot-based Progress Tracking
3
+ *
4
+ * Implements content-hash-based progress detection to identify when
5
+ * agents are truly making progress vs just cycling without completion.
6
+ */
7
+ export interface NormalizedTodo {
8
+ id: string | null;
9
+ content: string;
10
+ priority: string;
11
+ status: string;
12
+ }
13
+ export interface ProgressUpdateResult {
14
+ hasProgressed: boolean;
15
+ stagnationCount: number;
16
+ previousIncompleteCount?: number;
17
+ progressSource: "none" | "count" | "snapshot";
18
+ recoveredFromStagnation?: boolean;
19
+ }
20
+ export declare const DEFAULT_STAGNATION_THRESHOLD = 3;
21
+ export declare const PROGRESS_GRACE_PERIOD_MS = 5000;
22
+ export declare function hashTodos(todos: NormalizedTodo[]): string;
23
+ export declare function countCompleted(todos: NormalizedTodo[]): number;
24
+ export declare function resetProgress(sessionID: string): void;
25
+ export declare function clearSession(sessionID: string): void;
26
+ export declare function trackProgress(sessionID: string, incompleteCount: number, todos?: NormalizedTodo[]): ProgressUpdateResult;
27
+ export declare function markInjectionPerformed(sessionID: string): void;
28
+ export declare function isStagnant(sessionID: string, threshold?: number): boolean;
29
+ export declare function getStagnationCount(sessionID: string): number;
30
+ export interface ProgressTracker {
31
+ trackProgress: typeof trackProgress;
32
+ resetProgress: typeof resetProgress;
33
+ clearSession: typeof clearSession;
34
+ hashTodos: typeof hashTodos;
35
+ isStagnant: typeof isStagnant;
36
+ getStagnationCount: typeof getStagnationCount;
37
+ markInjectionPerformed: typeof markInjectionPerformed;
38
+ }
39
+ export declare function createProgressTracker(): ProgressTracker;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Session State Store - TTL-based Session State Management
3
+ *
4
+ * Provides automatic cleanup of stale session states to prevent memory leaks.
5
+ */
6
+ export interface SessionState {
7
+ stagnationCount: number;
8
+ countdownTimer?: ReturnType<typeof setTimeout>;
9
+ countdownStartedAt?: number;
10
+ lastCheckTime?: number;
11
+ isRecovering: boolean;
12
+ isAborting: boolean;
13
+ inFlight: boolean;
14
+ }
15
+ export declare const SESSION_STATE_TTL_MS: number;
16
+ export declare const PRUNE_INTERVAL_MS: number;
17
+ export interface SessionStateStore {
18
+ getState: (sessionID: string) => SessionState;
19
+ getExistingState: (sessionID: string) => SessionState | undefined;
20
+ cancelCountdown: (sessionID: string) => void;
21
+ cleanup: (sessionID: string) => void;
22
+ cancelAllCountdowns: () => void;
23
+ shutdown: () => void;
24
+ }
25
+ declare function createSessionStateStore(): SessionStateStore;
26
+ export { createSessionStateStore };
@@ -8,7 +8,7 @@ type OpencodeClient = PluginInput["client"];
8
8
  /**
9
9
  * Initialize the toast system with the OpenCode client
10
10
  */
11
- export declare function initToastClient(client: OpencodeClient): void;
11
+ export declare function initToastClient(client: OpencodeClient): () => void;
12
12
  /**
13
13
  * Register a notification handler
14
14
  */
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * PluginManager - Manages dynamic loading of orchestrator plugins
3
3
  */
4
+ import type { ToolDefinition } from "@opencode-ai/plugin";
4
5
  export declare class PluginManager {
5
6
  private static instance;
6
7
  private plugins;
@@ -17,7 +18,7 @@ export declare class PluginManager {
17
18
  /**
18
19
  * Get all dynamically registered tools
19
20
  */
20
- getDynamicTools(): Record<string, any>;
21
+ getDynamicTools(): Record<string, ToolDefinition>;
21
22
  /**
22
23
  * Shutdown - cleanup all plugins
23
24
  */