herdr-orchestra 6.43.0 → 6.44.1
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 +21 -0
- package/README.md +2 -2
- package/VERSION +1 -1
- package/bin/__pycache__/orchcpython-314.pyc +0 -0
- package/bin/orch +90 -11
- package/package.json +1 -1
- package/playbooks/plan.md +1 -1
- package/playbooks/run.md +2 -2
- package/playbooks/subagent.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes. Versions follow [semantic versioning](https://semver.org).
|
|
4
4
|
|
|
5
|
+
## [6.44.1] - 2026-11-29
|
|
6
|
+
|
|
7
|
+
A held milestone no longer always stops the run for you. orch now has two kinds of hold. The lead may approve the everyday ones itself, after reading the change and giving a reason. The dangerous ones still wait for you, and you can say "approve Mn" in the lead's chat instead of going to a shell.
|
|
8
|
+
|
|
9
|
+
Example: M1 adds `migrations/0007_add_deleted_at.sql` with one new column. Before, the run stopped and the lead told you to run `orch approve M1` in a terminal. Now the lead reads the change, runs `orch approve M1 --lead "only adds a nullable deleted_at column, no data changed"`, and M2 starts. M3 deletes `uploads/old/`: the lead shows you why, you reply "approve M3", and it runs `orch approve M3` for you.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- **Two kinds of hold.** A migration file, CI configuration, a dependency change the plan did not list or a very large diff: `the lead may approve after reading the change`. A milestone the plan marks `Door: one-way` (hard to undo), deleted files or secrets files: `only the developer may approve`. `orch status`, the HELD event, `orch sub done` (`Who approves:`) and the event manager's message say which.
|
|
13
|
+
- **`orch approve Mn --lead "<why it is safe>"`.** The lead's approval, with its reason. It is refused for a hold that needs the developer, and it is kept in the run diary (`orch story`), `orch report`, and a new summary (and PR) section "Risky changes the lead approved".
|
|
14
|
+
- **The developer can approve in chat.** For a hold only the developer may approve, the lead asks; when you reply "approve Mn", it runs `orch approve Mn` for you. It never does that without your message. `orch approve Mn` from your own terminal works as before.
|
|
15
|
+
- Without a lead (`Lead mode: off`) every hold waits for your `orch approve`, as before. `Risk hold: off` still turns holds off.
|
|
16
|
+
|
|
17
|
+
## [6.44.0] - 2026-11-29
|
|
18
|
+
|
|
19
|
+
Enter on an agent in the board popup jumps to that agent and closes the popup.
|
|
20
|
+
|
|
21
|
+
Example: you press `prefix+a`, pick `agy-3` with the arrow keys and press Enter. Before, herdr moved to agy-3 but the board popup stayed on top of it, and you had to press `q`. Now the popup closes and you are in agy-3's pane.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- **Board popup: Enter on an agent closes the popup after the jump.** Only in the popup (herdr's plugin pane, `HERDR_PLUGIN_ID` is the board plugin). An `orch board` in a pane of its own stays open, as before, so you can keep watching. If herdr cannot focus the agent, the board stays open and says so.
|
|
25
|
+
|
|
5
26
|
## [6.43.0] - 2026-11-28
|
|
6
27
|
|
|
7
28
|
A fix after a finished run no longer waits in silence when herdr has lost the agents' names.
|
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ Version choice, first match wins: `--version` flag › `ORCH_VERSION` env › `.
|
|
|
152
152
|
3. **Orchestration run:** tell the lead **go** (`/orch-run`). It dispatches the milestones (`orch dispatch M1 M2`), which starts the event manager, and pauses. From here the run looks after itself:
|
|
153
153
|
- a milestone finishes → the event manager checks and merges it, then wakes the lead, which dispatches what that unlocked;
|
|
154
154
|
- a coder asks a question → the lead is woken; if the plan or the code already answers it, it answers, otherwise it asks you in its pane. `orch answer M2 "<your answer>"` writes the answer into the plan and the **same coder** carries on with its work; if a criterion can't be met (say an outside API is missing) and you agree to ship the rest, the lead runs `orch answer M2 --defer AC2 "<your words>"`: no fix rounds or stronger-model retries for AC2, and the summary lists it as **not done**, with a follow-up;
|
|
155
|
-
- a risky change is **held** →
|
|
155
|
+
- a risky change is **held** → for a migration file, CI config, a package change or a very large diff, the lead reads the change and approves it itself, with its reason (`orch approve Mn --lead "<why>"`, listed in the summary and PR); for a hard-to-undo milestone, deleted files or secrets files only you can: reply "approve Mn" in the lead's chat, or run `orch approve Mn`.
|
|
156
156
|
|
|
157
157
|
You can also start the event manager yourself: `orch autopilot` in a spare terminal. It is the only driver of a run: while it runs, other `orch` commands that would change the run are refused (`orch status`, `orch report`, `orch approve` and the lead's `orch events` / `orch dispatch` / `orch answer` still work).
|
|
158
158
|
After each wake-up the lead says in its chat what happened and what it did, one plain line per event; `orch story` keeps the whole run as a diary, and `orch plan show` gives the plan as one short card per milestone.
|
|
@@ -375,7 +375,7 @@ Three views show a run while it goes; none of them changes it.
|
|
|
375
375
|
| A paused coder keeps writing files | whatever it writes anyway is saved into the milestone the next time the milestone or that folder is used. orch never refuses a task because a folder has unsaved files |
|
|
376
376
|
| plan.md changed while a coder works on that milestone | its task.md is not rewritten mid-work; `orch sync` warns and says how to send the new text (`orch set Mn paused`, then `orch dispatch Mn`) |
|
|
377
377
|
| Lockfiles changed since a folder was set up | the setup command runs again there (and in your main folder before the merge check) |
|
|
378
|
-
| Risky change (deleted file, migration, CI config, secrets file, unlisted dependency change, very large diff) | the milestone is **held
|
|
378
|
+
| Risky change (deleted file, migration, CI config, secrets file, unlisted dependency change, very large diff) | the milestone is **held**; the rest keeps going. The lead may approve a migration file, CI config, a dependency change or a large diff itself, with its reason. Hard to undo, deleted files and secrets files wait for you: tell the lead "approve Mn" or run `orch approve Mn` |
|
|
379
379
|
| The wake-up prompt never became a turn for the lead (it sat in the input box, or you were typing there) | sent again after 30s, then 1 min; after 3 tries you get a notification. The event manager does not leave at ALL_DONE before the lead has read the last events |
|
|
380
380
|
| A coder changes files outside its `Likely files` | listed in the summary (`Scope: strict` sends it back instead) |
|
|
381
381
|
| An orch step fails for one task | that task is paused with the error; the others keep running |
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.
|
|
1
|
+
6.44.1
|
|
Binary file
|
package/bin/orch
CHANGED
|
@@ -10,7 +10,7 @@ Plan: <main-repo>/.orchestrate/plan.md (human-editable, see orch-plan skill
|
|
|
10
10
|
|
|
11
11
|
Task status flow (every change goes through move(), which checks TRANSITIONS)
|
|
12
12
|
pending -> coding -> verifying -> [awaiting-review -> reviewing -> reviewed] -> committed -> merged
|
|
13
|
-
side states: needs-answer, paused, failed, conflict, needs-fix, held (waiting for `orch approve
|
|
13
|
+
side states: needs-answer, paused, failed, conflict, needs-fix, held (waiting for `orch approve`, from the developer or, for some reasons, the lead), skipped
|
|
14
14
|
Also: .orchestrate/events.jsonl (one line per transition), driver.lock (held by autopilot while it drives).
|
|
15
15
|
"""
|
|
16
16
|
import atexit, contextlib, fcntl, fnmatch, hashlib, json, os, re, shlex, shutil, signal, socket, subprocess, sys, tempfile, textwrap, time
|
|
@@ -72,6 +72,17 @@ RISK_RULES = [
|
|
|
72
72
|
(re.compile(r"(^|/)\.env(\.(?!example$|sample$|template$)[^/]+)?$|(^|/)[^/]*\.(pem|key|p12)$", re.I),
|
|
73
73
|
"secrets or environment file"),
|
|
74
74
|
]
|
|
75
|
+
# who may let a held milestone land. These reasons need the developer: the change can't simply be reverted, or it
|
|
76
|
+
# removes files or touches secrets. Any other reason (a migration file, CI config, a dependency change, a large diff)
|
|
77
|
+
# the lead may approve itself after it read the change, with its reason: `orch approve Mn --lead "<why it is safe>"`
|
|
78
|
+
DEVELOPER_ONLY = ("hard to undo", "deletes ", "secrets or environment file")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def hold_by(risks):
|
|
82
|
+
"""'developer' when any reason to hold needs the developer's OK, else 'lead'."""
|
|
83
|
+
return "developer" if any(r.startswith(DEVELOPER_ONLY) for r in risks) else "lead"
|
|
84
|
+
|
|
85
|
+
|
|
75
86
|
# quick runs (`Mode: quick`): small, clear changes only. Files that always need the full process...
|
|
76
87
|
QUICK_NEVER = RISK_RULES + [(LOCKFILE_RE, "dependency file")]
|
|
77
88
|
# ...and names that usually mean auth or payment code: the lead should be sure before calling it quick
|
|
@@ -2911,6 +2922,25 @@ def risk_section(st):
|
|
|
2911
2922
|
"|---|---|---|---|\n" + "\n".join("| " + " | ".join(esc(c) for c in r) + " |" for r in rows) + "\n\n")
|
|
2912
2923
|
|
|
2913
2924
|
|
|
2925
|
+
def lead_approvals(st):
|
|
2926
|
+
"""[(Mn and title, the reasons it was held, the lead's reason)] for each milestone the lead let land itself."""
|
|
2927
|
+
return [(f"{tid} {st['tasks'][tid]['title']}", "; ".join((st["tasks"][tid].get("risks") or [])[:5]) or "-",
|
|
2928
|
+
st["tasks"][tid]["approved_by"].get("reason") or "-")
|
|
2929
|
+
for tid in st["order"] if (st["tasks"][tid].get("approved_by") or {}).get("who") == "lead"]
|
|
2930
|
+
|
|
2931
|
+
|
|
2932
|
+
def lead_approval_section(st):
|
|
2933
|
+
"""The summary's (and so the PR's) list of risky changes the lead approved without asking the developer."""
|
|
2934
|
+
rows = lead_approvals(st)
|
|
2935
|
+
if not rows:
|
|
2936
|
+
return ""
|
|
2937
|
+
esc = lambda x: str(x).replace("|", "\\|").replace("\n", " ")
|
|
2938
|
+
return ("## Risky changes the lead approved\nThese were held for a risky change that does not need you (a migration "
|
|
2939
|
+
"file, CI config, a dependency change, a large diff). The lead read each one and let it land, with its "
|
|
2940
|
+
"reason. Look at them before you merge.\n\n| Milestone | Held for | Lead's reason |\n|---|---|---|\n"
|
|
2941
|
+
+ "\n".join("| " + " | ".join(esc(c) for c in r) + " |" for r in rows) + "\n\n")
|
|
2942
|
+
|
|
2943
|
+
|
|
2914
2944
|
def review_findings(tid, k):
|
|
2915
2945
|
"""(blockers, suggestions, known) for review round k: review-k.json, else the BLOCKER:/SUGGESTION: lines of
|
|
2916
2946
|
review-k.md. known=False when neither is usable."""
|
|
@@ -4198,13 +4228,16 @@ def _hold(st, tid, risks):
|
|
|
4198
4228
|
"""Stop a milestone before it lands until the developer runs `orch approve Mn` (exit 7)."""
|
|
4199
4229
|
t = st["tasks"][tid]
|
|
4200
4230
|
t["risks"] = risks
|
|
4231
|
+
t["hold_by"] = by = hold_by(risks)
|
|
4201
4232
|
if st["isolation"] == "worktree" and holds(st, tid): # its work is saved in the hidden ref: free the coder
|
|
4202
4233
|
st["workers"][t["worker"]]["task"] = None
|
|
4203
4234
|
t["last_worker"], t["worker"] = t["worker"], None
|
|
4204
4235
|
b = t.get("blast") or {}
|
|
4205
4236
|
proof = ((t.get("proof") or ("the coder's PROOF: line, in the lead's chat" if run_mode(st) == "subagent"
|
|
4206
4237
|
else "none given by the coder")) if t.get("door") == "one-way" else None)
|
|
4207
|
-
|
|
4238
|
+
who = (f"only the developer may approve (`orch approve {tid}`)" if by == "developer" else
|
|
4239
|
+
f"the lead may approve after reading the change (`orch approve {tid} --lead \"<why it is safe>\"`)")
|
|
4240
|
+
move(st, tid, "held", f"waiting for an OK, {who}: " + "; ".join(risks[:3])
|
|
4208
4241
|
+ (f" (+{len(risks) - 3} more)" if len(risks) > 3 else "")
|
|
4209
4242
|
+ (f" · could break: {b['level']}" if b else "") + (f" · proof: {proof[:200]}" if proof else ""))
|
|
4210
4243
|
save(st)
|
|
@@ -4213,6 +4246,10 @@ def _hold(st, tid, risks):
|
|
|
4213
4246
|
print(f"Could break: {b['level']} ({'; '.join(b['why'])})")
|
|
4214
4247
|
if proof:
|
|
4215
4248
|
print(f"Proof from the coder: {proof}")
|
|
4249
|
+
print("Who approves: " + (f"only the developer: they run `orch approve {tid}`, or tell the lead \"approve {tid}\" "
|
|
4250
|
+
f"in its chat" if by == "developer" else
|
|
4251
|
+
f"the lead may, after reading the change: `orch approve {tid} --lead \"<why it is safe>\"`"
|
|
4252
|
+
f" (or the developer: `orch approve {tid}`)"))
|
|
4216
4253
|
print(f"Look at it, then run `orch approve {tid}` (or `orch set {tid} paused` to stop it)")
|
|
4217
4254
|
sys.exit(7)
|
|
4218
4255
|
|
|
@@ -4270,17 +4307,36 @@ def recover_merge(st):
|
|
|
4270
4307
|
|
|
4271
4308
|
|
|
4272
4309
|
def cmd_approve(args):
|
|
4273
|
-
"""orch approve Mn -> let a held milestone land (
|
|
4274
|
-
|
|
4310
|
+
"""orch approve Mn -> let a held milestone land (the developer looked at its risky changes).
|
|
4311
|
+
orch approve Mn --lead "<why it is safe>" -> the lead approves it, only when nothing in it needs the developer."""
|
|
4312
|
+
lead_why = None
|
|
4313
|
+
if "--lead" in args:
|
|
4314
|
+
i = args.index("--lead")
|
|
4315
|
+
lead_why = " ".join(args[i + 1:]).strip()
|
|
4316
|
+
args = args[:i]
|
|
4317
|
+
if not lead_why:
|
|
4318
|
+
die('approve <Mn> --lead "<why it is safe>": say what you read in the change and why it is safe')
|
|
4319
|
+
need(args, 1, "approve <Mn> [--lead \"<why it is safe>\"]")
|
|
4275
4320
|
tid = args[0]
|
|
4276
4321
|
st = load()
|
|
4277
4322
|
t = task(st, tid)
|
|
4278
4323
|
if t["status"] != "held":
|
|
4279
4324
|
die(f"{tid} is {t['status']}, not held")
|
|
4325
|
+
by = t.get("hold_by") or hold_by(t.get("risks") or [])
|
|
4326
|
+
if lead_why is not None and by == "developer":
|
|
4327
|
+
need_dev = [r for r in t.get("risks") or [] if r.startswith(DEVELOPER_ONLY)]
|
|
4328
|
+
die(f"{tid} needs the developer's OK, not the lead's: " + "; ".join(need_dev[:5])
|
|
4329
|
+
+ f". Ask them; when they tell you \"approve {tid}\", run `orch approve {tid}` for them.")
|
|
4280
4330
|
t["approved"] = True
|
|
4281
|
-
|
|
4331
|
+
t["approved_by"] = ({"who": "lead", "reason": lead_why[:300], "ts": now()} if lead_why is not None
|
|
4332
|
+
else {"who": "developer", "ts": now()})
|
|
4333
|
+
move(st, tid, "committed", f"approved by the lead: {lead_why[:200]}" if lead_why is not None
|
|
4334
|
+
else "approved by the developer")
|
|
4335
|
+
if lead_why is not None:
|
|
4336
|
+
story_note(st, f"{tid} ({t['title']}): the lead approved its risky change: {lead_why[:200]}")
|
|
4282
4337
|
save(st)
|
|
4283
|
-
print(f"APPROVED {tid}
|
|
4338
|
+
print(f"APPROVED {tid}" + (" by the lead" if lead_why is not None else "")
|
|
4339
|
+
+ f": it lands on the next autopilot step (or `orch merge {tid}`)")
|
|
4284
4340
|
|
|
4285
4341
|
|
|
4286
4342
|
def _park(st, tid, status, reason, force=False):
|
|
@@ -6069,7 +6125,11 @@ EVENT_HELP = {
|
|
|
6069
6125
|
"failed": "still failing after its rounds. Read the last report and check or review output, add the missing "
|
|
6070
6126
|
"FACT or constraint to the plan (never a how-to), then `orch dispatch {t}` (add `--tier high` or "
|
|
6071
6127
|
"`--to <worker>` to give it a stronger model). If a criterion can't be met (a missing outside API) and the developer approves leaving it out: `orch defer {t} AC<n> \"<their reason>\"`, then `orch dispatch {t}`.",
|
|
6072
|
-
"held": "risky
|
|
6128
|
+
"held": "a risky change waits for an OK. The event says who may give it. `the lead may approve`: read the change "
|
|
6129
|
+
"(`orch changes {t}`, and the reasons in `orch status`); if it is safe, `orch approve {t} --lead \"<what you "
|
|
6130
|
+
"read and why it is safe>\"`; if you are not sure, ask the developer instead. `only the developer may "
|
|
6131
|
+
"approve` (hard to undo, deletes files, secrets): show them the reasons and ask; run `orch approve {t}` "
|
|
6132
|
+
"only after they tell you to in your chat (\"approve {t}\"), never on your own.",
|
|
6073
6133
|
"needs-answer": "open questions in plan.md: ask the developer, write the answers under \"Notes from user\", set "
|
|
6074
6134
|
"\"Open questions:\" to `- none`, `orch sync`, then `orch dispatch {t}`.",
|
|
6075
6135
|
"merged": "landed on the feature branch. Nothing to do unless it unlocked work listed under READY.",
|
|
@@ -6120,6 +6180,8 @@ def say_line(st, e):
|
|
|
6120
6180
|
if k == "failed":
|
|
6121
6181
|
return f"{name} failed: {text}."
|
|
6122
6182
|
if k == "held":
|
|
6183
|
+
if t.get("hold_by") == "lead":
|
|
6184
|
+
return f"{name} is finished but has a risky change, so the lead reads it before it lands: {text}."
|
|
6123
6185
|
return f"{name} is finished but waits for your OK, because it has a risky change: {text}."
|
|
6124
6186
|
if k == "needs-answer":
|
|
6125
6187
|
return f"{name} can't start yet: the plan has open questions only you can answer."
|
|
@@ -7021,9 +7083,16 @@ def _autopilot(args):
|
|
|
7021
7083
|
|
|
7022
7084
|
def held(tid, out):
|
|
7023
7085
|
extra = [l.strip() for l in out.splitlines() if l.startswith(("Could break:", "Proof from the coder:"))]
|
|
7086
|
+
s_ = load()
|
|
7087
|
+
if s_["tasks"][tid].get("hold_by") == "developer":
|
|
7088
|
+
who = f"Only you can approve it: look at it, then run `orch approve {tid}` (or tell the lead \"approve {tid}\")"
|
|
7089
|
+
elif lead_on(s_):
|
|
7090
|
+
who = (f"The lead may approve it after reading the change (`orch approve {tid} --lead \"<why>\"`), "
|
|
7091
|
+
f"or you can: `orch approve {tid}`")
|
|
7092
|
+
else:
|
|
7093
|
+
who = f"Look at it, then run `orch approve {tid}`"
|
|
7024
7094
|
say(f"{tid} is HELD for your approval: {out.splitlines()[0].split('—', 1)[-1].strip()}. "
|
|
7025
|
-
+ "".join(f"{l}. " for l in extra) +
|
|
7026
|
-
f"Look at it, then run `orch approve {tid}`; autopilot keeps going with the rest", True)
|
|
7095
|
+
+ "".join(f"{l}. " for l in extra) + who + "; autopilot keeps going with the rest", True)
|
|
7027
7096
|
|
|
7028
7097
|
# ---- background jobs: a check or a merge runs beside the event loop, and its end is one more event (like a
|
|
7029
7098
|
# browser's fetch: the work happens elsewhere, the callback is queued). Nothing waits for a check to finish.
|
|
@@ -7882,7 +7951,7 @@ def _autopilot(args):
|
|
|
7882
7951
|
f"\n\n## Commits\n```\n{log_}```\n\n## Files changed\n```\n{stat}```\n\n"
|
|
7883
7952
|
"## Changed outside Likely files\n" + ("\n".join(scope) or "none") + "\n\n"
|
|
7884
7953
|
"## Reviewer suggestions not applied\n" + ("\n".join(sugg) or "none") + "\n\n"
|
|
7885
|
-
+ review_axes_section(st) + risk_section(st)
|
|
7954
|
+
+ review_axes_section(st) + risk_section(st) + lead_approval_section(st)
|
|
7886
7955
|
+ ("## Deferred: not done, follow-ups\nThe developer approved leaving these out of this run. They were "
|
|
7887
7956
|
"NOT built.\n" + "\n".join(deferred_lines(st)) + "\n\n" if deferred_lines(st) else "")
|
|
7888
7957
|
+ ("## Models: planned and actual\n| Milestone | Planned tier | Ran on | Escalated | Why this tier |\n"
|
|
@@ -8117,6 +8186,8 @@ def _wait_part(st, status, why, agent):
|
|
|
8117
8186
|
if status == "needs-answer":
|
|
8118
8187
|
return "open questions waiting for the developer's answer", "developer"
|
|
8119
8188
|
if status == "held":
|
|
8189
|
+
if "the lead may approve" in (why or ""):
|
|
8190
|
+
return "risky change waiting for the lead's look (`orch approve --lead`)", "lead / developer"
|
|
8120
8191
|
return "risky change waiting for the developer's `orch approve`", "developer"
|
|
8121
8192
|
if status == "failed":
|
|
8122
8193
|
return "failed, waiting for the lead to dispatch it again", "lead / developer"
|
|
@@ -8366,6 +8437,8 @@ def cmd_report(args):
|
|
|
8366
8437
|
for r in rows:
|
|
8367
8438
|
print(f" {r[0]} — undo: {r[1].replace('**', '')} — could break: {r[2]}"
|
|
8368
8439
|
+ (f" — proof: {r[3]}" if r[3] != "-" else ""))
|
|
8440
|
+
for r in lead_approvals(st):
|
|
8441
|
+
print(f"approved by the lead: {r[0]} — held for: {r[1]} — reason: {r[2]}")
|
|
8369
8442
|
if by_axis["spec"] or by_axis["rules"]:
|
|
8370
8443
|
print(f"review findings: {len(by_axis['spec'])} spec (built what was asked?), {len(by_axis['rules'])} rules "
|
|
8371
8444
|
f"(followed the repo's rules?)")
|
|
@@ -10186,7 +10259,8 @@ def cmd_changes(args):
|
|
|
10186
10259
|
|
|
10187
10260
|
def cmd_board(args):
|
|
10188
10261
|
"""orch board [--once] [--no-color] -> the run as text, redrawn when it changes (for a herdr pane or popup).
|
|
10189
|
-
[f] or [enter] on a milestone opens its changed files, [enter] on a file its diff; q goes back one screen.
|
|
10262
|
+
[f] or [enter] on a milestone opens its changed files, [enter] on a file its diff; q goes back one screen.
|
|
10263
|
+
[enter] on an agent jumps to it; in the board popup (prefix+a) it also closes the popup."""
|
|
10190
10264
|
# live needs a keyboard and a screen: with stdin or stdout not a terminal, draw once (termios would fail)
|
|
10191
10265
|
once = "--once" in args or not (sys.stdout.isatty() and sys.stdin.isatty())
|
|
10192
10266
|
color = "--no-color" not in args and sys.stdout.isatty() and not os.environ.get("NO_COLOR")
|
|
@@ -10296,6 +10370,9 @@ def cmd_board(args):
|
|
|
10296
10370
|
elif key in ("\r", "\n") and sel is not None and n:
|
|
10297
10371
|
a = vm["agents"][rows[sel][1]]
|
|
10298
10372
|
r2 = subprocess.run([HERDR, "agent", "focus", a["name"]], text=True, capture_output=True)
|
|
10373
|
+
if r2.returncode == 0 and os.environ.get("HERDR_PLUGIN_ID") == VIEW_PLUGIN_ID:
|
|
10374
|
+
closed_by = f"enter (jumped to {a['name']})" # in the popup: get out of the way of the agent
|
|
10375
|
+
break
|
|
10299
10376
|
note = f"jumped to {a['name']}" if r2.returncode == 0 else f"herdr could not focus {a['name']}"
|
|
10300
10377
|
elif key in ("w", "W"):
|
|
10301
10378
|
r2 = subprocess.run([sys.executable, os.path.abspath(__file__), "view", "--bg"], text=True,
|
|
@@ -10439,6 +10516,8 @@ USAGE = """usage: orch <command> [args]
|
|
|
10439
10516
|
a coder still working on a paused/failed Mn gets the interrupt key (Esc) and a STOP note,
|
|
10440
10517
|
and stays busy ("stopping") until herdr shows it idle
|
|
10441
10518
|
approve <Mn> let a milestone held for risky changes land (works while autopilot runs)
|
|
10519
|
+
approve <Mn> --lead "<why>" the lead lets it land itself, with its reason (only when the hold does not need the
|
|
10520
|
+
developer: not for hard to undo, deleted files or secrets files)
|
|
10442
10521
|
cleanup remove clean worker worktrees
|
|
10443
10522
|
finish [--no-push] [--recheck] final check (reused if it passed on these exact files), remove the <repo>-wt
|
|
10444
10523
|
coder folders, push, open a PR
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "herdr-orchestra",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.44.1",
|
|
4
4
|
"description": "Orchestrate AI coding agents (Claude Code, Codex, OpenCode, Amp, Pi) as one team: a lead plans, coders build, a reviewer checks, you get one PR. Runs in Herdr panes, or in one Pi window with subagents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
package/playbooks/plan.md
CHANGED
|
@@ -107,7 +107,7 @@ Open questions:
|
|
|
107
107
|
- none
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
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
|
|
110
|
+
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 is held: the lead may approve a migration file, CI, a package or many lines after reading the change (`orch approve M1 --lead "<why>"`); deleted files and secrets wait for the developer. After it lands, more small changes go straight to the same coder with `orch fix M1 "<change>"`.
|
|
111
111
|
|
|
112
112
|
<!-- full -->
|
|
113
113
|
## 3. Discover the team
|
package/playbooks/run.md
CHANGED
|
@@ -14,7 +14,7 @@ A run behaves like a call stack. You **dispatch** work and **pause**. The **even
|
|
|
14
14
|
1. You NEVER edit application code. You only run `orch`, read its files, and edit `.orchestrate/plan.md` (answers, notes, tiers, the check command).
|
|
15
15
|
2. You NEVER prompt a worker or your own pane. Only the event manager sends prompts.
|
|
16
16
|
3. Never guess. A question only the developer can settle goes to the developer, with 2–3 concrete options. Answer a coder's question yourself only when the feature request, the plan or the code already settles it; say where the answer comes from.
|
|
17
|
-
4. Never answer a worker's permission prompt yourself
|
|
17
|
+
4. Never answer a worker's permission prompt yourself. A held milestone: approve it yourself only when orch says the lead may (`orch approve Mn --lead "<why it is safe>"`, after you read the change). When it says only the developer may (hard to undo, deleted files, secrets files), run `orch approve Mn` only after the developer tells you to in your chat ("approve Mn"), never on your own.
|
|
18
18
|
5. Never move a task forward by hand: `orch set` only accepts `pending`, `paused`, `failed` and `skipped`. Don't use `--force`.
|
|
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
|
7. **Never end a wake-up silently.** Before you STOP, write in your chat one short line per event, in plain words: what happened (its `SAY:` line from `orch events`) and what you did about it. Example: `M1 (Model) is done and on the branch. M3 started by itself because it was waiting for M1. Nothing for me to do.` or `M4 is paused: the coder asks which currency to use. I'm asking you: INR only, or several?`. The developer reads your chat to follow the run; `orch story` keeps the same lines.
|
|
@@ -47,7 +47,7 @@ Run `orch events`. It lists the new events, the ones still open, the milestones
|
|
|
47
47
|
| `FAILED Mn`: lost N attempts | The agents kept being unreachable, gone or rate-limited. Tell the developer which agents to restart or wait for; then `orch dispatch Mn`. |
|
|
48
48
|
| `WORKER-LOST Mn` | A coder vanished while it worked (pane closed, the agent quit and left a shell, herdr restarted), or Mn is ready but herdr has no agent for the coder it may go to (panes reopened after a finished run come back without their names). **Not routine:** tell the developer at once, with the exact fix in the event text (`orch resume`, or `orch team up`). The milestone waits for the next free coder with its work so far; nothing else to do. |
|
|
49
49
|
| `HERDR-RESTART` | Most agents vanished at once. Tell the developer to run `orch resume`, then `orch team up` for any agent it reports `LOST`. |
|
|
50
|
-
| `HELD Mn` |
|
|
50
|
+
| `HELD Mn` | A risky change waits for an OK; the event says who may give it. **The lead may approve** (a migration file, CI config, an unlisted dependency change, a very large diff): read the change (`orch changes Mn`, the reasons in `orch status`). If it does what the milestone asks and nothing more, run `orch approve Mn --lead "<what you read and why it is safe>"`, e.g. `--lead "new migration only adds a nullable deleted_at column, no data changed"`, and say so in your chat. If you are not sure, ask the developer instead. **Only the developer may approve** (a milestone the plan marks hard to undo, deleted files, secrets files): show the reasons, how much it could break and, for a hard-to-undo milestone, the coder's proof, and ask them. When they reply "approve Mn" in your chat, run `orch approve Mn` for them (they can also run it themselves, or `orch set Mn paused`). Never approve it on your own. |
|
|
51
51
|
| `NEEDS-ANSWER Mn` | Open questions in the plan: ask the developer, write the answers under "Notes from user", set "Open questions:" to `- none`, `orch sync`, then `orch dispatch Mn`. |
|
|
52
52
|
| `ESCALATED Mn`, `AUTO-DISPATCHED Mn` | Information: nothing to dispatch. Mention an escalation in the final summary. |
|
|
53
53
|
| `FINISHED` | The developer ran `orch finish`. Post the MANUAL TESTS list that `orch events` prints under it in your chat, numbered and word for word, under "Try these by hand before you merge", plus the PR link from the event when there is one. If it says none, say there is nothing to try by hand and why. Nothing else to do: the run is over. |
|
package/playbooks/subagent.md
CHANGED
|
@@ -9,7 +9,7 @@ There is no event manager and there are no herdr panes. You drive one milestone
|
|
|
9
9
|
0. **Roles: you decide what and why; the coder decides how.** Your prompts to the coder name the task file, the failing check output or the review findings: problems and goals, never solutions.
|
|
10
10
|
1. You NEVER edit application code yourself. You only run `orch`, read its files, start subagents, and edit `.orchestrate/plan.md` (answers, notes, tiers, the check command).
|
|
11
11
|
2. Never guess. A question only the developer can settle goes to the developer, with 2–3 concrete options. Answer the coder's question yourself only when the feature request, the plan or the code already settles it; say where the answer comes from.
|
|
12
|
-
3.
|
|
12
|
+
3. A held milestone: approve it yourself only when orch says the lead may (`orch approve Mn --lead "<why it is safe>"`, after you read the change). When only the developer may (hard to undo, deleted files, secrets files), run `orch approve Mn` only after they tell you to in your chat, never on your own. Never `git commit`, `git stash` or `git reset` yourself: `orch sub done` saves the work.
|
|
13
13
|
4. Never skip the check, and never ask the coder to weaken or skip tests.
|
|
14
14
|
5. After each milestone, write one short line in your chat in plain words: what landed, what the check and the review said, what starts next. Example: `M1 (Model) is saved on the branch: check PASS, review found nothing. Starting M2 (Endpoint).`
|
|
15
15
|
6. **Never push to main.** You and the subagents never push to main, master or the repo's default branch, and never merge a PR (`gh pr merge`, `git push origin HEAD:main`, a force push), even when the developer tells you to. Refuse in one line ("I can't push to main, even when asked; the work is on <branch>, `orch finish` pushes it and opens a PR, and you merge it") and never get around the repo's pre-push guard (`--no-verify`, `.git/hooks`).
|
|
@@ -26,7 +26,7 @@ There is no event manager and there are no herdr panes. You drive one milestone
|
|
|
26
26
|
- If the coder replies `QUESTION: ...`: answer it from the plan or the code (say where the answer comes from), or ask the developer with 2–3 options and **STOP**. Write the answer under that milestone's "Notes from user" in `.orchestrate/plan.md`, then send it to the same coder with the `Agent` tool's `resume` (its agent id), so it carries on from its work.
|
|
27
27
|
3. **Check.** Run `orch check Mn`. On `CHECK FAIL`, resume the same coder with the failing output (the last lines `orch check` printed) and ask it to fix the cause. Run `orch check Mn` again. At most 3 fix rounds; after that, run `orch set Mn failed "<what keeps failing>"`, explain it to the developer in two lines, and **STOP**.
|
|
28
28
|
4. **Review** (only when `REVIEW yes`). Call the `Agent` tool: `subagent_type: "reviewer"`, `run_in_background: false`, prompt `Review milestone Mn. Task file: <TASK path>. Look at the change with git diff HEAD and git status --short.` Each `BLOCKER:` line goes back to the same coder (resume it with those lines only), then `orch check Mn` again, then one more review. At most 2 review rounds; blockers still left after that: `orch set Mn failed "<the blockers>"`, tell the developer, **STOP**. `SUGGESTION:` lines do not block: keep them for the summary.
|
|
29
|
-
5. **Save.** Run `orch sub done Mn`. `MERGED Mn` means it is committed on the feature branch. `HELD Mn` (exit 7) means risky changes (a milestone the plan marks hard to undo, deleted files, migrations, CI config, secrets files, unlisted dependency changes, a very large diff) wait for the developer: show the reasons from `orch status` and what `orch sub done` printed (how much it could break; for a hard-to-undo milestone, the coder's `PROOF:` line from its reply),
|
|
29
|
+
5. **Save.** Run `orch sub done Mn`. `MERGED Mn` means it is committed on the feature branch. `HELD Mn` (exit 7) means risky changes (a milestone the plan marks hard to undo, deleted files, migrations, CI config, secrets files, unlisted dependency changes, a very large diff) wait for an OK. Its `Who approves:` line says who. The lead may: read the change, and if it is safe run `orch approve Mn --lead "<what you read and why it is safe>"`, then `orch sub done Mn` again (not sure: ask the developer). Only the developer may: show the reasons from `orch status` and what `orch sub done` printed (how much it could break; for a hard-to-undo milestone, the coder's `PROOF:` line from its reply), ask them, and **STOP**; when they say "approve Mn", run `orch approve Mn` (or they run it), then `orch sub done Mn` again.
|
|
30
30
|
6. Write your one line in the chat (hard rule 5), and go back to step 1 for the next milestone.
|
|
31
31
|
|
|
32
32
|
`orch sub next` printing `WAITING` means nothing is ready (a milestone is paused, failed or needs an answer): tell the developer which and why (`orch status`), and **STOP**. When it is sorted out, `orch set Mn pending` and carry on.
|