@giamme/forge 0.14.1 → 0.16.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 (81) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/SKILL.md +47 -14
  3. package/VERSION +1 -1
  4. package/docs/artifacts.md +1 -1
  5. package/docs/commands.md +302 -9
  6. package/docs/forge-ui.md +14 -0
  7. package/docs/memory.md +22 -0
  8. package/docs/models.md +53 -0
  9. package/docs/reviews.md +7 -0
  10. package/forge +11 -0
  11. package/package.json +1 -1
  12. package/references/dataset.md +16 -4
  13. package/references/decompose.md +154 -9
  14. package/references/harnesses.md +21 -1
  15. package/references/planning.md +59 -0
  16. package/references/solo.md +5 -1
  17. package/references/ui.md +48 -1
  18. package/scripts/forge-artifact.sh +53 -0
  19. package/scripts/forge-compare.py +6 -3
  20. package/scripts/forge-config.py +531 -4
  21. package/scripts/forge-contract.py +55 -8
  22. package/scripts/forge-control.py +0 -2
  23. package/scripts/forge-dispatch.sh +84 -14
  24. package/scripts/forge-fail-first.py +3 -1
  25. package/scripts/forge-guard.py +247 -8
  26. package/scripts/forge-issues.py +12 -0
  27. package/scripts/forge-lib-adopt.sh +260 -0
  28. package/scripts/forge-lib-attribute.sh +10 -2
  29. package/scripts/forge-lib-plans.sh +35 -6
  30. package/scripts/forge-lib-review.sh +13 -5
  31. package/scripts/forge-lib-task.sh +138 -5
  32. package/scripts/forge-memory.sh +41 -4
  33. package/scripts/forge-metrics.sh +7 -0
  34. package/scripts/forge-parallel-options.sh +12 -6
  35. package/scripts/forge-parallel.sh +659 -32
  36. package/scripts/forge-plan-check.py +591 -8
  37. package/scripts/forge-planner.py +480 -0
  38. package/scripts/forge-route.py +16 -2
  39. package/scripts/forge-runs-rm.py +23 -7
  40. package/scripts/forge-runtime.py +111 -2
  41. package/scripts/forge-schedule.py +5 -2
  42. package/scripts/forge-shadow.py +53 -7
  43. package/scripts/forge-solo.sh +87 -7
  44. package/scripts/forge_dataset/cli.py +26 -0
  45. package/scripts/forge_dataset/efforts.py +215 -0
  46. package/scripts/forge_dataset/export.py +1 -0
  47. package/scripts/forge_dataset/harvest.py +55 -0
  48. package/scripts/forge_dataset/history.py +126 -0
  49. package/scripts/forge_dataset/worktrees.py +95 -0
  50. package/scripts/forge_decide/__init__.py +19 -1
  51. package/scripts/forge_decide/builtin_profiles.json +25 -0
  52. package/scripts/forge_decide/cli.py +12 -0
  53. package/scripts/forge_decide/profiles.py +866 -0
  54. package/scripts/forge_decide/resolve.py +38 -6
  55. package/scripts/forge_memory_list.py +153 -0
  56. package/scripts/forge_worktrees.py +88 -0
  57. package/ui/README.md +31 -0
  58. package/ui/docs/api.md +168 -12
  59. package/ui/forge_ui/__init__.py +14 -1
  60. package/ui/forge_ui/__main__.py +1 -1
  61. package/ui/forge_ui/control.py +250 -12
  62. package/ui/forge_ui/executions.py +28 -8
  63. package/ui/forge_ui/findings.py +7 -0
  64. package/ui/forge_ui/models.py +60 -1
  65. package/ui/forge_ui/projects.py +571 -0
  66. package/ui/forge_ui/reader.py +48 -8
  67. package/ui/forge_ui/static/app.js +99 -21
  68. package/ui/forge_ui/static/cloudui.js +6 -2
  69. package/ui/forge_ui/static/convo.js +1 -1
  70. package/ui/forge_ui/static/diffview.js +2 -2
  71. package/ui/forge_ui/static/files.js +1 -1
  72. package/ui/forge_ui/static/index.html +5 -1
  73. package/ui/forge_ui/static/leaderboard.js +5 -1
  74. package/ui/forge_ui/static/modelstats.js +25 -1
  75. package/ui/forge_ui/static/panel.js +47 -4
  76. package/ui/forge_ui/static/projectsview.js +372 -0
  77. package/ui/forge_ui/static/settings.js +924 -29
  78. package/ui/forge_ui/static/style.css +116 -3
  79. package/ui/forge_ui/static/uikit.js +94 -1
  80. package/ui/forge_ui/static/worktreesview.js +250 -0
  81. package/ui/forge_ui/worktrees.py +570 -0
package/docs/commands.md CHANGED
@@ -18,10 +18,12 @@ 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) |
24
25
  | `forge runs compare RUN_A RUN_B [--json] [--no-record]` | two runs of one plan, side by side, per task; records the pair in the dataset |
