@giamme/forge 0.14.1 → 0.15.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/SKILL.md +47 -14
  3. package/VERSION +1 -1
  4. package/docs/commands.md +288 -6
  5. package/docs/models.md +53 -0
  6. package/package.json +1 -1
  7. package/references/dataset.md +12 -3
  8. package/references/decompose.md +103 -4
  9. package/references/harnesses.md +17 -0
  10. package/references/planning.md +59 -0
  11. package/references/ui.md +39 -1
  12. package/scripts/forge-compare.py +6 -3
  13. package/scripts/forge-config.py +531 -4
  14. package/scripts/forge-dispatch.sh +56 -2
  15. package/scripts/forge-lib-plans.sh +19 -2
  16. package/scripts/forge-lib-review.sh +5 -3
  17. package/scripts/forge-lib-task.sh +119 -0
  18. package/scripts/forge-parallel-options.sh +12 -6
  19. package/scripts/forge-parallel.sh +565 -21
  20. package/scripts/forge-plan-check.py +591 -8
  21. package/scripts/forge-planner.py +480 -0
  22. package/scripts/forge-runtime.py +86 -0
  23. package/scripts/forge-shadow.py +51 -7
  24. package/scripts/forge-solo.sh +81 -7
  25. package/scripts/forge_dataset/cli.py +10 -0
  26. package/scripts/forge_dataset/efforts.py +215 -0
  27. package/scripts/forge_dataset/harvest.py +44 -0
  28. package/scripts/forge_decide/__init__.py +19 -1
  29. package/scripts/forge_decide/builtin_profiles.json +25 -0
  30. package/scripts/forge_decide/cli.py +12 -0
  31. package/scripts/forge_decide/profiles.py +866 -0
  32. package/scripts/forge_decide/resolve.py +38 -6
  33. package/ui/docs/api.md +87 -8
  34. package/ui/forge_ui/control.py +173 -12
  35. package/ui/forge_ui/executions.py +28 -8
  36. package/ui/forge_ui/models.py +60 -1
  37. package/ui/forge_ui/reader.py +21 -1
  38. package/ui/forge_ui/static/leaderboard.js +5 -1
  39. package/ui/forge_ui/static/modelstats.js +25 -1
  40. package/ui/forge_ui/static/panel.js +19 -2
  41. package/ui/forge_ui/static/settings.js +788 -25
  42. package/ui/forge_ui/static/style.css +23 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and versions follow the format `{major}.{minor}[.{patch}]` ([...] parts appear only when non-zero).
7
7
 
