@irythill/orq 0.4.0 → 0.6.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/dist/stats.js CHANGED
@@ -6,7 +6,8 @@
6
6
  import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
7
7
  import { homedir } from "node:os";
8
8
  import { basename, join } from "node:path";
9
- const ROLE = /^(impl|fix\d*|review\d*|[a-z]+-review\d*)-?/;
9
+ import { doneStatus } from "./process.js";
10
+ const ROLE = /^(impl|fix\d*|review\d*|[a-z]+-review\d*|watchdog\d*)-?/;
10
11
  const read = (f) => { try {
11
12
  return readFileSync(f, "utf8");
12
13
  }
@@ -115,11 +116,12 @@ export function collectRuns(ws, days) {
115
116
  const name = basename(pre);
116
117
  const rm = ROLE.exec(name);
117
118
  const role = rm && rm[1].includes("review") ? "review"
118
- : name.startsWith("fix") || txt.includes("-R ") || txt.includes(" resume ") || txt.includes("--resume") ? "fix"
119
- : name.startsWith("impl") ? "impl" : "other";
119
+ : rm && rm[1].startsWith("watchdog") ? "watchdog"
120
+ : name.startsWith("fix") || txt.includes("-R ") || txt.includes(" resume ") || txt.includes("--resume") ? "fix"
121
+ : name.startsWith("impl") ? "impl" : "other";
120
122
  const out = read(`${pre}.out.md`);
121
123
  const [neu, tot] = tokens(agent, log, read(`${pre}.id`).trim());
122
- runs.push({ issue, name, agent, model, role, ok: read(done).includes("status=ok") && out.trim() !== "",
124
+ runs.push({ issue, name, agent, model, role, ok: doneStatus(read(done)) === "ok" && out.trim() !== "",
123
125
  secs: Math.max(0, Math.floor((statSync(done).mtimeMs - rs.mtimeMs) / 1000)), new: neu, tot,
124
126
  repo: name.includes("-") ? name.slice(name.indexOf("-") + 1) : "" });
125
127
  }
package/dist/testrun.js CHANGED
@@ -2,14 +2,14 @@
2
2
  // memory cap (src/process.ts) and read its JSON report into "<file relative to the repo> :: <full test name>" lines.
3
3
  // The runner's own bin (node_modules/<runner>/package.json "bin") runs with this node, so Windows needs no shell;
4
4
  // without it, npx as before. Also the background job both share (launch on a TerminalHost, queue, .pid/.done, notify).
5
- import { spawn, spawnSync } from "node:child_process";
5
+ import { spawnSync } from "node:child_process";
6
6
  import { createWriteStream, existsSync, lstatSync, readFileSync, realpathSync, rmdirSync, rmSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
7
7
  import { dirname, isAbsolute, join, relative } from "node:path";
8
8
  import { fileURLToPath } from "node:url";
9
9
  import { writeAtomic } from "./fsutil.js";
10
10
  import { m } from "./i18n.js";
11
11
  import { acquire, release } from "./lock.js";
12
- import { stateDir } from "./paths.js";
12
+ import { handoffFile, notify } from "./notice.js";
13
13
  import { killTree, parseSize, runCapped } from "./process.js";
14
14
  import { closeOwnTab, detectHost, launch } from "./terminal.js";
15
15
  export const JS_EXT = /\.(ts|tsx|js|jsx|mjs|cjs|mts|cts)$/;
@@ -197,28 +197,5 @@ export async function inJob(j, label, slots, body, done) {
197
197
  }
198
198
  return st === "ok" ? 0 : 1;
199
199
  }
200
- /** Where `orq handoff` records the pane that replaced a conductor's. */
201
- export const handoffFile = (pane) => join(stateDir(), "handoff", pane.replace(/\W/g, "_"));
202
- /** The conductor is a herdr pane: type the line into it (herdr-notify waits for it to leave a dialog). In the
203
- * background when the caller must not wait for that (an agent's end-of-turn hook holds its screen meanwhile). */
204
- export function notify(pane, line, background = false) {
205
- const seen = new Set();
206
- while (!seen.has(pane) && existsSync(handoffFile(pane))) {
207
- seen.add(pane);
208
- let next;
209
- try {
210
- next = readFileSync(handoffFile(pane), "utf8").trim();
211
- }
212
- catch {
213
- break;
214
- } // gone between the two calls
215
- if (!next || next === pane)
216
- break;
217
- pane = next; // follow repeated handoffs to the current conductor
218
- }
219
- const local = join(dirname(CLI), "..", "setup", "herdr-notify"), cmd = existsSync(local) ? local : "herdr-notify";
220
- if (background)
221
- spawn(cmd, [pane, line], { detached: true, stdio: "ignore" }).on("error", () => { }).unref();
222
- else
223
- spawnSync(cmd, [pane, line], { stdio: "inherit" });
224
- }
200
+ /** Tell the conductor's herdr pane (src/notice.ts): returns at once, delivery runs detached with retries and a log. */
201
+ export { handoffFile, notify };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@irythill/orq",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Orchestrate coding agents (Claude Code, Codex, OpenCode, Antigravity, Copilot) from one conductor.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,36 +1,36 @@
1
1
  ---
2
2
  name: issue
3
- description: Runs a Plane issue end to end by orchestrating coding agents in herdr or any terminal (herdr-agent / orq agent + orq wait) — implementer and cross-vendor reviewer picked by orq pick, tests by herdr-verify / orq verify, comment and status in Plane. Use when the user says "/issue <ID>", "take issue X", "run ABC-123", or asks to check/create issues in the conductor's ecosystem.
3
+ description: Runs a Plane issue end to end by orchestrating coding agents in herdr or any terminal (orq agent + orq wait) — implementer and cross-vendor reviewer picked by orq pick, tests by orq verify, comment and status in Plane. Use when the user says "/issue <ID>", "take issue X", "run ABC-123", or asks to check/create issues in the conductor's ecosystem.
4
4
  ---
5
5
 
6
- # /issue <ID> — conductor playbook (herdr or any terminal)
6
+ # /issue <ID> — conductor playbook
7
7
 
8
8
  You are the **orchestrator**: you plan, dispatch, follow up and report. **Do not implement anything yourself** (it
9
9
  burns the conductor's model). Talk to the user in the user's language.
10
10
 
11
11
  **Ecosystem configuration:** the **workspace** `CLAUDE.md` (the folder named in your conductor instructions) defines
12
- the repositories and their groups (= herdr workspace, `-g`), **each repo's base branch**, verification commands,
12
+ the repositories and their groups (= herdr workspace or just a label, `-g`), **each repo's base branch**, verification commands,
13
13
  Plane projects (identifier → project_id), default assignee, labels/modules and MCP limitations. Read it before you
14
14
  start. Below, `$WS` = workspace.
15
- **Inside herdr** (`HERDR_ENV=1`): children open in herdr tabs and their notices reach your pane — the flow below.
16
- **Outside herdr** (any terminal, tmux, any OS): the same flow with these swaps —
17
- - `herdr-agent ...` → `orq agent ...` (same flags; it is the same program). Children run in tmux windows inside tmux,
18
- else in the background (their screen goes to a log; the answer is still `<prefix>.out.md`). `-T` needs tmux.
19
- - `herdr-claim` → `orq claim` (set `ORQ_CONDUCTOR_ID` to a fixed name per conductor), `herdr-deps` → `orq deps`.
20
- - **Completion signal:** no line arrives in your pane. After dispatching, run `orq wait <prefix>` **as a background
15
+ **Terminal:** the flow is the same in herdr, tmux or a plain terminal, on any OS. Children open in herdr tabs inside
16
+ herdr (`HERDR_ENV=1`), in tmux windows inside tmux, else in the background (their screen goes to a log; the answer is
17
+ still `<prefix>.out.md`; `-T`, the agent's own screen, needs herdr or tmux). Set `ORQ_CONDUCTOR_ID` to a fixed name per
18
+ conductor outside herdr.
19
+ - **Completion signal:** in herdr, one line `[HERDR-AGENT DONE] <title> status=ok|fail ... answer: <file>` is typed into
20
+ your pane after each child. Anywhere else no line arrives: after dispatching, run `orq wait <prefix>` **as a background
21
21
  task** (Claude Code: Bash with `run_in_background`); its exit wakes you and its output is the line
22
- `[ORQ AGENT DONE] <title> status=ok|fail ... answer: <file>` — treat it exactly like `[HERDR-AGENT DONE]`. Several
23
- children in parallel: `orq wait --any <prefix1> <prefix2>` (one wake-up per finish; wait again for the rest).
24
- No background tasks in your harness → run `orq wait` in the foreground; that is the one allowed blocking wait.
25
- - `herdr-verify` → `orq verify`, `herdr-baseline` → `orq baseline` (same flags). They run in a tmux window or in
26
- the background like children, and you wait for them the same way: `orq wait $O/verify-<repo>`.
27
- - Peeking at a child: `<prefix>.log` (not `herdr pane read`).
22
+ `[ORQ AGENT DONE] <title> status=ok|fail ... answer: <file>`. Treat both lines the same. Several children in parallel:
23
+ `orq wait --any <prefix1> <prefix2>` (one wake-up per finish; wait again for the rest). No background tasks in your
24
+ harness → run `orq wait` in the foreground; that is the one allowed blocking wait.
25
+ - `orq verify` and `orq baseline` run like children (herdr tab, tmux window or background) and you wait for them the same
26
+ way, e.g. `orq wait $O/verify-<repo>`.
27
+ - Peeking at a child: `<prefix>.log` (in herdr also `herdr pane read $(cat <prefix>.pane) --source recent`).
28
28
  Issue artifacts (prompts, notes) live in `$WS/.orquestra/<ID>/`.
29
29
 
30
30
  ## 1. Read the issue
31
- - **First, claim it:** `herdr-claim -w $WS <ID>`. Exit 1 = another conductor owns it: **stop** and tell the user
31
+ - **First, claim it:** `orq claim -w $WS <ID>`. Exit 1 = another conductor owns it: **stop** and tell the user
32
32
  (don't read it, don't dispatch anything). Taking it over (e.g. switching accounts) only with the user's OK:
33
- `herdr-claim -w $WS -f <ID>`. Several conductors may share a workspace; `herdr-claim -w $WS -l` lists who has what,
33
+ `orq claim -w $WS -f <ID>`. Several conductors may share a workspace; `orq claim -w $WS -l` lists who has what,
34
34
  with each conductor's name (its herdr workspace label, e.g. "emp: orq-cms-dsgn"; outside herdr, `ORQ_CONDUCTOR_ID`).
35
35
  - **The user names another conductor** ("take over orq-cms-dsgn's work"): never guess a pane id. Run
36
36
  `orq claim -w $WS --from "<what they said>"` (any part of the name works). It lists that conductor's issues; exit 3 =
@@ -58,7 +58,7 @@ independent acceptance criteria.
58
58
  - Each batch is independently testable and reviewable; dispatch in order, one implementer per batch. Record the split in
59
59
  Plane (sub-issues or a checklist comment) before starting.
60
60
  - Scope too big mid-run (reviews hitting `policy.max_rounds`, repeated findings, the implementer asking to change
61
- scope): stop, split the remainder, don't force more rounds.
61
+ scope): stop, split the remainder, don't force more rounds. `orq rounds <ID>` shows the alert; on warn/stop `orq rounds <ID> --diagnose` says why.
62
62
 
63
63
  ## 3. Pick agent and model: always `orq pick`, never by hand
64
64
  `orq pick` decides agent, model, effort and account (user config + delivery and token history + current quota +
@@ -71,19 +71,19 @@ orq pick opinion --impl-agent <agent that implemented> # second opin
71
71
  ```
72
72
  More than one agent eligible for `review`/`opinion` (declared, not excluded or blocked, with a model for the role; quota is not considered) and neither `--impl-agent` nor `--impl-vendor` given → exit 2:
73
73
  always pass one of them (`--no-record`/`--explain` do not change this).
74
- The output goes straight into `herdr-agent` (`herdr-agent $(orq pick ...) -g ... -t ... -d ... -o ... -- prompt.md`).
74
+ The output goes straight into `orq agent` (`orq agent $(orq pick ...) -g ... -t ... -d ... -o ... -- prompt.md`).
75
75
  - Exit 3 = no candidate (quota exhausted, no agent with that role): **stop and ask the user**.
76
76
  - Implementer failed review twice (step 6) → pick again without it: `orq pick impl --level <level> --exclude-agent <agent>`.
77
77
  - `--exclude-agent` never "sticks": every `orq pick` call decides again, with only that dispatch's exclusions.
78
78
  - The conductor's own model (e.g. Opus) as implementer: only with the user's OK, never through `orq pick`.
79
79
  - Want to understand a choice? `orq pick ... --explain --no-record` (score of each candidate; not counted in rotation).
80
80
 
81
- **Every child runs through `herdr-agent`** (agent from `orq pick`): headless (`claude -p` / `codex exec` /
82
- `opencode run` / `agy -p` / `copilot -p`) in a herdr tab (workspace = group `-g`, tab = title) with live output.
83
- When it finishes it writes `<prefix>.done` and sends ONE line `[HERDR-AGENT DONE] <title> status=ok|fail ...` to your
84
- pane; no MCP, and a **4 GB memory cap per agent** (own cgroup: if it blows up, only it dies). NEVER `herdr agent start`
81
+ **Every child runs through `orq agent`** (agent from `orq pick`): headless (`claude -p` / `codex exec` /
82
+ `opencode run` / `agy -p` / `copilot -p`) in a herdr tab (workspace = group `-g`, tab = title), a tmux window or the
83
+ background, with a log. When it finishes it writes `<prefix>.done` and signals you (see the completion signal above:
84
+ `[HERDR-AGENT DONE] <title> status=ok|fail ...` in herdr, `orq wait` elsewhere); no MCP, and a **4 GB memory cap per agent** (own cgroup: if it blows up, only it dies). NEVER `herdr agent start`
85
85
  for children (no memory cap, no answer file). **Screen mode (`-T`, or `HERDR_AGENT_TUI=1`; herdr or tmux):** the tab
86
- shows the agent's own TUI instead of the log; same cap, same files, same signal (end-of-turn hook). The screen stays
86
+ or window shows the agent's own TUI instead of the log; same cap, same files, same signal (end-of-turn hook). The screen stays
87
87
  open after the turn (it holds memory until the tab closes); `-R` with the tab open types the follow-up into it. Use it
88
88
  when the user wants to watch. The repo must already be trusted in Codex/Claude (otherwise the TUI stops at the "trust this
89
89
  folder?" dialog — tell the user, don't approve it for them).
@@ -115,7 +115,7 @@ git -C $WT log -1 --format='%h %s' # check HEAD == origin/$BA
115
115
  on a modest disk that saturates I/O and memory and freezes the machine). The worktree uses a **link** to the main
116
116
  repo's `node_modules`:
117
117
  ```bash
118
- herdr-deps -r $R -b $BASE -w $WT # link; stale deps → fast-forward + ONE install in $R (per-repo lock across conductors)
118
+ orq deps -r $R -b $BASE -w $WT # link; stale deps → fast-forward + ONE install in $R (per-repo lock across conductors)
119
119
  ```
120
120
  Exit 3 = stale deps and `$R` dirty or not on `$BASE` → **ask the user**. If another conductor is installing in the
121
121
  same repo, the command waits its turn (never install by hand).
@@ -124,36 +124,39 @@ tell me".
124
124
  **Dispatch** (no MCP; memory cap; writes in automatic mode — that is why implementation only happens in a worktree):
125
125
  ```bash
126
126
  orq pick impl --level <level> > $O/impl-<repo>.pick # the fix rounds reuse it (step 6)
127
- herdr-agent $(cat $O/impl-<repo>.pick) -g <group> -t "<ID> impl <repo>" -d $WT -o $O/impl-<repo> -- $O/impl-<repo>.md
127
+ orq agent $(cat $O/impl-<repo>.pick) -g <group> -t "<ID> impl <repo>" -d $WT -o $O/impl-<repo> -- $O/impl-<repo>.md
128
128
  ```
129
129
  - The Claude account (`-c`) already comes from `orq pick` (one under the limit whose pace stays within it, then the least used).
130
130
  - Full final answer in `$O/impl-<repo>.out.md`; log in `.log`; the agent's session id in `.id`.
131
131
  - Codex's sandbox has no network: `git fetch` is yours, beforehand (above). Push/PR: yours (step 7).
132
- - `herdr-agent` returns immediately (no need to background it); the child's pane is in `<prefix>.pane`
133
- (`herdr pane read $(cat <prefix>.pane) --source recent` to peek).
134
- - **No baseline in the issue flow:** don't run `herdr-baseline` before dispatching (the base moves with every merge and
135
- the full suite blocks every conductor's test queue). `herdr-verify` checks the base on demand (step 4b).
132
+ - `orq agent` returns immediately (no need to background it); the child's pane is in `<prefix>.pane`
133
+ (to peek: `<prefix>.log`; in herdr, `herdr pane read $(cat <prefix>.pane) --source recent`).
134
+ - **No baseline in the issue flow:** don't run `orq baseline` before dispatching (the base moves with every merge and
135
+ the full suite blocks every conductor's test queue). `orq verify` checks the base on demand (step 4b).
136
136
  - **Children start WITHOUT MCP** (Plane is yours; each MCP costs ~150–200 MB per session and `systemd-oomd` kills the
137
- whole herdr server when memory runs out) — `herdr-agent` takes care of it.
137
+ whole herdr server when memory runs out) — `orq agent` takes care of it.
138
138
  - Every child prompt ends with: "Don't try to talk to the conductor or use herdr; finish with your complete final
139
139
  answer (that is what I read)."
140
140
  - **Verification in the child: lint and tsc only, one command at a time** (the cap is 4 GB per agent and jest/vitest
141
141
  blow it; tests are yours, step 4b): use the Verification column of the workspace `CLAUDE.md` and put in the prompt
142
142
  "verify sequentially, never in parallel or watch mode: (1) lint only the changed files (`git diff --name-only
143
143
  origin/<BASE>...HEAD`); (2) `NODE_OPTIONS=--max-old-space-size=2048 tsc --noEmit` for the project. Don't run tests".
144
- Full suite only in CI (or a manual `herdr-baseline` if the user asks).
144
+ Full suite only in CI (or a manual `orq baseline` if the user asks).
145
145
  - An issue that changes an API contract: **API first**; consumers afterwards, with the new contract in the prompt.
146
+ - **A red board line / `✗` pane title = a failure you may have missed.** If you see one (or the user says notices aren't
147
+ arriving), run `orq notice` (delivery log) and `<prefix>.done` for that issue, then handle the failure; running
148
+ `orq wait`, `orq verify` or `orq agent` for the issue acknowledges it.
146
149
  - **Never block waiting** (`herdr agent wait`, `pane wait-output`, `sleep`, `timeout`): completion arrives as a
147
- `[HERDR-AGENT DONE]` line in your pane. Dispatch, report in one line and end your turn. "Done yet?" = `<prefix>.done`
150
+ `[HERDR-AGENT DONE]` line in your pane (herdr) or through the background `orq wait`. Dispatch, report in one line and end your turn. "Done yet?" = `<prefix>.done`
148
151
  exists (never `pgrep`).
149
- - Investigation only (no code): "READ ONLY" prompt, in the repo itself, no worktree. `herdr-agent -r` (Claude:
152
+ - Investigation only (no code): "READ ONLY" prompt, in the repo itself, no worktree. `orq agent -r` (Claude:
150
153
  `--permission-mode plan`; the others: throwaway worktree, no editing).
151
154
 
152
155
  ## 4b. Tests (yours, not the child's)
153
156
  Child with `status=ok` → run the tests related to the diff, in their own tab, one at a time on the machine (queue):
154
- `herdr-verify -w $WS -r <repo> -d $WT -b <BASE> -o $O/verify-<repo> -g <group>` → `$O/verify-<repo>.txt` with
157
+ `orq verify -w $WS -r <repo> -d $WT -b <BASE> -o $O/verify-<repo> -g <group>` → `$O/verify-<repo>.txt` with
155
158
  **new failures** and pre-existing ones: if any test fails, it runs the same test files on an updated
156
- `origin/<BASE>` (whatever fails there is pre-existing). You get `[HERDR-AGENT DONE] verify ... new=N`.
159
+ `origin/<BASE>` (whatever fails there is pre-existing). You get the done line (`[HERDR-AGENT DONE]` / `[ORQ AGENT DONE]`) `verify ... new=N`.
157
160
  `new>0` → fix round with the list (step 6), no review. `new=0` → review.
158
161
  **Pre-existing failures get fixed too.** Any failure — tests listed as "already failing on origin/<BASE>", or a CI job
159
162
  (lint, biome, typecheck, shard, regression) failing on the PR or on the base — goes into a fix round on the issue's
@@ -162,12 +165,12 @@ something is red, new or old, and never widen a baseline or allowlist to silence
162
165
  outside the issue's domain: ask the user first (then it ships as its own PR, not as a note).
163
166
  **Mandatory order every round (impl and each fix): child `ok` → verify → review.** Never dispatch the review (or an
164
167
  "early" fix) while this round's verify is pending, even if it is queued behind another verify: wait for
165
- `[HERDR-AGENT DONE] ... verify ...` and end your turn until then.
168
+ the `... verify ...` done line and end your turn until then.
166
169
 
167
170
  ## 5. Cross review (always another vendor)
168
171
  ```bash
169
172
  orq pick review --level <level> --impl-agent <who implemented> > $O/review-<repo>.pick # round 2+ reuses it
170
- herdr-agent $(cat $O/review-<repo>.pick) -b $BASE \
173
+ orq agent $(cat $O/review-<repo>.pick) -b $BASE \
171
174
  -g <group> -t "<ID> review <repo>" -d $WT -o $O/review-<repo> -r -i $O/impl-<repo>.md -i $O/impl-<repo>.out.md \
172
175
  -i $O/verify-<repo>.txt \
173
176
  -- $O/review-<repo>.md
@@ -178,12 +181,14 @@ are in the attached verify)". If the reviewer ends with `status=fail` and no ver
178
181
  `jetski: ... permission` line), that is not a rejection: run `orq pick review ... --exclude-agent <it>` and redo it.
179
182
  `--exclude-agent` applies **only to redoing that review** (save the new pick to `review-<repo>.pick`); the next
180
183
  round reuses whoever gave the verdict. An agent that failed twice in a row with no verdict →
181
- `orq block <agent> --days 1` and tell the user.
184
+ `orq block <agent> --days 1` and tell the user. If it stopped on a quota limit, use `orq block <agent> --quota` (until
185
+ the window resets; a fixed period outlives it and keeps the agent out of `orq pick` for nothing). If `orq pick` finds no
186
+ candidate, its output is empty and `orq agent` refuses to start: stop and tell the user.
182
187
  **Review tools** (an agent whose `run` has no `{prompt}`/`{prompt_text}`/stdin, e.g. a CodeRabbit-like CLI with
183
188
  `ok_exit`/`filter` in the config): same command; it ignores the prompt and the attachments and reviews the branch
184
189
  against `{base}` itself. Read its answer like any other: `status=ok` with `rc≠0` is a verdict with findings, not a
185
190
  failure. Its high-severity items are the blockers, still under the step 6 rule (`file:line` + concrete failure).
186
- If the tool's answer opens with (or, when short, consists of) a statement that nothing was reviewed (e.g. Corvus's "Nada para revisar"), `agents.<name>.no_review` (a
191
+ If the tool's answer opens with (or, when short, consists of) a statement that nothing was reviewed (e.g. Revtool's "Nothing to review"), `agents.<name>.no_review` (a
187
192
  regex) makes `orq agent` end that run `status=fail`: `orq pick`'s fallback and the conductor treat it as not run,
188
193
  same as an empty answer.
189
194
  **Second opinion** (`orq pick opinion`, read only, same attachments): only on **heavy** issues or when reviewer and
@@ -206,7 +211,7 @@ repo checklist.
206
211
  only restates a `## Decisions` choice, counts as a suggestion; when you downgrade one, say why in the Plane comment.
207
212
  No blockers left → APPROVED, even with suggestions.
208
213
  Blocking problems → write the list (blockers only) to `$O/fix-<n>.md` (always this name; reviews `$O/review-<repo>-<n>`, never `fix<n>-<repo>` or other variants — a later conductor counts rounds by these files) and continue the implementer's session (any agent):
209
- `herdr-agent $(orq pick fix --same $O/impl-<repo>.pick) -g <group> -t "<ID> fix<n> <repo>" -d $WT -o $O/impl-<repo> -R $(cat $O/impl-<repo>.id) -- $O/fix-<n>.md`.
214
+ `orq agent $(orq pick fix --same $O/impl-<repo>.pick) -g <group> -t "<ID> fix<n> <repo>" -d $WT -o $O/impl-<repo> -R $(cat $O/impl-<repo>.id) -- $O/fix-<n>.md`.
210
215
  A fix is a continuation: same agent, model, account and session, effort one level up (`--same` reads the implementer's
211
216
  pick; never a new `orq pick`, never `-a` alone — without `-m` the session resumes on the CLI's default model, which
212
217
  loses the prompt cache and hands the work to a weaker model). `fix-<n>.md` = the numbered blockers + these rules: "fix only
@@ -214,7 +219,7 @@ these items, with the smallest diff that does it; don't refactor, rename or refo
214
219
  each blocker add or adjust a test that fails without the fix, when the code is testable (say so when it isn't); if an
215
220
  item is wrong or conflicts with a criterion, don't fix it: say why"; and it ends with "update the `## Decisions`
216
221
  section of your final answer for the whole branch". **Before dispatching the fix:** `git -C $WT rev-parse HEAD > $O/round-<n>.sha`.
217
- Then a new `herdr-verify` (4b) and the **round review** (step 5 with these changes):
222
+ Then a new `orq verify` (4b) and the **round review** (step 5 with these changes):
218
223
  - Same reviewer as the round before: `$(cat $O/review-<repo>.pick)`. Only if it is over quota, blocked or fails with
219
224
  no verdict → a new `orq pick review` (saved to the same file).
220
225
  - Extra attachments: `git -C $WT diff $(cat $O/round-<n>.sha)..HEAD > $O/fix-<n>.diff` → `-i $O/fix-<n>.md -i $O/fix-<n>.diff`
@@ -223,7 +228,7 @@ Then a new `herdr-verify` (4b) and the **round review** (step 5 with these chang
223
228
  any regression it introduced, as `[blocker]`/`[suggestion]`. Outside the fix diff, report only a blocker you missed
224
229
  before that would break production, and say why it wasn't in the first review". Anything else is a suggestion. A review tool can't answer that: it reviews the whole
225
230
  branch again, so you do the matching — a finding is a blocker this round only if it is inside `fix-<n>.diff` or is a
226
- NOT RESOLVED item of `fix-<n>.md`; one you already decided on (fixed, rejected or downgraded) stays decided. **Maximum: `orq config get policy.max_rounds` rounds** — `orq agent -R` refuses the next one (exit 4) and counts per session, so a renamed prefix doesn't reset it; on exit 4 stop and tell the user, `-F` only with their OK; over it → `orq pick impl
231
+ NOT RESOLVED item of `fix-<n>.md`; one you already decided on (fixed, rejected or downgraded) stays decided. **Maximum: `orq config get policy.max_rounds` rounds** — `orq agent -R` refuses the next one (exit 4) and counts per session, so a renamed prefix doesn't reset it; on exit 4 stop and tell the user. With their OK run `orq rounds <ID> --diagnose` (a cheap independent agent, advisory: read its `RECOMMENDATION` — continue / split / change-implementer / ask-user — and tell the user), then `-F` (refused without a diagnosis newer than the last fix/review; `-F -F` skips that, only if the user says so); over it → `orq pick impl
227
232
  --exclude-agent <it> > $O/impl-<repo>.pick` only with the user's OK, or stop and report. Non-blocking suggestions go into the comment; they
228
233
  don't become a round.
229
234
 
@@ -253,9 +258,9 @@ rules live) commits and writes the PR. Find and cite in the prompt, by path, wha
253
258
  Red → `gh run view <id> --log-failed | tail -40`: error from the diff → fix round; error already on the base → create
254
259
  a Plane issue (workspace standard) and tell the user. "Ready to merge" only with green checks or an explained failure
255
260
  + issue.
256
- - Move it to **In Review** (finished child tabs close by themselves; close any leftover with
261
+ - Move it to **In Review** (finished child tabs close by themselves; in herdr, close any leftover with
257
262
  `herdr tab list | jq -r '.result.tabs[]|select(.label|startswith("<ID> "))|.tab_id' | xargs -rn1 herdr tab close`)
258
- and **release the issue**: `herdr-claim -w $WS -r <ID>`. The worktree stays until the merge.
263
+ and **release the issue**: `orq claim -w $WS -r <ID>`. The worktree stays until the merge.
259
264
  - **After the merge** (when the user confirms): run `orq gc -w $WS` and show the list. If this issue's worktree is
260
265
  listed as removable, run `orq gc -w $WS --yes`; anything else → ask the user.
261
266
  - **Never** push, PR, merge or deploy unless the user asks. Report to the user in 3–5 lines.
@@ -5,18 +5,20 @@ rules — read the repo's own before touching it. This file only holds the map a
5
5
 
6
6
  ## Orchestration (read by the `/issue` skill)
7
7
  - **Workspace:** `{{WORKSPACE}}`
8
- - **Conductor (herdr):** opened with `herdr-conductor [account] [model] [-r <session-id>]` in a herdr pane, in this folder
9
- (instructions in `.orquestra-conductor.md`); the **Group** in the table below is the herdr workspace (`-g`).
10
- Tests from the Verification column (jest/vitest) **don't run in the child**: the conductor runs `herdr-verify` (`orq verify`
11
- outside herdr; one at a time on the machine); the child does lint + `tsc` (`NODE_OPTIONS=--max-old-space-size=2048`).
12
- - **Agents:** chosen by `orq-pick` from each developer's `~/.config/orq/config.toml` — nothing about models here.
8
+ - **Conductor:** opened with `orq conductor [account] [model] [-r <session-id>]` in this folder, in any terminal (inside a
9
+ herdr pane too; `herdr-conductor` still works there). Instructions in `.orquestra-conductor.md`; the **Group** in the
10
+ table below is the herdr workspace (`-g`) or just a label outside herdr.
11
+ Tests from the Verification column (jest/vitest) **don't run in the child**: the conductor runs `orq verify`
12
+ (one at a time on the machine); the child does lint + `tsc` (`NODE_OPTIONS=--max-old-space-size=2048`).
13
+ - **Agents:** chosen by `orq pick` from each developer's `~/.config/orq/config.toml` — nothing about models here.
13
14
 
14
15
  ## Scope
15
16
  - Before dispatching, split big issues into sub-issues or sequential batches (one PR, one implementer each) when they touch
16
17
  several unrelated areas, change roughly >400 lines, mix refactor with behavior change, or have independent acceptance
17
18
  criteria. Each batch must be testable and reviewable on its own; record the split in Plane before starting.
18
19
  - Reviews hitting `policy.max_rounds`, repeated findings or the implementer asking to change scope mean it was too big:
19
- stop and split the remainder instead of forcing more rounds.
20
+ stop and split the remainder instead of forcing more rounds. `orq rounds <ID> --diagnose` asks an independent agent why
21
+ (advisory); `orq agent -R -F` past `max_rounds` needs that diagnosis (`-F -F` skips it, only on the user's word).
20
22
 
21
23
  ## Repositories
22
24