26
+ | `forge memory show\|learnings\|prune\|spend REPO …` | a repository's project memory; `learnings REPO --json` lists every learning in its ledger with what forge does with it (`in_memory`, `waiting` for a second run, `stale`, `capped`, `muted`), from forge-memory.sh's own rebuild, without changing the repository. See [project memory](memory.md) |
25
27
  | `forge issues RUN [--apply] …` | file the review findings a run left open as GitHub issues; see [below](#forge-issues) |
26
28
  | `forge pr [RUN_DIR \| --repo DIR] [--texts] [--paths] [--out FILE] [--create [--base B] [--head B]]` | a draft pull-request description for a finished run, on stdout; `--create` opens it as a draft PR with `gh`; see [below](#forge-pr) |
27
29
  | `forge ui open\|status\|stop` | forge-ui, the run viewer; see [the command group](forge-ui.md#forge-ui-command-group) |
@@ -79,7 +81,9 @@ solo run), so a run started meanwhile fails to start instead of racing the delet
79
81
 
80
82
  What counts as the run's is decided from the run id, not read from the run directory: a worktree
81
83
  under `<repo>/../.forge-worktrees/<run id>/` on `forge/<run id>/<task>` or
82
- `forge/<run id>-integration`. Any other worktree there is `foreign`, one with uncommitted changes
84
+ `forge/<run id>-integration`, or a detached scratch worktree forge left there (`_candidate-<n>` from
85
+ `integrate`, `_attribute[-<n>]` from `attribute`). forge-ui's Worktrees screen uses the same rule
86
+ (`scripts/forge_worktrees.py`). Any other worktree there is `foreign`, one with uncommitted changes
83
87
  is `dirty`; neither is touched, and a dirty one keeps the run directory only when `--worktrees`
84
88
  was asked. Branches are reported
85
89
  `merged` or `UNMERGED`, so you see what deleting them would lose. `--dry-run` changes nothing and
@@ -181,7 +185,7 @@ request cache) is in [Measuring a gate](../references/decision-models.md#measuri
181
185
  | Command | Does |
182
186
  |---|---|
183
187
  | `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)) |
188
+ | `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
189
  | `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
190
  | `provider list [--json]` | configured providers |
187
191
  | `provider rm N` | remove a provider no gate uses, and the `keys/<N>.key` it wrote |
@@ -204,6 +208,77 @@ a bare `budget`, `status` and `doctor` do not.
204
208
  `forge jev` is the deprecated alias, kept for one release. `setup`, `sites`, `enable`,
205
209
  `disable`, `status` and `doctor` print the `forge decide` command and then run the old one.
206
210
 
211
+ ### `forge config profile`
212
+
213
+ A profile is a named bundle of routing, policy, gates and budget, stored in `decide.json`.
214
+ One name resolves user, then repo, then built-in: a user profile hides a repo profile of
215
+ the same name, which hides a built-in. The built-ins `balanced` and `lite` are read-only
216
+ and carry the [recommended routing](models.md#recommended-routing). `forge config profile
217
+ show balanced` prints `balanced`; `lite` is the same routing with the high tier on
218
+ `sonnet:high` for both dwarf and reviewer.
219
+
220
+ ```
221
+ forge config profile list [--repo DIR] [--json]
222
+ forge config profile show NAME [--repo DIR] [--json]
223
+ forge config profile create NAME (--from OTHER | --from-run PLAN | --file F) [--repo DIR] [--json]
224
+ forge config profile edit NAME --file F [--repo DIR] [--json]
225
+ forge config profile set NAME KEY VALUE [--repo DIR] [--json]
226
+ forge config profile unset NAME KEY [--repo DIR] [--json]
227
+ forge config profile rm NAME [--repo DIR] [--json]
228
+ forge config profile use NAME [--repo DIR] [--json]
229
+ forge config profile use --none [--repo DIR] [--json]
230
+ ```
231
+
232
+ Without `--repo` the command reads and writes the user file,
233
+ `${XDG_CONFIG_HOME:-~/.config}/forge/decide.json`, and `list` and `show` see that file plus
234
+ the built-ins. `--repo DIR` uses `<repo>/.forge/decide.json`. A repo-only profile is not
235
+ visible, and cannot be copied, without `--repo`.
236
+
237
+ The effective default is the user file's `default_profile`, else the repo file's. A user
238
+ default hides a repo default even when `--repo` is passed. `use --none` clears
239
+ `default_profile` only in the file that command writes, so clearing the user default
240
+ reveals a repo default.
241
+
242
+ A name is 1–64 characters of letters, digits, `.`, `_` or `-`, and starts with a letter or
243
+ a digit.
244
+
245
+ | Subcommand | Does |
246
+ |---|---|
247
+ | `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 |
248
+ | `show NAME` | the winning body, its level, what it shadows, and whether it is the default. `--json` adds `body` |
249
+ | `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 |
250
+ | `edit NAME --file F` | replace the body stored at this level. `-` reads stdin |
251
+ | `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 |
252
+ | `unset NAME KEY` | remove that key. An empty section is dropped |
253
+ | `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) |
254
+ | `use NAME` | write `default_profile` at this level, after the body validates |
255
+ | `use --none` | clear `default_profile` at this level |
256
+
257
+ `set` and `unset` accept `routing.dwarf.<tier>`, `routing.qa.<tier>` (`tier` is `any`,
258
+ `low`, `medium` or `high`), `routing.planner`, `routing.fractal_planner`,
259
+ `routing.final_reviewer`, `routing.escalate_after`, `routing.escalate_effort`,
260
+ `policy.qa_threshold`, `policy.retry_failed`, `policy.infra_retries`,
261
+ `policy.verify_retries`, `policy.timeout`, `policy.explore`, `policy.shadow_rate`,
262
+ `policy.shadow_qa` and `policy.fast`. Gates and budget are not dotted keys: put them in
263
+ the JSON body with `create` or `edit`. Unknown keys inside `routing` or `policy` are
264
+ refused. Unknown top-level keys of a body are kept and ignored.
265
+
266
+ A built-in with no copy of its own cannot be edited, set, unset or removed:
267
+
268
+ ```
269
+ built-in profile 'NAME' is read-only; copy it: forge config profile create NAME --from NAME
270
+ ```
271
+
272
+ A user or repo copy of that name is what those commands change. `edit`, `set`, `unset` and
273
+ `rm` without `--repo` change the user file only.
274
+
275
+ On success, `create`, `edit`, `set`, `unset`, `rm` and `use` print `profile NAME: ACTION (LEVEL)`.
276
+ `use --none` prints `profile none: cleared (LEVEL)`. With `--json` that is
277
+ `{"ok": true, "name", "level", "body"}` (`name` is null for `use --none`). On error,
278
+ `--json` also prints `{"ok": false, "error": "..."}`. Exit 2 on
279
+ 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`,
280
+ which writes that profile's gates and refuses `gate on` with exit 3.
281
+
207
282
  Run flags, on `forge-solo.sh` and `forge-parallel.sh plan`, are frozen in `jev-selection.json`.
208
283
  A re-plan replaces the file. Solo again on the same run dir keeps it. When the file exists,
209
284
  `run` and `retry` keep it and say so when flags are passed again. A plan with no selection
@@ -221,6 +296,7 @@ file takes the flags on `run` or `retry` and freezes them then.
221
296
  /forge "<goal>" --dwarf <alias>[:<effort>[:<harness>]]
222
297
  [--qa <alias>[:<effort>[:<harness>]]]
223
298
  [--planner <alias>[:<effort>[:<harness>]]]
299
+ [--profile <name> | --no-profile] [--fast <roles>]
224
300
  [--yolo-dwarf] [--yolo-qa] [--repo <dir>] [--native-review]
225
301
  [--no-memory] [--gate NAME=MODE[,...]] [--no-gates]
226
302
  [--decide-budget tokens=N[,usd=X]]
@@ -228,7 +304,8 @@ file takes the flags on `run` or `retry` and freezes them then.
228
304
  [--fractal-auto-decompose] [--fractal-planner <spec>]
229
305
  [--fractal-depth <n>] [--fractal-children <n>] [--fractal-nodes <n>]
230
306
  [--fractal-iterations <n>] [--fractal-concurrency <n>] [--fractal-deadline <s>]
231
- [--decompose-level low|medium|high] [--max-parallel <n>]
307
+ [--decompose-level low|medium|high] [--collapse-chains]
308
+ [--plan auto|always|never] [--max-parallel <n>]
232
309
  [--dwarf-high <spec>] [--dwarf-medium <spec>] [--dwarf-low <spec>]
233
310
  [--qa-high <spec>] [--qa-medium <spec>] [--qa-low <spec>]
234
311
  ```
@@ -237,7 +314,10 @@ file takes the flags on `run` or `retry` and freezes them then.
237
314
  |---|---|---|
238
315
  | `--dwarf <spec>` | *asks* | the model that implements the change |
239
316
  | `--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` |
317
+ | `--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) |
318
+ | `--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) |
319
+ | `--no-profile` | — | use no profile, and remove a frozen copy |
320
+ | `--fast <roles>` | off | fast service tier for those roles. Opt-in. See [below](#the-fast-tier) |
241
321
  | `--no-memory` | memory on | write and inject nothing in `.forge/` |
242
322
  | `--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
323
  | `--no-gates` | gates as configured | every decision-model gate off for this run |
@@ -248,6 +328,8 @@ file takes the flags on `run` or `retry` and freezes them then.
248
328
  | `--repo <dir>` | cwd | repository to work in |
249
329
  | `--native-review` | off | use native Codex review against the recorded baseline instead of an inlined diff |
250
330
  | `--decompose-level <l>` | off | split the goal into parallel tasks |
331
+ | `--collapse-chains` | off; on inside `auto` unless `--no-collapse` | this `plan` only: merge a sequential chain into one task. See [below](#collapse-chains) |
332
+ | `--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
333
  | `--max-parallel <n>` | `3` | concurrent task pipelines |
252
334
  | `--dwarf-high/-medium/-low` | — | per-difficulty routing; comma-list pools models |
253
335
  | `--qa-high/-medium/-low` | — | same, for reviewers |
@@ -330,7 +412,7 @@ Resolves a spec into a real CLI invocation and runs it. Needs only bash and core
330
412
  is the point: it behaves identically no matter which harness is orchestrating.
331
413
 
332
414
  ```
333
- forge-dispatch.sh doctor
415
+ forge-dispatch.sh doctor --spec <spec> [--role dwarf|qa|planner] [--service-tier fast]
334
416
  forge-dispatch.sh dwarf <spec> --prompt-file <f> [--repo <dir>] [--run-dir <d>] [--yolo] [--dry-run]
335
417
  forge-dispatch.sh qa <spec> --prompt-file <f> [--repo <dir>] [--run-dir <d>] [--yolo] [--dry-run]
336
418
  [--native-review [--review-base <ref>]]
@@ -342,6 +424,19 @@ forge-dispatch.sh efforts --spec <spec>
342
424
  when the pairing has no effort dial); a literal model id with a harness takes that harness's
343
425
  whole ladder. It never dispatches and spends no quota. The retry policy's effort step reads it.
344
426
 
427
+ **Slow-effort note.** `doctor --spec` may also print one line on stderr, `forge: note: …`.
428
+ It is not part of the resolved block, a plain dispatch does not print it, and it never
429
+ changes the spec or the exit code. `plan` prints the same note under the table, once per
430
+ distinct dwarf or qa spec (`forge-dataset.py slow-notes`). The dataset supplies the note
431
+ when it is on and both this effort and a lower effort of the same model have at least five
432
+ first attempts: the nearest lower effort this one is at least twice as slow as, with a
433
+ first-try pass rate no better. A nearer pair with enough data that fails the rule does not
434
+ hide a farther pair that meets it. When some pair has enough data and none meet the rule,
435
+ there is no note: measured pairs override the built-in row. Otherwise the built-in row is
436
+ `haiku:max` against `haiku:xhigh` on claude's model (#86, 2026-10-28). openclaude's haiku is
437
+ that same model, so the row matches it; opencode's haiku does not. The line is
438
+ `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.`
439
+
345
440
  | Option | Meaning |
346
441
  |---|---|
347
442
  | `--prompt-file <f>` | file holding the prompt (required for `dwarf`/`qa`) |
@@ -353,6 +448,7 @@ whole ladder. It never dispatches and spends no quota. The retry policy's effort
353
448
  | `--review-base <ref>` | qa only; base ref for the native review |
354
449
  | `--agy-timeout <s>` | antigravity `--print-timeout` (long runs need this raised) |
355
450
  | `--timeout <s>` | kill this dispatch after `<s>` seconds; `0` disables. See the precedence below |
451
+ | `--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
452
 
357
453
  **Exit codes:** `0` ok · `2` spec or usage error · `3` harness missing or unusable ·
358
454
  `4` the backend ran and failed · `7` the backend hit its timeout and was killed (unless it had
@@ -395,7 +491,12 @@ quietly swapping backends hides the fact that the one you picked is broken.
395
491
  **Process hygiene.** Unless `FORGE_ORPHAN_GUARD=off` (or the run is a Fractal one), the harness
396
492
  is started in its own session, and after it exits any process still alive in that session is
397
493
  listed in `<role>.orphans` and stopped, so a backgrounded measurement cannot outlive the
398
- dispatch. The timeout watchdog and the exit trap signal the whole session too.
494
+ dispatch. The timeout watchdog and the exit trap signal the whole session too. A tool that leaves
495
+ that session (a test runner's web server started in a session of its own) is still the harness's
496
+ descendant: forge samples the harness's descendants every 2 s while it runs, and stops those
497
+ still alive, with their children, after a timeout or exit as well. A process that double-forks
498
+ away within those 2 s is not seen. A standalone `retry` that gets a TERM or Ctrl-C stops
499
+ everything it dispatched the same way before it exits (`143`).
399
500
 
400
501
  **Log clock.** Beside the log, `<role>.clock` records when it grew (one `<epoch> <bytes>` line for
401
502
  each second it did), so forge-ui can time the commands of a harness that logs no times (codex,
@@ -422,10 +523,16 @@ forge-solo.sh <run-dir> --repo <dir> --dwarf <spec> [--qa <spec>]
422
523
  [--native-review] [--no-memory] [--timeout <s>] [--dry-run] [--ui | --no-ui]
423
524
  [--gate NAME=MODE[,...]] [--no-gates] [--decide-budget tokens=N[,usd=X]]
424
525
  [--fail-first] [--qa-threshold P0|P1|P2|P3|none]
526
+ [--fast dwarf|qa|none] [--profile NAME | --no-profile]
425
527
  [--fractal | --no-fractal] [--fractal-<limit> <n>]
426
528
  [--dwarf-low <pool>] [--dwarf-medium <pool>] [--dwarf-high <pool>] [--retry]
427
529
  ```
428
530
 
531
+ `--profile` and `--fast` are the same flags as on `plan`, with two solo limits: `--fast`
532
+ accepts only `dwarf`, `qa` or `none` (`planner`, `review` and `all` are refused), and the
533
+ profile's dwarf and qa are its medium pool, else its `any` pool. See
534
+ [profiles on a run](#profile-and---no-profile) and [the fast tier](#the-fast-tier).
535
+
429
536
  `--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
537
 
431
538
  You write two files into the run directory; forge does the rest:
@@ -499,7 +606,12 @@ forge-parallel.sh plan <plan-dir> --repo <dir> [routing flags] [--planner <
499
606
  [--explore E] [--ui | --no-ui] [--fail-first | --no-fail-first]
500
607
  [--pre-review-tests | --no-pre-review-tests] [--pre-review-parallel N]
501
608
  [--qa-threshold P0|P1|P2|P3|none|default]
609
+ [--profile NAME | --no-profile] [--fast ROLES] [--collapse-chains]
502
610
  [--max-attempts N] [--converge-window N] [--no-infra-fallback]
611
+ forge-parallel.sh auto <plan-dir> --repo <dir> --goal-file <file> [--planner <spec>]
612
+ [--decompose-level L] [--plan auto|always|never]
613
+ [--one-task-difficulty low|medium|high]
614
+ [--no-collapse] [--approved] [plan flags...] [-- run flags...]
503
615
  forge-parallel.sh run <plan-dir> [--max-parallel N] [--yolo-dwarf] [--yolo-qa] [--dry-run]
504
616
  [--verify <cmd> | --verify-lane 'name[opts]=cmd' ...]
505
617
  [--verify-parallel N] [--setup <cmd>] [--timeout S]
@@ -517,6 +629,7 @@ forge-parallel.sh retry <plan-dir> <task-id> [--dwarf <spec>] [--answer <tex
517
629
  [--verify <cmd> | --verify-lane 'name[opts]=cmd' ...] [--verify-parallel N]
518
630
  [--escalate-after N] [--escalate-effort | --no-escalate-effort]
519
631
  forge-parallel.sh accept <plan-dir> <task-id> --reason "<why>" --approved
632
+ forge-parallel.sh adopt <plan-dir> <commit|a..b> | --head --reason "<why>" [--qa <spec>] [--yolo-qa] [--approved]
520
633
  forge-parallel.sh review <plan-dir> [--qa <spec>] [--yolo-qa] [--qa-threshold P0|P1|P2|P3|none|default]
521
634
  forge-parallel.sh attribute <plan-dir> [--force]
522
635
  forge-parallel.sh integrate <plan-dir> --approved [--final-review <qa-spec>] [--verify-retries N]
@@ -528,6 +641,7 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
528
641
  | Subcommand | Does |
529
642
  |---|---|
530
643
  | `plan` | validate `tasks.tsv`, resolve difficulty → concrete dwarf/qa specs, compute waves, render the approval table |
644
+ | `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
645
  | `run` | schedule ready tasks; per task: worktree → dwarf → diff → QA → status; merge passing tasks onto the integration branch |
532
646
  | `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
647
  | `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 +678,194 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
564
678
  | `--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
679
  | `--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
680
  | `--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) |
681
+ | `--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) |
682
+ | `--no-profile` | plan | removes `profile.json` | no profile. `routed.json` stays |
683
+ | `--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) |
684
+ | `--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
685
 
568
686
  **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) ·