8
+ ## [0.15] - 2026-11-04
9
+
10
+ Profiles keep your model routing and run policies under a name, and forge-parallel.sh auto takes a goal to the approval table in one blocking command, planning only when it pays and collapsing plans that would run sequentially. Fast service tiers can be asked per role.
11
+
12
+ ### Highlights
13
+
14
+ - `forge-parallel.sh auto` takes a goal file to the approval table in one blocking command: the planner, its reply parsed into the task table, one send-back round when the plan gates ask, and `plan`. With `--approved` it also runs the plan. The orchestrator no longer explores the repository or polls, so a small model can drive it (#87).
15
+ - `--fast dwarf,qa,planner,review` (or `all`, `none`) on `plan` and `forge-solo.sh` asks for the fast service tier on those roles' dispatches: codex's `service_tier=fast` and claude's fast mode (billed at a higher rate; claude's needs extra usage). Other harnesses refuse it before any model call, and each dispatch records the tier it got (#68).
16
+ - Profiles keep your model pools and policies under a name: `forge config profile list|show|create|edit|set|unset|rm|use` stores them in decide.json (user or repo level), with the read-only built-ins `balanced` (the recommended routing) and `lite`. `--profile NAME` or `--no-profile` on `plan` and `forge-solo.sh` picks one, and a default set with `use` applies when neither is given. The run freezes the profile, so `run` and `retry` read it; a flag still replaces one value, and the table says so (#48).
17
+ - `plan` names a plan's shape. A chain, where no two tasks can run at once, gets a note in the table, and `--collapse-chains` merges it into one task that runs and is reviewed once (`auto` does this unless `--no-collapse`). The dataset records each plan's shape (#97).
18
+
19
+ ### Added
20
+
21
+ - forge-ui's Settings page has a Profiles section to list, edit, create, duplicate, delete and choose the default profile, and a run's page shows the profile it froze and the values its flags replaced (#48).
22
+ - docs/models.md gives a recommended routing per difficulty, measured on benchmark #86, and forge-ui's Models page shows it under each tier. `doctor --spec` and the plan table add a note when a spec is measurably slower than a lower effort of the same model with no better first-try pass rate, such as `haiku:max` against `haiku:xhigh` (#91).
23
+ - `auto` first decides whether a goal needs a planner at all: with `--plan auto` (the default) a small goal becomes one task without a planner call; `--plan always` and `--plan never` force either path (#88).
24
+
8
25
  ## [0.14.1] - 2026-11-03
9
26
 
10
27
  Two fixes from run 1's follow-ups: a lateral move after an infrastructure stop stays in the tier the task was last assigned, and a claude or openclaude dispatch that already gave its final result is no longer lost to a timeout while a background task keeps it open.
package/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: forge
3
3
  description: Dispatch implementation and independent diff review to user-selected models through local agent CLIs. Use for /forge or explicit requests to delegate coding or review; explanation-only questions do not authorize dispatch.
4
- argument-hint: '"<goal>" --dwarf <alias>[:effort[:harness]] [--qa <alias>] [--planner <alias>] [--yolo-dwarf] [--yolo-qa] [--decompose-level low|medium|high] [--fractal|--no-fractal|--fractal-auto-decompose] [--fractal-planner <spec>] [--jev|--no-jev] [--jev-shadow] [--gate NAME=MODE] [--no-gates] [--decide-budget tokens=N[,usd=X]] [--no-memory] [--no-ripwire] [--ui|--no-ui] [--timeout <seconds>] [--retry-failed <n>] [--escalate-after <n>] [--qa-threshold P0|P1|P2|P3|none|default] [--file-issues ask|auto|off] [--shadow-qa <spec>[,<spec>]] [--shadow-rate <0..1>] [--reviewer-session] [--explore <0..0.5>] [--fail-first]'
4
+ argument-hint: '"<goal>" --dwarf <alias>[:effort[:harness]] [--qa <alias>] [--planner <alias>] [--profile <name>|--no-profile] [--fast <roles>] [--yolo-dwarf] [--yolo-qa] [--decompose-level low|medium|high] [--collapse-chains] [--plan auto|always|never] [--fractal|--no-fractal|--fractal-auto-decompose] [--fractal-planner <spec>] [--jev|--no-jev] [--jev-shadow] [--gate NAME=MODE] [--no-gates] [--decide-budget tokens=N[,usd=X]] [--no-memory] [--no-ripwire] [--ui|--no-ui] [--timeout <seconds>] [--retry-failed <n>] [--escalate-after <n>] [--qa-threshold P0|P1|P2|P3|none|default] [--file-issues ask|auto|off] [--shadow-qa <spec>[,<spec>]] [--shadow-rate <0..1>] [--reviewer-session] [--explore <0..0.5>] [--fail-first]'
5
5
  allowed-tools: [Bash, Read]
6
6
  ---
7
7
 
@@ -14,11 +14,27 @@ For explanation requests, explain the workflow without spending model quota.
14
14
  ## Choices and boundaries
15
15
 
16
16
  - A dwarf model must be chosen by the user. Ask when it is missing; never invent one.
17
- - QA defaults to `opus`; effort defaults to `medium` for dwarf, `high` for QA and `xhigh` for the planner.
17
+ `--profile NAME` the user selected, or a default they set (`forge config profile use`),
18
+ counts as that choice: do not ask role by role on top of it. When neither a flag nor a
19
+ profile names models, offer one profile and wait: the user's default if one is set, else
20
+ the built-in `balanced` ([recommended routing](docs/models.md#recommended-routing)). Ask
21
+ role by role only if they decline. The runner applies a configured default when neither
22
+ flag is passed and the run has no frozen copy, and it does not select `balanced` by
23
+ itself. Pass `--profile balanced` when they accept it and it is not already the default;
24
+ pass `--no-profile` when they decline, so a configured default does not fill the rest.
25
+ A profile that names no dwarf pool still needs `--dwarf`.
26
+ - QA defaults to `opus` when no profile names a reviewer; effort defaults to `medium` for dwarf, `high` for QA and `xhigh` for the planner.
18
27
  - Specs are `alias[:effort[:harness]]`, e.g. `sol:xhigh:openclaude`. Resolve using
19
28
  [registry.tsv](registry.tsv); report any effort clamp. Literal model IDs require a harness.
20
29
  - Bypass flags apply only when explicitly requested for that role (`--yolo-dwarf`,
21
30
  `--yolo-qa`). Bash access can mutate files despite disabled editing tools.
31
+ - `--fast ROLES` is opt-in. Offer it only when the user asks for speed. `ROLES` is a comma
32
+ list of `dwarf`, `qa`, `planner` and `review`, or `all`, or `none`. It is billed at a
33
+ higher rate. Claude's fast mode needs extra usage enabled; without it the run stays at
34
+ standard speed, exits 0, and forge prints a note. Codex can do the same when the tier is
35
+ unsupported. Other harnesses (openclaude, opencode, antigravity, grok) refuse and exit 3.
36
+ A solo run accepts only `dwarf`, `qa` or `none`. Read
37
+ [the fast service tier](references/harnesses.md#fast-service-tier). A note is not a failed run.
22
38
  - Ask **“Use Fractal for this run? [y/N]”** once before an interactive run, unless
23
39
  the user supplied `--fractal`, `--no-fractal`, or `--fractal-auto-decompose`. Pass the answer explicitly to
24
40
  the runner. Unattended runs default off. Installation never activates Fractal.
@@ -44,7 +60,12 @@ For explanation requests, explain the workflow without spending model quota.
44
60
  - The QA threshold defaults to `P2`: a CONFIRMED finding at P2 or worse blocks, so a PASS that
45
61
  lists one becomes FAIL, and milder CONFIRMED findings are recorded as known issues. `--qa-threshold`
46
62
  changes it (see [the verdict rule](docs/reviews.md#verdicts-and-failure)).
47
- - Show the decomposed task/model table and wait for approval before dispatch. Retry only
63
+ - Show the decomposed task/model table and wait for approval before dispatch. Relay the
64
+ table's `profile:` line: the profile, and the flags that override it. Solo prints the
65
+ same line. When the table says the plan runs sequentially, offer `--collapse-chains`
66
+ (or one task) before approval. `forge-parallel.sh auto` already passes
67
+ `--collapse-chains` unless `--no-collapse`, so that line appears when collapse did not
68
+ run. Retry only
48
69
  when requested; preserve failed task branches and worktrees. `run --retry-failed N`,
49
70
  `--infra-retries M`, `plan --shadow-qa` (a second review of a
50
71
  sampled share of attempts, never read, to measure reviewer agreement) and
@@ -107,15 +128,18 @@ For explanation requests, explain the workflow without spending model quota.
107
128
 
108
129
  ## Common workflow
109
130
 
110
- 1. Inspect the repository and existing work. State the goal, selected models and any bypass
111
- flags. Keep complete requirements in `prompt.md`; short titles are insufficient for QA.
131
+ 1. Inspect the repository and existing work, unless this is a decomposed `--planner` run:
132
+ the planner reads the repository, so do not explore it yourself. State the goal,
133
+ selected models and any bypass flags. Keep complete requirements in `prompt.md`; short
134
+ titles are insufficient for QA.
112
135
  2. Preflight every selected role before the first model call, including an optional planner:
113
136
  `bash <skill_dir>/scripts/forge-dispatch.sh doctor --spec <spec> --role <role>`.
114
137
  This checks resolution, executable and advertised flags without model quota. Authentication,
115
138
  quota and live model availability remain unverified; a live probe must be explicitly requested.
116
139
  3. Use [solo runs](references/solo.md) for one implementation. For `--decompose-level
117
- low|medium|high`, read [decomposition](references/decompose.md), prepare the task table,
118
- obtain approval, then use `forge-parallel.sh plan/run`. Write the user's request verbatim
140
+ low|medium|high`, read [decomposition](references/decompose.md). With `--planner`, do not
141
+ assemble the table: call `auto` as below. Otherwise prepare the task table, obtain
142
+ approval, then use `forge-parallel.sh plan/run`. Write the user's request verbatim
119
143
  to `request.md` in the run or plan dir, and pass `--decompose-level` to `plan` with the
120
144
  level you actually split at, even when the user named none. Keep each task small and end
121
145
  its `prompt.md` with an `## Acceptance criteria` section of checks the reviewer can verify;
@@ -123,10 +147,19 @@ For explanation requests, explain the workflow without spending model quota.
123
147
  Pass the recorded Fractal choice and requested limits to the execution runner; tier
124
148
  pools go to solo directly or decomposed `plan`. Fractal does not replace planner dispatch.
125
149
  `--timeout` applies to decomposed runs too (kept in the plan).
126
- When `plan` exits 4, the prompt or coverage gate sent work back: read `<plan>/plan.sendback.md`,
127
- rewrite each listed task's `prompt.md`, and extend or add tasks for each uncovered
128
- requirement (with `--planner`, re-dispatch it with that file appended), then run `plan`
129
- again, once. Forge never sends the same task or requirement back twice.
150
+ For a decomposed `--planner` run, call `forge-parallel.sh auto` once, as one blocking
151
+ command, instead of writing the planner prompt and assembling the plan by hand. Omit
152
+ `--approved` on an interactive run, show the table, and wait; `--approved` is only for
153
+ the user's explicit pre-approval. Where the harness limits foreground commands, start
154
+ `auto` in the background and wait for its completion notice. Do not poll and do not
155
+ read its logs meanwhile. Auto preflights the planner and, on one plan send-back,
156
+ re-dispatches once. After the run (the `run` command `auto` printed, or
157
+ `auto --approved`), read `<plan>/results.tsv` and each failed task's `qa.last`, and
158
+ report. When you called `plan` yourself and it exits 4, the prompt or coverage gate
159
+ sent work back: read `<plan>/plan.sendback.md`, rewrite each listed task's `prompt.md`,
160
+ and extend or add tasks for each uncovered requirement (with `--planner`, re-dispatch
161
+ it with that file appended), then run `plan` again, once. Forge never sends the same
162
+ task or requirement back twice.
130
163
  4. Runners default to summary output. Read each `dwarf.last` and `qa.last` once; retrieve raw
131
164
  logs only when needed. Report findings faithfully, and identify verification
132
165
  limits. Source or review mutations invalidate acceptance. Missing verdicts are UNKNOWN.
@@ -147,10 +180,10 @@ Runners offer installation once before agents; dispatch never prompts. See
147
180
 
148
181
  ## Conditional references
149
182
 
150
- - [Planning](references/planning.md): read for `--planner` or an agreed approach.
183
+ - [Planning](references/planning.md): read for `--planner` (including `forge-parallel.sh auto`) or an agreed approach.
151
184
  - [Solo](references/solo.md): command, snapshots, artifacts, exit codes and native-review limits.
152
- - [Decomposition](references/decompose.md): task schema, routing, waves, retries and integration.
153
- - [Harnesses](references/harnesses.md): invocation troubleshooting or adding a harness.
185
+ - [Decomposition](references/decompose.md): task schema, routing and profiles, `auto`, plan shape, waves, retries and integration.
186
+ - [Harnesses](references/harnesses.md): invocation troubleshooting, the fast service tier, or adding a harness.
154
187
  - [Fractal](references/fractal.md): opt-in nested execution, installation, limits,
155
188
  recovery, managed run commands, read-only dashboard and portable reports.
156
189
  - [Memory](references/memory.md): `.forge/` learning and spend records; `--no-memory` disables
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.14.1
1
+ 0.15
package/docs/commands.md CHANGED
@@ -18,6 +18,7 @@ harness (`/forge`); this command installs forge and drives its optional tools.
18
18
  | `forge runs [--repo DIR \| --all] [--limit N] [--json]` | this repo's recent runs, newest first: run id, kind, age, task states, verification and final review, goal, and the run dir. Read-only; the same summaries forge-ui shows |
19
19
  | `forge control show\|set\|pin\|unpin\|drain\|resume\|stop\|retry\|add PLAN_DIR …` | change a live plan: `set` takes `qa-threshold` (`P0`..`P3`, `none` or `default` for the plan, `inherit` per task), `timeout`, `escalate-after`, `escalate-effort` (`on`/`off`), `verify-retries`, `infra-backoff` (a backoff shape; `none` drops it), `infra-fallback` (`on`/`off`), `max-attempts` (a non-negative integer, `0` = no cap, and only with `--confirm`), `converge-window` (a non-negative integer), `pre-review-tests` (`on`/`off`), `pre-review-parallel` (1-64), `retry-budget`, `infra-retries` or `max-parallel` (1-64) (the last three only while a scheduler runs; `--task ID` for `qa-threshold` and `retry-budget`, value `inherit` drops the override); `pin PLAN_DIR TASK SPEC` sets the model the task's next full retry uses once, `unpin` drops it. While a scheduler runs: `drain` starts nothing new until `resume` (a run with nothing left to start ends as usual); `stop [--now]` ends the run once the running tasks finish (`--now` interrupts them; `run` exits 130 without verifying, unless every task had merged by then: it then verifies and exits 0 as usual); `retry PLAN_DIR TASK [--dwarf SPEC]` queues a retry, and a `NEEDS_DECISION` task instead needs `--decide retry=N` or `--decide threshold=Pn`, or `--dwarf SPEC`, each with `--reason TEXT --approved`; `add PLAN_DIR TASK` (a row appended to `tasks.tsv`) queues a request the scheduler applies or refuses. `show` (`--json` for JSON) also says whether the run is drained or stopping, prints an `INFRA` task's cause, and, while a scheduler is live, lists each infrastructure pause with its reset and "needs you". The text table lists each task's attempts against its cap (`9/8`, or `9/-` when there is no cap). Every change and every request's outcome is logged in `control.log`. Exit 2 invalid input, 3 refused. See [live controls](decomposed-runs.md#changing-a-run-while-it-works) |
20
20
  | `forge config show [--repo DIR] [--json]` / `forge config set <key> <value> [--repo DIR] [--json]` / `forge config unset <key> [--repo DIR] [--json]` | one view of every config source (registry, the legacy Jev file, decide, the repo's `.forge/verify`, `setup` and `verify-subset`, dataset, `FORGE_*` variables with secrets hidden); `set` / `unset` edit `repo.verify`, `repo.setup`, `repo.verify-subset` (must contain `{files}` or `{changed}`; `--repo` required) and `decide.gate.<gate>`, `decide.gate.<gate>.provider`, `decide.gate.<gate>.model` (`off`, `shadow` or `on`; those write the user level and do not need `--repo`). Unset of a `decide.gate.*` key is refused: set the mode to `off`. `-` as a value reads stdin for the per-repo files. Exit 2 on invalid input |
21
+ | `forge config profile list\|show\|create\|edit\|set\|unset\|rm\|use` | named bundles of routing, policy, gates and budget in `decide.json`; see [below](#forge-config-profile) |
21
22
  | `forge watch [RUN_DIR \| --repo DIR \| --all] [--interval S] [--settle S] [--until-done] [--no-notify] [--exec CMD]` | follow runs live: a line for every task status change, and a desktop notification, `--exec CMD` and the repo's `.forge/on-finish` when a run finishes or fails, a task fails or a final review gives its verdict; see [below](#forge-watch). Read-only |
22
23
  | `forge runs rm RUN_DIR [--dry-run] [--yes] [--no-archive] [--worktrees] [--branches] [--json]` | delete a run directory but keep what it taught the dataset; see [below](#forge-runs-rm) |
23
24
  | `forge runs rerun RUN_DIR --dwarf SPEC [--qa SPEC] [--to DIR] [--max-parallel N] [--dry-run] [--run --yes]` | set up the same plan again with another implementer, from the same starting commit; spends nothing unless `--run --yes`; never merges. See [below](#forge-runs-rerun-and-compare) |
@@ -181,7 +182,7 @@ request cache) is in [Measuring a gate](../references/decision-models.md#measuri
181
182
  | Command | Does |
182
183
  |---|---|
183
184
  | `status [--repo DIR] [--json]` | each gate's effective mode and which level set it, providers (`present` or `missing` key), caps and today's spend, privacy floor. A gate that is `on` without a passing replay is shown as `forced`. Never writes |
184
- | `gate GATE off\|shadow\|on [--force] [--provider P] [--model M] [--profile NAME \| --repo DIR]` | set one gate. Gates: `drift`, `forward`, `prompt`, `coverage`, `retry-addressed`, `dwarf-message`, `attribution`, `findings`, `memory-curate`, `memory-slice`, `memory-stale`, `verify-discover` (what each does when `on`: [Gates and modes](../references/decision-models.md#gates-and-modes)). With no `--provider`, a gate uses the legacy transport (`jev.json`'s endpoint with `TYPESAFE_API_KEY` or `jev.json`'s key, or Cloudflare for a site `jev.json` maps there); name a provider to choose where requests go. Without `--repo`, writes the user file and migrates `jev.json` first. `--profile` writes that profile in the user file. `on` needs a passing replay for the provider and model it resolves to, else it is refused (exit 3). `--force` turns it on anyway, and it shows as forced (see [measuring a gate](../references/decision-models.md#promotion)) |
185
+ | `gate GATE off\|shadow\|on [--force] [--provider P] [--model M] [--profile NAME \| --repo DIR]` | set one gate. Gates: `drift`, `forward`, `prompt`, `coverage`, `retry-addressed`, `dwarf-message`, `attribution`, `findings`, `memory-curate`, `memory-slice`, `memory-stale`, `verify-discover` (what each does when `on`: [Gates and modes](../references/decision-models.md#gates-and-modes)). With no `--provider`, a gate uses the legacy transport (`jev.json`'s endpoint with `TYPESAFE_API_KEY` or `jev.json`'s key, or Cloudflare for a site `jev.json` maps there); name a provider to choose where requests go. Without `--repo`, writes the user file and migrates `jev.json` first. `--profile` writes that profile in the user file; a name only a built-in or repo profile has is refused (copy it first with `forge config profile create NAME --from SOURCE`). `on` needs a passing replay for the provider and model it resolves to, else it is refused (exit 3). `--force` turns it on anyway, and it shows as forced (see [measuring a gate](../references/decision-models.md#promotion)) |
185
186
  | `provider add jev\|clef --name N [--url U] [--account-id A] [--model M] [--context N] [--price X] [--deadline S] [--local] [--key-stdin \| --key-env VAR]` | add a hosted or local provider. A key is never an argument: one line on stdin or a terminal prompt is written to `keys/<N>.key` mode `0600`, or `--key-env VAR` stores the variable name and reads it at request time |
186
187
  | `provider list [--json]` | configured providers |
187
188
  | `provider rm N` | remove a provider no gate uses, and the `keys/<N>.key` it wrote |
@@ -204,6 +205,77 @@ a bare `budget`, `status` and `doctor` do not.
204
205
  `forge jev` is the deprecated alias, kept for one release. `setup`, `sites`, `enable`,
205
206
  `disable`, `status` and `doctor` print the `forge decide` command and then run the old one.
206
207
 
208
+ ### `forge config profile`
209
+
210
+ A profile is a named bundle of routing, policy, gates and budget, stored in `decide.json`.
211
+ One name resolves user, then repo, then built-in: a user profile hides a repo profile of
212
+ the same name, which hides a built-in. The built-ins `balanced` and `lite` are read-only
213
+ and carry the [recommended routing](models.md#recommended-routing). `forge config profile
214
+ show balanced` prints `balanced`; `lite` is the same routing with the high tier on
215
+ `sonnet:high` for both dwarf and reviewer.
216
+
217
+ ```
218
+ forge config profile list [--repo DIR] [--json]
219
+ forge config profile show NAME [--repo DIR] [--json]
220
+ forge config profile create NAME (--from OTHER | --from-run PLAN | --file F) [--repo DIR] [--json]
221
+ forge config profile edit NAME --file F [--repo DIR] [--json]
222
+ forge config profile set NAME KEY VALUE [--repo DIR] [--json]
223
+ forge config profile unset NAME KEY [--repo DIR] [--json]
224
+ forge config profile rm NAME [--repo DIR] [--json]
225
+ forge config profile use NAME [--repo DIR] [--json]
226
+ forge config profile use --none [--repo DIR] [--json]
227
+ ```
228
+
229
+ Without `--repo` the command reads and writes the user file,
230
+ `${XDG_CONFIG_HOME:-~/.config}/forge/decide.json`, and `list` and `show` see that file plus
231
+ the built-ins. `--repo DIR` uses `<repo>/.forge/decide.json`. A repo-only profile is not
232
+ visible, and cannot be copied, without `--repo`.
233
+
234
+ The effective default is the user file's `default_profile`, else the repo file's. A user
235
+ default hides a repo default even when `--repo` is passed. `use --none` clears
236
+ `default_profile` only in the file that command writes, so clearing the user default
237
+ reveals a repo default.
238
+
239
+ A name is 1–64 characters of letters, digits, `.`, `_` or `-`, and starts with a letter or
240
+ a digit.
241
+
242
+ | Subcommand | Does |
243
+ |---|---|
244
+ | `list` | one line per winning profile: name, level (`user`, `repo` or `builtin`), `default` when it is the effective default, and `shadows` the levels it hides. `--json` is `{default: {name, level}, profiles: [{name, level, shadowed, default}]}`; `name` and `level` are null when no default is set |
245
+ | `show NAME` | the winning body, its level, what it shadows, and whether it is the default. `--json` adds `body` |
246
+ | `create NAME` | exactly one of `--from OTHER` (a copy of a profile `show` can see), `--from-run PLAN` (routing and policy taken from that plan's files, with a frozen `profile.json` filling policy keys no file has), or `--file F` (`-` reads stdin). The body must be at most 1 MiB. Refuses a name that already exists at this level |
247
+ | `edit NAME --file F` | replace the body stored at this level. `-` reads stdin |
248
+ | `set NAME KEY VALUE` | set one dotted routing or policy key. `routing.escalate_effort` is `on` or `off`. Pools, `policy.shadow_qa` and `policy.fast` are comma lists |
249
+ | `unset NAME KEY` | remove that key. An empty section is dropped |
250
+ | `rm NAME` | delete the profile stored at this level; this level's `default_profile` goes with it unless another copy of the name is left (a lower level's or a built-in) |
251
+ | `use NAME` | write `default_profile` at this level, after the body validates |
252
+ | `use --none` | clear `default_profile` at this level |
253
+
254
+ `set` and `unset` accept `routing.dwarf.<tier>`, `routing.qa.<tier>` (`tier` is `any`,
255
+ `low`, `medium` or `high`), `routing.planner`, `routing.fractal_planner`,
256
+ `routing.final_reviewer`, `routing.escalate_after`, `routing.escalate_effort`,
257
+ `policy.qa_threshold`, `policy.retry_failed`, `policy.infra_retries`,
258
+ `policy.verify_retries`, `policy.timeout`, `policy.explore`, `policy.shadow_rate`,
259
+ `policy.shadow_qa` and `policy.fast`. Gates and budget are not dotted keys: put them in
260
+ the JSON body with `create` or `edit`. Unknown keys inside `routing` or `policy` are
261
+ refused. Unknown top-level keys of a body are kept and ignored.
262
+
263
+ A built-in with no copy of its own cannot be edited, set, unset or removed:
264
+
265
+ ```
266
+ built-in profile 'NAME' is read-only; copy it: forge config profile create NAME --from NAME
267
+ ```
268
+
269
+ A user or repo copy of that name is what those commands change. `edit`, `set`, `unset` and
270
+ `rm` without `--repo` change the user file only.
271
+
272
+ On success, `create`, `edit`, `set`, `unset`, `rm` and `use` print `profile NAME: ACTION (LEVEL)`.
273
+ `use --none` prints `profile none: cleared (LEVEL)`. With `--json` that is
274
+ `{"ok": true, "name", "level", "body"}` (`name` is null for `use --none`). On error,
275
+ `--json` also prints `{"ok": false, "error": "..."}`. Exit 2 on
276
+ invalid input, and 3 when the profile is a read-only built-in with no copy at that level. This is not `forge decide gate --profile`,
277
+ which writes that profile's gates and refuses `gate on` with exit 3.
278
+
207
279
  Run flags, on `forge-solo.sh` and `forge-parallel.sh plan`, are frozen in `jev-selection.json`.
208
280
  A re-plan replaces the file. Solo again on the same run dir keeps it. When the file exists,
209
281
  `run` and `retry` keep it and say so when flags are passed again. A plan with no selection
@@ -221,6 +293,7 @@ file takes the flags on `run` or `retry` and freezes them then.
221
293
  /forge "<goal>" --dwarf <alias>[:<effort>[:<harness>]]
222
294
  [--qa <alias>[:<effort>[:<harness>]]]
223
295
  [--planner <alias>[:<effort>[:<harness>]]]
296
+ [--profile <name> | --no-profile] [--fast <roles>]
224
297
  [--yolo-dwarf] [--yolo-qa] [--repo <dir>] [--native-review]
225
298
  [--no-memory] [--gate NAME=MODE[,...]] [--no-gates]
226
299
  [--decide-budget tokens=N[,usd=X]]
@@ -228,7 +301,8 @@ file takes the flags on `run` or `retry` and freezes them then.
228
301
  [--fractal-auto-decompose] [--fractal-planner <spec>]
229
302
  [--fractal-depth <n>] [--fractal-children <n>] [--fractal-nodes <n>]
230
303
  [--fractal-iterations <n>] [--fractal-concurrency <n>] [--fractal-deadline <s>]
231
- [--decompose-level low|medium|high] [--max-parallel <n>]
304
+ [--decompose-level low|medium|high] [--collapse-chains]
305
+ [--plan auto|always|never] [--max-parallel <n>]
232
306
  [--dwarf-high <spec>] [--dwarf-medium <spec>] [--dwarf-low <spec>]
233
307
  [--qa-high <spec>] [--qa-medium <spec>] [--qa-low <spec>]
234
308
  ```
@@ -237,7 +311,10 @@ file takes the flags on `run` or `retry` and freezes them then.
237
311
  |---|---|---|
238
312
  | `--dwarf <spec>` | *asks* | the model that implements the change |
239
313
  | `--qa <spec>` | `opus` at `high` | the model that reviews the dwarf's diff |
240
- | `--planner <spec>` | orchestrator plans | dispatch planning to a model; one dispatch per run, effort defaults to `xhigh` |
314
+ | `--planner <spec>` | orchestrator plans | dispatch planning to a model; one dispatch per run, effort defaults to `xhigh`. A decomposed run calls [`forge-parallel.sh auto`](#forge-parallelsh-auto) |
315
+ | `--profile <name>` | the default profile, if one is set and the run has no frozen copy | that profile's routing and policy. Mutually exclusive with `--no-profile`. See [profiles on a run](#profile-and---no-profile) |
316
+ | `--no-profile` | — | use no profile, and remove a frozen copy |
317
+ | `--fast <roles>` | off | fast service tier for those roles. Opt-in. See [below](#the-fast-tier) |
241
318
  | `--no-memory` | memory on | write and inject nothing in `.forge/` |
242
319
  | `--gate NAME=MODE` | the configured gates | set decision-model gates for this run (`off`, `shadow` or `on`); repeatable, a later one wins. Frozen in `jev-selection.json`. See [`forge decide`](#forge-decide) |
243
320
  | `--no-gates` | gates as configured | every decision-model gate off for this run |
@@ -248,6 +325,8 @@ file takes the flags on `run` or `retry` and freezes them then.
248
325
  | `--repo <dir>` | cwd | repository to work in |
249
326
  | `--native-review` | off | use native Codex review against the recorded baseline instead of an inlined diff |
250
327
  | `--decompose-level <l>` | off | split the goal into parallel tasks |
328
+ | `--collapse-chains` | off; on inside `auto` unless `--no-collapse` | this `plan` only: merge a sequential chain into one task. See [below](#collapse-chains) |
329
+ | `--plan auto\|always\|never` | `auto`, and only on `forge-parallel.sh auto` | whether the pre-plan gate plans or writes one task. See [`auto`](#forge-parallelsh-auto) |
251
330
  | `--max-parallel <n>` | `3` | concurrent task pipelines |
252
331
  | `--dwarf-high/-medium/-low` | — | per-difficulty routing; comma-list pools models |
253
332
  | `--qa-high/-medium/-low` | — | same, for reviewers |
@@ -330,7 +409,7 @@ Resolves a spec into a real CLI invocation and runs it. Needs only bash and core
330
409
  is the point: it behaves identically no matter which harness is orchestrating.
331
410
 
332
411
  ```
333
- forge-dispatch.sh doctor
412
+ forge-dispatch.sh doctor --spec <spec> [--role dwarf|qa|planner] [--service-tier fast]
334
413
  forge-dispatch.sh dwarf <spec> --prompt-file <f> [--repo <dir>] [--run-dir <d>] [--yolo] [--dry-run]
335
414
  forge-dispatch.sh qa <spec> --prompt-file <f> [--repo <dir>] [--run-dir <d>] [--yolo] [--dry-run]
336
415
  [--native-review [--review-base <ref>]]
@@ -342,6 +421,19 @@ forge-dispatch.sh efforts --spec <spec>
342
421
  when the pairing has no effort dial); a literal model id with a harness takes that harness's
343
422
  whole ladder. It never dispatches and spends no quota. The retry policy's effort step reads it.
344
423
 
424
+ **Slow-effort note.** `doctor --spec` may also print one line on stderr, `forge: note: …`.
425
+ It is not part of the resolved block, a plain dispatch does not print it, and it never
426
+ changes the spec or the exit code. `plan` prints the same note under the table, once per
427
+ distinct dwarf or qa spec (`forge-dataset.py slow-notes`). The dataset supplies the note
428
+ when it is on and both this effort and a lower effort of the same model have at least five
429
+ first attempts: the nearest lower effort this one is at least twice as slow as, with a
430
+ first-try pass rate no better. A nearer pair with enough data that fails the rule does not
431
+ hide a farther pair that meets it. When some pair has enough data and none meet the rule,
432
+ there is no note: measured pairs override the built-in row. Otherwise the built-in row is
433
+ `haiku:max` against `haiku:xhigh` on claude's model (#86, 2026-10-28). openclaude's haiku is
434
+ that same model, so the row matches it; opencode's haiku does not. The line is
435
+ `alias:effort: no measured gain over alias:lower (first try k/n vs k/n) at about Nx the time (m vs m min; source). The spec is unchanged.`
436
+
345
437
  | Option | Meaning |
346
438
  |---|---|
347
439
  | `--prompt-file <f>` | file holding the prompt (required for `dwarf`/`qa`) |
@@ -353,6 +445,7 @@ whole ladder. It never dispatches and spends no quota. The retry policy's effort
353
445
  | `--review-base <ref>` | qa only; base ref for the native review |
354
446
  | `--agy-timeout <s>` | antigravity `--print-timeout` (long runs need this raised) |
355
447
  | `--timeout <s>` | kill this dispatch after `<s>` seconds; `0` disables. See the precedence below |
448
+ | `--service-tier fast` | ask for the fast tier on this one invocation. `doctor` preflights it the same way. `fast` is the only value. codex and claude only; any other harness exits 3 before a model call. See [the fast service tier](../references/harnesses.md#fast-service-tier) |
356
449
 
357
450
  **Exit codes:** `0` ok · `2` spec or usage error · `3` harness missing or unusable ·
358
451
  `4` the backend ran and failed · `7` the backend hit its timeout and was killed (unless it had
@@ -422,10 +515,16 @@ forge-solo.sh <run-dir> --repo <dir> --dwarf <spec> [--qa <spec>]
422
515
  [--native-review] [--no-memory] [--timeout <s>] [--dry-run] [--ui | --no-ui]
423
516
  [--gate NAME=MODE[,...]] [--no-gates] [--decide-budget tokens=N[,usd=X]]
424
517
  [--fail-first] [--qa-threshold P0|P1|P2|P3|none]
518
+ [--fast dwarf|qa|none] [--profile NAME | --no-profile]
425
519
  [--fractal | --no-fractal] [--fractal-<limit> <n>]
426
520
  [--dwarf-low <pool>] [--dwarf-medium <pool>] [--dwarf-high <pool>] [--retry]
427
521
  ```
428
522
 
523
+ `--profile` and `--fast` are the same flags as on `plan`, with two solo limits: `--fast`
524
+ accepts only `dwarf`, `qa` or `none` (`planner`, `review` and `all` are refused), and the
525
+ profile's dwarf and qa are its medium pool, else its `any` pool. See
526
+ [profiles on a run](#profile-and---no-profile) and [the fast tier](#the-fast-tier).
527
+
429
528
  `--qa-threshold` sets the blocking level for this run: `P0`..`P3`, or `none` (P3); the default is `P2`. The gate's decision is in `qa.gate` and the tolerated findings are in `known_issues.md`. See [the verdict rule](reviews.md#verdicts-and-failure).
430
529
 
431
530
  You write two files into the run directory; forge does the rest:
@@ -499,7 +598,12 @@ forge-parallel.sh plan <plan-dir> --repo <dir> [routing flags] [--planner <
499
598
  [--explore E] [--ui | --no-ui] [--fail-first | --no-fail-first]
500
599
  [--pre-review-tests | --no-pre-review-tests] [--pre-review-parallel N]
501
600
  [--qa-threshold P0|P1|P2|P3|none|default]
601
+ [--profile NAME | --no-profile] [--fast ROLES] [--collapse-chains]
502
602
  [--max-attempts N] [--converge-window N] [--no-infra-fallback]
603
+ forge-parallel.sh auto <plan-dir> --repo <dir> --goal-file <file> [--planner <spec>]
604
+ [--decompose-level L] [--plan auto|always|never]
605
+ [--one-task-difficulty low|medium|high]
606
+ [--no-collapse] [--approved] [plan flags...] [-- run flags...]
503
607
  forge-parallel.sh run <plan-dir> [--max-parallel N] [--yolo-dwarf] [--yolo-qa] [--dry-run]
504
608
  [--verify <cmd> | --verify-lane 'name[opts]=cmd' ...]
505
609
  [--verify-parallel N] [--setup <cmd>] [--timeout S]
@@ -528,6 +632,7 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
528
632
  | Subcommand | Does |
529
633
  |---|---|
530
634
  | `plan` | validate `tasks.tsv`, resolve difficulty → concrete dwarf/qa specs, compute waves, render the approval table |
635
+ | `auto` | from a goal file to that table in one blocking command; with `--approved`, also `run`. The orchestrator's job is mechanical, so a small model can drive it. See [below](#forge-parallelsh-auto) |
531
636
  | `run` | schedule ready tasks; per task: worktree → dwarf → diff → QA → status; merge passing tasks onto the integration branch |
532
637
  | `retry` | re-run **one** failed task in the worktree it already has, with its reviewer's findings in the prompt; with `--answer` or `--answer-file`, answer a `NEEDS_INPUT` task and run it; with `--decide` or `--dwarf` plus `--reason` and `--approved`, decide a `NEEDS_DECISION` task and run it |
533
638
  | `attribute` | after a failed combined verification, search the merge order for **a merge that breaks it**; merges, revises and accepts nothing. See below |
@@ -564,17 +669,194 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
564
669
  | `--sweep-ahead` | run | `sweep_ahead` | a task is also told the open findings in files it owns, to fix on its way (off by default; `--no-sweep-ahead` turns it off) |
565
670
  | `--attribute` | run | `attribute_on` | when the run's combined verification fails, search the merge order for a merge that breaks it, right after the failure is reported (off by default; `--no-attribute` turns it off). Without it the summary says how to run `attribute` later |
566
671
  | `--escalate-effort` | run, retry | `escalate_effort` | at the top tier, retry the same model once more at its next accepted effort before stopping (off by default; `--no-escalate-effort` turns it off) |
672
+ | `--profile NAME` | plan | `profile.json` | that profile's routing and policy, frozen at `plan`. A flag of this call replaces just that value. Mutually exclusive with `--no-profile`. See [below](#profile-and---no-profile) |
673
+ | `--no-profile` | plan | removes `profile.json` | no profile. `routed.json` stays |
674
+ | `--fast ROLES` | plan | `fast` | which of `dwarf`, `qa`, `planner`, `review` ask for the fast tier (`all` or `none`). Omitted on a re-plan, the file stays; `none` removes it. See [below](#the-fast-tier) |
675
+ | `--collapse-chains` | plan | no — this call only | merge a chain into one task named `combined`, after validation and before routing. A one-task or branching plan is unchanged. An already collapsed plan is not an error. See [below](#collapse-chains) |
567
676
 
568
677
  **Exit codes:** `0` ok · `2` usage or validation · `3` precondition (not a git repo, …) ·
569
- `4` **`plan` only: the plan gates sent work back** (see below) ·
678
+ `4` **`plan` only: the plan gates sent work back** (see below); **`auto`:** the planner failed, its reply was refused, or the gates sent items back a second time ·
570
679
  `5` some task failed QA, the combined verification failed, or a task is still waiting for an
571
680
  answer or a decision · `6` integration conflict ·
572
681
  `8` **paused on an infrastructure failure** (`capacity`, `rate_limit`, `usage_limit`, `budget`,
573
682
  `auth`, `network`, `provider_down`, `empty` or `cancelled`; an old run may say `quota`): no
574
- attempt was spent and nothing was judged — fix a "needs you" cause, or run the same command again ·
683
+ attempt was spent and nothing was judged — fix a "needs you" cause, or run the same command again.
684
+ **`auto`:** the planner stopped on an infrastructure failure, and nothing was dispatched after it ·
575
685
  `130` **interrupted or stopped** (a signal, or `forge control stop`): the running tasks are
576
686
  `INTERRUPTED` and verification was skipped or stopped; the summary prints the `retry` for each.
577
687
 
688
+ `auto` also exits `0` when it stops at the approval table (or when the run exits 0), `2` for
689
+ its own usage (no planner, a plan dir that already has `tasks.tsv`, a bad flag, an unknown
690
+ or invalid profile), and otherwise with the exit of the preflight, of `plan`, or of `run`.
691
+ The full list is under [`auto`](#forge-parallelsh-auto).
692
+
693
+ ### Profile and --no-profile
694
+
695
+ `--profile NAME` and `--no-profile` are mutually exclusive. An unknown or invalid profile
696
+ exits 2 before anything is written. They apply on `plan` and on `forge-solo.sh`.
697
+
698
+ `plan` freezes the chosen profile into `<plan-dir>/profile.json`: `name`, `level` (`user`,
699
+ `repo` or `builtin`), `body`, `shadowed` (levels the winning copy hid), `frozen_at` (UTC,
700
+ `YYYY-MM-DDTHH:MM:SSZ`) and `overridden` (a sorted list of the dotted keys a flag of this
701
+ call replaced). The approval table prints:
702
+
703
+ ```
704
+ profile: NAME (LEVEL[, shadows LEVEL]) — flags override: KEY, KEY
705
+ ```
706
+
707
+ A flag of this call replaces just that value: the dwarf and qa pools, `--planner`,
708
+ `--shadow-qa`, `--shadow-rate`, `--explore`, `--fast` and `--qa-threshold`. A plain `--dwarf`
709
+ or `--qa` is that role's pool for every tier, so it replaces the profile's tier pools of the
710
+ role as well; a `--dwarf-<tier>` beside it still names that tier. What is not
711
+ overridden is applied as those flags would have been, including the plan files
712
+ `final_qa`, `escalate_after`, `escalate_effort`, `qa_threshold`, `timeout` and
713
+ `verify_retries`. QA stays `opus` when the profile names no reviewer pool. Gates and
714
+ budget stay in the frozen body and are exported as `FORGE_DECIDE_PROFILE_JSON`; daily
715
+ token and USD caps count only when `level` is `user`.
716
+
717
+ With neither flag, a plan that already has `profile.json` keeps it and does not apply it
718
+ again, except that its dwarf and qa pools fill the rows still unassigned (a plan its gates
719
+ sent back before routing); a pool a flag replaced stays replaced. A plan with no copy gets the default profile, if one is set. The runner does not
720
+ select `balanced` by itself. `--no-profile` removes `profile.json`. `routed.json` stays,
721
+ so a later profile can still tell a model routing wrote from one written by hand.
722
+
723
+ `run` and `retry` read three things from the frozen file when this invocation did not pass
724
+ the flag: `policy.retry_failed`, `policy.infra_retries`, and `routing.fractal_planner`
725
+ (the last only with `--fractal-auto-decompose` and no `--fractal-planner`). A flag of the
726
+ invocation wins, and those two retry budgets are not written back. `run`, `retry`,
727
+ `integrate`, `accept`, `review`, `split` and `attribute` export the frozen gates and
728
+ budget. `integrate` with no `--final-review`, when the profile names
729
+ `routing.final_reviewer`, reviews the whole run: the spec already in `final_qa` if that
730
+ file has one, else the profile's spec, and prints `final review: SPEC, from the plan's profile`.
731
+ The other routing and policy keys were copied into plan files when the profile was frozen.
732
+
733
+ Solo freezes the same file in the solo run dir. From a profile it takes the dwarf and the
734
+ qa at the medium tier, else the `any` tier, plus the QA threshold, the timeout and the
735
+ fast roles (`dwarf` and `qa` only) that no flag gave. Fractal tier pools, and
736
+ `routing.fractal_planner`, apply only when Fractal is on (the planner only with
737
+ `--fractal-auto-decompose` and no `--fractal-planner`). It prints the profile line before
738
+ it takes the run lock. It writes `profile.json` only under that lock, not on `--dry-run`,
739
+ and only when this call chose a new profile. With neither flag, a later run of the same
740
+ directory keeps the frozen copy. `--no-profile` removes it.
741
+
742
+ ### The fast tier
743
+
744
+ `--fast ROLES` names which roles ask dispatch for `--service-tier fast`. On `plan`,
745
+ `ROLES` is a comma list of `dwarf`, `qa`, `planner` and `review`, or `all`, or `none`.
746
+ On solo, only `dwarf`, `qa` or `none`: `planner`, `review` and `all` are refused. The
747
+ plan or run dir keeps them in `fast`, one role per line, in the order `dwarf`, `qa`,
748
+ `planner`, `review`. Omitting the flag on a re-plan keeps the file. `none` removes it.
749
+ Dispatch adds `--service-tier fast` only for a listed role. Specs never grow a `+fast`
750
+ suffix. `<role>.resolved` gains `service_tier=fast` only when it was asked.
751
+
752
+ The approval table, when `fast` is non-empty, prints:
753
+
754
+ ```
755
+ fast tier: ROLES — billed at a higher rate (codex service_tier=fast; claude fast mode needs extra usage enabled)
756
+ ```
757
+
758
+ It is billed at a higher rate. Codex and claude are the only harnesses that take it.
759
+ Claude's fast mode needs extra usage enabled; without it the CLI does not refuse, the run
760
+ stays at standard speed, exits 0, and forge prints `forge: claude ran at standard speed: fast mode is unavailable (REASON)`.
761
+ Codex can do the same when the tier is unsupported (EU data residency for GPT-6 models,
762
+ for example): it continues at the default tier, exits 0, and forge prints one note. The
763
+ note never changes the exit. openclaude, opencode, antigravity and grok are refused,
764
+ exit 3, before anything runs. Fractal dispatches ignore the file; forge prints `fast tier is not applied to Fractal dispatches` once. A whole-run review still asks.
765
+ `auto` forwards `--fast` to `plan`, and the planner dispatch uses the tier when `planner`
766
+ is a fast role. The per-harness command lines are in
767
+ [the fast service tier](../references/harnesses.md#fast-service-tier).
768
+
769
+ ### Collapse chains
770
+
771
+ `--collapse-chains` is a `plan` flag, this call only, and it is not kept. After the gates
772
+ (drift may have added files) and after the task rows are validated, a chain — two or more
773
+ tasks, every wave holding one — becomes one task. Routing then fills that task's `-`
774
+ columns. A plan whose shape is `one` or `branches` is not changed (`not collapsed: SHAPE`).
775
+ A plan that already has `tasks.precollapse.tsv` or `collapsed.json` is not an error. Any
776
+ other collapse failure stops `plan`.
777
+
778
+ The merged task is always id `combined`, deps `-`. Difficulty is the highest of the parts
779
+ (`low` < `medium` < `high`). Files are the union. Dwarf and qa are the value every part
780
+ shares, or `-` when they differ; routing fills a `-`, and a spec they all already named
781
+ is kept. The title is `N parts: FIRST TITLE`, cut at 100 characters. The prompt starts
782
+ "This task combines the N parts of a plan that could only run one after another…", then
783
+ `## Part i: TITLE (id)` with that part's headings demoted one level, then one
784
+ `## Acceptance criteria` with `### Part i: TITLE` and that part's criteria, or
785
+ `- (no criteria were written for this part)`. Approaches that exist become
786
+ `tasks/combined/approach.md` under `### Part i`.
787
+
788
+ The original `tasks.tsv` bytes are saved as `tasks.precollapse.tsv`. Each `tasks/<id>/`
789
+ moves to `tasks.precollapse/<id>/`. `collapsed.json` is `{from, into: "combined", shape}`
790
+ with `from` the ids in wave order and `shape` the `{shape, tasks, waves, widest}` of the
791
+ chain. The table announces a collapse only when this call did it:
792
+
793
+ ```
794
+ collapsed a sequential plan of N tasks into one (tasks.precollapse.tsv keeps the original)
795
+ ```
796
+
797
+ A chain left as a chain prints:
798
+
799
+ ```
800
+ this plan runs sequentially: N tasks, at most 1 in parallel; each pays its own implementation and review. One task would run once: re-plan with --collapse-chains
801
+ ```
802
+
803
+ `one` and `branches` say nothing. `plan-shape.json` (`shape` `one`, `chain` or `branches`,
804
+ plus `tasks`, `waves`, `widest`) is written at the end of `plan`. That write is advisory:
805
+ a failure is a note, and the table is still printed. `auto` passes `--collapse-chains`
806
+ unless `--no-collapse`.
807
+
808
+ ### `forge-parallel.sh auto`
809
+
810
+ From a goal to the approval table in one blocking command. The orchestrator's job is
811
+ mechanical, so a small model can drive it. A new plan dir only: one that already has
812
+ `tasks.tsv` exits 2. The goal is copied verbatim to `<plan-dir>/request.md`, `auto`
813
+ is written to `<plan-dir>/orchestrator`, and the request's first non-empty line (a heading's
814
+ `#` marks dropped) to `<plan-dir>/goal.txt`, unless that file already exists.
815
+
816
+ ```
817
+ forge-parallel.sh auto <plan-dir> --repo DIR --goal-file FILE [--planner SPEC]
818
+ [--decompose-level low|medium|high] [--plan auto|always|never]
819
+ [--one-task-difficulty low|medium|high] [--no-collapse] [--approved]
820
+ [plan flags...] [-- run flags...]
821
+ ```
822
+
823
+ A `--` splits the command. `auto` consumes `--goal-file`, `--plan`,
824
+ `--one-task-difficulty`, `--no-collapse` and `--approved`, and does not pass them to
825
+ `plan`. `--repo` starts the plan arguments. `--planner`, and `--decompose-level` when it
826
+ was set, are forwarded, as are `--profile`, `--no-profile`, `--fast` and `--no-ripwire`.
827
+ Every other flag before `--` goes to `plan`. Flags after `--` are `run` arguments only.
828
+ `auto` also adds `--collapse-chains` unless `--no-collapse`.
829
+
830
+ 1. **Gate.** `--plan auto` (the default) runs `forge-planner.py gate`, which prints
831
+ `one-task` when the request is at most 1500 characters and at most 6 requirements,
832
+ otherwise `plan`, and records `plan-gate.json` (`decision`, `signals` of `chars`,
833
+ `requirements` and `paths`, `thresholds`, `rule` `size`). `always` plans. `never` is
834
+ one task. The gate only skips the planner for a small goal: on the 16 plans of
835
+ benchmark #86, size did not predict shape.
836
+ 2. **One task.** `forge-planner.py one-task --difficulty`, from `--one-task-difficulty`
837
+ (default `medium`). No planner. The row is id `task`, deps `-`, files `.`, dwarf and
838
+ qa `-`, and the title is the request's first line, cut at 80 characters. The prompt is
839
+ the request plus one criterion: every requirement of the request is met, and the tests
840
+ for the files you changed pass.
841
+ 3. **Planning.** The spec is `--planner`, else `routing.planner` of the profile the plan
842
+ flags select. With neither, exit 2. `doctor` preflights that spec before any model
843
+ call. The planner is dispatched into the plan dir, with the fast tier when `planner`
844
+ is a fast role, and `forge-planner.py parse` reads the reply strictly.
845
+ 4. **`plan`**, with the forwarded flags and `--collapse-chains` unless `--no-collapse`.
846
+ When `plan` exits 4 and `plan.sendback.md` is non-empty, the planner is re-dispatched
847
+ once with that file appended, and `plan` runs again. A second send-back stops.
848
+ 5. **Without `--approved`:** exit 0 after printing the exact `run` command. Nothing is
849
+ dispatched after the planner. **With `--approved`** (the user's explicit
850
+ pre-approval): `run` with the flags after `--`, and `auto` exits with `run`'s code.
851
+
852
+ **Exit codes:** `0` stopped at the approval table, or the run's `0` · `2` usage (no
853
+ planner, a plan dir that already has `tasks.tsv`, a bad flag, an unknown or invalid
854
+ profile, a gate or one-task input error) · `3` precondition (`die`: not a git repository,
855
+ the plan dir could not be created) · `4` the planner failed (its dispatch exited neither
856
+ 0 nor 8), its reply was refused, or the plan gates sent items back a second time · `8`
857
+ the planner stopped on an infrastructure failure, and nothing was dispatched after it ·
858
+ otherwise the exit of the preflight, of `plan`, or of `run`.
859
+
578
860
  **`plan` and the plan-time gates.** With the `prompt` or `coverage` gate `on`, `plan` may send work
579
861
  back and exits `4` before it validates the tasks or prints the table. It writes `plan.sendback.md`,
580
862
  listing the task prompts a reviewer could not judge, and the requirements of `request.md` (the first
package/docs/models.md CHANGED
@@ -31,6 +31,59 @@ the wrong provider.
31
31
  stage entirely; `xhigh` reviews cost about twice as much as `high` ones for the same verdicts in
32
32
  the SWE-bench Pro benchmark (#89), so `high` is the default and `xhigh` is yours to ask for.
33
33
 
34
+ ## Recommended routing
35
+
36
+ What follows is measured, not a rule. It comes from benchmark #86 (SWE-bench Pro,
37
+ decomposed runs, every role on the claude harness), dated 2026-10-28. It will be
38
+ re-measured, and this table replaced, on the next benchmark round.
39
+
40
+ Measured over dwarf attempts across four decomposed runs. Times are model session times.
41
+
42
+ | Spec | Attempts | Mean time | Mean cost | Review outcome |
43
+ |---|---|---|---|---|
44
+ | `haiku:max` | 7 | 7.8 min | $0.25 | 7/7 passed first time; up to 5.1M tokens in one attempt |
45
+ | `haiku:xhigh` | 4 | 1.9 min | $0.02 | 4/4 passed first time |
46
+ | `sonnet:medium` | 15 (14 tasks) | 1.1 min | $0.14 | 13 passed first time, 1 on retry |
47
+ | `sonnet:high` | 5 | 3.3 min | $0.33 | 5/5 passed first time, including the high tasks of three HARD-51 problems |
48
+ | `sonnet:xhigh` | 2 | 3.6 min | $0.54 | 2/2 passed first time |
49
+ | `opus:high` | 2 (hard set, high tier) | 5.9 min | $1.13 | 2/2 passed first time |
50
+
51
+ What it says:
52
+
53
+ - `haiku:max` was the slowest dwarf in every run that used it, about 4x `haiku:xhigh`,
54
+ for no gain in pass rate.
55
+ - `sonnet:medium` is the workhorse: about a minute, $0.14, and enough for every medium
56
+ task.
57
+ - Above medium, `sonnet:high` held up even on HARD-51 high tasks, and `opus:high` is the
58
+ safer choice where a high task's failure costs a whole chain.
59
+ - Escalation never triggered: no task failed twice on one model.
60
+
61
+ The recommendation:
62
+
63
+ - Dwarfs: low `haiku:xhigh`, medium `sonnet:medium`, high `opus:high` (`sonnet:high` for a
64
+ cheaper run).
65
+ - Reviewers by difficulty: `sonnet:medium` / `sonnet:high` / `opus:high` (see #89).
66
+ - Planner: `sonnet:high`. In #86, `sonnet:xhigh` cost about what `opus:xhigh` did per plan
67
+ and was slower, and most of a planner's cost is exploring the repository.
68
+
69
+ ```
70
+ --dwarf-low haiku:xhigh --dwarf-medium sonnet:medium --dwarf-high opus:high --qa-low sonnet:medium --qa-medium sonnet:high --qa-high opus:high
71
+ ```
72
+
73
+ forge ships two built-in profiles carrying this routing, `balanced` and `lite` — `lite` is
74
+ the same with the high tier on `sonnet:high` for both dwarf and reviewer — both using
75
+ `--retry-failed 2 --escalate-after 2`; select one with `--profile balanced` (see
76
+ [commands.md](commands.md)), and `forge config profile show balanced` prints it.
77
+
78
+ | Profile | High tier (dwarf and reviewer) |
79
+ |---|---|
80
+ | `balanced` | `opus:high` |
81
+ | `lite` | `sonnet:high` |
82
+
83
+ forge notes a spec measurably slower than a lower effort of the same model with no gain
84
+ (today `haiku:max` against `haiku:xhigh`), in `doctor` and under the plan table, and never
85
+ changes the spec.
86
+
34
87
  ## Effort, ceilings and clamping
35
88
 
36
89
  Every harness has its own effort ladder:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giamme/forge",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "description": "Multi-model coding with a reviewer that reads the code: plan, build in parallel worktrees, review every real diff, merge only what passes.",
5
5
  "keywords": ["claude-code", "codex", "opencode", "agent-skill", "code-review", "multi-model"],
6
6
  "license": "MIT",