@giamme/forge 0.13.0 → 0.14.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 (60) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/SKILL.md +17 -11
  3. package/VERSION +1 -1
  4. package/docs/artifacts.md +1 -0
  5. package/docs/commands.md +121 -7
  6. package/docs/development.md +3 -0
  7. package/docs/forge-ui.md +7 -1
  8. package/docs/reviews.md +2 -0
  9. package/docs/troubleshooting.md +5 -1
  10. package/forge +28 -1
  11. package/package.json +1 -1
  12. package/references/dataset.md +3 -1
  13. package/references/decision-models.md +5 -1
  14. package/references/decompose.md +199 -61
  15. package/references/runtime.md +29 -0
  16. package/references/ui.md +10 -0
  17. package/scripts/forge-compare.py +491 -0
  18. package/scripts/forge-config.py +3 -3
  19. package/scripts/forge-contract.py +34 -8
  20. package/scripts/forge-control.py +105 -13
  21. package/scripts/forge-dispatch.sh +9 -5
  22. package/scripts/forge-jev-options.sh +17 -4
  23. package/scripts/forge-ledger.py +387 -0
  24. package/scripts/forge-lib-plans.sh +16 -2
  25. package/scripts/forge-lib-task.sh +390 -28
  26. package/scripts/forge-parallel-options.sh +20 -4
  27. package/scripts/forge-parallel.sh +118 -12
  28. package/scripts/forge-plan-check.py +68 -3
  29. package/scripts/forge-pr.py +276 -0
  30. package/scripts/forge-route.py +350 -34
  31. package/scripts/forge-runs.py +18 -1
  32. package/scripts/forge-runtime.py +23 -7
  33. package/scripts/forge-schedule.py +303 -46
  34. package/scripts/forge-solo.sh +1 -0
  35. package/scripts/forge-ui-options.sh +25 -0
  36. package/scripts/forge-verify-failed.py +111 -0
  37. package/scripts/forge-watch.py +372 -0
  38. package/scripts/forge_dataset/export.py +87 -41
  39. package/scripts/forge_dataset/harvest.py +3 -1
  40. package/scripts/forge_decide/budget.py +39 -8
  41. package/scripts/forge_decide/doctor.py +49 -0
  42. package/scripts/forge_fractal/cli.py +23 -6
  43. package/scripts/forge_infra.py +274 -0
  44. package/scripts/forge_jev/client.py +13 -9
  45. package/ui/docs/api.md +83 -15
  46. package/ui/forge_ui/control.py +11 -3
  47. package/ui/forge_ui/export.py +6 -2
  48. package/ui/forge_ui/models.py +16 -16
  49. package/ui/forge_ui/reader.py +217 -13
  50. package/ui/forge_ui/repos.py +428 -0
  51. package/ui/forge_ui/static/app.js +24 -5
  52. package/ui/forge_ui/static/checksview.js +20 -7
  53. package/ui/forge_ui/static/cloudmodel.js +8 -5
  54. package/ui/forge_ui/static/controls.js +6 -3
  55. package/ui/forge_ui/static/modelstats.js +12 -8
  56. package/ui/forge_ui/static/panel.js +69 -4
  57. package/ui/forge_ui/static/runmodel.js +55 -10
  58. package/ui/forge_ui/static/scene3d.js +3 -2
  59. package/ui/forge_ui/static/settings.js +147 -29
  60. package/ui/forge_ui/static/style.css +49 -7
