@sulhadin/orchestrator 4.0.0-beta → 4.0.1-beta.0

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
@@ -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** — `inline` mode stops after each milestone (user compacts manually). `agent` mode spawns each milestone in its own sub-agent — context freed automatically, enabling 20+ milestones in a single `--auto` session.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sulhadin/orchestrator",
3
- "version": "4.0.0-beta",
3
+ "version": "4.0.1-beta.0",
4
4
  "description": "AI Team Orchestration System — multi-role coordination for Claude Code",
5
5
  "bin": "bin/index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "orchestra",
3
3
  "description": "AI Team Orchestration — multi-role coordination with milestones, phases, and quality gates for Claude Code",
4
- "version": "4.0.0-beta",
4
+ "version": "4.0.1-beta.0",
5
5
  "author": {
6
6
  "name": "Sulhadin Öney"
7
7
  },
@@ -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. After milestone completion, behavior
54
- depends on `milestone_isolation` config: stops (inline) or continues to next (agent).
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 config.yml `thresholds.milestone_lock_timeout` minutes (default 120).
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 Isolation
104
+ ### Milestone Execution
105
105
 
106
- Config `pipeline.milestone_isolation` controls how the lead handles multiple milestones:
107
-
108
- | Mode | Behavior | Best for |
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
- Inline mode: Agent mode:
115
- /orchestra start /orchestra start --auto
116
- M1 executes done STOP → Spawn Agent(M1) → done → freed
117
- user: /compact → Spawn Agent(M2) → done → freed
118
- /orchestra start Spawn Agent(M3)done freed
119
- M2 executes → done → STOP → All done
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
- In agent mode, the delegation is two-tier:
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 config `pipeline.max_rfc_rounds`)
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 >= config `re_review_lines` threshold.
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 Inline mode (default)
348
- C->>C: STOP user compacts and restarts
349
- else Agent mode
350
- C->>C: Next milestone? loop or done
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 (Inline Mode)
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: Write retro, ~1-2k tokens retained
365
+ Note over C: ~1-2k tokens retained
387
366
 
388
- C->>MA: Spawn Agent(M2)
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
 
@@ -16,6 +16,9 @@ one commit at a time. Push back and say no when it doesn't make sense.
16
16
  Can write: `.orchestra/milestones/*` (prd.md, milestone.md, grooming.md, phases)
17
17
  Cannot write: feature code, RFCs, architecture docs, review findings, system files
18
18
 
19
+ Do NOT ask for approval to write milestone files — they are your ownership scope.
20
+ Write directly, then inform the user what you changed.
21
+
19
22
  ## On Activation
20
23
 
21
24
  1. Read `.orchestra/config.yml` for pipeline settings
@@ -41,7 +44,7 @@ Cannot write: feature code, RFCs, architecture docs, review findings, system fil
41
44
  After creating milestone files, launch a milestone-reviewer sub-agent before
42
45
  marking the milestone as ready. This catches planning errors before lead executes.
43
46
 
44
- **Flow:** PM creates → reviewer sub-agent → PM fixes → reviewer again → max `pipeline.max_milestone_review_rounds`
47
+ **Flow:** PM creates → reviewer sub-agent → PM fixes → reviewer again → max 3 rounds
45
48
 
46
49
  Launch sub-agent (general-purpose, model: sonnet) with this prompt:
47
50
 
@@ -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 < config.yml `thresholds.milestone_lock_timeout` minutes → skip this milestone
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
 
@@ -83,12 +81,9 @@ phases with the same skills.
83
81
  6. Read `rfc.md` from milestone directory → rfc_content (read once per milestone, cache; skip if not exists)
84
82
  7. Derive team member identity from phase content:
85
83
  - Read the phase's `## Objective`, `## Scope`, and `skills:` list
86
- - Determine the right specialist identity for the job:
87
- - Scope targets `api/`, `server/`, `db/`, `migrations/`, `services/` + backend skills → **backend engineer**
88
- - Scope targets `app/`, `components/`, `pages/`, `styles/`, `ui/` + frontend skills → **frontend engineer**
89
- - Scope targets `infra/`, `.github/`, `docker`, `ci/`, `terraform/` + devops skills → **devops engineer**
90
- - Scope targets `rfc.md`, `architecture.md`, `adrs/` → **software architect**
91
- - Mixed or unclear → **fullstack engineer**
84
+ - Determine the right specialist identity for the job
85
+ (backend, frontend, devops, architect, or fullstack engineer)
86
+ based on the phase content no hardcoded directory rules
92
87
  - Generate an identity block: who they are + domain priorities + the golden rule