687
+ `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
688
  `5` some task failed QA, the combined verification failed, or a task is still waiting for an
571
689
  answer or a decision · `6` integration conflict ·
572
690
  `8` **paused on an infrastructure failure** (`capacity`, `rate_limit`, `usage_limit`, `budget`,
573
691
  `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 ·
692
+ attempt was spent and nothing was judged — fix a "needs you" cause, or run the same command again.
693
+ **`auto`:** the planner stopped on an infrastructure failure, and nothing was dispatched after it ·
575
694
  `130` **interrupted or stopped** (a signal, or `forge control stop`): the running tasks are
576
695
  `INTERRUPTED` and verification was skipped or stopped; the summary prints the `retry` for each.
577
696
 
697
+ `auto` also exits `0` when it stops at the approval table (or when the run exits 0), `2` for
698
+ its own usage (no planner, a plan dir that already has `tasks.tsv`, a bad flag, an unknown
699
+ or invalid profile), and otherwise with the exit of the preflight, of `plan`, or of `run`.
700
+ The full list is under [`auto`](#forge-parallelsh-auto).
701
+
702
+ ### Profile and --no-profile
703
+
704
+ `--profile NAME` and `--no-profile` are mutually exclusive. An unknown or invalid profile
705
+ exits 2 before anything is written. They apply on `plan` and on `forge-solo.sh`.
706
+
707
+ `plan` freezes the chosen profile into `<plan-dir>/profile.json`: `name`, `level` (`user`,
708
+ `repo` or `builtin`), `body`, `shadowed` (levels the winning copy hid), `frozen_at` (UTC,
709
+ `YYYY-MM-DDTHH:MM:SSZ`) and `overridden` (a sorted list of the dotted keys a flag of this
710
+ call replaced). The approval table prints:
711
+
712
+ ```
713
+ profile: NAME (LEVEL[, shadows LEVEL]) — flags override: KEY, KEY
714
+ ```
715
+
716
+ A flag of this call replaces just that value: the dwarf and qa pools, `--planner`,
717
+ `--shadow-qa`, `--shadow-rate`, `--explore`, `--fast` and `--qa-threshold`. A plain `--dwarf`
718
+ or `--qa` is that role's pool for every tier, so it replaces the profile's tier pools of the
719
+ role as well; a `--dwarf-<tier>` beside it still names that tier. What is not
720
+ overridden is applied as those flags would have been, including the plan files
721
+ `final_qa`, `escalate_after`, `escalate_effort`, `qa_threshold`, `timeout` and
722
+ `verify_retries`. QA stays `opus` when the profile names no reviewer pool. Gates and
723
+ budget stay in the frozen body and are exported as `FORGE_DECIDE_PROFILE_JSON`; daily
724
+ token and USD caps count only when `level` is `user`.
725
+
726
+ With neither flag, a plan that already has `profile.json` keeps it and does not apply it
727
+ again, except that its dwarf and qa pools fill the rows still unassigned (a plan its gates
728
+ 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
729
+ select `balanced` by itself. `--no-profile` removes `profile.json`. `routed.json` stays,
730
+ so a later profile can still tell a model routing wrote from one written by hand.
731
+
732
+ `run` and `retry` read three things from the frozen file when this invocation did not pass
733
+ the flag: `policy.retry_failed`, `policy.infra_retries`, and `routing.fractal_planner`
734
+ (the last only with `--fractal-auto-decompose` and no `--fractal-planner`). A flag of the
735
+ invocation wins, and those two retry budgets are not written back. `run`, `retry`,
736
+ `integrate`, `accept`, `review`, `split` and `attribute` export the frozen gates and
737
+ budget. `integrate` with no `--final-review`, when the profile names
738
+ `routing.final_reviewer`, reviews the whole run: the spec already in `final_qa` if that
739
+ file has one, else the profile's spec, and prints `final review: SPEC, from the plan's profile`.
740
+ The other routing and policy keys were copied into plan files when the profile was frozen.
741
+
742
+ Solo freezes the same file in the solo run dir. From a profile it takes the dwarf and the
743
+ qa at the medium tier, else the `any` tier, plus the QA threshold, the timeout and the
744
+ fast roles (`dwarf` and `qa` only) that no flag gave. Fractal tier pools, and
745
+ `routing.fractal_planner`, apply only when Fractal is on (the planner only with
746
+ `--fractal-auto-decompose` and no `--fractal-planner`). It prints the profile line before
747
+ it takes the run lock. It writes `profile.json` only under that lock, not on `--dry-run`,
748
+ and only when this call chose a new profile. With neither flag, a later run of the same
749
+ directory keeps the frozen copy. `--no-profile` removes it.
750
+
751
+ ### The fast tier
752
+
753
+ `--fast ROLES` names which roles ask dispatch for `--service-tier fast`. On `plan`,
754
+ `ROLES` is a comma list of `dwarf`, `qa`, `planner` and `review`, or `all`, or `none`.
755
+ On solo, only `dwarf`, `qa` or `none`: `planner`, `review` and `all` are refused. The
756
+ plan or run dir keeps them in `fast`, one role per line, in the order `dwarf`, `qa`,
757
+ `planner`, `review`. Omitting the flag on a re-plan keeps the file. `none` removes it.
758
+ Dispatch adds `--service-tier fast` only for a listed role. Specs never grow a `+fast`
759
+ suffix. `<role>.resolved` gains `service_tier=fast` only when it was asked.
760
+
761
+ The approval table, when `fast` is non-empty, prints:
762
+
763
+ ```
764
+ fast tier: ROLES — billed at a higher rate (codex service_tier=fast; claude fast mode needs extra usage enabled)
765
+ ```
766
+
767
+ It is billed at a higher rate. Codex and claude are the only harnesses that take it.
768
+ Claude's fast mode needs extra usage enabled; without it the CLI does not refuse, the run
769
+ stays at standard speed, exits 0, and forge prints `forge: claude ran at standard speed: fast mode is unavailable (REASON)`.
770
+ Codex can do the same when the tier is unsupported (EU data residency for GPT-6 models,
771
+ for example): it continues at the default tier, exits 0, and forge prints one note. The
772
+ note never changes the exit. openclaude, opencode, antigravity and grok are refused,
773
+ 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.
774
+ `auto` forwards `--fast` to `plan`, and the planner dispatch uses the tier when `planner`
775
+ is a fast role. The per-harness command lines are in
776
+ [the fast service tier](../references/harnesses.md#fast-service-tier).
777
+
778
+ ### Collapse chains
779
+
780
+ `--collapse-chains` is a `plan` flag, this call only, and it is not kept. After the gates
781
+ (drift may have added files) and after the task rows are validated, a chain — two or more
782
+ tasks, every wave holding one — becomes one task. Routing then fills that task's `-`
783
+ columns. A plan whose shape is `one` or `branches` is not changed (`not collapsed: SHAPE`).
784
+ A plan that already has `tasks.precollapse.tsv` or `collapsed.json` is not an error. Any
785
+ other collapse failure stops `plan`.
786
+
787
+ The merged task is always id `combined`, deps `-`. Difficulty is the highest of the parts
788
+ (`low` < `medium` < `high`). Files are the union. Dwarf and qa are the value every part
789
+ shares, or `-` when they differ; routing fills a `-`, and a spec they all already named
790
+ is kept. The title is `N parts: FIRST TITLE`, cut at 100 characters. The prompt starts
791
+ "This task combines the N parts of a plan that could only run one after another…", then
792
+ `## Part i: TITLE (id)` with that part's headings demoted one level, then one
793
+ `## Acceptance criteria` with `### Part i: TITLE` and that part's criteria, or
794
+ `- (no criteria were written for this part)`. Approaches that exist become
795
+ `tasks/combined/approach.md` under `### Part i`.
796
+
797
+ The original `tasks.tsv` bytes are saved as `tasks.precollapse.tsv`. Each `tasks/<id>/`
798
+ moves to `tasks.precollapse/<id>/`. `collapsed.json` is `{from, into: "combined", shape}`
799
+ with `from` the ids in wave order and `shape` the `{shape, tasks, waves, widest}` of the
800
+ chain. The table announces a collapse only when this call did it:
801
+
802
+ ```
803
+ collapsed a sequential plan of N tasks into one (tasks.precollapse.tsv keeps the original)
804
+ ```
805
+
806
+ A chain left as a chain prints:
807
+
808
+ ```
809
+ 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
810
+ ```
811
+
812
+ `one` and `branches` say nothing. `plan-shape.json` (`shape` `one`, `chain` or `branches`,
813
+ plus `tasks`, `waves`, `widest`) is written at the end of `plan`. That write is advisory:
814
+ a failure is a note, and the table is still printed. `auto` passes `--collapse-chains`
815
+ unless `--no-collapse`.
816
+
817
+ ### `forge-parallel.sh auto`
818
+
819
+ From a goal to the approval table in one blocking command. The orchestrator's job is
820
+ mechanical, so a small model can drive it. A new plan dir only: one that already has
821
+ `tasks.tsv` exits 2. The goal is copied verbatim to `<plan-dir>/request.md`, `auto`
822
+ is written to `<plan-dir>/orchestrator`, and the request's first non-empty line (a heading's
823
+ `#` marks dropped) to `<plan-dir>/goal.txt`, unless that file already exists.
824
+
825
+ ```
826
+ forge-parallel.sh auto <plan-dir> --repo DIR --goal-file FILE [--planner SPEC]
827
+ [--decompose-level low|medium|high] [--plan auto|always|never]
828
+ [--one-task-difficulty low|medium|high] [--no-collapse] [--approved]
829
+ [plan flags...] [-- run flags...]
830
+ ```
831
+
832
+ A `--` splits the command. `auto` consumes `--goal-file`, `--plan`,
833
+ `--one-task-difficulty`, `--no-collapse` and `--approved`, and does not pass them to
834
+ `plan`. `--repo` starts the plan arguments. `--planner`, and `--decompose-level` when it
835
+ was set, are forwarded, as are `--profile`, `--no-profile`, `--fast` and `--no-ripwire`.
836
+ Every other flag before `--` goes to `plan`. Flags after `--` are `run` arguments only.
837
+ `auto` also adds `--collapse-chains` unless `--no-collapse`.
838
+
839
+ 1. **Gate.** `--plan auto` (the default) runs `forge-planner.py gate`, which prints
840
+ `one-task` when the request is at most 1500 characters and at most 6 requirements,
841
+ otherwise `plan`, and records `plan-gate.json` (`decision`, `signals` of `chars`,
842
+ `requirements` and `paths`, `thresholds`, `rule` `size`). `always` plans. `never` is
843
+ one task. The gate only skips the planner for a small goal: on the 16 plans of
844
+ benchmark #86, size did not predict shape.
845
+ 2. **One task.** `forge-planner.py one-task --difficulty`, from `--one-task-difficulty`
846
+ (default `medium`). No planner. The row is id `task`, deps `-`, files `.`, dwarf and
847
+ qa `-`, and the title is the request's first line, cut at 80 characters. The prompt is
848
+ the request plus one criterion: every requirement of the request is met, and the tests
849
+ for the files you changed pass.
850
+ 3. **Planning.** The spec is `--planner`, else `routing.planner` of the profile the plan
851
+ flags select. With neither, exit 2. `doctor` preflights that spec before any model
852
+ call. The planner is dispatched into the plan dir, with the fast tier when `planner`
853
+ is a fast role, and `forge-planner.py parse` reads the reply strictly.
854
+ 4. **`plan`**, with the forwarded flags and `--collapse-chains` unless `--no-collapse`.
855
+ When `plan` exits 4 and `plan.sendback.md` is non-empty, the planner is re-dispatched
856
+ once with that file appended, and `plan` runs again. A second send-back stops.
857
+ 5. **Without `--approved`:** exit 0 after printing the exact `run` command. Nothing is
858
+ dispatched after the planner. **With `--approved`** (the user's explicit
859
+ pre-approval): `run` with the flags after `--`, and `auto` exits with `run`'s code.
860
+
861
+ **Exit codes:** `0` stopped at the approval table, or the run's `0` · `2` usage (no
862
+ planner, a plan dir that already has `tasks.tsv`, a bad flag, an unknown or invalid
863
+ profile, a gate or one-task input error) · `3` precondition (`die`: not a git repository,
864
+ the plan dir could not be created) · `4` the planner failed (its dispatch exited neither
865
+ 0 nor 8), its reply was refused, or the plan gates sent items back a second time · `8`
866
+ the planner stopped on an infrastructure failure, and nothing was dispatched after it ·
867
+ otherwise the exit of the preflight, of `plan`, or of `run`.
868
+
578
869
  **`plan` and the plan-time gates.** With the `prompt` or `coverage` gate `on`, `plan` may send work
