@sulhadin/orchestrator 4.0.0-beta → 4.0.1-beta
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 +1 -1
- package/package.json +1 -1
- package/template/.claude-plugin/plugin.json +1 -1
- package/template/.orchestra/README.md +29 -46
- package/template/.orchestra/config.yml +0 -23
- package/template/.orchestra/roles/product-manager.md +1 -1
- package/template/agents/lead.md +13 -33
- package/template/commands/start.md +2 -4
- package/template/rules/phase-limits.orchestra.md +0 -7
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ PM challenges scope, creates M1-user-auth with 3 phases
|
|
|
122
122
|
|
|
123
123
|
**Role boundaries** — Enforced via `.claude/rules/`. PM cannot write code. Engineers cannot modify system files. Orchestrator cannot write features. Boundaries checked by file path, not by words.
|
|
124
124
|
|
|
125
|
-
**Milestone isolation** —
|
|
125
|
+
**Milestone isolation** — Every milestone runs in its own sub-agent — context freed automatically, enabling 20+ milestones in a single session. Normal mode asks before continuing; `--auto` chains milestones automatically.
|
|
126
126
|
|
|
127
127
|
**Stuck detection** — Detects repeated failures, circular fixes, over-engineering. Tries different approach once, then escalates. Auto mode skips to next phase.
|
|
128
128
|
|
package/package.json
CHANGED
|
@@ -50,9 +50,9 @@ You can plan new milestones while the lead is executing another one.
|
|
|
50
50
|
### Terminal 2: `/orchestra start` (Execution)
|
|
51
51
|
|
|
52
52
|
Lead reads milestones, derives the right team member identity from phase content, and delegates each phase to a sub-agent.
|
|
53
|
-
Sub-agents implement + verify; lead commits.
|
|
54
|
-
|
|
55
|
-
Maintains `context.md` for resume capability.
|
|
53
|
+
Sub-agents implement + verify; lead commits. Each milestone runs in its own sub-agent
|
|
54
|
+
for context isolation. After completion, `--auto` continues to next milestone automatically;
|
|
55
|
+
normal mode asks user before continuing. Maintains `context.md` for resume capability.
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
/orchestra start
|
|
@@ -86,7 +86,7 @@ Hotfix (production bugs):
|
|
|
86
86
|
### Milestone Lock
|
|
87
87
|
|
|
88
88
|
Lead claims a milestone by writing `Locked-By: {timestamp}` to milestone.md before execution.
|
|
89
|
-
Other leads skip locked milestones. Lock expires after
|
|
89
|
+
Other leads skip locked milestones. Lock expires after 60 minutes.
|
|
90
90
|
|
|
91
91
|
### Pipeline Modes (Complexity)
|
|
92
92
|
|
|
@@ -101,25 +101,22 @@ PM sets `Complexity` on milestone (pipeline) and `complexity` on each phase (mod
|
|
|
101
101
|
|
|
102
102
|
Defaults: config.yml `pipeline.default_pipeline` and `pipeline.default_complexity`.
|
|
103
103
|
|
|
104
|
-
### Milestone
|
|
104
|
+
### Milestone Execution
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|------|----------|----------|
|
|
110
|
-
| `inline` (default) | Lead runs milestone directly, **stops** after completion. User runs `/compact` then `/orchestra start` for next milestone. | Manual sessions, PC-based work |
|
|
111
|
-
| `agent` | Lead spawns a sub-agent per milestone. Context freed automatically after each. Loops to next milestone. | `--auto` overnight batch runs |
|
|
106
|
+
Every milestone runs in its own sub-agent for context isolation. After completion:
|
|
107
|
+
- **Normal mode:** Lead asks "Continue to next milestone?" — user decides
|
|
108
|
+
- **`--auto` mode:** Lead continues to next milestone automatically
|
|
112
109
|
|
|
113
110
|
```
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
→
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
→
|
|
111
|
+
/orchestra start /orchestra start --auto
|
|
112
|
+
→ Spawn Agent(M1) → done → Spawn Agent(M1) → done → freed
|
|
113
|
+
→ "Continue to M2?" → yes → Spawn Agent(M2) → done → freed
|
|
114
|
+
→ Spawn Agent(M2) → done → Spawn Agent(M3) → done → freed
|
|
115
|
+
→ "Continue to M3?" → yes → All done
|
|
116
|
+
→ Spawn Agent(M3) → done
|
|
120
117
|
```
|
|
121
118
|
|
|
122
|
-
|
|
119
|
+
Delegation is two-tier:
|
|
123
120
|
```
|
|
124
121
|
Lead (lean dispatcher)
|
|
125
122
|
└── Milestone Agent (fresh context)
|
|
@@ -210,7 +207,7 @@ Push is automatic after review passes. All other transitions are automatic.
|
|
|
210
207
|
### Rejection Handling
|
|
211
208
|
|
|
212
209
|
If the user says **no** at any gate:
|
|
213
|
-
- **RFC rejected** → Lead revises based on feedback, re-submits (max
|
|
210
|
+
- **RFC rejected** → Lead revises based on feedback, re-submits (max 3 rounds)
|
|
214
211
|
- **Milestone rejected** → PM revises in PM terminal
|
|
215
212
|
|
|
216
213
|
Rejections are normal. The system does not stall — it loops back with feedback.
|
|
@@ -234,7 +231,7 @@ Lead calls reviewer agent
|
|
|
234
231
|
**If approved-with-comments** → push immediately. Comments are logged in context.md.
|
|
235
232
|
|
|
236
233
|
**If changes-requested** → Lead continues the phase's sub-agent via SendMessage with
|
|
237
|
-
reviewer findings. Re-review triggered if fix >=
|
|
234
|
+
reviewer findings. Re-review triggered if fix >= 50 lines.
|
|
238
235
|
|
|
239
236
|
---
|
|
240
237
|
|
|
@@ -344,34 +341,16 @@ sequenceDiagram
|
|
|
344
341
|
|
|
345
342
|
C->>C: git push → milestone done
|
|
346
343
|
|
|
347
|
-
alt
|
|
348
|
-
C->>C:
|
|
349
|
-
else
|
|
350
|
-
C->>C:
|
|
344
|
+
alt --auto mode
|
|
345
|
+
C->>C: Next milestone → loop or done
|
|
346
|
+
else Normal mode
|
|
347
|
+
C->>C: Ask user: "Continue to next?"
|
|
351
348
|
end
|
|
352
349
|
|
|
353
350
|
Note over PM: PM is free the entire time<br/>Can plan M2 while M1 executes
|
|
354
351
|
```
|
|
355
352
|
|
|
356
|
-
### 2. Lead Execution Loop
|
|
357
|
-
|
|
358
|
-
```mermaid
|
|
359
|
-
sequenceDiagram
|
|
360
|
-
participant C as Lead
|
|
361
|
-
|
|
362
|
-
C->>C: Scan milestones/
|
|
363
|
-
Note over C: M1: in-progress<br/>M2: planning<br/>M3: done
|
|
364
|
-
|
|
365
|
-
C->>C: Resume M1 (read context.md)
|
|
366
|
-
C->>C: backend phase-2 (resuming)
|
|
367
|
-
C->>C: backend phase-3
|
|
368
|
-
C->>C: reviewer → approved
|
|
369
|
-
C->>C: Push → M1 done
|
|
370
|
-
|
|
371
|
-
Note over C: STOP. "Run /compact or /clear then /orchestra start"
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
### 3. Lead Execution Loop (Agent Mode)
|
|
353
|
+
### 2. Lead Execution Loop
|
|
375
354
|
|
|
376
355
|
```mermaid
|
|
377
356
|
sequenceDiagram
|
|
@@ -383,12 +362,16 @@ sequenceDiagram
|
|
|
383
362
|
C->>MA: Spawn Agent(M1)
|
|
384
363
|
MA->>MA: phase-1 → phase-2 → review → push
|
|
385
364
|
MA-->>C: {status: done, retro: ...}
|
|
386
|
-
Note over C:
|
|
365
|
+
Note over C: ~1-2k tokens retained
|
|
387
366
|
|
|
388
|
-
|
|
367
|
+
alt --auto mode
|
|
368
|
+
C->>MA: Spawn Agent(M2) automatically
|
|
369
|
+
else Normal mode
|
|
370
|
+
C->>C: "Continue to M2?" → user says yes
|
|
371
|
+
C->>MA: Spawn Agent(M2)
|
|
372
|
+
end
|
|
389
373
|
MA->>MA: phase-1 → phase-2 → review → push
|
|
390
374
|
MA-->>C: {status: done, retro: ...}
|
|
391
|
-
Note over C: Write retro, ~1-2k tokens retained
|
|
392
375
|
|
|
393
376
|
C->>C: No more milestones
|
|
394
377
|
Note over C: "All done. Waiting for new work."
|
|
@@ -22,36 +22,13 @@ pipeline:
|
|
|
22
22
|
# When enabled, phases with depends_on: [] run in parallel
|
|
23
23
|
parallel: disabled
|
|
24
24
|
|
|
25
|
-
# Milestone isolation mode: inline | agent
|
|
26
|
-
# inline: lead runs milestones directly, stops after each. User compacts manually. (default)
|
|
27
|
-
# agent: each milestone runs in its own sub-agent. Context freed automatically. Best for --auto.
|
|
28
|
-
milestone_isolation: inline
|
|
29
|
-
|
|
30
25
|
# Default pipeline when milestone Complexity is missing
|
|
31
26
|
default_pipeline: full # quick | standard | full
|
|
32
27
|
|
|
33
28
|
# Default phase complexity when not set by PM
|
|
34
29
|
default_complexity: standard # trivial | quick | standard | complex
|
|
35
30
|
|
|
36
|
-
# Max RFC rejection rounds before escalating to user
|
|
37
|
-
max_rfc_rounds: 3
|
|
38
|
-
|
|
39
|
-
# Max milestone review rounds before proceeding anyway with warnings
|
|
40
|
-
max_milestone_review_rounds: 3
|
|
41
|
-
|
|
42
31
|
thresholds:
|
|
43
|
-
# Milestone lock timeout in minutes (stale locks are ignored)
|
|
44
|
-
milestone_lock_timeout: 120
|
|
45
|
-
|
|
46
|
-
# Fix cycle: re-review if fix exceeds this many lines
|
|
47
|
-
re_review_lines: 30
|
|
48
|
-
|
|
49
|
-
# Phase time limit in minutes (pause and report if exceeded)
|
|
50
|
-
phase_time_limit: 15
|
|
51
|
-
|
|
52
|
-
# Phase tool call limit (pause if exceeded without commit)
|
|
53
|
-
phase_tool_limit: 40
|
|
54
|
-
|
|
55
32
|
# Stuck detection: max retries before escalation
|
|
56
33
|
stuck_retry_limit: 3
|
|
57
34
|
|
|
@@ -41,7 +41,7 @@ Cannot write: feature code, RFCs, architecture docs, review findings, system fil
|
|
|
41
41
|
After creating milestone files, launch a milestone-reviewer sub-agent before
|
|
42
42
|
marking the milestone as ready. This catches planning errors before lead executes.
|
|
43
43
|
|
|
44
|
-
**Flow:** PM creates → reviewer sub-agent → PM fixes → reviewer again → max
|
|
44
|
+
**Flow:** PM creates → reviewer sub-agent → PM fixes → reviewer again → max 3 rounds
|
|
45
45
|
|
|
46
46
|
Launch sub-agent (general-purpose, model: sonnet) with this prompt:
|
|
47
47
|
|
package/template/agents/lead.md
CHANGED
|
@@ -21,8 +21,6 @@ When started:
|
|
|
21
21
|
|
|
22
22
|
1. If `--auto`: print `Warning: Auto mode — RFC gate skipped, fully autonomous.` and proceed.
|
|
23
23
|
2. Read `.orchestra/config.yml` for pipeline settings and thresholds.
|
|
24
|
-
- Read `pipeline.milestone_isolation` (default: `inline`).
|
|
25
|
-
- If `--auto` and `milestone_isolation: inline`: warn once: "Inline mode with --auto: lead stops after each milestone. Consider `milestone_isolation: agent` for batch runs."
|
|
26
24
|
3. Read `.orchestra/README.md` for orchestration rules.
|
|
27
25
|
4. Scan milestones:
|
|
28
26
|
- Glob `.orchestra/milestones/*/milestone.md`
|
|
@@ -51,7 +49,7 @@ Default: config.yml `pipeline.default_pipeline` (default `full`).
|
|
|
51
49
|
|
|
52
50
|
Before starting a milestone:
|
|
53
51
|
1. Check milestone.md for `Locked-By` field
|
|
54
|
-
2. If locked and <
|
|
52
|
+
2. If locked and < 60 minutes old → skip this milestone
|
|
55
53
|
3. If no lock or stale → write `Locked-By: {timestamp}`
|
|
56
54
|
4. On completion or failure → remove `Locked-By`
|
|
57
55
|
|
|
@@ -234,8 +232,8 @@ After all implementation phases (unless config says `review: skip`):
|
|
|
234
232
|
5. **changes-requested** → fix cycle:
|
|
235
233
|
- Use SendMessage to continue the last phase's sub-agent with reviewer findings
|
|
236
234
|
(if sub-agent no longer available, launch new sub-agent with findings + identity)
|
|
237
|
-
- If fix <
|
|
238
|
-
- If fix >=
|
|
235
|
+
- If fix < 50 lines → proceed
|
|
236
|
+
- If fix >= 50 lines → abbreviated re-review
|
|
239
237
|
|
|
240
238
|
## Approval Gates
|
|
241
239
|
|
|
@@ -245,49 +243,31 @@ Read gate behavior from config.yml:
|
|
|
245
243
|
|
|
246
244
|
## Rejection Flow
|
|
247
245
|
|
|
248
|
-
- **RFC Rejected:** Ask feedback → architect sub-agent revises → re-submit (max
|
|
246
|
+
- **RFC Rejected:** Ask feedback → architect sub-agent revises → re-submit (max 3 rounds).
|
|
249
247
|
|
|
250
248
|
## Milestone Completion
|
|
251
249
|
|
|
252
|
-
### Inline Mode (default)
|
|
253
|
-
|
|
254
|
-
After push:
|
|
255
|
-
1. Update milestone.md `status: done`, remove `Locked-By`.
|
|
256
|
-
2. Proceed to "Next Milestone — Mode-Dependent Behavior" → Inline Mode.
|
|
257
|
-
|
|
258
|
-
### Agent Mode
|
|
259
|
-
|
|
260
250
|
Milestone agent handles push and returns structured result (see Milestone Agent Delegation).
|
|
261
251
|
Lead processes the return:
|
|
262
252
|
1. Update milestone.md `status: done`, remove `Locked-By`.
|
|
263
|
-
2. Proceed to
|
|
264
|
-
|
|
265
|
-
## Next Milestone — Mode-Dependent Behavior
|
|
253
|
+
2. Proceed to next milestone.
|
|
266
254
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
### Inline Mode (default)
|
|
270
|
-
|
|
271
|
-
After push:
|
|
272
|
-
1. **STOP.** Print: "Milestone {id} complete and pushed."
|
|
273
|
-
2. Do NOT loop to next milestone.
|
|
274
|
-
|
|
275
|
-
### Agent Mode
|
|
255
|
+
## Next Milestone
|
|
276
256
|
|
|
277
257
|
After milestone agent returns:
|
|
278
258
|
1. Re-scan `.orchestra/milestones/` using Glob (PM may have created new ones)
|
|
279
|
-
|
|
280
|
-
|
|
259
|
+
2. If pending milestones exist:
|
|
260
|
+
- `--auto` mode → spawn next milestone agent immediately
|
|
261
|
+
- Normal mode → ask user: "Milestone {id} complete. Continue to {next-id}?" → yes: spawn next, no: stop
|
|
262
|
+
3. If none → "All milestones complete. Waiting for new work from PM."
|
|
281
263
|
|
|
282
264
|
Context stays lean because all phase-level context lived in the (now ended)
|
|
283
265
|
milestone agent. Lead only accumulates ~1-2k tokens per milestone
|
|
284
266
|
(prompt + structured result).
|
|
285
267
|
|
|
286
|
-
## Milestone Agent Delegation
|
|
287
|
-
|
|
288
|
-
This section applies ONLY when config `pipeline.milestone_isolation: agent`.
|
|
268
|
+
## Milestone Agent Delegation
|
|
289
269
|
|
|
290
|
-
|
|
270
|
+
Every milestone runs as a separate sub-agent. Lead is a two-tier dispatcher:
|
|
291
271
|
- Lead spawns one milestone agent per milestone
|
|
292
272
|
- Milestone agent spawns phase sub-agents (same as current phase delegation)
|
|
293
273
|
- When milestone agent completes, its context is freed entirely
|
|
@@ -404,7 +384,7 @@ Read context.md → skip phases marked `done` → resume from first non-done pha
|
|
|
404
384
|
|
|
405
385
|
## Hotfix Pipeline
|
|
406
386
|
|
|
407
|
-
Hotfix
|
|
387
|
+
Hotfix runs as a single-phase fast path — no milestone agent needed.
|
|
408
388
|
|
|
409
389
|
When user types `/orchestra hotfix {description}`:
|
|
410
390
|
1. Auto-create hotfix milestone + single phase
|
|
@@ -8,10 +8,8 @@ The lead will:
|
|
|
8
8
|
3. Delegate phases to sub-agents, load skills, implement code
|
|
9
9
|
4. Trigger code review via reviewer agent
|
|
10
10
|
5. Push automatically after review passes
|
|
11
|
-
6.
|
|
11
|
+
6. After milestone: `--auto` continues to next automatically, normal mode asks user
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- `inline` (default): stops after each milestone. User compacts and restarts.
|
|
15
|
-
- `agent`: spawns each milestone in sub-agent. Loops automatically. Best with `--auto`.
|
|
13
|
+
Each milestone runs in its own sub-agent for context isolation.
|
|
16
14
|
|
|
17
15
|
Pass `--auto` flag for fully autonomous mode (warns once, then skips all gates).
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
# Phase Limits
|
|
2
2
|
|
|
3
|
-
Read thresholds from `.orchestra/config.yml` (`phase_time_limit`, `phase_tool_limit`).
|
|
4
|
-
|
|
5
|
-
**Time limit:** Phase exceeds limit → pause: "Phase-{N} exceeded {limit}min. Continue or stop?"
|
|
6
|
-
In `--auto` mode: continue, log overage in context.md.
|
|
7
|
-
|
|
8
3
|
**Scope guard:** Working on something NOT in phase acceptance criteria → STOP. Note in context.md, don't implement.
|
|
9
|
-
|
|
10
|
-
**Tool call guard:** More tool calls than limit without committing → pause, assess: commit what you have or escalate.
|