93
88
 
94
89
  ### 3. Delegate to Phase Sub-Agent
@@ -234,8 +229,8 @@ After all implementation phases (unless config says `review: skip`):
234
229
  5. **changes-requested** → fix cycle:
235
230
  - Use SendMessage to continue the last phase's sub-agent with reviewer findings
236
231
  (if sub-agent no longer available, launch new sub-agent with findings + identity)
237
- - If fix < config `re_review_lines` → proceed
238
- - If fix >= config `re_review_lines` → abbreviated re-review
232
+ - If fix < 50 lines → proceed
233
+ - If fix >= 50 lines → abbreviated re-review
239
234
 
240
235
  ## Approval Gates
241
236
 
@@ -245,49 +240,31 @@ Read gate behavior from config.yml:
245
240
 
246
241
  ## Rejection Flow
247
242
 
248
- - **RFC Rejected:** Ask feedback → architect sub-agent revises → re-submit (max config.yml `pipeline.max_rfc_rounds`).
243
+ - **RFC Rejected:** Ask feedback → architect sub-agent revises → re-submit (max 3 rounds).
249
244
 
250
245
  ## Milestone Completion
251
246
 
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
247
  Milestone agent handles push and returns structured result (see Milestone Agent Delegation).
261
248
  Lead processes the return:
262
249
  1. Update milestone.md `status: done`, remove `Locked-By`.
263
- 2. Proceed to "Next Milestone — Mode-Dependent Behavior" → Agent Mode.
264
-
265
- ## Next Milestone — Mode-Dependent Behavior
250
+ 2. Proceed to next milestone.
266
251
 
267
- Behavior after milestone completion depends on `pipeline.milestone_isolation`:
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
252
+ ## Next Milestone
276
253
 
277
254
  After milestone agent returns:
278
255
  1. Re-scan `.orchestra/milestones/` using Glob (PM may have created new ones)
279
- 3. If pending spawn next milestone agent
280
- 4. If none"All milestones complete. Waiting for new work from PM."
256
+ 2. If pending milestones exist:
257
+ - `--auto` modespawn next milestone agent immediately
258
+ - Normal mode → ask user: "Milestone {id} complete. Continue to {next-id}?" → yes: spawn next, no: stop
259
+ 3. If none → "All milestones complete. Waiting for new work from PM."
281
260
 
282
261
  Context stays lean because all phase-level context lived in the (now ended)
283
262
  milestone agent. Lead only accumulates ~1-2k tokens per milestone
284
263
  (prompt + structured result).
285
264
 
286
- ## Milestone Agent Delegation (Agent Mode Only)
287
-
288
- This section applies ONLY when config `pipeline.milestone_isolation: agent`.
265
+ ## Milestone Agent Delegation
289
266
 
290
- In agent mode, the lead becomes a two-tier dispatcher:
267
+ Every milestone runs as a separate sub-agent. Lead is a two-tier dispatcher:
291
268
  - Lead spawns one milestone agent per milestone
292
269
  - Milestone agent spawns phase sub-agents (same as current phase delegation)
293
270
  - When milestone agent completes, its context is freed entirely
@@ -404,7 +381,7 @@ Read context.md → skip phases marked `done` → resume from first non-done pha
404
381
 
405
382
  ## Hotfix Pipeline
406
383
 
407
- Hotfix always runs inline regardless of `milestone_isolation` setting — single-phase fast path, sub-agent isolation adds no value.
384
+ Hotfix runs as a single-phase fast path no milestone agent needed.
408
385
 
409
386
  When user types `/orchestra hotfix {description}`:
410
387
  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. Behavior after milestone: stop (inline mode) or continue to next (agent mode)
11
+ 6. After milestone: `--auto` continues to next automatically, normal mode asks user
12
12
 
13
- Config `pipeline.milestone_isolation` controls post-milestone behavior:
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.