package/CHANGELOG.md CHANGED
@@ -5,6 +5,46 @@ 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.14] - 2026-11-02
9
+
10
+ Infrastructure stops now carry a cause and recover on their own where they can, moving sideways to a model of the same tier; forge watch, forge pr and forge runs rerun/compare follow, describe and compare runs; and a run now pays for the full test suite once, after the merge, instead of on every attempt.
11
+
12
+ ### Highlights
13
+
14
+ - `forge watch` follows runs from the terminal: it prints each task status change and, when a run finishes or fails, a task fails or a final review gives its verdict, raises a desktop notification (`notify-send` or `osascript`; on a headless machine or in CI it says there is none and only prints). `--exec CMD` and an untracked, executable `.forge/on-finish` in the repo run on those events with `FORGE_WATCH_EVENT`, `FORGE_WATCH_RUN_ID` and `FORGE_WATCH_VERDICT` in their environment. It is read-only and uses the same run reader as forge-ui.
15
+ - `forge pr` writes a draft pull-request description for a finished run: the goal, the tasks and their status, who implemented and reviewed them, the verification and final-review results, the open findings and the integration branch. Private text (the request, prompts, deferrals, local paths) is left out unless you ask with `--texts` or `--paths`, as in the export. `forge pr --create` opens it with `gh pr create --draft`; without `--create` it only prints, and it never pushes.
16
+ - `forge runs rerun <run-dir> --dwarf SPEC` sets the same plan up again with another implementer, starting from the commit the original run started from, and `forge runs compare <run-dir-A> <run-dir-B>` sets two runs side by side per task (status, attempts, tokens, time, diff size) and records the pair in the dataset. A rerun spends nothing until you pass `--run --yes` after reading the token warning and forecast it prints, and it never merges anything.
17
+ - Infrastructure stops now carry a cause (capacity, rate limit, usage limit, budget, login, network, provider down, an empty reply or a cancelled call), and each recovers its own way. When another model of the same tier can take the work, the task, or its review, moves there sideways at once, without spending an attempt or counting as an escalation; a limit that resets is waited out; and a stop only a person can clear, such as spent credits or an expired login, is marked "needs you" in the run summary, `forge control show` and forge-ui. Sideways moves are on for new plans; `plan --no-infra-fallback` turns them off (#81).
18
+ - A failed verification no longer reruns the whole suite to confirm a real failure: with `.forge/verify-subset`, forge first reruns only the failing test files, and runs everything again only if they pass. A `retry` that leaves tasks still to run skips its verification, since the next `run` or `integrate` verifies the branch (#112).
19
+ - When a run has a verification command, implementers no longer run the whole test suite on every attempt, even if a task's acceptance criteria ask for it: forge runs the suite after the merge. `plan` also names tasks whose acceptance criteria ask for the whole suite (#111).
20
+
21
+ ### Added
22
+
23
+ - A task whose reviews keep failing with new findings now stops as `NEEDS_DECISION` and waits for you instead of retrying: `retry --decide retry=N` or `threshold=Pn`, `retry --dwarf <spec>`, `accept`, or a split in `tasks.tsv`. A task that reaches its cap on attempts across runs stops the same way (`plan --max-attempts N`, default 8; raised only with `forge control set max-attempts N --confirm`), and `plan --converge-window N` sets how many reviews the signal looks at (#69).
24
+ - forge-ui shows why a task stopped on infrastructure and whether it needs you, the sideways moves, each task's findings ledger, and a decision panel for tasks waiting for your decision (#81, #69).
25
+
26
+ ### Changed
27
+
28
+ - A command group typed on its own, such as `forge control` or `forge dataset`, now prints that group's help with its subcommands, the same as `forge control --help`, instead of a one-line "the following arguments are required" error. It still exits 2, like a bare `forge`.
29
+ - `forge fractal --help` and `forge config --help` (and a bare `forge fractal` or `forge config`) give each subcommand a one-line description, as `forge decide`, `forge dataset`, `forge ui` and `forge control` already did, instead of only listing the names.
30
+ - Task reviews now ask the reviewer to report every confirmed finding in one pass, and to say plainly when the change is correct (#69).
31
+
32
+ ### Fixed
33
+
34
+ - `--gate` and `--decide-budget` take a `*` or `?` in their value as typed: it is no longer matched against file names in the current directory, so `--gate 'drift=*'` next to a file named `drift=on` is refused and named as given instead of quietly becoming `drift=on` (#82).
35
+ - A decision-model request made from inside a repo, with no `--repo` and no `FORGE_DECIDE_REPO`, now records in `jev.jsonl` and the run dataset the gate mode it was actually sent under, the one that repo's `.forge/decide.json` sets, instead of the mode resolved with no repo at all (#82).
36
+
37
+ ## [0.13.1] - 2026-10-30
38
+
39
+ Runs started from a git worktree now sit under their repository in forge-ui, showing the worktree and branch they started in. Also exact decision-model spend caps, and the right gate on each exported review.
40
+
41
+ ### Fixed
42
+
43
+ - Decision-model spend caps: token caps compare exactly, a cost that overflowed to infinity counts as reaching the USD caps, and `forge decide doctor` names a provider whose price is unusable (`bad-price`).
44
+ - `forge dataset export` gives each review the gate decision of its own QA execution: a review that ended in an outage before a QA-only resume no longer inherits the gate of the review the attempt ended on, and separate runs that met the same diff still export as one review case.
45
+ - forge-ui groups runs by repository: a run started in any worktree of a repository joins that repository's group, also after the worktree is removed, and shows the worktree and branch it started in. New runs record `repo.identity` (root, worktree, branch); older runs are matched by their base commit. `/api/runs` carries `repo_root`, `repo_worktree` and `repo_branch`, and per-repository settings resolve against the repository rather than the worktree.
46
+ - forge-ui Settings: the repository picker lists runs by repository with each run's worktree and branch, works from the keyboard (arrow keys, Enter, Escape, typing), and the page names the directory the configuration was actually read from.
47
+
8
48
  ## [0.13] - 2026-10-30
9
49
 
10
50
  Decision-model gates are now yours to set, off, shadow or on, per user or per repository with `forge decide`, and when on they act: drift and forward edit the plan, prompt and coverage send it back to the planner, and five new gates bounce unaddressed retries, read the implementer's final message, find the merge that broke verification and triage leftover findings. QA verdicts now follow a P2 blocking threshold in both directions, and a retry can continue the implementer's own session.
package/SKILL.md CHANGED
@@ -60,23 +60,29 @@ For explanation requests, explain the workflow without spending model quota.
60
60
  a row left to forge gets its neighbouring tier's model from the user's pools, odds
61
61
  recorded for `forge dataset routing`); say so with the table and pass `--explore 0` when
62
62
  the user declines. Retries follow a policy: after three failed attempts on one model the
63
- next goes a tier up in the user's pools, or the task stops with a split suggestion
63
+ next goes a tier up in the user's pools, or the task stops as `NEEDS_DECISION`
64
64
  (`--escalate-after N`, `0` = off); an explicit `retry --dwarf` overrides it. `accept`
65
- overrides a reviewer, so run it (with the user's `--reason` and
66
- `--approved`) only on the user's explicit instruction; never self-accept.
65
+ overrides a reviewer: run it, with `--reason` and `--approved`, only when the user
66
+ explicitly says so; never self-accept.
67
67
  - When you report a run, read `<plan>/control.log` and mention any human change made mid-run
68
68
  (a threshold, a budget, a model pin, a drain, stop or queued retry; `forge control show <plan>`
69
69
  lists them). Never set a control, pin, `drain|stop|retry` or delete a run with `forge control` /
70
70
  `forge runs rm` unless the user asks. Exit `130` / `INTERRUPTED`: the run was signalled or
71
71
  stopped; relay the `retry` lines it printed.
72
- - A run that ends with a `waiting for your answer:` block has tasks in status `NEEDS_INPUT`: the
73
- implementer asked a question only the user can answer. Relay each question to the user
74
- verbatim, and pass the reply with `retry <plan> <id> --answer "<reply>"`. Never answer for the
75
- user, and never retry such a task without an answer: nothing else resumes it.
76
- - Exit `8` / status `INFRA` is a quota, auth or network stop, not a task failure and no
77
- attempt was spent: report it, say what to fix, and re-run only when told. For a multi-task
78
- plan, offer the opt-in whole-run review (`review`, or `integrate --final-review <qa-spec>`);
79
- it spends QA quota, so never run it unprompted.
72
+ - A `waiting for your answer:` block is status `NEEDS_INPUT`: relay each question verbatim and
73
+ pass it with `retry <plan> <id> --answer "<reply>"`. Never answer for the user; nothing else
74
+ resumes it.
75
+ - A task at `NEEDS_DECISION` waits for the user. Present `tasks/<id>/decision.md`'s reasons and
76
+ choices. Run `retry --decide`, `retry --dwarf` or `accept` (with `--reason` and `--approved`)
77
+ only on the user's explicit word, never to keep a run going. Nothing else resumes it. The
78
+ split choice replaces the row in `tasks.tsv` and is a later `run`
79
+ ([when reviews don't converge](references/decompose.md#when-reviews-dont-converge)); do that
80
+ only when the user asks.
81
+ - Exit `8` / status `INFRA` is an infrastructure stop (`capacity`, `rate_limit`, `usage_limit`,
82
+ `budget`, `auth`, `network`, `provider_down`, `empty` or `cancelled`; an old run may say
83
+ `quota`), not a task failure, and no attempt was spent. Report each "needs you" item with its
84
+ hint, and re-run only when told. Offer a multi-task plan's whole-run review (`review`, or
85
+ `integrate --final-review <qa-spec>`) only when asked: it spends QA quota.
80
86
  - **Leftover findings become issues.** A run can finish with review findings nobody will act on:
81
87
  - CONFIRMED findings the threshold tolerated, from a PASS or a FAIL (`tasks/<id>/known_issues.md`);
82
88
  - PLAUSIBLE findings in a passed task's `qa.last`;
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.13
1
+ 0.14
package/docs/artifacts.md CHANGED
@@ -61,6 +61,7 @@ A decomposed run adds:
61
61
  tasks/<id>/<role>.harness only while a guarded dispatch runs: its harness's pid and start time, for forge-guard.py stop
62
62
  tasks/<id>/qa_threshold optional per-task blocking threshold: P0-P3, or none (P3; exempt from a looser plan threshold)
63
63
  tasks/<id>/escalations.tsv epoch, attempt, from-spec, to-spec, source (policy|retry|pin|fallback); older rows have 4 columns
64
+ tasks/<id>/running.tier tier<TAB>spec: the tier the last escalations.tsv row moved the task to; ignored once the task runs another spec
64
65
  tasks/<id>/escalation.pin a human's one-shot model for the next full retry: one dwarf spec on one line
65
66
  tasks/<id>/escalation.pin.applying the pin while a retry has claimed it; removed once the retry is recorded
66
67
  tasks/<id>/retry_findings.commit commit the carried review judged
package/docs/commands.md CHANGED
@@ -16,16 +16,54 @@ harness (`/forge`); this command installs forge and drives its optional tools.
16
16
  | `forge version [--check]` | the installed version, and whether a newer release is out |
17
17
  | `forge fractal …` | opt-in Fractal execution; see [the command group](fractal.md#forge-fractal-command-group) |
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
- | `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), `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]` and `add PLAN_DIR TASK` (a row appended to `tasks.tsv`) queue a request the scheduler applies or refuses. `show` (`--json` for JSON) also says whether the run is drained or stopping and lists its infrastructure pauses. 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) |
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 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 |
21
22
  | `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
+ | `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
+ | `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 |
22
25
  | `forge issues RUN [--apply] …` | file the review findings a run left open as GitHub issues; see [below](#forge-issues) |
26
+ | `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) |
23
27
  | `forge ui open\|status\|stop` | forge-ui, the run viewer; see [the command group](forge-ui.md#forge-ui-command-group) |
24
28
  | `forge dataset …` | every run's inputs and outcomes; see [run dataset](dataset.md) |
25
29
  | `forge decide …` | decision-model gates, providers, budgets and the privacy floor; see [below](#forge-decide) |
26
30
  | `forge jev …` | deprecated alias of the old decision-model commands, kept for one release; see [below](#forge-decide) |
27
31
  | `forge --help` | list the commands; `forge <command> --help` shows each one's options |
28
32
 
33
+ ### `forge watch`
34
+
35
+ Follows runs from the terminal, for when forge-ui is not open or you are away from it.
36
+
37
+ ```
38
+ forge watch # every run registered for this repo, new ones too; Ctrl-C stops
39
+ forge watch RUN_DIR # one run, until it ends: exit 0 done, 1 failed, 3 its process looks dead
40
+ forge watch --all --until-done # every repo's runs; stop once nothing is running
41
+ ```
42
+
43
+ Every task status change prints a line. These events also raise a notification and run the hooks:
44
+ a run finishing (`run-done`) or ending with failures (`run-failed`), a task newly failing
45
+ (`task-failed`) and a final review's `PASS`/`FAIL` (`review`). They are the events forge-ui's bell
46
+ reports, and the runs are read with forge-ui's own reader. The first look at each run is only a
47
+ baseline, so a run that was already over, or had not changed for two hours, says nothing. A run
48
+ that stops is announced once it has stayed stopped for `--settle` seconds (10), so a task that
49
+ fails and is retried automatically is not reported as a failed run (the `task-failed` event still is).
50
+
51
+ - **Desktop notification.** `notify-send` on Linux, `osascript` on macOS. With no notifier on the `PATH`, or on Linux
52
+ with no desktop session (`DISPLAY`, `WAYLAND_DISPLAY` and `DBUS_SESSION_BUS_ADDRESS` all unset: a
53
+ server, a container, CI), forge says so once on stderr and the events only print. `--no-notify` or
54
+ `FORGE_WATCH_NOTIFY=off` turns notifications off.
55
+ - **`--exec CMD`** runs `CMD` through the shell on every event. **`.forge/on-finish`** in the run's repo
56
+ runs on `run-done` and `run-failed` only, with the repo as its working directory.
57
+ - **The environment** of both: `FORGE_WATCH_EVENT`, `FORGE_WATCH_RUN_ID`, `FORGE_WATCH_RUN_DIR`,
58
+ `FORGE_WATCH_REPO`, `FORGE_WATCH_GOAL`, `FORGE_WATCH_TASK` (a `task-failed` event), `FORGE_WATCH_VERDICT`
59
+ (the review's verdict, the failing task's status, else the run's final review or verification status, else
60
+ `PASS`/`FAIL`) and `FORGE_WATCH_MESSAGE`. A hook's output goes to stderr; one that fails or runs
61
+ past 30 seconds is reported there and never stops the watch.
62
+ - **`.forge/on-finish` is run only when it is safe.** `.forge/` is usually committed, so a hook that arrived with
63
+ a cloned repository would run code the first time you watch. It runs only when it is executable, owned by you,
64
+ not writable by others, and not tracked by git; otherwise forge says why on stderr and skips it. A hook you want
65
+ to share goes in your own checkout untracked, or is passed with `--exec`.
66
+
29
67
  ### `forge runs rm`
30
68
 
31
69
  Deletes a run directory (a plan dir or a solo run dir) without losing its traces. It holds the
@@ -49,6 +87,34 @@ reports; `--yes` skips the prompt for the run id (needed without a terminal); `-
49
87
  object, on failure too. Exit 0 ok, 2 refused input, 3 busy or the run is active, 4 failed during
50
88
  deletion or the run directory was kept (the same command finishes the job).
51
89
 
90
+ ### `forge runs rerun` and `forge runs compare`
91
+
92
+ `forge runs rerun <run-dir> --dwarf SPEC` answers "would this plan have gone better on another
93
+ model?" with the same tasks, prompts and options. It copies the plan into a new directory
94
+ (`<run-dir>-<spec>`, or `--to`), puts SPEC on every task (`--qa` changes the reviewer too; by
95
+ default each task keeps its own, so one thing changes), and prepares it the way `forge-parallel.sh
96
+ plan` does. The new run's integration branch `forge/<new id>-integration` starts at the commit the
97
+ original run started from (`integration.base`), not at wherever your branch is now, so both runs
98
+ see the same code. Exploratory routing is off for it (`--explore 0`), or some tasks would run on
99
+ a third model.
100
+
101
+ It spends nothing: it prints a warning that a second run costs a second run's tokens, what the
102
+ original run recorded for these tasks, the [plan forecast](dataset.md) for the new model when the
103
+ dataset has history, and the command that starts it. `--run --yes` starts it (`--run` alone is
104
+ refused, so the cost is read first); `--dry-run` creates nothing at all. It never merges: the
105
+ rerun only writes its own `forge/<new id>…` branches and worktrees, and your branch, the original
106
+ run and its branches are not touched. A plan that has a task still `RUNNING`, a solo run (no task
107
+ table), a plan that never started, and a Fractal-backed plan are refused, and a rerun that fails to
108
+ set up is removed again. Exit 0 ok, 2 bad input, 3 refused.
109
+
110
+ `forge runs compare <run-dir-A> <run-dir-B>` sets two runs of one repository side by side per
111
+ task: status, attempts, tokens and time (from the dataset, when the runs are in it) and the lines
112
+ added and deleted on the task's branch. It writes the pair as one `comparison` event to the dataset
113
+ (`--no-record` skips that; the same pair twice is one event; a run that has not attempted a task
114
+ yet is shown but not recorded). `--json` prints everything. One pair of runs is one sample: a task
115
+ that passed on one model and failed on the other may have just been the model's day, so read it
116
+ as what happened, not as which model is better. Nothing routes on it.
117
+
52
118
  ### `forge issues`
53
119
 
54
120
  `forge issues <plan dir, task dir, review dir, known_issues.md or qa.last>` drafts one GitHub
@@ -77,6 +143,34 @@ repository lock from the issue lookup to the last `gh issue create`, and each di
77
143
  around its write. A busy lock is retried for 10 s, then exit 3. Exit 0 ok, 2 usage or a `gh` or
78
144
  dismissal-store error, 3 busy.
79
145
 
146
+ ### `forge pr`
147
+
148
+ Writes the pull-request description a finished run deserves, from what the run recorded, so the PR
149
+ that proposes its integration branch says what was built and what was not.
150
+
151
+ ```
152
+ forge pr # the newest finished run of this repo, on stdout
153
+ forge pr RUN_DIR --out pr.md # a given run, also written to a file
154
+ forge pr | gh pr create --draft --body-file - --title "…" # your own gh call
155
+ forge pr --create --base main # gh pr create --draft, on forge/<run id>-integration
156
+ ```
157
+
158
+ The body has the goal, a table of the tasks (status, difficulty, implementer, reviewer), the tasks that
159
+ did not merge, the verification status and the final review's verdict (marked when tasks merged after
160
+ it), the final review's open findings (severity, location and headline, worst first) and the integration
161
+ branch with the commit it forked from. The suggested title (the goal's first line) goes to stderr.
162
+ A run that still has running or pending tasks is refused; solo runs have no tasks or integration branch
163
+ to describe and are refused too.
164
+
165
+ - **Private text stays out**, as in `forge ui export`: the request, the prompts and the deferrals
166
+ (`--texts` adds the request and the deferrals) and local paths, which are cut to their last component
167
+ (`--paths` keeps them). The goal, task titles and finding headlines are kept: read the body before it
168
+ goes anywhere public.
169
+ - **`--create` is the only thing that does more than print.** It runs `gh pr create --draft` in the
170
+ repo, for `--head` (default `forge/<run id>-integration`) and `--base` (default gh's). It never pushes:
171
+ the branch must already have an upstream (`git push -u origin <branch>`) or forge says so and stops.
172
+ Without `--create` neither `gh` nor the network is used.
173
+
80
174
  ### `forge decide`
81
175
 
82
176
  Per-gate decision models. The setup — precedence, what each gate does, budgets, the privacy
@@ -393,6 +487,7 @@ forge-parallel.sh plan <plan-dir> --repo <dir> [routing flags] [--planner <
393
487
  [--explore E] [--ui | --no-ui] [--fail-first | --no-fail-first]
394
488
  [--pre-review-tests | --no-pre-review-tests] [--pre-review-parallel N]
395
489
  [--qa-threshold P0|P1|P2|P3|none|default]
490
+ [--max-attempts N] [--converge-window N] [--no-infra-fallback]
396
491
  forge-parallel.sh run <plan-dir> [--max-parallel N] [--yolo-dwarf] [--yolo-qa] [--dry-run]
397
492
  [--verify <cmd> | --verify-lane 'name[opts]=cmd' ...]
398
493
  [--verify-parallel N] [--setup <cmd>] [--timeout S]
@@ -404,6 +499,7 @@ forge-parallel.sh run <plan-dir> [--max-parallel N] [--yolo-dwarf] [--yolo
404
499
  [--sweep-ahead | --no-sweep-ahead] [--attribute | --no-attribute]
405
500
  [--fractal | --no-fractal] [--fractal-<limit> <n>]
406
501
  forge-parallel.sh retry <plan-dir> <task-id> [--dwarf <spec>] [--answer <text> | --answer-file <file>]
502
+ [--decide retry=N|threshold=Pn] [--reason "<why>" --approved]
407
503
  [--timeout S]
408
504
  [--qa-threshold P0|P1|P2|P3|none|default] [--verify-retries N]
409
505
  [--verify <cmd> | --verify-lane 'name[opts]=cmd' ...] [--verify-parallel N]
@@ -421,7 +517,7 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
421
517
  |---|---|
422
518
  | `plan` | validate `tasks.tsv`, resolve difficulty → concrete dwarf/qa specs, compute waves, render the approval table |
423
519
  | `run` | schedule ready tasks; per task: worktree → dwarf → diff → QA → status; merge passing tasks onto the integration branch |
424
- | `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's question and run it |
520
+ | `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 |
425
521
  | `attribute` | after a failed combined verification, search the merge order for **a merge that breaks it**; merges, revises and accepts nothing. See below |
426
522
  | `integrate` | **never automatic** — merge the integration branch into your branch |
427
523
  | `accept` | **only on your explicit instruction** — merge a `FAIL`/`UNKNOWN` task's reviewed work anyway, recording why |
@@ -438,9 +534,13 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
438
534
  | `--retry-failed N` | run | no — this run only | re-queue a task the reviewer rejected up to `N` more times inside the run |
439
535
  | `--infra-retries M` | run | no — this run only | wait out up to `M` infrastructure stops per paused scope (a model, a harness, or everything) instead of ending the run |
440
536
  | `--infra-backoff SHAPE` | run | `infra_backoff` | the waits between those stops when the provider gave no retry-after: `exp:B[,C]`, `linear:S,T[,C]` or `list:a,b,...` in seconds (default `exp:60`) |
441
- | `--infra-fallback` | run | `infra_fallback` | a dwarf stopped by a rate limit moves to the next healthy model of its tier pool instead of waiting (off by default; `--no-infra-fallback` turns it off) |
537
+ | `--infra-fallback` | run | `infra_fallback` | turn lateral recovery on: a stop whose cause moves sideways goes to another model of the same tier (the dwarf pool, or a QA peer from `qa-routing.json`), never a stronger one. A new `plan` writes `on`; this flag writes `on` for a later `run` |
538
+ | `--no-infra-fallback` | plan, run | `infra_fallback` | turn lateral recovery off. A plan with no file stays off, and a re-plan keeps the setting it has |
539
+ | `--converge-window N` | plan | `converge_window` | reviews the non-converging signal looks at (default `4` when the file is absent; below `2` it never fires). Changing it later is `forge control set converge-window N` |
540
+ | `--max-attempts N` | plan | `max_attempts` | attempts a task may spend across runs before it stops for a decision (default `8` when the file is absent; `0` means no cap). Changing it later is `forge control set max-attempts N --confirm` |
541
+ | `--decide retry=N` / `--decide threshold=Pn` | retry | no — this retry only | resume a `NEEDS_DECISION` task: `N` more attempts (`N` from 1 to 20) or this task's blocking threshold (`P0`..`P3`) and then one retry. Needs `--reason` and `--approved`. Refused on any other status |
442
542
  | `--qa-threshold P0\|P1\|P2\|P3\|none\|default` | plan, run, retry, review | `qa_threshold` | the least severe CONFIRMED finding that still blocks (default `P2`); milder ones become known issues; `none` means P3, `default` removes the setting. Solo takes `P0`..`P3` or `none`. See [the verdict rule](reviews.md#verdicts-and-failure) |
443
- | `--verify-retries N` | run, retry, integrate | `verify_retries` | reruns of a failed verify command, or of each failed lane (default `1`, `0` = strict single run) |
543
+ | `--verify-retries N` | run, retry, integrate | `verify_retries` | reruns of a failed verify command, or of each failed lane (default `1`, `0` = strict single run); with `.forge/verify-subset`, a failed command's failing test files run alone first and confirm a regression without a full rerun |
444
544
  | `--verify-lane 'name[opts]=cmd'` | run, retry | `verify.d/<name>` | one verification lane; repeatable. Options as in a lane file, comma-separated (`group=g`, `first`, `retries=n`, `reports=dir`, `baseline=file`). The first one of an invocation replaces the plan's earlier lanes and `--verify`; see [verification lanes](../references/decompose.md#execution-checks-and-integration-verification) |
445
545
  | `--verify-parallel N` | run, retry, integrate | `verify_parallel` | lanes run at once, 1 to 32 (default `3`) |
446
546
  | `--escalate-after N` | run, retry | `escalate_after` | failed attempts on one model before the next goes a tier up (default `3`, `0` = off) |
@@ -456,9 +556,10 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
456
556
  **Exit codes:** `0` ok · `2` usage or validation · `3` precondition (not a git repo, …) ·
457
557
  `4` **`plan` only: the plan gates sent work back** (see below) ·
458
558
  `5` some task failed QA, the combined verification failed, or a task is still waiting for an
459
- answer · `6` integration conflict ·
460
- `8` **paused on an infrastructure failure** (quota, auth, rate limit, network): no attempt was
461
- spent and nothing was judged — fix the cause and run the same command again ·
559
+ answer or a decision · `6` integration conflict ·
560
+ `8` **paused on an infrastructure failure** (`capacity`, `rate_limit`, `usage_limit`, `budget`,
561
+ `auth`, `network`, `provider_down`, `empty` or `cancelled`; an old run may say `quota`): no
562
+ attempt was spent and nothing was judged — fix a "needs you" cause, or run the same command again ·
462
563
  `130` **interrupted or stopped** (a signal, or `forge control stop`): the running tasks are
463
564
  `INTERRUPTED` and verification was skipped or stopped; the summary prints the `retry` for each.
464
565
 
@@ -523,6 +624,19 @@ question and the answer stay for the same `--answer` to be tried again. A run th
523
624
  task unmerged exits `5`, as it does for a task that failed. Only the `dwarf-message` gate, when `on`,
524
625
  sets this status.
525
626
 
627
+ **`NEEDS_DECISION`** is the same kind of stop for a choice rather than a question. The reviews in
628
+ the last window all failed and kept finding new problems, or the retry policy has no stronger
629
+ model, or the task has spent its attempt cap (`plan --max-attempts N`, default 8 across runs;
630
+ `forge control set max-attempts N --confirm` changes it, and `0` means no cap). The reasons and
631
+ the `retry` and `accept` commands are in `tasks/<id>/decision.md`. The run summary lists them under
632
+ `waiting for your decision:`. Neither a later `run`, `--retry-failed`, a retry budget nor a pin
633
+ resumes that same task. Only `retry <plan> <id> --decide retry=N` or `--decide threshold=Pn`, or
634
+ `--dwarf <spec>`, each with `--reason "…" --approved`, or `accept`, does. Replacing it is a hand
635
+ edit of `tasks.tsv` before the next `run`, as the summary says (`forge control add` queues a new
636
+ 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
637
+ task still in `tasks.tsv` and unmerged exits `5`. See
638
+ [when reviews don't converge](../references/decompose.md#when-reviews-dont-converge).
639
+
526
640
  The full plan → run → integrate walkthrough is in [decomposed runs](decomposed-runs.md#plan-run-integrate). `retry`, `accept` and `review` are covered in [reviews, retries and recovery](reviews.md); resuming, `split`/`combine`, scope drift and `tasks.tsv` in [decomposed runs](decomposed-runs.md).
527
641
 
528
642
  ## `scripts/forge-jev.py`
@@ -34,11 +34,14 @@ forge/
34
34
  │ ├── forge-fractal-dispatch.sh bridge entrypoint for existing pipelines
35
35
  │ ├── forge-install-fractal.sh isolated optional runtime installer
36
36
  │ ├── forge_fractal/ nested execution, recovery, inspection and dashboard
37
+ │ ├── forge-compare.py `forge runs rerun|compare`: a plan under another implementer, side by side
37
38
  │ ├── forge-ui.py `forge ui open|status|stop`: the one shared forge-ui server
38
39
  │ ├── forge-ui-options.sh `--ui|--no-ui` and the fail-open launch, sourced by the runners
40
+ │ ├── forge-watch.py `forge watch`: follow runs, notify, run hooks (reads with forge-ui's reader)
39
41
  │ ├── forge_registry.py the run registry: where run dirs are noted, read by forge-ui
40
42
  │ ├── forge-dataset.py `forge dataset` entry point
41
43
  │ ├── forge_dataset/ the run dataset: capture hooks, readers, importer, status checks
44
+ │ ├── forge-pr.py `forge pr`: a draft PR description for a finished run (reads with forge-ui's reader)
42
45
  │ └── forge-install.sh install into every harness that needs it (opencode and grok find it themselves)
43
46
  ├── ui/ forge-ui: read-only local run viewer (`forge_ui` package, tests, API contract)
44
47
  └── references/
package/docs/forge-ui.md CHANGED
@@ -8,6 +8,9 @@ run in one full-screen view, grouped by project, in five layouts (helix, sphere,
8
8
  timeline, constellation), filtered down to exactly the runs you want; drag any run anywhere
9
9
  and the cloud remembers it.
10
10
 
11
+ Runs are grouped by repository. A run started in any worktree of a repository shares that
12
+ repository's group, and each run shows the worktree and branch it started in.
13
+
11
14
  <p align="center">
12
15
  <img src="../ui/docs/media/cloud.webp" width="880" alt="The run cloud: about seventy runs as blocks in five project spirals, orbited, then laid out as galaxies and as a timeline with one lane per project.">
13
16
  </p>
@@ -133,7 +136,10 @@ indistinguishable from the same command typed in a terminal, except that `contro
133
136
  out. Anything that is not the run's own, or has uncommitted changes, is listed and left alone.
134
137
  - **Settings:** every config source in one view (`forge config show`) and edits for the
135
138
  per-repo ones (`repo.verify`, `repo.setup`, `repo.verify-subset`, and Jev on or off). The
136
- registry stays read-only: the skill directory is often a live symlink to a checkout.
139
+ registry stays read-only: the skill directory is often a live symlink to a checkout. You pick
140
+ the repository through one of its runs, from a list grouped by repository that shows each
141
+ run's worktree and branch (arrow keys and typing work in it), and the page names the
142
+ directory the configuration was read from.
137
143
 
138
144
  Writing is protected, because anything that can reach the server could otherwise change your
139
145
  runs. The server makes a random token each time it starts and puts it in the page it serves;
package/docs/reviews.md CHANGED
@@ -149,6 +149,8 @@ still collapses to Fractal's own "failed" handling; QA-side stops propagate as a
149
149
  QA is asked to label every finding `- [P0..P3][CONFIRMED|PLAUSIBLE] file:line — what breaks`
150
150
  (P0 data loss/security/crash on the main path, P1 wrong behaviour on realistic input, P2
151
151
  edge-case bug, P3 minor). [The verdict rule](#verdicts-and-failure) says which of them block.
152
+ Task and solo reviews ask for every CONFIRMED finding, and task reviews also ask the reviewer
153
+ to say so plainly when the diff is correct.
152
154
 
153
155
  `--qa-threshold Pn` (on `plan`, `run`, `retry`, `review` and solo; a plan remembers it) changes
154
156
  the default `P2`, the **least severe level that still blocks**: `P2` means P0–P2 block and only P3
@@ -16,7 +16,11 @@ Symptoms, causes and fixes, from a skill a harness cannot see to a task that wil
16
16
  | task status `ERROR` | worktree creation or a dispatch failed — read `tasks/<id>/dwarf.out` / `qa.out` |
17
17
  | task status `UNKNOWN` | QA never emitted a verdict line; read `tasks/<id>/qa.last`. `retry` (or `run --retry-failed N`) asks QA again on the unchanged work — no dwarf runs, no attempt is spent |
18
18
  | task status `INVALIDATED`, "artifact changed during review" | the reviewer changed a tracked file in its review copy, so its verdict counts for nothing. `retry` (or `run --retry-failed N`) reviews the unchanged work again — no dwarf runs, no attempt is spent. Untracked leftovers such as `__pycache__/` never cause this |
19
- | task status `INFRA`, `run` exits `8` | a quota/usage limit, auth problem, rate limit, network error or empty answer stopped a dispatch — not a task failure, and no attempt was spent. Read `tasks/<id>/infra.txt` (`class=`, `retry_after=`), fix the cause, run the same command again. `run --infra-retries M` waits it out instead. Dependents stay `PENDING`, never `BLOCKED` |
19
+ | task status `INFRA`, `run` exits `8` | an infrastructure stop, not a task failure, and no attempt was spent. The summary names the cause (`capacity`, `rate_limit`, `usage_limit`, `budget`, `auth`, `network`, `provider_down`, `empty`, `cancelled`; an old run may say `quota`). Read `tasks/<id>/infra.txt`. A line that does not say "needs you" can be waited out with `run --infra-retries M`, or the same command run again. Dependents stay `PENDING`, never `BLOCKED`. See [infrastructure failures](../references/decompose.md#infrastructure-failures) |
20
+ | "needs you" and the cause is **budget** | the harness is out of money. Add credits, or check that harness's billing. The pause spends no waits. A healthy peer of the same tier may already have taken the task |
21
+ | "needs you" and the cause is **auth** | log in to that harness again. The pause spends no waits |
22
+ | "needs you" and the cause is a **usage limit** | the account's usage window, no peer could take the work, and the reset is unknown or more than six hours away. Wait for the reset, or add another harness to this tier's pool |
23
+ | "needs you" and the cause is **cancelled** | the harness cancelled the dispatch. Check that harness's approval and permission settings. The first such stop is tried again at once; with nowhere to move, the pause needs you and spends no waits |
20
24
  | a task merged although its reviewer said FAIL | the threshold (`P2` by default) accepted it: every CONFIRMED finding was labelled and milder than the threshold. See `tasks/<id>/known_issues.md` and `qa.gate` (decision `accept`); [the verdict rule](reviews.md#verdicts-and-failure) |
21
25
  | a task FAILed although its reviewer said PASS | forge's gate: a CONFIRMED finding at or above the threshold was listed. `qa.gate` says `fail`, and the next attempt starts with a note saying so. Fix those findings, or `accept` the task if a person decides to; [the verdict rule](reviews.md#verdicts-and-failure) |
22
26
  | `accept` exits `3` "changed since it was reviewed" | the branch or worktree moved after QA, so accepting would sign off on unreviewed code. `retry` for a fresh review |
package/forge CHANGED
@@ -23,8 +23,10 @@ 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
+ ' pr a draft pull-request description for a finished run (--create opens it with gh)' \
26
27
  ' ui forge-ui, the run viewer: open [DIR], status, stop' \
27
- ' runs this repo'"'"'s recent runs in the terminal: state, verdicts and run dirs' \
28
+ ' runs this repo'"'"'s recent runs in the terminal: state, verdicts and run dirs; rerun a plan with another model, compare' \
29
+ ' watch follow runs live and get a desktop notification when one finishes or fails' \
28
30
  ' control a plan'"'"'s live controls: show, set (QA threshold, retries, timeouts), pin, unpin' \
29
31
  ' config every config source: show, and set/unset the per-repo .forge files and Jev on/off' \
30
32
  ' update fast-forward this checkout and refresh every harness installation' \
@@ -46,6 +48,16 @@ hit = prefixed if len(prefixed) == 1 else difflib.get_close_matches(word, names,
46
48
  print(hit[0] if hit else "")' "$1" 2>/dev/null
47
49
  }
48
50
 
51
+ # A command group given no subcommand prints its own help, the way a bare `forge` prints
52
+ # the command list: on stderr with exit 2, rather than argparse's one "arguments are
53
+ # required" line that names none of the subcommands.
54
+ help_if_bare() {
55
+ [ "$1" -gt 0 ] && return 0
56
+ shift
57
+ "$@" --help >&2
58
+ exit 2
59
+ }
60
+
49
61
  case "${1:-}" in
50
62
  install)
51
63
  shift
@@ -53,14 +65,17 @@ case "${1:-}" in
53
65
  ;;
54
66
  fractal)
55
67
  shift
68
+ help_if_bare $# python3 "$ROOT/scripts/forge-fractal.py"
56
69
  exec python3 "$ROOT/scripts/forge-fractal.py" "$@"
57
70
  ;;
58
71
  decide)
59
72
  shift
73
+ help_if_bare $# python3 "$ROOT/scripts/forge-decide.py"
60
74
  exec python3 "$ROOT/scripts/forge-decide.py" "$@"
61
75
  ;;
62
76
  jev)
63
77
  shift
78
+ help_if_bare $# python3 "$ROOT/scripts/forge-jev.py"
64
79
  # Only the launcher says so: forge's own callers run forge-jev.py directly.
65
80
  case "${1:-}" in
66
81
  setup) NEW='forge decide provider add …' ;;
@@ -76,26 +91,38 @@ case "${1:-}" in
76
91
  ;;
77
92
  dataset)
78
93
  shift
94
+ help_if_bare $# python3 "$ROOT/scripts/forge-dataset.py"
79
95
  exec python3 "$ROOT/scripts/forge-dataset.py" "$@"
80
96
  ;;
81
97
  issues)
82
98
  shift
83
99
  exec python3 "$ROOT/scripts/forge-issues.py" "$@"
84
100
  ;;
101
+ pr)
102
+ shift
103
+ exec python3 "$ROOT/scripts/forge-pr.py" "$@"
104
+ ;;
85
105
  ui)
86
106
  shift
107
+ help_if_bare $# python3 "$ROOT/scripts/forge-ui.py"
87
108
  exec python3 "$ROOT/scripts/forge-ui.py" "$@"
88
109
  ;;
89
110
  runs)
90
111
  shift
91
112
  exec python3 "$ROOT/scripts/forge-runs.py" "$@"
92
113
  ;;
114
+ watch)
115
+ shift
116
+ exec python3 "$ROOT/scripts/forge-watch.py" "$@"
117
+ ;;
93
118
  control)
94
119
  shift
120
+ help_if_bare $# python3 "$ROOT/scripts/forge-control.py"
95
121
  exec python3 "$ROOT/scripts/forge-control.py" "$@"
96
122
  ;;
97
123
  config)
98
124
  shift
125
+ help_if_bare $# python3 "$ROOT/scripts/forge-config.py"
99
126
  exec python3 "$ROOT/scripts/forge-config.py" "$@"
100
127
  ;;
101
128
  update)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giamme/forge",
3
- "version": "0.13.0",
3
+ "version": "0.14.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",
@@ -37,7 +37,8 @@ time order: an attempt that PASSed, then a merge that CONFLICTed, then a human `
37
37
  | `run_end` | `run` | results per task, the accepted integration commit, `memory.md` |
38
38
  | `invocation` | user-facing `forge-parallel.sh` subcommand | argv, exit, duration, plus final review, accept, integrate and split/combine payloads |
39
39
  | `event` | point event | `merge` (MERGED, CONFLICT with the files, INVALIDATED and why), `integrate_advanced`, `integrate_conflict`, `combine_conflict`, `sched_terminal`, `memory_record`, `memory_prune`, `attribution` (below) |
40
- | `event` `escalation` | retry that changes the model | the model a retry escalated from and to, `after_attempt`, and `source` (`policy`, `retry` for an explicit `--dwarf`, or `pin`), recorded at the rewrite, before the retried attempt begins |
40
+ | `event` `escalation` | retry that changes the model | the model a retry escalated from and to, `after_attempt`, and `source` (`policy`, `retry` for an explicit `--dwarf`, or `pin`), recorded at the rewrite, before the retried attempt begins. Runs from before lateral moves had their own record may also hold `source` `fallback`: those rows are lateral moves |
41
+ | `event` `lateral` | dwarf-stage infrastructure stop moved the task to another model of its tier | `role` (`dwarf`), the model it moved `from` and `to`, `cause` (the stop's class, `-` when none was given) and `attempt` (the attempts spent when it moved). Recorded in `tasks/<id>/lateral.tsv`, not as an `escalation`; a streak of failures carries across it |
41
42
  | `event` `control` | `forge control` change | a human's live change: `at`, `actor` (`cli`/`ui`), `action` (`set`, `pin`, `unpin`), `key`, `value`, `previous`; task events carry the task id. Also read back from `control.log` by `import` |
42
43
  | `event` `run_delete_started` / `run_deleted` | `forge runs rm` | written strictly around a run's deletion: `path`, `run_id`, `archive`, and for `run_deleted` the bytes freed |
43
44
  | `event` `shadow_review` | shadow review | how an opt-in second review ended (`done`, `invalid`, `overtime`, `orphaned`, ...), with the reviewed commit and both specs. Its dispatch is recorded with role `qa_shadow` |
@@ -45,6 +46,7 @@ time order: an attempt that PASSed, then a merge that CONFLICTed, then a human `
45
46
  | `fractal_step` / `fractal_node` | Fractal step, node state | decomposition decision, iteration, resolved model, cost, tokens, candidate diff |
46
47
  | `ledger` | ledger row | imported `.forge/ledger.tsv` rows |
47
48
  | `forecast` | forecast shown by `run` | the plan forecast printed before dispatch (see [plan forecast](#plan-forecast)), once per run and content. Also in the plan as `forecast.json` |
49
+ | `comparison` | `forge runs compare` | two runs of one plan side by side: `a` and `b` each with the run's uid, run id, starting commit and per-task status, attempts, tokens, time and diff size, and a `summary` (tasks merged in both, only in one, in neither). One event per pair and content; the event's run is the second one. Descriptive: nothing routes on it |
48
50
  | `outcome` | integrated task, per horizon | written by `forge dataset outcomes`, never by a run: how many of the lines a task added survive N days after `integrate`, and what reverted it |
49
51
 
50
52
  An attempt that forge sent back without a review keeps the status `FAIL` in the dataset, and
@@ -370,7 +370,11 @@ the measured default), `shadowed` (the user file wins over the repo), `privacy-f
370
370
  Problems: `retired-threshold`, `unknown-provider` (a gate names a provider that is not
371
371
  configured), `unused-provider`, `misplaced` (providers or a daily budget in a repo file, or
372
372
  `privacy` in the user file), `key-file` (missing, or not mode `0600`), `not-migrated`
373
- (`jev.json` exists and `decide.json` does not), `config-error`.
373
+ (`jev.json` exists and `decide.json` does not), `config-error`, `bad-price` (a stored
374
+ `price_usd_per_mtok` is not a finite number above zero, so it is ignored and that
375
+ provider's spend does not count toward a USD cap). A non-finite price is reported as
376
+ the string `Infinity`, `-Infinity` or `NaN`, including when it sits inside a list or
377
+ object, so `doctor --json` is standard JSON.
374
378
 
375
379
  `--live` sends one fixed synthetic request, with no repo data, to each configured provider.
376
380
  It is the only `forge decide` subcommand that uses the network, and it is skipped when the