herdr-orchestra 5.2.0 → 5.4.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 +19 -0
- package/README.md +8 -4
- package/VERSION +1 -1
- package/agents.default.toml +22 -7
- package/bin/__pycache__/orchcpython-314.pyc +0 -0
- package/bin/orch +341 -103
- package/install.sh +3 -2
- package/package.json +1 -1
- package/playbooks/plan.md +12 -1
- package/playbooks/run.md +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes. Versions follow [semantic versioning](https://semver.org).
|
|
4
4
|
|
|
5
|
+
## [5.4.0] - 2026-11-14
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- **Skills no longer show up twice.** An update always wrote over the same files, but the installer put each skill in a shared folder (`~/.agents/skills`) and in every agent's own folder, and several tools read more than one of them. Codex reads `~/.agents/skills` and `~/.codex/skills`, and its docs say two skills with the same name both show up, so it listed `orch-plan` and `orch-run` twice. OpenCode got its slash commands in both `commands` and the older `command` folder. Claude Code, OpenCode and Amp skills were not shown twice (their docs say one copy wins), but an old copy could be the one that wins. Now the agent registry lists every folder a tool reads (`skills_reads`, `commands_reads`, and `skills_one_wins` for tools that show one copy), and `orch agents sync` (run by the installer) writes the fewest folders so each installed agent reads one copy. Example: with Claude, Codex and OpenCode it writes `~/.claude/skills` (Claude) and `~/.agents/skills` (Codex, OpenCode), and removes the copies in `~/.codex/skills`. Claude Code gets the skill only, since a skill is already the `/orch-plan` command and wins over a command file of the same name; the old `~/.claude/commands/orch-*.md` copies are removed.
|
|
9
|
+
- **Updates clean up after older versions.** Every sync removes orch's copies from folders it no longer uses, and any skill an older version installed under a name that is no longer shipped (from the install manifest). Only orch's own thin wrappers are removed; your own skills, even ones named `orch-...`, are left alone. A copy in a folder that no installed agent reads is kept (its agent may just be missing from PATH right now), and a skills folder that is a symlink to another one counts as one folder. Installing three times in a row leaves exactly the same files.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- `orch agents check` (and `orch doctor`) report `DUPLICATE` when an agent would see a skill twice, with the two folders, and tell you to run `orch agents sync`.
|
|
13
|
+
## [5.3.0] - 2026-11-13
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- **A wake-up that never became a turn is no longer lost.** In a real run the event manager logged `woke the lead` after a milestone merged, the lead never got a turn, and the run sat at ALL_DONE until the developer asked "status?". Two things in the code caused the silence. "Woke the lead" only meant the prompt was handed to herdr; nothing checked that the lead acted on it. And the only retry was after 5 minutes, by a process that exits at ALL_DONE: the ALL_DONE wake-up 4 seconds later was skipped because a wake-up for the same batch was "already pending", and then the event manager left, so nothing was ever sent again. (Why the first prompt did not become a turn could not be confirmed from the logs: most likely it landed in the pane's input box while the developer was typing there.) Now only the lead reading its events (`orch events`) counts. If the lead is idle again and the events are still unread, the wake-up is sent again after `ORCH_LEAD_CONFIRM_S` (30 seconds), then after twice that; after 3 wake-ups the developer gets a notification that says what to do. At ALL_DONE the event manager stays up until the lead has read the last events (at most `ORCH_LEAD_SETTLE_S`, 5 minutes, when the lead is busy). The log is honest about it: `woke the lead … (sent; it counts once the lead reads them)`, `the lead did not pick up its wake-up … -> sent it again (2 of 3)`, `the lead picked up its events`. `orch status` shows `wake-up sent 2x (last 0m40s ago), not picked up yet`. The lead's playbook also tells it to run `orch events` before it stops whenever the developer talks to it.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **The manual checklist holds only what a person must check.** The summary used to ask the lead for a checklist "per user-facing behaviour", which filled it with things like reading code or comments. Now the summary has a "Checked automatically" section written by orch: the check command on the finished branch, each review, and every acceptance criterion with the coder's and the reviewer's recorded evidence. The lead then adds "Checked by the lead": whatever else a command or a look at the code can settle, it settles itself and writes the evidence (it may run the check command, single tests and read-only commands; it still never edits code; a check that fails is offered as an `orch fix`). The "Manual verification checklist" is left with what needs eyes or hands: how the UI looks and behaves in a real browser or on a real device, and anything that needs an outside account or hardware, each written as "where to go, what to do → what you should see". A change with nothing to look at says `Nothing to check by hand`. The plan playbook asks for acceptance criteria a test can prove, and to say plainly when one needs a person.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- **A role for every coder.** Each milestone gets a `Role:` line from the lead: the specialist the work needs and what that specialist cares about in this milestone (for UI work: "senior frontend engineer with a designer's eye: matches the app's existing components and spacing, works on a small screen, has loading, empty and error states, usable by keyboard"). orch puts it at the top of the coder's task file ("For this task you are: …", work to that standard, review your own result as that specialist before finishing) and in `task.json` as `role`. An `orch fix` follow-up keeps the role of the milestone it fixes. The role sets the standard, never the method: the coder still owns the how. A plan without `Role:` works as before.
|
|
23
|
+
|
|
5
24
|
## [5.2.0] - 2026-11-13
|
|
6
25
|
|
|
7
26
|
### Added
|
package/README.md
CHANGED
|
@@ -59,8 +59,10 @@ It installs:
|
|
|
59
59
|
| What | Where |
|
|
60
60
|
|---|---|
|
|
61
61
|
| `orch` CLI (scheduler + autopilot) | `~/.local/bin/orch` |
|
|
62
|
-
| `orch-plan`, `orch-run` skills (
|
|
62
|
+
| `orch-plan`, `orch-run` skills, one copy per agent (an agent never lists them twice) | `~/.agents/skills/` or the agent's own skills folder |
|
|
63
63
|
| `/orch-plan`, `/orch-run` OpenCode commands | `~/.config/opencode/commands/` |
|
|
64
|
+
|
|
65
|
+
Updating replaces the skills, it never adds a second copy: the installer picks one folder per agent and removes orch's older copies from the rest (your own skills are left alone). `orch agents check` says `DUPLICATE` if an agent would still see a skill twice.
|
|
64
66
|
| every installed version, side by side | `~/.local/share/herdr-orchestra/` |
|
|
65
67
|
|
|
66
68
|
Install once — you don't need to run the installer again when you add an agent. After installing Claude, Hermes, Amp or anything else, run:
|
|
@@ -126,7 +128,7 @@ Version choice, first match wins: `--version` flag › `ORCH_VERSION` env › `.
|
|
|
126
128
|
|
|
127
129
|
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).
|
|
128
130
|
4. **If the lead is away** (its pane is closed, or it never reads its events): nothing is lost, the events wait in the queue. Ready work starts by itself after 15 minutes, you get a desktop notification, and `orch events --peek` shows what is open. With `Lead mode: off` in the plan header there is no lead in the run at all: `orch autopilot` dispatches by itself and stops (exit 3) when it needs you.
|
|
129
|
-
5. **When it's done:** read `.orchestrate/summary.md` and
|
|
131
|
+
5. **When it's done:** read `.orchestrate/summary.md` and do its manual checklist. It holds only what needs your eyes or hands (how the UI looks and behaves, a real device); whatever a command or a look at the code can settle, the run and the lead have already checked and listed with the evidence. Want a change? Tell the lead (for example "the login button should be blue"). It runs `orch fix M1 "the login button should be blue"`: one small follow-up job goes straight to the coder who built M1, with the check and review as before, and no new plan. You can run `orch fix` yourself too. When you are happy, run `orch finish`. It re-runs the check, removes the worktrees, pushes `feature/<name>` and opens a PR into `main` (with `gh`, or prints the compare link).
|
|
130
132
|
|
|
131
133
|
### Git: one branch per run, real commits, one PR
|
|
132
134
|
Planning touches no git at all. `orch start` creates the plan's `Branch:` (`feature/<slug>`) and that is the only branch a run makes: coders work on detached worktrees, and a milestone's work in progress (under review, parked, waiting for a fix) lives in hidden refs under `refs/orch/`, which `git branch` doesn't list and `git push` doesn't send. Each milestone lands as **one commit whose message says what changed** (the coder's `COMMIT:` line, e.g. `feat(api): add categories endpoint`, with a `Milestone: M2` trailer). `Commits: single` in the plan header squashes the run into one commit at finish.
|
|
@@ -157,6 +159,7 @@ Model why: one module, a clear contract, an existing endpoint to copy; no design
|
|
|
157
159
|
- **One escalation.** A milestone that runs out of fix or review rounds gets one fresh round on a stronger model, with the work so far, before it fails.
|
|
158
160
|
- **Policy.** Ultra-premium models (`*fable*`, `*astra*`) are kept out of runs: `orch sync` refuses a plan that names one. Everything else your agents reach is allowed, open-weight models included. Edit `[policy] deny` to change the list.
|
|
159
161
|
- **Checked against reality.** `summary.md` has a table of planned tier against the model that really did each milestone, and `orch report` shows first-pass rate and escalations per model. When a model does worse than its rating, lower the rating.
|
|
162
|
+
- **A role for every coder.** The lead writes `Role:` on each milestone (for UI work, for example, "senior frontend engineer with a designer's eye: matches the existing components, works on a small screen, has loading, empty and error states"). The coder's task file starts with it, so the coder works to that standard.
|
|
160
163
|
- **Estimate vs actual time.** The lead writes `Estimate:` for each milestone and for the whole feature. orch measures the real time, and the summary shows both. When something took longer, it lists where the time went and who it waited on (for example "10m claude-1 (sonnet): fix rounds: the check command failed" or "20m developer / lead: paused, waiting for an answer"), only from what orch recorded.
|
|
161
164
|
- **Yours to change.** Add or re-rate models in `~/.config/herdr-orchestra/models.toml` (merged over `models.default.toml`). The default ratings are starting points with their sources, not benchmarks run by this project. A model that is not in the catalog still works; it just has no tier.
|
|
162
165
|
|
|
@@ -191,7 +194,7 @@ roles = ["coder"]
|
|
|
191
194
|
skills_dirs = ["~/.myagent/skills"]
|
|
192
195
|
```
|
|
193
196
|
|
|
194
|
-
`orch doctor [kind]` checks an installed agent against the real tool (version, whether the launch flags still exist in its `--help`, skills, herdr detection). `orch agents launch <kind>` prints the command · `orch team <kind>` / `orch team up` build and open a whole team from one tool · `orch agents sync` installs the skills for every installed agent (run it after adding a new one) · `orch agents check` confirms
|
|
197
|
+
`orch doctor [kind]` checks an installed agent against the real tool (version, whether the launch flags still exist in its `--help`, skills, herdr detection). `orch agents launch <kind>` prints the command · `orch team <kind>` / `orch team up` build and open a whole team from one tool · `orch agents sync` installs the skills for every installed agent (run it after adding a new one) · `orch agents check` confirms every installed agent sees each skill exactly once (not missing, not twice). Many tools read more than one folder (Codex reads `~/.agents/skills` and `~/.codex/skills` and lists a skill found in both twice), so the installer writes the fewest folders that give each installed agent one copy, e.g. with Claude, Codex and OpenCode: `~/.claude/skills` (Claude) and `~/.agents/skills` (Codex; OpenCode reads both, and its docs say one copy wins). Claude Code gets the skill only (a skill is already the `/orch-plan` command); OpenCode gets slash commands in `~/.config/opencode/commands`.
|
|
195
198
|
|
|
196
199
|
### Agents herdr can't watch
|
|
197
200
|
For a kind with `herdr_detect = false` (or one missing from the registry, which `orch sync` warns about), `orch` relies only on the **done file and the time budget**: it never reports GONE, BLOCKED or IDLE for it, treats it as free whenever it has no task, and `orch status` marks it `detect:off`. If herdr doesn't recognise the pane as an agent at all, address it by pane id: `Workers: hermes-1 (hermes @pane:w1:p3)`. `orch` then types prompts into that pane, and `orch start` reports a `STALE pane` when the id has changed (`herdr pane list` shows the current ids).
|
|
@@ -234,6 +237,7 @@ When a milestone passes its checks it's saved to its hidden ref and the coder is
|
|
|
234
237
|
| Autopilot is killed mid-step | the next run confirms or re-sends an unconfirmed prompt to the same agent, and finishes or undoes a half-done merge |
|
|
235
238
|
| Lockfiles changed since a folder was set up | the setup command runs again there (and in your main folder before the merge check) |
|
|
236
239
|
| Risky change (deleted file, migration, CI config, secrets file, unlisted dependency change, very large diff) | the milestone is **held** until you run `orch approve Mn`; the rest keeps going |
|
|
240
|
+
| 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 |
|
|
237
241
|
| A coder changes files outside its `Likely files` | listed in the summary (`Scope: strict` sends it back instead) |
|
|
238
242
|
| An orch step fails for one task | that task is paused with the error; the others keep running |
|
|
239
243
|
| The final check fails on the branch | stops; the next run re-checks and carries on once it passes |
|
|
@@ -251,7 +255,7 @@ Optional plan header lines: `Lead mode: events | off` (default `events` when the
|
|
|
251
255
|
### Commands
|
|
252
256
|
`orch status` · `orch report` · `orch approve Mn` · `orch models [show|check <id>]` · `orch events [--peek]` · `orch dispatch Mn... [--to <worker>] [--tier <tier>]` · `orch answer Mn "<answer>"` · `orch fix Mn "<change>" [--to <worker>]` · `orch doctor [kind]` · `orch ready` · `orch autopilot` · `orch lead plan|run|check|whoami` · `orch agents [launch <kind> [--model <id>]|sync|check]` · `orch handoff Mn` · `orch needs-fix Mn` · `orch set M3 pending` · `orch park M2 paused "why"` · `orch cooldown claude-1 60` · `orch cleanup` · `orch finish [--no-push]` · `orch version` · `orch` (full help)
|
|
253
257
|
|
|
254
|
-
Tunables: `ORCH_CODER_BUDGET_MIN` (45) · `ORCH_REVIEW_BUDGET_MIN` (15) · `ORCH_CHECK_TIMEOUT_MIN` (30) · `ORCH_COOLDOWN_MIN` (60) · `ORCH_MAX_TASKS` (unset: no limit) · `ORCH_GONE_COOLDOWN_MIN` (10) · `ORCH_SEND_RETRY_S` (120) · `ORCH_HERDR_TIMEOUT_S` (30) · `ORCH_MAX_LOST` (4) · `ORCH_UNREACHABLE_MIN` (30) · `ORCH_CONFIRM_S` (30) · `ORCH_RISK_MAX_LINES` (1500) · `ORCH_LEAD_WAIT_MIN` (15: ready work the lead hasn't dispatched starts by itself) · `ORCH_LEAD_REWAKE_S` (300) · `ORCH_LEAD_MAX_WAKES` (3) · `ORCH_LEAD_IDLE_MAX_MIN` (720: how long the event manager waits for an answer) · `ORCH_NO_AUTOSTART=1` (the lead's commands never start the event manager)
|
|
258
|
+
Tunables: `ORCH_CODER_BUDGET_MIN` (45) · `ORCH_REVIEW_BUDGET_MIN` (15) · `ORCH_CHECK_TIMEOUT_MIN` (30) · `ORCH_COOLDOWN_MIN` (60) · `ORCH_MAX_TASKS` (unset: no limit) · `ORCH_GONE_COOLDOWN_MIN` (10) · `ORCH_SEND_RETRY_S` (120) · `ORCH_HERDR_TIMEOUT_S` (30) · `ORCH_MAX_LOST` (4) · `ORCH_UNREACHABLE_MIN` (30) · `ORCH_CONFIRM_S` (30) · `ORCH_RISK_MAX_LINES` (1500) · `ORCH_LEAD_WAIT_MIN` (15: ready work the lead hasn't dispatched starts by itself) · `ORCH_LEAD_CONFIRM_S` (30: a wake-up the lead did not pick up is sent again, doubling) · `ORCH_LEAD_REWAKE_S` (300) · `ORCH_LEAD_MAX_WAKES` (3) · `ORCH_LEAD_IDLE_MAX_MIN` (720: how long the event manager waits for an answer) · `ORCH_NO_AUTOSTART=1` (the lead's commands never start the event manager)
|
|
255
259
|
|
|
256
260
|
## Develop and release
|
|
257
261
|
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.
|
|
1
|
+
5.4.0
|
package/agents.default.toml
CHANGED
|
@@ -7,8 +7,17 @@
|
|
|
7
7
|
# out when the tool has none or it is unverified, and choose the model inside the tool
|
|
8
8
|
# herdr_detect herdr can tell idle / working / blocked for it (false: orch relies on the done file only)
|
|
9
9
|
# roles any of "lead", "coder", "reviewer"
|
|
10
|
-
# skills_dirs global SKILL.md folders the installer
|
|
11
|
-
#
|
|
10
|
+
# skills_dirs global SKILL.md folders the installer may put the thin orch-plan / orch-run skills into
|
|
11
|
+
# (first = preferred)
|
|
12
|
+
# skills_reads every global skills folder the tool reads, its own and shared ones (e.g. ~/.agents/skills).
|
|
13
|
+
# `orch agents sync` picks the fewest folders so each installed tool reads exactly ONE copy
|
|
14
|
+
# of each skill (a skill in two folders it reads is listed twice), and removes orch's copies
|
|
15
|
+
# from every other folder
|
|
16
|
+
# commands_dirs slash-command folders the installer may put orch-plan.md / orch-run.md into
|
|
17
|
+
# skills_one_wins true when the tool shows a skill once even if two folders it reads have it (its docs
|
|
18
|
+
# say one copy wins); false or unset: it lists both, so orch keeps exactly one copy
|
|
19
|
+
# commands_reads every slash-command folder the tool reads (same one-copy rule)
|
|
20
|
+
# old_dirs folders older versions installed into and no longer use: sync removes orch's copies there
|
|
12
21
|
# commands_from which command flavour to install there: "claude-commands" or "opencode-commands"
|
|
13
22
|
# invoke how the developer starts the plan playbook in that agent
|
|
14
23
|
# verified true only when the launch option and skills folder were checked against the real tool
|
|
@@ -24,11 +33,11 @@ model_flag = "--model"
|
|
|
24
33
|
herdr_detect = true
|
|
25
34
|
roles = ["lead", "coder", "reviewer"]
|
|
26
35
|
skills_dirs = ["~/.claude/skills"]
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
skills_one_wins = true
|
|
37
|
+
old_dirs = ["~/.claude/commands"]
|
|
29
38
|
invoke = "/orch-plan <feature>"
|
|
30
39
|
verified = true
|
|
31
|
-
notes = "Claude Code 2.1: --permission-mode acceptEdits in --help; ~/.claude/skills present; herdr kind 'claude'."
|
|
40
|
+
notes = "Claude Code 2.1: --permission-mode acceptEdits in --help; ~/.claude/skills present; herdr kind 'claude'. A skill is also a slash command (/orch-plan) and its docs say a skill beats a ~/.claude/commands file of the same name, so no commands copy is installed."
|
|
32
41
|
|
|
33
42
|
[codex]
|
|
34
43
|
binary = "codex"
|
|
@@ -36,10 +45,11 @@ launch = "codex --approve-for-me"
|
|
|
36
45
|
model_flag = "--model"
|
|
37
46
|
herdr_detect = true
|
|
38
47
|
roles = ["lead", "coder", "reviewer"]
|
|
39
|
-
skills_dirs = ["~/.codex/skills"]
|
|
48
|
+
skills_dirs = ["~/.agents/skills", "~/.codex/skills"]
|
|
49
|
+
skills_reads = ["~/.agents/skills", "~/.codex/skills"]
|
|
40
50
|
invoke = "$orch-plan <feature> (or: use the orch-plan skill: <feature>)"
|
|
41
51
|
verified = true
|
|
42
|
-
notes = "codex-cli 0.167: --full-auto is gone; --approve-for-me routes approvals to automatic review in the workspace-write sandbox. Reads ~/.codex/skills and ~/.agents/skills."
|
|
52
|
+
notes = "codex-cli 0.167: --full-auto is gone; --approve-for-me routes approvals to automatic review in the workspace-write sandbox. Reads ~/.codex/skills and ~/.agents/skills (its docs name ~/.agents/skills as the user folder, and say two skills with the same name both show up, so orch keeps one copy)."
|
|
43
53
|
|
|
44
54
|
[amp]
|
|
45
55
|
binary = "amp"
|
|
@@ -47,6 +57,8 @@ launch = "amp"
|
|
|
47
57
|
herdr_detect = true
|
|
48
58
|
roles = ["lead", "coder", "reviewer"]
|
|
49
59
|
skills_dirs = ["~/.config/agents/skills", "~/.agents/skills"]
|
|
60
|
+
skills_reads = ["~/.config/agents/skills", "~/.agents/skills"]
|
|
61
|
+
skills_one_wins = true
|
|
50
62
|
invoke = "use the orch-plan skill: <feature>"
|
|
51
63
|
verified = true
|
|
52
64
|
notes = "No auto-approve CLI flag; set amp.dangerouslyAllowAll or `amp permissions add` rules in its settings. `amp skill list` lists skills."
|
|
@@ -58,7 +70,10 @@ model_flag = "--model"
|
|
|
58
70
|
herdr_detect = true
|
|
59
71
|
roles = ["lead", "coder", "reviewer"]
|
|
60
72
|
skills_dirs = []
|
|
73
|
+
skills_reads = ["~/.agents/skills", "~/.claude/skills"]
|
|
74
|
+
skills_one_wins = true
|
|
61
75
|
commands_dirs = ["~/.config/opencode/commands"]
|
|
76
|
+
commands_reads = ["~/.config/opencode/commands", "~/.config/opencode/command"]
|
|
62
77
|
commands_from = "opencode-commands"
|
|
63
78
|
invoke = "/orch-plan <feature>"
|
|
64
79
|
verified = true
|
|
Binary file
|
package/bin/orch
CHANGED
|
@@ -28,7 +28,9 @@ CONFIRM_S = int(os.environ.get("ORCH_CONFIRM_S", "30")) # a prompt not
|
|
|
28
28
|
MAX_LOST = int(os.environ.get("ORCH_MAX_LOST", "4")) # lost attempts (unreachable, gone, rate limit)
|
|
29
29
|
UNREACHABLE_AFTER = int(os.environ.get("ORCH_UNREACHABLE_AFTER", "3")) # failed prompts in a row before a long bench
|
|
30
30
|
UNREACHABLE_MIN = int(os.environ.get("ORCH_UNREACHABLE_MIN", "30"))
|
|
31
|
-
LEAD_REWAKE_S = int(os.environ.get("ORCH_LEAD_REWAKE_S", "300")) #
|
|
31
|
+
LEAD_REWAKE_S = int(os.environ.get("ORCH_LEAD_REWAKE_S", "300")) # longest wait before a wake-up is sent again
|
|
32
|
+
LEAD_CONFIRM_S = int(os.environ.get("ORCH_LEAD_CONFIRM_S", "30")) # a wake-up the lead did not pick up is sent again after this (doubling)
|
|
33
|
+
LEAD_SETTLE_S = int(os.environ.get("ORCH_LEAD_SETTLE_S", "300")) # at ALL_DONE, stay up this long for the lead to pick up its events
|
|
32
34
|
LEAD_MAX_WAKES = int(os.environ.get("ORCH_LEAD_MAX_WAKES", "3")) # ...this many times, then tell the developer
|
|
33
35
|
LEAD_WAIT_S = int(os.environ.get("ORCH_LEAD_WAIT_MIN", "15")) * 60 # ready work the lead never dispatched starts by itself
|
|
34
36
|
LEAD_IDLE_MAX_S = int(os.environ.get("ORCH_LEAD_IDLE_MAX_MIN", "720")) * 60 # give up waiting for answers after this
|
|
@@ -1021,7 +1023,7 @@ def cmd_sync(args):
|
|
|
1021
1023
|
"wait": o.get("wait"),
|
|
1022
1024
|
"files": sorted(files[tid]),
|
|
1023
1025
|
"parallel": field(t, "parallel", "").lower().startswith("allow"),
|
|
1024
|
-
"tier": tiers[tid], "needs": needs[tid], "model_why": field(t, "model why"),
|
|
1026
|
+
"tier": tiers[tid], "needs": needs[tid], "model_why": field(t, "model why"), "role": field(t, "role"),
|
|
1025
1027
|
"estimate_s": estimates[tid],
|
|
1026
1028
|
}
|
|
1027
1029
|
if status != st["tasks"][tid]["status"]:
|
|
@@ -2292,6 +2294,8 @@ def cmd_status(args):
|
|
|
2292
2294
|
hold = undispatched(st)
|
|
2293
2295
|
print(f" lead {st['lead']['name']}: {len(unread_events(st))} unread event(s), {len(ev)} open"
|
|
2294
2296
|
+ (f"; waiting for `orch dispatch`: {', '.join(hold)}" if hold else "")
|
|
2297
|
+
+ (f"; wake-up sent {lw['n']}x (last {_fmt_secs(now() - lw.get('ts', now()))} ago), not picked up yet"
|
|
2298
|
+
if unread_events(st) and (lw := st.get("lead_wake") or {}).get("n") else "")
|
|
2295
2299
|
+ ("" if driver_alive() else "; the event manager is NOT running (`orch autopilot`)"))
|
|
2296
2300
|
if all(t["status"] in ("merged", "skipped") for t in st["tasks"].values()):
|
|
2297
2301
|
print(f"ALL_DONE — run `orch finish` to push {st['branch']} and open a PR into {st.get('base')}")
|
|
@@ -2437,7 +2441,14 @@ def cmd_write_task(args):
|
|
|
2437
2441
|
secs, glob = plan_sections()
|
|
2438
2442
|
if tid not in secs:
|
|
2439
2443
|
die(f"{tid} not found in plan.md")
|
|
2440
|
-
parts = [f"# Task {tid}: {t['title']}", ""
|
|
2444
|
+
parts = [f"# Task {tid}: {t['title']}", ""]
|
|
2445
|
+
if t.get("role"):
|
|
2446
|
+
parts += ["## Your role", f"For this task you are: **{t['role']}**.",
|
|
2447
|
+
"Work the way that person would. Before you write anything, read the code around the change and "
|
|
2448
|
+
"the patterns it already follows. Then build it to the standard that specialist would put their "
|
|
2449
|
+
"name on: \"the check passes\" is the floor, not the goal. Before you finish, look at your own "
|
|
2450
|
+
"result as that specialist reviewing someone else's work, and fix what they would send back.", ""]
|
|
2451
|
+
parts += [secs[tid].replace(f"## [x] {tid}:", "Title:", 1), ""]
|
|
2441
2452
|
if glob and glob.lower() not in ("none", "<empty — user may fill in>"):
|
|
2442
2453
|
parts += ["## Global instructions", glob, ""]
|
|
2443
2454
|
ctx = []
|
|
@@ -2486,7 +2497,7 @@ def task_contract(st, tid):
|
|
|
2486
2497
|
"goal": field(pt, "goal"), "why": field(pt, "why"),
|
|
2487
2498
|
"acceptance_criteria": [{"id": f"AC{i}", "text": c} for i, c in enumerate(items("acceptance criteria"), 1)],
|
|
2488
2499
|
"files_allowed": t.get("files") or [], "scope": st.get("scope", "warn"),
|
|
2489
|
-
"tier": t.get("tier"), "needs": t.get("needs") or [],
|
|
2500
|
+
"tier": t.get("tier"), "needs": t.get("needs") or [], "role": t.get("role") or None,
|
|
2490
2501
|
"interfaces": items("interfaces"), "constraints": items("constraints"), "out_of_scope": items("out of scope"),
|
|
2491
2502
|
"depends_on": deps, "check": st["check"], "attempt": t.get("attempt", 0) + 1, "lost_attempts": t.get("lost", 0),
|
|
2492
2503
|
"previous_work": {"by": t.get("last_worker")} if work_ref(st, tid) else None,
|
|
@@ -2638,6 +2649,8 @@ def cmd_fix(args):
|
|
|
2638
2649
|
sec = [f"## [x] {new}: {title}", f"Depends on: {tid} (a fix to what {tid} built)",
|
|
2639
2650
|
f"Why separate: a change the developer asked for after {tid} landed.", f"Review: {review}",
|
|
2640
2651
|
"Estimate: none"]
|
|
2652
|
+
if field(src, "role"):
|
|
2653
|
+
sec.append(f"Role: {field(src, 'role')}")
|
|
2641
2654
|
if field(src, "likely files"):
|
|
2642
2655
|
sec.append(f"Likely files: {field(src, 'likely files')}")
|
|
2643
2656
|
if t.get("tier"):
|
|
@@ -2654,7 +2667,7 @@ def cmd_fix(args):
|
|
|
2654
2667
|
"status": "pending", "reason": f"fix for {tid}", "worker": None, "dir": None, "attempt": 0, "fix": 0,
|
|
2655
2668
|
"review_round": 0, "wait": None, "files": list(t.get("files") or []), "parallel": False,
|
|
2656
2669
|
"tier": t.get("tier"), "needs": [], "model_why": f"a fix to {tid}, for the coder who built it." if t.get("tier") else "",
|
|
2657
|
-
"go": True, "fix_of": tid,
|
|
2670
|
+
"go": True, "fix_of": tid, "role": field(src, "role"),
|
|
2658
2671
|
}
|
|
2659
2672
|
if who:
|
|
2660
2673
|
st["tasks"][new]["assign"] = who
|
|
@@ -2776,6 +2789,43 @@ def cmd_nudge(args):
|
|
|
2776
2789
|
print(f"NUDGED {tid} -> {w['agent']}")
|
|
2777
2790
|
|
|
2778
2791
|
|
|
2792
|
+
def auto_checked(st, final_ok):
|
|
2793
|
+
"""What the run already verified without a person, for the summary: the check command, the reviews, and each
|
|
2794
|
+
acceptance criterion with the coder's and the reviewer's evidence. The lead builds on this, so the manual
|
|
2795
|
+
checklist holds only what a person must look at. Only recorded facts; a criterion nobody gave evidence for says so."""
|
|
2796
|
+
try:
|
|
2797
|
+
_, ptasks = parse_plan((ORCH / "plan.md").read_text())
|
|
2798
|
+
except OSError:
|
|
2799
|
+
ptasks = []
|
|
2800
|
+
out = [f"- Check command `{st['check']}` on the finished branch: {'PASS' if final_ok else 'FAIL'}"]
|
|
2801
|
+
for tid in st["order"]:
|
|
2802
|
+
t = st["tasks"][tid]
|
|
2803
|
+
if t["status"] != "merged":
|
|
2804
|
+
continue
|
|
2805
|
+
pt = next((x for x in ptasks if x["id"] == tid), {"fields": {}})
|
|
2806
|
+
crit = [v.lstrip("- ").strip() for v in pt["fields"].get("acceptance criteria", [])]
|
|
2807
|
+
crit = [v for v in crit if v and v.lower() != "none"]
|
|
2808
|
+
res, _ = read_result(t.get("last_result"))
|
|
2809
|
+
coder = {str(c.get("id")): c for c in (res or {}).get("criteria", []) if isinstance(c, dict)}
|
|
2810
|
+
k = t.get("review_round", 0)
|
|
2811
|
+
rev, _ = read_json(ORCH / "review" / tid / f"review-{k}.json") if k else (None, None)
|
|
2812
|
+
rcrit = rev.get("criteria", []) if isinstance(rev, dict) and isinstance(rev.get("criteria", []), list) else []
|
|
2813
|
+
reviewer = {str(c.get("id")): c for c in rcrit if isinstance(c, dict)}
|
|
2814
|
+
passed = sum(1 for c in t.get("checks") or [] if c.get("ok"))
|
|
2815
|
+
out.append(f"- {tid} \"{t['title']}\": check command passed" + (f" {passed}x" if passed > 1 else "")
|
|
2816
|
+
+ (f"; review passed (round {k})" if t.get("review") and k else "; no review planned"))
|
|
2817
|
+
for i, text in enumerate(crit, 1):
|
|
2818
|
+
cid, ev = f"AC{i}", []
|
|
2819
|
+
c, r = coder.get(cid), reviewer.get(cid)
|
|
2820
|
+
if c and c.get("met") is not None:
|
|
2821
|
+
ev.append(f"coder: {'met' if c['met'] else 'NOT met'}" + (f" ({c['evidence']})" if c.get("evidence") else ""))
|
|
2822
|
+
if r and r.get("met") is not None:
|
|
2823
|
+
ev.append(f"reviewer: {'met' if r['met'] else 'NOT met'}" + (f" ({r['note']})" if r.get("note") else ""))
|
|
2824
|
+
out.append(f" - {cid} {text} — " + ("; ".join(ev) if ev else "no evidence recorded: the lead checks it, "
|
|
2825
|
+
"or it goes on the manual list"))
|
|
2826
|
+
return "\n".join(out)
|
|
2827
|
+
|
|
2828
|
+
|
|
2779
2829
|
RATE_RE = re.compile(r"usage limit|rate.?limit|quota|too many requests|\b429\b|limit reached|try again (in|at)|out of credits",
|
|
2780
2830
|
re.I)
|
|
2781
2831
|
|
|
@@ -2834,25 +2884,31 @@ def cmd_autopilot(args):
|
|
|
2834
2884
|
park(tid, "failed", reason)
|
|
2835
2885
|
|
|
2836
2886
|
def wake_lead(force=False):
|
|
2837
|
-
"""Tell the lead it has unread events
|
|
2838
|
-
|
|
2887
|
+
"""Tell the lead it has unread events, and make sure the wake-up became a turn. Sending the prompt proves
|
|
2888
|
+
nothing: it can sit in the pane's input box or collide with what the developer is typing. Only the lead
|
|
2889
|
+
reading its events (`orch events`) counts. A lead that is idle again with the events still unread did not
|
|
2890
|
+
pick the wake-up up, so it is sent again: after LEAD_CONFIRM_S, then twice that, and so on (never longer
|
|
2891
|
+
than LEAD_REWAKE_S), up to LEAD_MAX_WAKES; then the developer is told. A lead herdr can't watch is woken
|
|
2892
|
+
again every LEAD_REWAKE_S. The events themselves are already safe in state.json."""
|
|
2839
2893
|
s_ = load()
|
|
2840
2894
|
if not lead_on(s_):
|
|
2841
2895
|
return
|
|
2842
2896
|
un = unread_events(s_)
|
|
2897
|
+
lw = s_.get("lead_wake") or {}
|
|
2898
|
+
lead = s_["lead"]["name"]
|
|
2843
2899
|
if not un:
|
|
2900
|
+
if lw.get("n") and not lw.get("ack"):
|
|
2901
|
+
patch_state(lambda s2: s2.update(lead_wake={**(s2.get("lead_wake") or {}), "ack": True}))
|
|
2902
|
+
say(f"the lead ({lead}) picked up its events")
|
|
2844
2903
|
return
|
|
2845
|
-
|
|
2846
|
-
lw = s_.get("lead_wake") or {}
|
|
2904
|
+
newest = max(e["id"] for e in un)
|
|
2847
2905
|
# a wake the lead has not acted on yet covers newer events too: it reads the whole queue when it comes
|
|
2848
2906
|
same = any(e["id"] <= lw.get("upto", 0) for e in un)
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
patch_state(lambda s2: s2["lead_wake"].update(told=True))
|
|
2852
|
-
say(f"the lead ({lead}) has not read its events after {LEAD_MAX_WAKES} wake-ups — look at its pane, "
|
|
2853
|
-
f"or run `orch events --peek` yourself", True)
|
|
2907
|
+
n = lw.get("n", 0) if same else 0
|
|
2908
|
+
if same and now() - lw.get("ts", 0) < lw.get("wait", LEAD_REWAKE_S):
|
|
2854
2909
|
return
|
|
2855
|
-
|
|
2910
|
+
watch = watched(s_, lead)
|
|
2911
|
+
if watch and not force:
|
|
2856
2912
|
hs = herdr_state(lead)
|
|
2857
2913
|
if hs is None:
|
|
2858
2914
|
if not lw.get("gone"):
|
|
@@ -2861,19 +2917,31 @@ def cmd_autopilot(args):
|
|
|
2861
2917
|
f"for it (`orch events --peek` shows them)", True)
|
|
2862
2918
|
return
|
|
2863
2919
|
if word(hs, "working", "blocked"):
|
|
2864
|
-
return #
|
|
2920
|
+
return # in a turn: the events wait in the queue, one wake when it is idle
|
|
2921
|
+
if n >= LEAD_MAX_WAKES:
|
|
2922
|
+
if not lw.get("told"):
|
|
2923
|
+
patch_state(lambda s2: s2["lead_wake"].update(told=True))
|
|
2924
|
+
say(f"the lead ({lead}) has not read its events after {LEAD_MAX_WAKES} wake-ups — look at its pane "
|
|
2925
|
+
f"(if the wake-up text sits in its input box, press Enter), or tell it: run `orch events`. "
|
|
2926
|
+
f"{len(un)} event(s) wait for it (`orch events --peek` shows them)", True)
|
|
2927
|
+
return
|
|
2865
2928
|
text = (f"orch: {len(un)} new event(s) in the run on {s_['branch']} need the lead. Run `orch events` and "
|
|
2866
2929
|
f"handle what it prints, then stop.")
|
|
2867
2930
|
try:
|
|
2868
2931
|
deliver(s_, lead, text)
|
|
2869
2932
|
except DeliveryError as e:
|
|
2870
2933
|
say(f"could not wake the lead ({lead}): {e} — will retry; the events are kept")
|
|
2871
|
-
patch_state(lambda s2: s2.update(lead_wake={"upto": newest, "ts": now()
|
|
2872
|
-
"n": lw.get("n", 0) if same else 0}))
|
|
2934
|
+
patch_state(lambda s2: s2.update(lead_wake={"upto": newest, "ts": now(), "n": n, "wait": SEND_RETRY_S}))
|
|
2873
2935
|
return
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2936
|
+
wait = min(LEAD_REWAKE_S, LEAD_CONFIRM_S * 2 ** n) if watch else LEAD_REWAKE_S
|
|
2937
|
+
patch_state(lambda s2: s2.update(lead_wake={"upto": newest, "ts": now(), "n": n + 1, "wait": wait}))
|
|
2938
|
+
what = ", ".join(f"{e['kind']}{' ' + e['task'] if e.get('task') else ''}" for e in un[:6])
|
|
2939
|
+
if n:
|
|
2940
|
+
say(f"the lead ({lead}) did not pick up its wake-up (" + ("idle again, " if watch else "")
|
|
2941
|
+
+ f"events still unread after {now() - lw.get('ts', now())}s) -> sent it again "
|
|
2942
|
+
f"({n + 1} of {LEAD_MAX_WAKES}): {len(un)} event(s) — {what}")
|
|
2943
|
+
else:
|
|
2944
|
+
say(f"woke the lead ({lead}): {len(un)} event(s) — {what} (sent; it counts once the lead reads them)")
|
|
2877
2945
|
|
|
2878
2946
|
def lead_ready():
|
|
2879
2947
|
"""Ready milestones the lead has not dispatched: tell it once per set; start them ourselves after LEAD_WAIT_S."""
|
|
@@ -3287,10 +3355,16 @@ def cmd_autopilot(args):
|
|
|
3287
3355
|
+ ("## Models: planned and actual\n| Milestone | Planned tier | Ran on | Escalated | Why this tier |\n"
|
|
3288
3356
|
"|---|---|---|---|---|\n" + "\n".join(models) + "\n\n" if models else "") +
|
|
3289
3357
|
f"## Time: estimate vs actual\n{timing}\n\n"
|
|
3358
|
+
f"## Checked automatically\nAlready verified by the run; nobody needs to redo these by hand.\n"
|
|
3359
|
+
f"{auto_checked(st, ok)}\n\n"
|
|
3290
3360
|
f"## Run report\n```\n{report}\n```\n\n"
|
|
3291
3361
|
+ ("## Still to write (the lead was woken to write these)\n" if lead_ else
|
|
3292
3362
|
"## Still to write (ask the lead: 'use the orch-run skill' to finish the summary)\n") +
|
|
3293
|
-
"- Design decisions & study notes\n
|
|
3363
|
+
"- Design decisions & study notes\n"
|
|
3364
|
+
"- Checked by the lead: what you verified yourself by running a command or reading the code, with the "
|
|
3365
|
+
"evidence\n"
|
|
3366
|
+
"- Manual verification checklist: only what a person must see or do (how the UI looks and behaves, a "
|
|
3367
|
+
"real device, an outside account). Nothing a command or a look at the code can settle.\n"
|
|
3294
3368
|
+ ("\nThe summary before this one is in `.orchestrate/summary.prev.md`: carry its notes and checklist "
|
|
3295
3369
|
"over, and add what the new work changed.\n" if prev.exists() else ""))
|
|
3296
3370
|
if lead_:
|
|
@@ -3304,6 +3378,20 @@ def cmd_autopilot(args):
|
|
|
3304
3378
|
wake_lead(force=True)
|
|
3305
3379
|
say(f"ALL_DONE on {st['branch']} — final check {'PASS' if ok else 'FAIL'}. See .orchestrate/summary.md, "
|
|
3306
3380
|
f"then run `orch finish` to push {st['branch']} and open a PR into {base}", True)
|
|
3381
|
+
if lead_:
|
|
3382
|
+
# don't leave with a wake-up nobody confirmed: after this exit nothing would send it again
|
|
3383
|
+
end = time.time() + LEAD_SETTLE_S
|
|
3384
|
+
while True:
|
|
3385
|
+
wake_lead()
|
|
3386
|
+
s_ = load()
|
|
3387
|
+
lw_ = s_.get("lead_wake") or {}
|
|
3388
|
+
if not unread_events(s_) or lw_.get("told") or lw_.get("gone"):
|
|
3389
|
+
break
|
|
3390
|
+
if time.time() > end:
|
|
3391
|
+
say(f"the lead ({st['lead']['name']}) still has not read ALL_DONE — tell it: run `orch events`",
|
|
3392
|
+
True)
|
|
3393
|
+
break
|
|
3394
|
+
time.sleep(POLL_STEP_S)
|
|
3307
3395
|
sys.exit(0 if ok else 3)
|
|
3308
3396
|
active = [k for k, v in tasks.items() if v["status"] in ACTIVE and v["status"] != "held"]
|
|
3309
3397
|
ready = [k for k, v in tasks.items() if v["status"] == "pending" and deps_met(st, v)]
|
|
@@ -3915,8 +4003,9 @@ USAGE = """usage: orch <command> [args]
|
|
|
3915
4003
|
answer <Mn> <text> (lead) the developer's answer: into plan.md, and back to the same coder
|
|
3916
4004
|
fix <Mn> <text> [--to <worker>] a change to something Mn already landed: a small follow-up milestone, sent
|
|
3917
4005
|
straight to the coder who built Mn (no new plan; check, review and summary still apply)
|
|
3918
|
-
agents sync [kind...] install the orch-plan / orch-run skills
|
|
3919
|
-
|
|
4006
|
+
agents sync [kind...] install the orch-plan / orch-run skills so every installed agent sees each one exactly once,
|
|
4007
|
+
and remove old copies (run it after adding a new agent; the installer runs it)
|
|
4008
|
+
agents check check every installed agent sees each orch skill once (not missing, not twice)
|
|
3920
4009
|
doctor [kind...] check installed agents against the real tool: version, launch flags, skills, herdr
|
|
3921
4010
|
sync parse .orchestrate/plan.md -> state.json (validates deps, cycles, overlaps)
|
|
3922
4011
|
start create/switch to the feature branch (plan `Branch:`); create worker worktrees (worktree mode)
|
|
@@ -4031,15 +4120,25 @@ def short(p):
|
|
|
4031
4120
|
return "~" + p[len(home):] if p.startswith(home) else p
|
|
4032
4121
|
|
|
4033
4122
|
|
|
4034
|
-
def
|
|
4035
|
-
|
|
4123
|
+
def manifest_lines():
|
|
4124
|
+
mf = manifest_path()
|
|
4125
|
+
return mf.read_text().splitlines() if mf.exists() else []
|
|
4126
|
+
|
|
4127
|
+
|
|
4128
|
+
def manifest_write(lines):
|
|
4036
4129
|
mf = manifest_path()
|
|
4037
4130
|
mf.parent.mkdir(parents=True, exist_ok=True)
|
|
4038
|
-
|
|
4039
|
-
for
|
|
4040
|
-
if
|
|
4041
|
-
|
|
4042
|
-
|
|
4131
|
+
seen, out = set(), []
|
|
4132
|
+
for line in lines:
|
|
4133
|
+
if line and line not in seen:
|
|
4134
|
+
seen.add(line)
|
|
4135
|
+
out.append(line)
|
|
4136
|
+
mf.write_text("".join(line + "\n" for line in out))
|
|
4137
|
+
|
|
4138
|
+
|
|
4139
|
+
def manifest_record(*paths):
|
|
4140
|
+
"""Append paths to the installer's manifest so `install.sh --uninstall` removes them."""
|
|
4141
|
+
manifest_write(manifest_lines() + [str(p) for p in paths])
|
|
4043
4142
|
|
|
4044
4143
|
|
|
4045
4144
|
def _copy_asset(src, dst):
|
|
@@ -4051,74 +4150,214 @@ def _copy_asset(src, dst):
|
|
|
4051
4150
|
return True
|
|
4052
4151
|
|
|
4053
4152
|
|
|
4054
|
-
|
|
4055
|
-
|
|
4153
|
+
SHARED_SKILLS = "~/.agents/skills" # read by several tools; used when it doesn't make a second copy
|
|
4154
|
+
SHARED_COMMANDS = ("~/.config/opencode/commands", "opencode-commands") # written even before OpenCode is installed
|
|
4155
|
+
|
|
4156
|
+
|
|
4157
|
+
def shipped_skills():
|
|
4056
4158
|
src = asset("skills") or die("skills/ not found next to orch or in the install")
|
|
4057
|
-
|
|
4058
|
-
for s in ("orch-plan", "orch-run"):
|
|
4059
|
-
changed |= _copy_asset(src / s / "SKILL.md", d / s / "SKILL.md")
|
|
4060
|
-
recs.append(d / s)
|
|
4061
|
-
return changed, recs
|
|
4159
|
+
return sorted(p.name for p in src.iterdir() if (p / "SKILL.md").exists() and p.name.startswith("orch-"))
|
|
4062
4160
|
|
|
4063
4161
|
|
|
4064
|
-
def
|
|
4065
|
-
"""Copy the orch-*.md slash commands into d. Returns (changed, paths to record)."""
|
|
4162
|
+
def shipped_commands(flavor):
|
|
4066
4163
|
src = asset(flavor)
|
|
4067
|
-
if
|
|
4068
|
-
return False, []
|
|
4069
|
-
changed, recs = False, []
|
|
4070
|
-
for f in sorted(src.glob("orch-*.md")):
|
|
4071
|
-
changed |= _copy_asset(f, d / f.name)
|
|
4072
|
-
recs.append(d / f.name)
|
|
4073
|
-
return changed, recs
|
|
4164
|
+
return sorted(f.name for f in src.glob("orch-*.md")) if src else []
|
|
4074
4165
|
|
|
4075
4166
|
|
|
4076
|
-
def
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4167
|
+
def _dirs(v, key):
|
|
4168
|
+
return [expand(d) for d in v.get(key, []) or []]
|
|
4169
|
+
|
|
4170
|
+
|
|
4171
|
+
def _same(d):
|
|
4172
|
+
"""A folder's identity: two paths that are one folder (a symlinked skills folder) count once."""
|
|
4173
|
+
return os.path.realpath(d)
|
|
4174
|
+
|
|
4175
|
+
|
|
4176
|
+
def agent_reads(v, what):
|
|
4177
|
+
"""Every global folder the tool reads skills (or slash commands) from: `skills_reads` / `commands_reads`
|
|
4178
|
+
plus the folders the registry installs into. Order kept, no repeats (a symlink to a listed folder is the
|
|
4179
|
+
same folder)."""
|
|
4180
|
+
out, seen = [], set()
|
|
4181
|
+
for d in _dirs(v, f"{what}_reads") + _dirs(v, f"{what}_dirs"):
|
|
4182
|
+
if _same(d) not in seen:
|
|
4183
|
+
seen.add(_same(d))
|
|
4184
|
+
out.append(d)
|
|
4087
4185
|
return out
|
|
4088
4186
|
|
|
4089
4187
|
|
|
4090
|
-
def
|
|
4091
|
-
"""
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4188
|
+
def pick_dirs(agents, shared=None):
|
|
4189
|
+
"""agents: [(kind, reads, candidates, one_wins)]. Pick the fewest folders to write so every agent reads exactly
|
|
4190
|
+
one copy (an agent with one_wins shows a skill once even when two folders have it, so two copies are fine).
|
|
4191
|
+
Returns (chosen folders, {kind: [folders it reads a copy from]}). Prefers the shared folder, then the folders
|
|
4192
|
+
each agent lists first. When no exact choice exists, the fewest agents with two copies."""
|
|
4193
|
+
import itertools
|
|
4194
|
+
pool = []
|
|
4195
|
+
for _, reads, cands, _ in agents:
|
|
4196
|
+
for d in cands:
|
|
4197
|
+
if _same(d) not in {_same(p) for p in pool}:
|
|
4198
|
+
pool.append(d)
|
|
4199
|
+
if shared is not None and _same(shared) not in {_same(p) for p in pool}:
|
|
4200
|
+
pool.append(shared)
|
|
4201
|
+
if not agents:
|
|
4202
|
+
return ([shared] if shared is not None else []), {}
|
|
4203
|
+
|
|
4204
|
+
def rank(d):
|
|
4205
|
+
return min((c.index(d) for _, _, c, _ in agents if d in c), default=9)
|
|
4206
|
+
|
|
4207
|
+
best = None
|
|
4208
|
+
for n in range(1, len(pool) + 1):
|
|
4209
|
+
for combo in itertools.combinations(pool, n):
|
|
4210
|
+
s = {_same(d) for d in combo}
|
|
4211
|
+
seen = [(len(s & {_same(d) for d in reads}), ow) for _, reads, _, ow in agents]
|
|
4212
|
+
cost = (sum(c == 0 for c, _ in seen), sum(c > 1 and not ow for c, ow in seen), n,
|
|
4213
|
+
0 if shared is not None and _same(shared) in s else 1, sum(rank(d) for d in combo))
|
|
4214
|
+
if best is None or cost < best[0]:
|
|
4215
|
+
best = (cost, combo)
|
|
4216
|
+
if best and best[0][:2] == (0, 0):
|
|
4217
|
+
break # bigger sets only cost more
|
|
4218
|
+
chosen = list(best[1])
|
|
4219
|
+
ids = {_same(d) for d in chosen}
|
|
4220
|
+
return chosen, {k: [d for d in reads if _same(d) in ids] for k, reads, _, _ in agents}
|
|
4221
|
+
|
|
4222
|
+
|
|
4223
|
+
def _ours(p):
|
|
4224
|
+
"""Is this skill folder / command file one of orch's thin wrappers (so safe to remove)?"""
|
|
4225
|
+
f = p / "SKILL.md" if p.is_dir() else p
|
|
4226
|
+
try:
|
|
4227
|
+
text = f.read_text(errors="replace") if f.is_file() else ""
|
|
4228
|
+
except OSError:
|
|
4229
|
+
return False
|
|
4230
|
+
# every version's skills and commands: thin wrappers say "orch lead", the first (4.0) skills "Orchestrator step"
|
|
4231
|
+
return "orch lead" in text or "Orchestrator step" in text
|
|
4232
|
+
|
|
4233
|
+
|
|
4234
|
+
def _remove(p):
|
|
4235
|
+
if p.is_dir() and not p.is_symlink():
|
|
4236
|
+
shutil.rmtree(p)
|
|
4237
|
+
else:
|
|
4238
|
+
p.unlink()
|
|
4239
|
+
|
|
4240
|
+
|
|
4241
|
+
def sync_plan(reg, installed):
|
|
4242
|
+
"""What `orch agents sync` writes: {(kind of item, folder): flavor}, plus the per-agent view."""
|
|
4243
|
+
agents = [(k, agent_reads(v, "skills"), _dirs(v, "skills_dirs") or agent_reads(v, "skills"),
|
|
4244
|
+
bool(v.get("skills_one_wins")))
|
|
4245
|
+
for k, v in reg.items() if installed[k]]
|
|
4246
|
+
agents = [a for a in agents if a[1]]
|
|
4247
|
+
sdirs, sview = pick_dirs(agents, expand(SHARED_SKILLS))
|
|
4248
|
+
flavor, cagents = {}, []
|
|
4097
4249
|
for k, v in reg.items():
|
|
4098
|
-
if
|
|
4250
|
+
if not installed[k] or not agent_reads(v, "commands"):
|
|
4099
4251
|
continue
|
|
4100
|
-
|
|
4101
|
-
|
|
4252
|
+
cands = _dirs(v, "commands_dirs") or agent_reads(v, "commands")
|
|
4253
|
+
for d in cands:
|
|
4254
|
+
flavor.setdefault(d, v.get("commands_from", "claude-commands"))
|
|
4255
|
+
cagents.append((k, agent_reads(v, "commands"), cands, False))
|
|
4256
|
+
shared = expand(SHARED_COMMANDS[0])
|
|
4257
|
+
flavor.setdefault(shared, SHARED_COMMANDS[1])
|
|
4258
|
+
cdirs, cview = pick_dirs(cagents, shared)
|
|
4259
|
+
return sdirs, sview, [(d, flavor[d]) for d in cdirs], cview
|
|
4260
|
+
|
|
4261
|
+
|
|
4262
|
+
def agents_sync(reg, installed, want=None):
|
|
4263
|
+
"""Copy the orch skills/commands so that every installed agent reads exactly one copy, and remove orch's
|
|
4264
|
+
copies from every other folder (old folders, renamed or dropped skills). Idempotent; keeps the uninstall
|
|
4265
|
+
manifest in step. Prints a status table."""
|
|
4266
|
+
if want is not None:
|
|
4267
|
+
for k in sorted(want):
|
|
4268
|
+
if not installed.get(k):
|
|
4102
4269
|
print(f"skip {k:<9} not installed")
|
|
4270
|
+
was_ok = {k: all(st == "ok" for _, st in agent_assets(v)) for k, v in reg.items() if installed[k]}
|
|
4271
|
+
sdirs, sview, cdirs, cview = sync_plan(reg, installed)
|
|
4272
|
+
skills = shipped_skills()
|
|
4273
|
+
keep, changed_dirs = set(), set()
|
|
4274
|
+
for d in sdirs:
|
|
4275
|
+
src = asset("skills")
|
|
4276
|
+
for s in skills:
|
|
4277
|
+
if _copy_asset(src / s / "SKILL.md", d / s / "SKILL.md"):
|
|
4278
|
+
changed_dirs.add(d)
|
|
4279
|
+
keep.add(d / s)
|
|
4280
|
+
for d, fl in cdirs:
|
|
4281
|
+
src = asset(fl)
|
|
4282
|
+
for name in shipped_commands(fl):
|
|
4283
|
+
if _copy_asset(src / name, d / name):
|
|
4284
|
+
changed_dirs.add(d)
|
|
4285
|
+
keep.add(d / name)
|
|
4286
|
+
|
|
4287
|
+
# Remove the copies that make a tool list a skill twice: orch's copies in any folder an installed agent
|
|
4288
|
+
# reads (or used to read: old_dirs) that is not a chosen one, and skills orch no longer ships (renamed or
|
|
4289
|
+
# dropped) wherever an earlier install put them. A copy in a folder no installed agent reads is left: it
|
|
4290
|
+
# shows up nowhere, and it may belong to an agent that is only missing from PATH right now.
|
|
4291
|
+
removed = []
|
|
4292
|
+
lines = manifest_lines()
|
|
4293
|
+
keep_ids = {_same(p) for p in keep}
|
|
4294
|
+
read_ids = {_same(d) for k, v in reg.items() if installed[k]
|
|
4295
|
+
for d in agent_reads(v, "skills") + agent_reads(v, "commands") + _dirs(v, "old_dirs")}
|
|
4296
|
+
current = set(skills) | {n for fl in ("claude-commands", "opencode-commands") for n in shipped_commands(fl)}
|
|
4297
|
+
candidates = [Path(p) for p in lines if Path(p).name.startswith("orch-")]
|
|
4298
|
+
for k, v in reg.items():
|
|
4299
|
+
if installed[k]:
|
|
4300
|
+
for d in agent_reads(v, "skills") + agent_reads(v, "commands") + _dirs(v, "old_dirs"):
|
|
4301
|
+
if d.is_dir():
|
|
4302
|
+
candidates += [p for p in sorted(d.iterdir()) if p.name.startswith("orch-")]
|
|
4303
|
+
for p in candidates:
|
|
4304
|
+
if not (p.exists() or p.is_symlink()) or _same(p) in keep_ids or p in removed:
|
|
4305
|
+
continue
|
|
4306
|
+
if not (str(p) in lines or _ours(p)):
|
|
4307
|
+
continue # the developer's own orch-... skill
|
|
4308
|
+
if p.name in current and _same(p.parent) not in read_ids:
|
|
4103
4309
|
continue
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4310
|
+
_remove(p)
|
|
4311
|
+
removed.append(p)
|
|
4312
|
+
manifest_write([p for p in lines if Path(p) not in removed] + [str(p) for p in sorted(keep)])
|
|
4313
|
+
|
|
4108
4314
|
new = same = 0
|
|
4109
|
-
for k,
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
manifest_record(*recs)
|
|
4315
|
+
for k, v in reg.items():
|
|
4316
|
+
if not installed[k] or (want is not None and k not in want):
|
|
4317
|
+
continue
|
|
4318
|
+
mine = sview.get(k, []) + [d for d in cview.get(k, [])]
|
|
4319
|
+
changed = not was_ok[k] or any(d in changed_dirs for d in mine)
|
|
4115
4320
|
new += changed
|
|
4116
4321
|
same += not changed
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4322
|
+
parts = []
|
|
4323
|
+
if k in sview:
|
|
4324
|
+
parts.append("skills: " + (", ".join(short(d) for d in sview[k]) or "NONE"))
|
|
4325
|
+
if k in cview:
|
|
4326
|
+
parts.append("commands: " + (", ".join(short(d) for d in cview[k]) or "NONE"))
|
|
4327
|
+
dup = len(cview.get(k, [])) > 1 or (len(sview.get(k, [])) > 1 and not v.get("skills_one_wins"))
|
|
4328
|
+
status = "DUP " if dup else ("NEW " if changed else "ok ")
|
|
4329
|
+
print(f" {status} {k:<8} {' '.join(parts)} {v.get('invoke', 'Run `orch lead plan` and follow it. Feature: <feature>')}")
|
|
4330
|
+
for d, what, view in ((expand(SHARED_SKILLS), "skills", sview), (expand(SHARED_COMMANDS[0]), "commands", cview)):
|
|
4331
|
+
if d in (sdirs if what == "skills" else [c for c, _ in cdirs]) and not any(d in x for x in view.values()):
|
|
4332
|
+
print(f" {'NEW ' if d in changed_dirs else 'ok '} {'shared':<8} {what}: {short(d)}")
|
|
4333
|
+
for p in removed:
|
|
4334
|
+
print(f" removed old copy {short(p)}")
|
|
4335
|
+
print(f"synced {new + same} agent(s): {new} new, {same} unchanged, {len(removed)} old cop"
|
|
4336
|
+
f"{'y' if len(removed) == 1 else 'ies'} removed — every agent sees each skill once. "
|
|
4337
|
+
f"Restart running agents so they pick up the skills")
|
|
4338
|
+
|
|
4339
|
+
|
|
4340
|
+
def agent_assets(v):
|
|
4341
|
+
"""[(text, state)] per skill / slash command an installed agent should see once: state is ok, missing or
|
|
4342
|
+
duplicate (the same skill in two folders the tool reads, so it is listed twice)."""
|
|
4343
|
+
out = []
|
|
4344
|
+
reads = agent_reads(v, "skills")
|
|
4345
|
+
for s in shipped_skills() if reads else []:
|
|
4346
|
+
copies = [d for d in reads if (d / s / "SKILL.md").exists()]
|
|
4347
|
+
out.append(_asset_state(f"skill {s}", copies[:1] if v.get("skills_one_wins") else copies, reads))
|
|
4348
|
+
reads = agent_reads(v, "commands")
|
|
4349
|
+
for name in shipped_commands(v.get("commands_from", "claude-commands")) if reads else []:
|
|
4350
|
+
copies = [d for d in reads if (d / name).exists()]
|
|
4351
|
+
out.append(_asset_state(f"command {name}", copies, reads))
|
|
4352
|
+
return out
|
|
4353
|
+
|
|
4354
|
+
|
|
4355
|
+
def _asset_state(label, copies, reads):
|
|
4356
|
+
if not copies:
|
|
4357
|
+
return f"{label} not in {', '.join(short(d) for d in reads)}", "missing"
|
|
4358
|
+
if len(copies) > 1:
|
|
4359
|
+
return f"{label} twice: {' and '.join(short(d) for d in copies)}", "duplicate"
|
|
4360
|
+
return f"{label} {short(copies[0])}", "ok"
|
|
4122
4361
|
|
|
4123
4362
|
|
|
4124
4363
|
def cmd_agents(args):
|
|
@@ -4138,27 +4377,25 @@ def cmd_agents(args):
|
|
|
4138
4377
|
f"(add it in {user_agents_file()})")
|
|
4139
4378
|
print(launch_cmd(kind, v, model))
|
|
4140
4379
|
return
|
|
4141
|
-
if sub == "dirs": #
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
print(f"{k}\tskills\t{expand(d)}")
|
|
4148
|
-
for d in v.get("commands_dirs", []):
|
|
4149
|
-
print(f"{k}\tcommands\t{expand(d)}\t{v.get('commands_from', 'claude-commands')}")
|
|
4380
|
+
if sub == "dirs": # the folders `orch agents sync` writes: <skills|commands>\t<dir>[\t<commands_from>]
|
|
4381
|
+
sdirs, _, cdirs, _ = sync_plan(reg, installed)
|
|
4382
|
+
for d in sdirs:
|
|
4383
|
+
print(f"skills\t{d}")
|
|
4384
|
+
for d, fl in cdirs:
|
|
4385
|
+
print(f"commands\t{d}\t{fl}")
|
|
4150
4386
|
return
|
|
4151
4387
|
if sub == "check":
|
|
4152
|
-
bad = 0
|
|
4388
|
+
bad = {"missing": 0, "duplicate": 0}
|
|
4153
4389
|
for k, v in reg.items():
|
|
4154
4390
|
if not installed[k]:
|
|
4155
4391
|
continue
|
|
4156
|
-
for
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
print(f"{'ok
|
|
4160
|
-
if bad:
|
|
4161
|
-
print(f"{
|
|
4392
|
+
for text, state in agent_assets(v):
|
|
4393
|
+
if state != "ok":
|
|
4394
|
+
bad[state] += 1
|
|
4395
|
+
print(f"{ {'ok': 'ok ', 'missing': 'MISSING ', 'duplicate': 'DUPLICATE'}[state]} {k:<9} {text}")
|
|
4396
|
+
if bad["missing"] or bad["duplicate"]:
|
|
4397
|
+
print(", ".join(f"{n} {w}" for w, n in bad.items() if n) + " — run: orch agents sync"
|
|
4398
|
+
+ (" (a duplicate means the tool lists that skill twice)" if bad["duplicate"] else ""))
|
|
4162
4399
|
sys.exit(1)
|
|
4163
4400
|
return
|
|
4164
4401
|
if sub == "sync":
|
|
@@ -4178,9 +4415,9 @@ def cmd_agents(args):
|
|
|
4178
4415
|
f"{'yes' if v.get('verified') else 'no':<8} {','.join(v.get('roles', [])):<22} "
|
|
4179
4416
|
f"{v.get('launch', v.get('binary', k))}")
|
|
4180
4417
|
missing = [k for k, v in reg.items()
|
|
4181
|
-
if installed[k] and any(
|
|
4418
|
+
if installed[k] and any(st != "ok" for _, st in agent_assets(v))]
|
|
4182
4419
|
if missing:
|
|
4183
|
-
print(f"\n{', '.join(missing)}: orch-plan/orch-run missing — run: orch agents sync")
|
|
4420
|
+
print(f"\n{', '.join(missing)}: orch-plan/orch-run missing or listed twice — run: orch agents sync")
|
|
4184
4421
|
print(f"\nOverride or add kinds in {user_agents_file()}")
|
|
4185
4422
|
|
|
4186
4423
|
|
|
@@ -4220,8 +4457,9 @@ def doctor_kind(kind, v, full=True):
|
|
|
4220
4457
|
out.append((False, f"launch flag {fl} is NOT in `{hcmd}` — the launch command in the registry may be out "
|
|
4221
4458
|
f"of date (override it in {short(user_agents_file())})"))
|
|
4222
4459
|
if full:
|
|
4223
|
-
for
|
|
4224
|
-
out.append((ok,
|
|
4460
|
+
for text, st in agent_assets(v):
|
|
4461
|
+
out.append((st == "ok", " ".join(text.split()) + ("" if st == "ok" else
|
|
4462
|
+
f" ({st}) — run `orch agents sync`")))
|
|
4225
4463
|
if v.get("herdr_detect", True):
|
|
4226
4464
|
code, txt = _probe([HERDR, "agent"])
|
|
4227
4465
|
if code == 0:
|
package/install.sh
CHANGED
|
@@ -89,7 +89,7 @@ case "$ACTION" in
|
|
|
89
89
|
uninstall)
|
|
90
90
|
if [[ -f "$MANIFEST" ]]; then # everything the installer put into agents' folders
|
|
91
91
|
while IFS= read -r p; do
|
|
92
|
-
case "$(basename "$p")" in orch
|
|
92
|
+
case "$(basename "$p")" in orch-*) rm -rf "$p";; esac
|
|
93
93
|
done < "$MANIFEST"
|
|
94
94
|
fi
|
|
95
95
|
rm -f "$BIN/orch"
|
|
@@ -184,7 +184,8 @@ if ! "$CUR/bin/orch" agents sync; then
|
|
|
184
184
|
# Python < 3.11 (no agent registry): fall back to the shared dirs only, as in 4.2
|
|
185
185
|
warn "per-agent skills skipped (orch agents sync failed — Python >= 3.11 needed for the agent registry)"
|
|
186
186
|
install_skills "$SKILLS" # ~/.agents/skills: Amp, OpenCode and Codex read it
|
|
187
|
-
|
|
187
|
+
install_commands "${OC_CMDS[0]}" opencode-commands # one folder only: OpenCode reads both, two = listed twice
|
|
188
|
+
rm -f "${OC_CMDS[1]}/orch-plan.md" "${OC_CMDS[1]}/orch-run.md"
|
|
188
189
|
fi
|
|
189
190
|
|
|
190
191
|
# clean up files from pre-repo kit versions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "herdr-orchestra",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.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
|
@@ -8,6 +8,7 @@ Load the `herdr` skill for exact CLI syntax if you have it (otherwise `herdr --s
|
|
|
8
8
|
- Research findings go in as **facts**, not instructions:
|
|
9
9
|
- ✅ "Uploads are handled in `server/routes/upload.ts`; categories live in the `categories` table."
|
|
10
10
|
- ❌ "Add a `matchCategory()` function to upload.ts that loops over rows."
|
|
11
|
+
- You give every milestone a **role**: the specialist the coder should work as, and what that specialist cares about here (step 6, Role). That sets the standard, not the method.
|
|
11
12
|
- You also decide **which level of model each milestone needs** (small, medium or high) and say why (step 6), and **how long each milestone and the whole feature should take** (step 6, Estimate).
|
|
12
13
|
- You never edit application code, and you never prompt worker agents: you hand out work with `orch dispatch`, and the event manager (`orch autopilot`, a plain script) prompts the agents, watches them and wakes you when something needs a decision.
|
|
13
14
|
|
|
@@ -92,6 +93,14 @@ Then:
|
|
|
92
93
|
- Don't put everything on `high`: a small model on small work is faster and cheaper, and that is the point. Don't put design work on `small` to save money either: a milestone that runs out of fix rounds is moved up to a stronger model once, and that costs more than starting right.
|
|
93
94
|
- orch gives a milestone to a free coder of its tier, or a stronger one when none is free; never to a weaker one while a suitable coder exists.
|
|
94
95
|
|
|
96
|
+
**Give the coder a role.** Every milestone gets `Role:`: one line naming the specialist this work needs and the two or three things that specialist would care about in THIS milestone. orch puts it at the top of the coder's task file ("For this task you are: …"), so the coder aims at that standard instead of at "the check passes". It says who and how good, never how: no steps, no function names.
|
|
97
|
+
- UI work: `Role: senior frontend engineer with a designer's eye: matches the app's existing components and spacing, works on a small screen, has loading, empty and error states, usable by keyboard`
|
|
98
|
+
- An API: `Role: backend engineer who designs APIs other teams depend on: clear error responses, input validated at the edge, every acceptance criterion covered by a test`
|
|
99
|
+
- A schema change: `Role: database engineer who has been burned by migrations: reversible, safe on a table with real data, no long locks`
|
|
100
|
+
- A bug nobody has diagnosed: `Role: debugging specialist: finds and proves the root cause before changing anything, and leaves a test that fails without the fix`
|
|
101
|
+
- Docs: `Role: technical writer for developers new to this project: short sentences, every command copy-pasteable and tested`
|
|
102
|
+
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.
|
|
103
|
+
|
|
95
104
|
**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.
|
|
96
105
|
|
|
97
106
|
## 7. Choose the isolation mode (ask if the user hasn't said)
|
|
@@ -136,6 +145,7 @@ Tier: small | medium | high
|
|
|
136
145
|
Needs: <any of: reasoning, coding, architecture, long-context, tool-use, planning, speed>
|
|
137
146
|
Model why: <one line: what in this milestone makes it that tier>
|
|
138
147
|
Estimate: <e.g. 40m: dispatch to landed if nothing goes wrong>
|
|
148
|
+
Role: <the specialist the coder works as, and what they care about in this milestone>
|
|
139
149
|
Review: yes | no
|
|
140
150
|
Likely files: src/a.ts, src/b.ts, src/feature/
|
|
141
151
|
Parallel: <leave this line out | allow>
|
|
@@ -161,7 +171,8 @@ Git: the run makes ONE branch, `Branch:` (use `feature/<slug>`, or `fix/<slug>`
|
|
|
161
171
|
Optional header lines: `Scope: strict` sends a milestone back when its coder changes files outside `Likely files` (default `warn`: listed in the summary); `Budget: 3h` stops autopilot when its running time is used up; `Risk hold: off` lets risky changes (deleted files, migrations, CI config, secrets files, unlisted dependency changes, very large diffs) land without `orch approve`; `Setup inputs: <globs>` names the files that mean "run the setup command again" (default: lockfiles and manifests); `Lead mode: off` makes the event manager dispatch by itself and stop for the developer instead of waking you (default with a `Lead:` line: `events`).
|
|
162
172
|
|
|
163
173
|
Rules for every milestone:
|
|
164
|
-
- **
|
|
174
|
+
- **Role**: from step 6, on every milestone. The standard to work to, never a how-to.
|
|
175
|
+
- **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.
|
|
165
176
|
- **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).
|
|
166
177
|
- **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.
|
|
167
178
|
- **No how**: no code blocks, no function names to create, no numbered implementation steps. `orch sync` warns if it sees them.
|
package/playbooks/run.md
CHANGED
|
@@ -5,7 +5,7 @@ Extra user input = whatever the user wrote alongside asking you to run this play
|
|
|
5
5
|
A run behaves like a call stack. You **dispatch** work and **pause**. The **event manager** (`orch autopilot`, a plain script with no AI in it) prompts the coders and the reviewer, watches them, runs checks, sends fixes, merges, and keeps every event in a queue on disk. When something needs you (a milestone finished, a coder asked a question, a milestone failed or is held, new work is ready) it **wakes you** with one line: run `orch events`. You handle what it prints and pause again. This repeats until every milestone has landed.
|
|
6
6
|
|
|
7
7
|
- You never watch, wait for or poll the agents. Between wake-ups you do nothing and cost nothing.
|
|
8
|
-
- No event is lost while you are paused or busy: it waits in the queue, and you get the whole batch in one wake-up. Reading `orch events` is your acknowledgement.
|
|
8
|
+
- No event is lost while you are paused or busy: it waits in the queue, and you get the whole batch in one wake-up. Reading `orch events` is your acknowledgement, and the only thing that counts as "the lead was woken": if you are idle and the events are still unread, the event manager sends the wake-up again (after 30 seconds, then 1 minute, then it tells the developer). So when the developer talks to you and you have not run `orch events` in this turn, run it before you stop.
|
|
9
9
|
- Only the event manager sends prompts, moves tasks and merges. Your commands (`orch dispatch`, `orch answer`) are requests it carries out, so two processes never act on the run at once. While it runs, `orch` refuses every other command that would change the run from your shell.
|
|
10
10
|
- Routine recovery is not your job: a failed check goes back to its coder, a rate-limited or vanished agent is benched and its work moves on, a milestone out of fix rounds gets one fresh round on a stronger model. You hear about results, not about every retry.
|
|
11
11
|
|
|
@@ -52,9 +52,12 @@ If you changed plan.md by hand, run `orch sync` (it works once the event manager
|
|
|
52
52
|
**Red baseline.** The event manager needs the check command to pass before any work. If it says the baseline fails: run the check yourself (`<check cmd> 2>&1 | tail -40`), tell the developer exactly what fails, and propose a narrower `Check command` that passes today and still covers the feature. Write it into the plan header only when the developer agrees, then `orch sync` and dispatch again. Never judge "no new failures" by eye.
|
|
53
53
|
|
|
54
54
|
## 3. ALL_DONE
|
|
55
|
-
1. The event manager already wrote `.orchestrate/summary.md`: tasks, commits, files changed, files changed outside each milestone's Likely files, reviewer suggestions not applied, **the model table (planned tier, the model that really did the work, escalations)**, **
|
|
56
|
-
2. You add
|
|
57
|
-
|
|
55
|
+
1. The event manager already wrote `.orchestrate/summary.md`: tasks, commits, files changed, files changed outside each milestone's Likely files, reviewer suggestions not applied, **the model table (planned tier, the model that really did the work, escalations)**, **"Checked automatically"** (the check command on the finished branch, each review, and every acceptance criterion with the coder's and the reviewer's evidence) and the run report (time, rounds, first-pass rate, wasted work, how each model did; `orch report` prints it again).
|
|
56
|
+
2. You add three sections, in this order:
|
|
57
|
+
- **"Design decisions & study notes"** for the developer (include any milestone that needed a stronger model than planned, and what that says about the plan).
|
|
58
|
+
- **"Checked by the lead"**. Go through every acceptance criterion and every behaviour the feature promised. Whatever can be settled by running a command or by reading the code, YOU settle now, and write one line each with the evidence: the command and its result, or `file:line`. This covers: a criterion "Checked automatically" marks `no evidence recorded` or `NOT met`, "the comment / doc / config says X", "the endpoint returns 400 for Y" (run its test, or read the test that covers it), "the migration adds column Z", "no leftover TODO or debug output". You may run the check command, single tests and read-only commands (`grep`, `git log`, `git diff --stat`), and open the few files you need; you still never edit application code. If a check of yours fails, it is a defect, not a checklist item: tell the developer and offer `orch fix Mn "<what is wrong>"`.
|
|
59
|
+
- **"Manual verification checklist"**: ONLY what a person must see or do, because no command and no reading of code can settle it. That is: how the UI looks (layout, spacing, colours, dark mode, a small screen), how it behaves in a real browser or on a real device (click-through flows, focus, animation, how fast it feels), and anything that needs an outside account or hardware (a real email arriving, a payment in the provider's test mode, a push notification, a printer). Write each item so the developer can do it without reading code: `- [ ] <where to go and what to do> → <what they should see>`. Test for every item: "could I, or a test, have checked this?" If yes, it does not belong here: check it and move it to "Checked by the lead". Never write "review the code", "read the comments", "confirm the tests pass" or "check the function handles X" as a manual item. If nothing needs a person (a pure backend, CLI or docs change), write `Nothing to check by hand: <one line why>` instead of inventing items.
|
|
60
|
+
3. Tell the developer: "All tasks landed on <branch>. Review .orchestrate/summary.md. I checked <n> things myself; <m> need your eyes (the manual checklist), or: nothing needs checking by hand. Then run `orch finish`: it re-runs the check, removes the worktrees and hidden refs, pushes <branch> and opens a PR into <base> (`orch finish --no-push` to only clean up)." Run `orch finish` yourself only when the developer says so: it pushes. **STOP.**
|
|
58
61
|
4. **The developer asks for a change after the summary** (for example "the login button should be blue"). Do not plan again. Find the milestone that built that part (the summary's Tasks list and Likely files tell you), then run `orch fix Mn "<the change, in the developer's words>"`. It adds one small follow-up milestone to `plan.md`, sends it straight to the coder who built Mn, and starts the event manager; the check and the review (when Mn had one) still run. Name another coder only when the developer asks: `--to <worker>`. Then **STOP**: you are woken with ALL_DONE again, and the new summary keeps the old one in `.orchestrate/summary.prev.md`, so carry your notes and checklist over and add what changed. Never type into a coder's pane yourself.
|
|
59
62
|
|
|
60
63
|
## Runs without a lead (`Lead mode: off`)
|