579
870
  back and exits `4` before it validates the tasks or prints the table. It writes `plan.sendback.md`,
580
871
  listing the task prompts a reviewer could not judge, and the requirements of `request.md` (the first
@@ -643,7 +934,9 @@ model, or the task has spent its attempt cap (`plan --max-attempts N`, default 8
643
934
  the `retry` and `accept` commands are in `tasks/<id>/decision.md`. The run summary lists them under
644
935
  `waiting for your decision:`. Neither a later `run`, `--retry-failed`, a retry budget nor a pin
645
936
  resumes that same task. Only `retry <plan> <id> --decide retry=N` or `--decide threshold=Pn`, or
646
- `--dwarf <spec>`, each with `--reason "…" --approved`, or `accept`, does. Replacing it is a hand
937
+ `--dwarf <spec>`, or `--decide` and `--dwarf` together, each with `--reason "…" --approved`, or
938
+ `accept`, does. To resume several at once, add `--no-dispatch` to each `retry`, which records the
939
+ decision and starts nothing, then `run` the plan. Replacing it is a hand
647
940
  edit of `tasks.tsv` before the next `run`, as the summary says (`forge control add` queues a new
648
941
  row but does not replace the stopped one). A live scheduler takes the same flags as `forge control retry`. A run that ends with such a
649
942
  task still in `tasks.tsv` and unmerged exits `5`. See
package/docs/forge-ui.md CHANGED
@@ -123,6 +123,20 @@ indistinguishable from the same command typed in a terminal, except that `contro
123
123
  Each is `forge control`; see [decomposed runs](decomposed-runs.md#changing-a-run-while-it-works).
124
124
  A control that cannot apply (a budget with no live scheduler, a merged task) is disabled and
125
125
  says why.
126
+ - **Projects (`#/projects`):** one page per repository with its runs, every finding forge's reviews
127
+ wrote about it (each attempt, final reviews, shadow reviews behind a toggle), and every memory forge
128
+ keeps for it, whichever run or checkout they came from. A finding a later review got past is
129
+ `superseded`, never `fixed`; repeats across rounds are one row with a count. The Memories tab shows
130
+ what `memory.md` gives each role and each learning's state, as `forge memory learnings` reports it.
131
+ Runs and checkouts that are gone are read from the dataset, and those rows say so. Reachable from the
132
+ header, a run's repository name and each map district.
133
+ - **Worktrees (`#/worktrees`):** every worktree forge created, in any repository it knows: its
134
+ run, task, branch, last commit, size and status (in use, uncommitted changes, locked, needed by
135
+ the run, failed task, finished, missing on disk, not forge's, unknown to git, removed), and the
136
+ command that removes it safely, to copy. The commands never use `--force` and the page runs
137
+ none of them. Removed worktrees are listed from the dataset (`worktree_created` and
138
+ `worktree_removed` events); worktrees from before forge recorded them are derived from run dirs,
139
+ without dates. With `FORGE_DATASET=off` the screen lists only what git and the run dirs say.
126
140
  - **Open findings:** the review findings a run left open (tolerated by `--qa-threshold`,
127
141
  PLAUSIBLE, or left by the whole-run review), for this run or every run of its repository.
128
142
  Findings of an outdated review carry an "outdated review" marker, findings a person
package/docs/memory.md CHANGED
@@ -113,6 +113,7 @@ forge-memory.sh record <repo> --last <file> --role <r> [--run-id X] [--task T]
113
113
  forge-memory.sh show <repo>
114
114
  forge-memory.sh prune <repo> # re-apply staleness and the cap now
115
115
  forge-memory.sh spend <repo> [--run <run-id>] # what forge has cost this repo
116
+ forge-memory.sh learnings <repo> [--json] # every ledger learning and its state, as JSON (forge memory learnings)
116
117
  ```
117
118
 
118
119
  `record` appends to the ledger and then rebuilds `memory.md` from the whole ledger — the
@@ -128,6 +129,27 @@ bash scripts/forge-memory.sh inject ~/dev/api dwarf
128
129
  rm -rf ~/dev/api/.forge
129
130
  ```
130
131
 
132
+ ## Every learning and its state
133
+
134
+ `forge memory learnings <repo> --json` lists each learning in the ledger once (grouped as the rebuild groups
135
+ them: by category and normalised text) with the number of distinct runs that emitted it, its latest wording,
136
+ its rows, and what forge does with it now:
137
+
138
+ | State | Why |
139
+ |---|---|
140
+ | `in_memory` | the rebuilt `memory.md` has it |
141
+ | `waiting` | a finding seen in one run only: it needs a second run to be promoted |
142
+ | `stale` | its `[anchor]` path no longer exists |
143
+ | `capped` | trimmed by the memory cap (`FORGE_MEMORY_MAX_LINES`, `FORGE_MEMORY_MAX_BYTES`) |
144
+ | `muted` | every row of it was marked not injectable (Jev's curation) |
145
+
146
+ The states come from forge-memory.sh's own rebuild, run into a scratch directory, so they cannot differ
147
+ from what `record` writes; the repository is only read. The answer also has the current `memory.md` by
148
+ section, with the roles each section reaches, and `rebuilt_differs` when that file is not what a rebuild
149
+ makes now (an older forge wrote it, or a `prune` asked Jev to drop facts). forge-ui's Projects screen
150
+ shows it on each repository's *Memories* tab, merged across the checkouts its runs started in and, from
151
+ the dataset, the learnings of checkouts that are gone.
152
+
131
153
  ## Spend
132
154
 
133
155
  The ledger already holds a row per dispatch and is never injected into a prompt, so
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/docs/reviews.md CHANGED
@@ -28,6 +28,13 @@ in the reply is never a verdict. A missing verdict is `UNKNOWN` and is treated e
28
28
  failure — excluded from integration and flagged. Merging a diff whose reviewer never reached
29
29
  a conclusion would defeat the point of reviewing it, so the ambiguous case fails safe.
30
30
 
31
+ Before the verdict, a reviewer says whether its tests ran: `FORGE_TESTS: RAN`,
32
+ `FORGE_TESTS: NOT NEEDED — why` or `FORGE_TESTS: COULD NOT RUN — why`. This never changes the
33
+ verdict. `COULD NOT RUN` prints a note, and forge-ui and the dataset record all three, so a review
34
+ that judged the diff by reading alone can be told apart. Markup and any separator are accepted,
35
+ because nothing gates on this line, and a line that says something else is recorded as `unclear`.
36
+ An older reply has no such line.
37
+
31
38
  A failing task is excluded and **its branch and worktree are preserved**; the rest of the run
32
39
  proceeds. forge never loops a dwarf against its reviewer on its own: a retry happens when you
33
40
  type `retry`, or when you opt in for a run with `--retry-failed N` ([below](#retrying-inside-a-run---retry-failed-n)).
package/forge CHANGED
@@ -23,6 +23,7 @@ usage() {
23
23
  ' jev the old decision-model commands, replaced by decide (kept for one release)' \
24
24
  ' dataset every run'"'"'s inputs and outcomes: status, dump, import, export, outcomes, ...' \
25
25
  ' issues file the review findings a run left open as GitHub issues (plain gh)' \
26
+ ' memory a repository'"'"'s project memory: show, learnings --json (each learning and its state), prune' \
26
27
  ' pr a draft pull-request description for a finished run (--create opens it with gh)' \
27
28
  ' ui forge-ui, the run viewer: open [DIR], status, stop' \
28
29
  ' runs this repo'"'"'s recent runs in the terminal: state, verdicts and run dirs; rerun a plan with another model, compare' \
@@ -98,6 +99,16 @@ case "${1:-}" in
98
99
  shift
99
100
  exec python3 "$ROOT/scripts/forge-issues.py" "$@"
100
101
  ;;
102
+ memory)
103
+ shift
104
+ # only the commands its help lists: note and record are what a run writes into the ledger, not a person
105
+ case "${1:-}" in
106
+ show|learnings|prune|spend|inject|-h|--help|help) ;;
107
+ '') /bin/bash "$ROOT/scripts/forge-memory.sh" --help >&2; exit 2 ;;
108
+ *) printf 'forge memory: unknown command: %s (show, learnings, prune, spend or inject)\n' "$1" >&2; exit 2 ;;
109
+ esac
110
+ exec /bin/bash "$ROOT/scripts/forge-memory.sh" "$@"
111
+ ;;
101
112
  pr)
102
113
  shift
103
114
  exec python3 "$ROOT/scripts/forge-pr.py" "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giamme/forge",
3
- "version": "0.14.1",
3
+ "version": "0.16.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",