herdr-orchestra 5.9.0 → 5.10.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/VERSION +1 -1
- package/bin/__pycache__/orchcpython-314.pyc +0 -0
- package/bin/orch +111 -7
- package/claude-commands/orch-run.md +1 -1
- package/opencode-commands/orch-run.md +1 -1
- package/package.json +1 -1
- package/playbooks/plan.md +18 -4
- package/playbooks/run.md +2 -2
- package/skills/orch-run/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes. Versions follow [semantic versioning](https://semver.org).
|
|
4
4
|
|
|
5
|
+
## [5.10.0] - 2026-11-18
|
|
6
|
+
|
|
7
|
+
The lead reads less text, and coders get a cleaner task, with no change to how a feature is built or checked. Example: a quick run ("make the login button blue") used to read the whole 31 KB planning playbook; now it reads about 15 KB. A run with 15 wake-ups no longer has the lead print the 17 KB run playbook again on each one. The check command, acceptance criteria, reviews, risk hold, fix rounds and summary work exactly as before.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- **Wake-ups.** The orch-run skill and the `/orch-run` commands run only `orch events` when the lead is woken, not `orch lead run` again. `orch events` now prints, under `WHAT TO DO`, the lead's hard rules and the playbook's own rows for the events it shows, word for word (on ALL_DONE: all of section 3). So a lead whose conversation was compacted, or a fresh session, still has every rule it needs.
|
|
11
|
+
- **Planning in parts.** `orch lead plan` prints the start (role, preflight, research, quick or full, and the split test from step 4b). A quick run then runs `orch lead plan quick` (the tiers, estimate, check command and milestone rules, word for word from the full process); a full plan runs `orch lead plan full` (steps 3 to 10). Start + full is every line of the old playbook, so full plans read the same rules as before.
|
|
12
|
+
- **Coder task file.** `task.md` leaves out the lines only orch uses (`Depends on`, `Why separate`, `Prefer`, `Tier`, `Needs`, `Model why`, `Estimate`, `Review`, `Parallel`; `Role` stays at the top as the coder's role) and lists the acceptance criteria once, with their ids. "Notes from user", where the developer's answers go, is kept as written. All of it is still in `plan.md` and `task.json`.
|
|
13
|
+
- **herdr commands.** The plan playbook writes out the three herdr commands the lead uses (`herdr agent list`, `herdr agent rename <pane id> <name>`, `herdr agent read <name> --source recent-unwrapped --lines 60`) and loads the herdr skill only if one of them fails.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- `orch lead plan quick|full` and `orch lead run --section <EVENT|ALL_DONE|rules>`.
|
|
17
|
+
- Tests: a developer's answer still reaches the coder's next `task.md`; a wake-up prints the hard rules and its events' rows; ALL_DONE prints the full summary steps; start + full hold every line of the plan playbook; task.md has no lead-only lines and lists each criterion once.
|
|
18
|
+
|
|
5
19
|
## [5.9.0] - 2026-11-17
|
|
6
20
|
|
|
7
21
|
Fixes a bug where a criterion the developer had agreed to leave out kept being sent back for fixes. Example: M7 "the watch syncs with the phone API" can't be built because the API doesn't exist; you say "build the rest, sync later". Before, the coder honestly reported that criterion as `met: false`, and orch sent it back for fix round after fix round, then moved M7 to a stronger model. Your approval was only a note in the plan, and the check never read it.
|
package/README.md
CHANGED
|
@@ -199,7 +199,7 @@ The agent whose pane you start the plan playbook in becomes the lead. It names i
|
|
|
199
199
|
| Antigravity (`agy`) | "use the orch-plan skill: <feature>" |
|
|
200
200
|
| **any agent** | "Run `orch lead plan` and follow it. Feature: <feature>" |
|
|
201
201
|
|
|
202
|
-
The skills and slash commands are thin wrappers: the playbooks themselves live in `orch` (`orch lead plan`, `orch lead run`), so every agent follows the same, versioned instructions.
|
|
202
|
+
The skills and slash commands are thin wrappers: the playbooks themselves live in `orch` (`orch lead plan`, `orch lead run`), so every agent follows the same, versioned instructions. They are printed in parts so the lead reads only what it needs: `orch lead plan` prints research and the quick-or-full decision, then `orch lead plan quick` (a quick run's rules) or `orch lead plan full` (steps 3 to 10); on a wake-up, `orch events` prints the rules and steps for those events, so the run playbook is read once.
|
|
203
203
|
|
|
204
204
|
### Agent registry
|
|
205
205
|
`orch agents` shows every known kind: installed or not, roles, whether herdr can watch it, and its launch command. Defaults ship in `agents.default.toml`; add or fix kinds in `~/.config/herdr-orchestra/agents.toml` (merged key by key):
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.
|
|
1
|
+
5.10.0
|
|
Binary file
|
package/bin/orch
CHANGED
|
@@ -3120,6 +3120,27 @@ WORKER_RULES = """## Rules for you (the coder)
|
|
|
3120
3120
|
"""
|
|
3121
3121
|
|
|
3122
3122
|
|
|
3123
|
+
# plan.md lines that are for the lead and orch, not the coder: they stay in plan.md and task.json
|
|
3124
|
+
LEAD_ONLY_FIELDS = {"depends on", "why separate", "prefer", "tier", "needs", "model why", "estimate", "role",
|
|
3125
|
+
"review", "parallel"}
|
|
3126
|
+
|
|
3127
|
+
|
|
3128
|
+
def coder_section(text, drop_criteria):
|
|
3129
|
+
"""A milestone's plan section as the coder sees it: without the lead-only fields (Role is shown above as
|
|
3130
|
+
"Your role"), and without the plain criteria list when the criteria are listed below with their ids.
|
|
3131
|
+
Everything from "Notes from user" on is kept as written: that is how the developer's answers reach the coder."""
|
|
3132
|
+
out, drop, notes = [], False, False
|
|
3133
|
+
for line in text.splitlines():
|
|
3134
|
+
fm = FIELD_RE.match(line.strip())
|
|
3135
|
+
if not notes and fm and not line.startswith((" ", "\t", "-")):
|
|
3136
|
+
key = fm.group(1).strip().lower()
|
|
3137
|
+
notes = bool(NOTES_RE.match(line))
|
|
3138
|
+
drop = not notes and (key in LEAD_ONLY_FIELDS or (drop_criteria and key == "acceptance criteria"))
|
|
3139
|
+
if not (drop and not notes):
|
|
3140
|
+
out.append(line)
|
|
3141
|
+
return "\n".join(out)
|
|
3142
|
+
|
|
3143
|
+
|
|
3123
3144
|
def cmd_write_task(args):
|
|
3124
3145
|
"""orch write-task Mn -> generate TASKDIR/task.md from the plan (+ dependency reports)."""
|
|
3125
3146
|
need(args, 1, "write-task <Mn>")
|
|
@@ -3137,7 +3158,9 @@ def cmd_write_task(args):
|
|
|
3137
3158
|
"the patterns it already follows. Then build it to the standard that specialist would put their "
|
|
3138
3159
|
"name on: \"the check passes\" is the floor, not the goal. Before you finish, look at your own "
|
|
3139
3160
|
"result as that specialist reviewing someone else's work, and fix what they would send back.", ""]
|
|
3140
|
-
|
|
3161
|
+
contract = task_contract(st, tid)
|
|
3162
|
+
parts += [coder_section(secs[tid].replace(f"## [x] {tid}:", "Title:", 1),
|
|
3163
|
+
drop_criteria=bool(contract["acceptance_criteria"])), ""]
|
|
3141
3164
|
if glob and glob.lower() not in ("none", "<empty — user may fill in>"):
|
|
3142
3165
|
parts += ["## Global instructions", glob, ""]
|
|
3143
3166
|
ctx = []
|
|
@@ -3151,9 +3174,8 @@ def cmd_write_task(args):
|
|
|
3151
3174
|
"\n".join(lines[:25]), ""]
|
|
3152
3175
|
if ctx:
|
|
3153
3176
|
parts += ["## Context: what the tasks you depend on built", *ctx]
|
|
3154
|
-
contract = task_contract(st, tid)
|
|
3155
3177
|
if contract["acceptance_criteria"]:
|
|
3156
|
-
parts += ["## Acceptance criteria ids
|
|
3178
|
+
parts += ["## Acceptance criteria (ids for your result file)",
|
|
3157
3179
|
*[f"- {c['id']}: {c['text']}" + (f" — DEFERRED by the developer: don't build it in this milestone, "
|
|
3158
3180
|
f"report it `met: false` (why: {c['deferred']['reason']})"
|
|
3159
3181
|
if c.get("deferred") else "")
|
|
@@ -3517,7 +3539,7 @@ EVENT_HELP = {
|
|
|
3517
3539
|
"herdr-restart": "most agents vanished at once: herdr was probably restarted or closed. Tell the developer to "
|
|
3518
3540
|
"run `orch resume` (it names the panes again and re-sends the work); then `orch team up` for "
|
|
3519
3541
|
"any agent it reports LOST.",
|
|
3520
|
-
"all_done": "every milestone landed. Finish .orchestrate/summary.md (
|
|
3542
|
+
"all_done": "every milestone landed. Finish .orchestrate/summary.md: the steps (section 3, ALL_DONE) are printed below.",
|
|
3521
3543
|
"stopped": "the event manager stopped. Tell the developer why; they run `orch resume` (or `orch autopilot`).",
|
|
3522
3544
|
}
|
|
3523
3545
|
|
|
@@ -3561,6 +3583,17 @@ def cmd_events(args):
|
|
|
3561
3583
|
+ (" (work is in progress: run `orch resume` now)" if needs_manager(st) else "")))
|
|
3562
3584
|
if not new and not old and not hold:
|
|
3563
3585
|
print("Nothing needs you.")
|
|
3586
|
+
kinds = list(dict.fromkeys([e["kind"] for e in new + old] + (["ready"] if hold else [])))
|
|
3587
|
+
pb = asset("playbooks/run.md") if kinds else None
|
|
3588
|
+
if pb: # the playbook's own words for these events: a wake-up never needs
|
|
3589
|
+
text = pb.read_text() # `orch lead run` again, even after the lead's context was compacted
|
|
3590
|
+
print("\nWHAT TO DO (from `orch lead run`; you need no other part of the playbook for these events):")
|
|
3591
|
+
print(run_playbook_part(text, "rules"), end="")
|
|
3592
|
+
rows = "".join(run_playbook_part(text, k) for k in kinds if k != "all_done")
|
|
3593
|
+
if rows:
|
|
3594
|
+
print("| Event | What you do |\n|---|---|\n" + rows, end="")
|
|
3595
|
+
if "all_done" in kinds:
|
|
3596
|
+
print("\n" + run_playbook_part(text, "ALL_DONE"), end="")
|
|
3564
3597
|
print("Handle each event above, then STOP: you are woken again when something else happens. Never prompt a "
|
|
3565
3598
|
"coder yourself and never poll.")
|
|
3566
3599
|
if not peek and new:
|
|
@@ -5284,6 +5317,8 @@ USAGE = """usage: orch <command> [args]
|
|
|
5284
5317
|
update [--check] [--version vX.Y.Z] install the latest release (or that one) and show what is new
|
|
5285
5318
|
config [auto-update on|off] this machine's settings: keep orch up to date by itself, or only be told
|
|
5286
5319
|
lead plan|run print the lead playbook (any agent can lead: "Run `orch lead plan` and follow it")
|
|
5320
|
+
lead plan quick|full the rest of the plan playbook: a quick run's rules, or steps 3-10 of the full process
|
|
5321
|
+
lead run --section <EVENT|ALL_DONE|rules> one part of the run playbook (orch events prints these for you)
|
|
5287
5322
|
lead check preflight: is this agent in a Herdr pane / can it reach herdr?
|
|
5288
5323
|
lead whoami show the lead's own herdr pane and how to name it `lead`
|
|
5289
5324
|
team <kind> [--coders N] [--models a,b] [--no-reviewer]
|
|
@@ -5377,15 +5412,84 @@ def lead_check():
|
|
|
5377
5412
|
+ hermes_fix)
|
|
5378
5413
|
|
|
5379
5414
|
|
|
5415
|
+
PB_MARK_RE = re.compile(r"^<!-- (/?)(full|start|quick)(?::\s*(.*?))?\s*-->$")
|
|
5416
|
+
|
|
5417
|
+
|
|
5418
|
+
def plan_playbook_part(text, part):
|
|
5419
|
+
"""The plan playbook in parts, so a quick run doesn't read the whole full process:
|
|
5420
|
+
"" = the start (role, preflight, research, quick-or-full, plus the `<!-- start -->` blocks of the full part);
|
|
5421
|
+
"quick" = the `<!-- quick: title -->` blocks (rules a quick plan uses, word for word from the full process);
|
|
5422
|
+
"full" = steps 3 to 10. start + full is every line of the playbook exactly once."""
|
|
5423
|
+
lines = text.splitlines(keepends=True)
|
|
5424
|
+
cut = next((i for i, l in enumerate(lines) if l.strip() == "<!-- full -->"), len(lines))
|
|
5425
|
+
head, rest = lines[:cut], lines[cut + 1:]
|
|
5426
|
+
blocks, out, cur, title = {"start": [], "quick": []}, [], None, ""
|
|
5427
|
+
for l in rest:
|
|
5428
|
+
m = PB_MARK_RE.match(l.strip())
|
|
5429
|
+
if m and m.group(2) in ("start", "quick"):
|
|
5430
|
+
if not m.group(1):
|
|
5431
|
+
cur, title, buf = m.group(2), m.group(3) or "", []
|
|
5432
|
+
if cur == "start":
|
|
5433
|
+
out.append(f"({title}: printed at the start of this playbook by `orch lead plan`; apply it "
|
|
5434
|
+
f"here.)\n")
|
|
5435
|
+
else:
|
|
5436
|
+
blocks[cur].append((title, buf))
|
|
5437
|
+
cur = None
|
|
5438
|
+
continue
|
|
5439
|
+
if cur:
|
|
5440
|
+
buf.append(l)
|
|
5441
|
+
if cur != "start":
|
|
5442
|
+
out.append(l)
|
|
5443
|
+
if part == "full":
|
|
5444
|
+
return "".join(out)
|
|
5445
|
+
if part == "quick":
|
|
5446
|
+
return "".join(f"## {t}\n{''.join(b)}\n" for t, b in blocks["quick"])
|
|
5447
|
+
return "".join(head) + "".join(f"\n## {t} (from the full process)\n{''.join(b)}" for t, b in blocks["start"])
|
|
5448
|
+
|
|
5449
|
+
|
|
5450
|
+
# which rows of the run playbook's event table belong to each lead event kind
|
|
5451
|
+
EVENT_ROWS = {"ready": "READY", "merged": "MERGED", "paused": "PAUSED", "failed": "FAILED", "held": "HELD",
|
|
5452
|
+
"worker-lost": "WORKER-LOST", "herdr-restart": "HERDR-RESTART", "needs-answer": "NEEDS-ANSWER",
|
|
5453
|
+
"escalated": "ESCALATED", "auto-dispatched": "AUTO-DISPATCHED", "stopped": "STOPPED",
|
|
5454
|
+
"all_done": "ALL_DONE"}
|
|
5455
|
+
|
|
5456
|
+
|
|
5457
|
+
def run_playbook_part(text, name):
|
|
5458
|
+
"""A piece of the run playbook: `rules` (the hard rules), `ALL_DONE` (section 3, whole) or an event kind (its
|
|
5459
|
+
rows of the event table, word for word). Lets the lead act on a wake-up without reading the whole playbook."""
|
|
5460
|
+
key = name.strip().lower()
|
|
5461
|
+
secs = re.split(r"(?m)^(?=## )", text)
|
|
5462
|
+
if key in ("rules", "hard rules"):
|
|
5463
|
+
return next((x for x in secs if x.startswith("## Hard rules")), "")
|
|
5464
|
+
if key in ("all_done", "all-done", "3"):
|
|
5465
|
+
return next((x for x in secs if x.startswith("## 3. ALL_DONE")), "")
|
|
5466
|
+
kind = EVENT_ROWS.get(key, key.upper())
|
|
5467
|
+
rows = [l for l in text.splitlines() if re.match(rf"^\| `{re.escape(kind)}\b", l)
|
|
5468
|
+
or (kind == "STOPPED" and l.startswith("| `STOPPED`"))]
|
|
5469
|
+
if kind == "STOPPED":
|
|
5470
|
+
rows += [l for l in text.splitlines() if l.startswith(("| `orch status` starts with", "**Red baseline.**",
|
|
5471
|
+
"**Why did the event manager stop?**"))]
|
|
5472
|
+
return "\n".join(rows) + ("\n" if rows else "")
|
|
5473
|
+
|
|
5474
|
+
|
|
5380
5475
|
def cmd_lead(args):
|
|
5381
5476
|
"""orch lead plan|run -> print the lead playbook; orch lead whoami -> this pane + how to name it `lead`."""
|
|
5382
5477
|
sub = args[0] if args else ""
|
|
5383
5478
|
if sub in ("plan", "run"):
|
|
5384
5479
|
pb = asset(f"playbooks/{sub}.md") or die(f"playbooks/{sub}.md not found next to orch or in the install")
|
|
5385
|
-
if
|
|
5480
|
+
part = args[1] if len(args) > 1 else ""
|
|
5481
|
+
if sub == "plan" and part not in ("", "quick", "full"):
|
|
5482
|
+
die("usage: orch lead plan [quick | full]")
|
|
5483
|
+
if sub == "run" and part not in ("", "--section"):
|
|
5484
|
+
die("usage: orch lead run [--section <EVENT | ALL_DONE | rules>]")
|
|
5485
|
+
if sub == "plan" and not part:
|
|
5386
5486
|
auto_update_at_plan() # a new feature starts on the newest release (never during a run)
|
|
5387
|
-
|
|
5388
|
-
|
|
5487
|
+
if sub == "run" and part == "--section":
|
|
5488
|
+
print(run_playbook_part(pb.read_text(), args[2] if len(args) > 2 else ""), end="")
|
|
5489
|
+
return
|
|
5490
|
+
label = f"{sub} ({part})" if part else sub
|
|
5491
|
+
print(f"herdr-orchestra {installed_version()} — lead playbook: {label}\n")
|
|
5492
|
+
print(plan_playbook_part(pb.read_text(), part) if sub == "plan" else pb.read_text(), end="")
|
|
5389
5493
|
return
|
|
5390
5494
|
if sub == "check":
|
|
5391
5495
|
lead_check()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Orchestrator step 2 — start the run (dispatch, then pause), handle the events you are woken for, finish the summary"
|
|
3
3
|
---
|
|
4
|
-
|
|
4
|
+
You are the lead. If you were woken with `orch events`, run only `orch events` (or `~/.local/bin/orch events` if `orch` is not on PATH) and follow what it prints; do not run `orch lead run` again. Otherwise run `orch lead run` and follow its output exactly.
|
|
5
5
|
User input (answers / overrides, may be empty): $ARGUMENTS
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Orchestrator step 2 — start the run (dispatch, then pause), handle the events you are woken for, finish the summary"
|
|
3
3
|
---
|
|
4
|
-
|
|
4
|
+
You are the lead. If you were woken with `orch events`, run only `orch events` (or `~/.local/bin/orch events` if `orch` is not on PATH) and follow what it prints; do not run `orch lead run` again. Otherwise run `orch lead run` and follow its output exactly.
|
|
5
5
|
User input (answers / overrides, may be empty): $ARGUMENTS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "herdr-orchestra",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.0",
|
|
4
4
|
"description": "Orchestrate AI coding agents (Claude Code, Codex, OpenCode, Amp) as one team in Herdr: a lead plans, coders build in parallel, a reviewer checks, you get one PR.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
package/playbooks/plan.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
You are the LEAD of a Herdr agent team, whatever agent you are (Claude Code, Codex, Amp, OpenCode, Hermes, Antigravity…). The rules are identical for every lead.
|
|
2
|
-
|
|
2
|
+
You need only three herdr commands, exactly as written here: `herdr agent list` (the agent panes), `herdr agent rename <pane id> <name>` (give a pane its plan name) and `herdr agent read <name> --source recent-unwrapped --lines 60` (what an agent shows). orch prints any other herdr command you need. Load the `herdr` skill (or run `herdr --skill`) only if one of these fails. The state helper is `orch` (`~/.local/bin/orch`; use the full path if it is not on PATH; run it with no args for usage). `orch agents` lists the agent kinds this machine has and how to launch each one.
|
|
3
3
|
|
|
4
4
|
## Your role: what and why, never how
|
|
5
5
|
- You RESEARCH and PLAN. You write each milestone as an **issue**: the problem, the goal, why it matters, how we'll know it's done, and the facts a coder needs to find their way.
|
|
@@ -37,12 +37,13 @@ A request that sounds small can be big ("add `discount` to the orders API" when
|
|
|
37
37
|
3. **It stays out of risky areas:** no database schema or migration, no auth, login, permissions or sessions, no payments or billing, no new or upgraded packages, no CI, no secrets or `.env` files.
|
|
38
38
|
4. **It follows what is already there.** It copies a pattern the code already has, and it does not change how two parts talk to each other (an API shape another app or team depends on, shared types).
|
|
39
39
|
|
|
40
|
-
If any is false, use the full process
|
|
40
|
+
If any is false, use the full process: run `orch lead plan full` and follow its steps 3 to 10. There is no rule about how many files or lines; it is your judgement, and you write it down: `Quick because: <what you found in the code that makes it small>`, e.g. `Quick because: orders.created_at already exists and the serializer lists fields; only the GET /orders response changes, no schema, auth or payment code`.
|
|
41
41
|
|
|
42
42
|
- The developer wrote `quick:` but one of the four is false: say which one and why in one line, and plan it in full unless they insist. Never take a risky change (point 3) as quick: `orch sync` refuses those files in a quick plan anyway.
|
|
43
|
-
- The developer wrote `full:`: plan in full, even for a small change.
|
|
43
|
+
- The developer wrote `full:`: plan in full (`orch lead plan full`), even for a small change.
|
|
44
44
|
|
|
45
45
|
**A quick run, step by step** (in place of steps 3 to 10):
|
|
46
|
+
- **First run `orch lead plan quick`.** It prints the rules a quick plan uses, word for word from the full process: the split test, the tiers, the estimate, the check command and how to write acceptance criteria and Likely files. Don't run `orch lead plan full` for a quick run.
|
|
46
47
|
- **Team: one coder, no reviewer.** Run `orch lead whoami` and name yourself `lead`. Pick ONE coder pane whose model fits the tier (a free pane of any kind; if only you are open, `orch team <your kind> --coders 1 --no-reviewer`). `Reviewer: none`, unless the developer wrote `quick review:`: then one reviewer pane and `Review: yes`. Why no reviewer: a quick change is small and stays out of risky areas, the check command (lint, types, tests) still has to pass before it lands, and the developer looks at UI changes in the browser anyway; the reviewer is often the slowest step of a small run.
|
|
47
48
|
- **One milestone** that holds every change in the request, with **one acceptance criterion per change**, so the coder and the summary go through them one by one.
|
|
48
49
|
- **Fields:** only `Tier`, `Estimate`, `Likely files`, `Goal`, `Acceptance criteria` and the `Context` facts the coder needs to find their way. Leave out `Feature breakdown`, `Why separate`, `Needs`, `Model why`, `Role`, `Interfaces` (none) and `Prefer` unless one really helps. A backend change gets an acceptance criterion a test can prove (e.g. "GET /orders returns `createdAt` as ISO 8601; a test covers it").
|
|
@@ -84,6 +85,7 @@ Open questions:
|
|
|
84
85
|
|
|
85
86
|
Then the run is the same as any run (`orch lead run`): the coder builds it, the check runs, and it lands on the branch; when the check already passed on exactly the files on the branch, the final check and `orch finish` reuse that result instead of running it again. The summary is short (step 3 of `orch lead run`). The risk hold still applies: if the coder's change turns out to touch a migration, CI, secrets, a package or many lines, it waits for the developer's `orch approve`. After it lands, more small changes go straight to the same coder with `orch fix M1 "<change>"`.
|
|
86
87
|
|
|
88
|
+
<!-- full -->
|
|
87
89
|
## 3. Discover the team
|
|
88
90
|
- Run `orch lead whoami`. It shows YOUR pane. Name yourself `lead` with the rename command it prints, and never prompt your own pane.
|
|
89
91
|
- Run `herdr agent list` and `orch agents` (which kinds exist here, their roles, and whether herdr can watch them).
|
|
@@ -101,12 +103,14 @@ There is no target number. The feature decides, not the size of the team. Work i
|
|
|
101
103
|
|
|
102
104
|
**a. Understand the feature first.** From your research, list the real pieces of work: what has to change, where, and which piece needs which. Write it in the plan as `## Feature breakdown` (step 9): one line per piece, and one line on how they connect. If you cannot write it, you have not researched enough; go back to step 2.
|
|
103
105
|
|
|
106
|
+
<!-- start: Step 4b, the split test -->
|
|
104
107
|
**b. Start from ONE milestone.** The whole feature is one milestone until a piece earns its own. Split a piece off only for one of these reasons:
|
|
105
108
|
- **Parallel**: another coder you really have (step 3) can build it at the same time, without waiting for the rest, and it is real work for them, not a few lines.
|
|
106
109
|
- **Foundation**: other pieces must build on it first, and they would otherwise wait or collide (a contract both sides code against, a scaffold for hotspot files).
|
|
107
110
|
- **Too big**: the whole thing is more than one coder can finish in one sitting, and there is a clean seam to cut along.
|
|
108
111
|
|
|
109
112
|
Nothing else is a reason. Not "there are free coders", not "backend and frontend are different folders", not "to be tidy". A small change that touches both the API and the UI (one field, one endpoint and its button) is ONE milestone, even with five coders: the split, the contract and the merge would cost more than the work. An idle coder is fine.
|
|
113
|
+
<!-- /start -->
|
|
110
114
|
|
|
111
115
|
**c. Every split says why.** In a plan with two or more milestones, each milestone has a `Why separate:` line: the reason from (b) in plain words a developer can check, e.g. `Why separate: the preview UI can be built in parallel once the API shape is fixed`. If you cannot write a real reason, merge the piece back. `orch sync` warns when the line is missing.
|
|
112
116
|
|
|
@@ -139,10 +143,12 @@ Big frontend, shared hotspot files: M1 scaffold (route, nav, packages, types)
|
|
|
139
143
|
```
|
|
140
144
|
|
|
141
145
|
## 6. Give every milestone a tier, from what it actually demands
|
|
146
|
+
<!-- quick: Tiers (from step 6) -->
|
|
142
147
|
Judge the milestone, not the model's name. For each one ask what it needs most, and write it down:
|
|
143
148
|
- **small**: mechanical and well specified. Renames, config, docs, a classification or lookup, a change that copies an existing pattern in one or two files. Speed matters more than depth.
|
|
144
149
|
- **medium**: normal implementation inside one module or one side (an endpoint with its tests, a component, a bug with a known cause). Needs solid coding and tool use, little design.
|
|
145
150
|
- **high**: reasoning is the hard part. A contract or interface other milestones build on, architecture or data-model decisions, a refactor across modules, auth / payments / schema changes, a bug nobody has diagnosed, anything where a wrong design is expensive.
|
|
151
|
+
<!-- /quick -->
|
|
146
152
|
|
|
147
153
|
Then:
|
|
148
154
|
- `Needs:` lists what the work leans on, from: `reasoning`, `coding`, `architecture`, `long-context` (it must hold a lot of code at once), `tool-use`, `planning`, `speed`.
|
|
@@ -158,7 +164,9 @@ Then:
|
|
|
158
164
|
- Docs: `Role: technical writer for developers new to this project: short sentences, every command copy-pasteable and tested`
|
|
159
165
|
Write the role from what you learned in research (the design system the app uses, the test style of the module), not a generic title: "senior engineer" alone tells the coder nothing.
|
|
160
166
|
|
|
167
|
+
<!-- quick: Estimate (from step 6) -->
|
|
161
168
|
**Estimate the time.** Every milestone gets `Estimate:` (e.g. `Estimate: 40m`, `Estimate: 1h30m`): how long from dispatch until it has landed if nothing goes wrong, which is the coder building it on the model you picked, the checks, and one review when it has `Review: yes`. Don't add time for fix rounds, questions or waiting: those are exactly what the summary measures against your estimate. The header gets `Estimate:` for the whole feature: milestones that run side by side count once, milestones that wait for another add up (M1 30m, then M2 40m ∥ M3 30m, makes `Estimate: 1h10m`). orch records the real time of every step, and the summary shows estimate vs actual; when a milestone or the feature took longer, it lists where the extra time went and who it was waiting on (a coder's fix rounds, the reviewer, a question waiting for the developer, a permission prompt, a usage limit, a lost agent), using only what orch measured.
|
|
169
|
+
<!-- /quick -->
|
|
162
170
|
|
|
163
171
|
## 7. Choose the isolation mode (ask if the user hasn't said)
|
|
164
172
|
- **worktree**: needed whenever 2+ milestones are independent. Each coder gets its own folder `../<repo>-wt/<worker>` (on a detached HEAD, no extra branch), so they can't overwrite each other. A coder whose milestone is under review is freed to take other work. Needs a **Setup command** for fresh folders (`npm ci`, `pnpm install`, `flutter pub get`, `go mod download`…). Keep the check command free of fixed ports (no dev server); run e2e after merging.
|
|
@@ -167,7 +175,9 @@ Write the role from what you learned in research (the design system the app uses
|
|
|
167
175
|
**Worktree setup:** each coder's agent must run INSIDE its worktree, which `orch start` creates when the run starts. `orch team up` (run playbook, step 1) opens a pane for every coder that is not running yet, in its worktree and on its model, and names it. A coder pane the developer already opened in the main folder must be restarted inside its worktree (`orch start` prints each `dir=`).
|
|
168
176
|
|
|
169
177
|
## 8. Check and setup commands; baseline
|
|
178
|
+
<!-- quick: Check command (from step 8) -->
|
|
170
179
|
- **Check command**: one command for lint + typecheck + unit tests, taken from the repo's scripts (package.json, Makefile, pubspec.yaml, Cargo.toml, pyproject.toml…). No dev servers, no fixed ports.
|
|
180
|
+
<!-- /quick -->
|
|
171
181
|
- **Setup command**: what a fresh worktree needs, or `none`.
|
|
172
182
|
- Run the check yourself (in a quick run, skip this: the event manager's baseline does it). It must pass before any work: autopilot checks it at the start (and records `.orchestrate/baseline.txt` itself), and runs it on every merge before committing. If it already fails, list what fails and propose to the developer a narrower check command that passes today and still covers the feature. Never plan on "no new failures" being judged by eye.
|
|
173
183
|
|
|
@@ -229,16 +239,20 @@ Optional header lines: `Scope: strict` sends a milestone back when its coder cha
|
|
|
229
239
|
|
|
230
240
|
Rules for every milestone:
|
|
231
241
|
- **Role**: from step 6, on every milestone. The standard to work to, never a how-to.
|
|
242
|
+
<!-- quick: Rules for the milestone (from step 9) -->
|
|
232
243
|
- **Acceptance criteria are observable**: "POST /upload returns 400 when the amount column is missing", not "handles errors well". Prefer criteria a test or a command can prove; say so plainly when one needs a person's eyes ("the upload button matches the other primary buttons, seen in the browser"), because at the end only those go on the developer's manual checklist. One per line: orch numbers them AC1, AC2… in the milestone's `task.json`, the coder says for each whether it is met, and the reviewer checks each one. A milestone without any gets a warning.
|
|
233
244
|
- **Likely files is the scope**: list every file or folder (`src/feature/`, globs work) the milestone should change, including dependency files (`package.json`, lockfiles) when it adds packages. orch compares the coder's real diff with it, runs milestones that share a listed file one after the other, and holds an unlisted dependency change for approval. `Parallel: allow` lets a milestone run next to one it shares files with (expect a merge conflict).
|
|
245
|
+
<!-- /quick -->
|
|
234
246
|
- **Why separate**: from step 4, on every milestone when the plan has more than one. The reason is about the feature (parallel work, a foundation others build on, too big for one sitting), never about filling coders.
|
|
247
|
+
<!-- quick: More rules for the milestone (from step 9) -->
|
|
235
248
|
- **No how**: no code blocks, no function names to create, no numbered implementation steps. `orch sync` warns if it sees them.
|
|
236
249
|
- **Estimate**: from step 6, on every milestone and in the header. `orch sync` refuses a value that is not a time (`40m`, `1h30m`, `2h`) and warns when one is missing.
|
|
237
250
|
- **Tier, Needs, Model why**: from step 6, on every milestone. The model in `Workers:` is what the pane really runs, never a wish. `orch sync` refuses a denied model and warns when no coder reaches a milestone's tier or the reviewer is weaker than the work.
|
|
251
|
+
<!-- /quick -->
|
|
238
252
|
- **Prefer**: a worker kind or name from `Workers:` when a tool (not a model) suits the work better, otherwise `any`. A preference, not a lock; the tier comes first.
|
|
239
253
|
- **Review**: `yes` for UI, API contracts, auth, payments and schema; `no` for mechanical milestones.
|
|
240
254
|
- **ZERO GUESSWORK**: missing business rules, undefined data shapes, and auth or security trade-offs go under **Open questions** with 2–3 concrete options. `orch sync` marks such milestones `needs-answer`, and their dependents wait.
|
|
241
|
-
- Each section must stand alone: autopilot hands it to the coder
|
|
255
|
+
- Each section must stand alone: autopilot hands it to the coder (without the lines only orch uses: `Depends on`, `Why separate`, `Prefer`, `Tier`, `Needs`, `Model why`, `Estimate`, `Review`, `Parallel`; `Role` goes at the top as the coder's role), together with the global instructions and the reports of merged dependencies.
|
|
242
256
|
|
|
243
257
|
## 10. Validate and show the plan
|
|
244
258
|
- Run `orch sync`. Fix every ERROR. Fix or consciously accept every WARN: missing dependency reasons, hotspot files in parallel milestones, "how" in a milestone, overlap, a milestone without `Why separate` or `Estimate`, independent milestones in shared mode, coders left idle by a fully sequential plan, a tier no coder reaches, a model outside the catalog.
|
package/playbooks/run.md
CHANGED
|
@@ -19,7 +19,7 @@ A run behaves like a call stack. You **dispatch** work and **pause**. The **even
|
|
|
19
19
|
6. After every step below that ends in **STOP**, stop. Do not sleep, loop or check back: you will be woken.
|
|
20
20
|
|
|
21
21
|
## Context budget (credits scale with how much you read and how many turns you take)
|
|
22
|
-
- Your memory is `orch events` + `orch status` + files on disk, not this conversation. Never re-read old reports, diffs or
|
|
22
|
+
- Your memory is `orch events` + `orch status` + files on disk, not this conversation. Never re-read old reports, diffs, plans or this playbook "to refresh": `orch events` prints what each wake-up needs.
|
|
23
23
|
- Never print whole files or logs into the conversation: logs → `tail -30 .orchestrate/autopilot.log`; reports → the report or result file only (workers keep them short); never open `diff.patch` yourself — that is the reviewer's job.
|
|
24
24
|
- Everything needed to resume is on disk, so a fresh session can pick up at any time: run `orch events` and carry on.
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ A run behaves like a call stack. You **dispatch** work and **pause**. The **even
|
|
|
31
31
|
4. Tell the developer in two lines what is running where (milestone → coder and model). **STOP.**
|
|
32
32
|
|
|
33
33
|
## 2. When you are woken (`orch events`)
|
|
34
|
-
Run `orch events`. It lists the new events, the ones still open, the milestones READY for your dispatch, the workers, and whether the event manager is running. Handle each line, then **STOP**.
|
|
34
|
+
Run `orch events`. It lists the new events, the ones still open, the milestones READY for your dispatch, the workers, and whether the event manager is running. Under `WHAT TO DO` it also prints the hard rules above and the rows of the table below for those events (on ALL_DONE, all of section 3), word for word, so on a wake-up you never need to run `orch lead run` again: not even in a fresh session or after your conversation was compacted. `orch lead run --section <EVENT>` prints one row again. Handle each line, then **STOP**.
|
|
35
35
|
|
|
36
36
|
| Event | What you do |
|
|
37
37
|
|---|---|
|
package/skills/orch-run/SKILL.md
CHANGED
|
@@ -3,4 +3,4 @@ name: orch-run
|
|
|
3
3
|
description: Orchestrator step 2 for a Herdr multi-agent team. Use when the user says "orch-run", "go", "start the run", "continue the plan", or answers a question; and whenever you are told to run `orch events`. The lead dispatches milestones and pauses; the event manager (`orch autopilot`) runs them and wakes the lead for questions, failures, held or ready milestones, and the final summary.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
You are the lead. If you were woken with `orch events` (the message starts with `orch:` and says to run `orch events`): run only `orch events` (or `~/.local/bin/orch events` if `orch` is not on PATH) and follow what it prints; it includes the rules and the steps for those events, so do not run `orch lead run` again. Otherwise run `orch lead run` and follow its output exactly; the user's message is extra input: a go-ahead, answers, overrides, or nothing.
|