@giamme/forge 0.11.1 → 0.12.1

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 (54) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/SKILL.md +7 -3
  3. package/VERSION +1 -1
  4. package/docs/artifacts.md +50 -11
  5. package/docs/commands.md +56 -8
  6. package/docs/decomposed-runs.md +43 -2
  7. package/docs/forge-ui.md +55 -8
  8. package/docs/reviews.md +64 -6
  9. package/package.json +1 -1
  10. package/references/dataset.md +4 -2
  11. package/references/decompose.md +191 -17
  12. package/references/harnesses.md +13 -1
  13. package/references/ui.md +25 -4
  14. package/scripts/forge-contract.py +37 -7
  15. package/scripts/forge-control.py +268 -25
  16. package/scripts/forge-dispatch.sh +90 -3
  17. package/scripts/forge-guard.py +156 -15
  18. package/scripts/forge-issues.py +47 -3
  19. package/scripts/forge-lib-plans.sh +9 -3
  20. package/scripts/forge-lib-review.sh +24 -5
  21. package/scripts/forge-lib-task.sh +53 -5
  22. package/scripts/forge-lib-verify.sh +137 -6
  23. package/scripts/forge-parallel-options.sh +85 -0
  24. package/scripts/forge-parallel.sh +262 -31
  25. package/scripts/forge-ripwire.py +1 -1
  26. package/scripts/forge-route.py +157 -5
  27. package/scripts/forge-runtime.py +49 -1
  28. package/scripts/forge-schedule.py +735 -53
  29. package/scripts/forge-solo.sh +3 -1
  30. package/scripts/forge-sweep.py +542 -0
  31. package/scripts/forge-verify.py +878 -0
  32. package/scripts/forge_dataset/forecast.py +33 -5
  33. package/scripts/forge_dataset/harvest.py +10 -4
  34. package/scripts/forge_verify_reports.py +225 -0
  35. package/ui/README.md +58 -12
  36. package/ui/docs/api.md +277 -28
  37. package/ui/forge_ui/checks.py +331 -0
  38. package/ui/forge_ui/control.py +12 -2
  39. package/ui/forge_ui/export.py +25 -8
  40. package/ui/forge_ui/reader.py +657 -24
  41. package/ui/forge_ui/server.py +29 -0
  42. package/ui/forge_ui/static/app.js +15 -7
  43. package/ui/forge_ui/static/checksview.js +449 -0
  44. package/ui/forge_ui/static/controls.js +217 -33
  45. package/ui/forge_ui/static/convo.js +11 -2
  46. package/ui/forge_ui/static/findingsview.js +6 -4
  47. package/ui/forge_ui/static/gantt.js +14 -9
  48. package/ui/forge_ui/static/index.html +2 -0
  49. package/ui/forge_ui/static/panel.js +44 -1
  50. package/ui/forge_ui/static/runmodel.js +109 -12
  51. package/ui/forge_ui/static/scene3d.js +9 -5
  52. package/ui/forge_ui/static/style.css +113 -0
  53. package/ui/forge_ui/static/verifyview.js +324 -0
  54. package/ui/forge_ui/transcripts.py +225 -54
package/CHANGELOG.md CHANGED
@@ -5,6 +5,62 @@ 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.12.1] - 2026-10-28
9
+
10
+ A run can now fix the review findings it tolerated before it ends (`run --sweep Pn`), and forge-ui shows where each task stands, the checks each attempt ran and the environment problems several tasks hit. A task that deletes large files no longer breaks its review.
11
+
12
+ ### Highlights
13
+
14
+ - forge-ui shows where each task of a decomposed run is: the task table's Now column and a task's Now section name the command a running dwarf or reviewer is running and for how long, flag it once its log has been quiet for five minutes, and say why a task that is not running waits (its dependencies, a task it shares files with, no free slot, a drain or stop, an infrastructure pause with its countdown, or the retry policy's stop with the split it suggests). The run's inspector says what the scheduler is doing.
15
+ - `run --sweep Pn` fixes the review findings a run tolerated while its context is fresh. Once every task has merged, and before the combined verification, the open findings at Pn or worse become a few extra fix tasks, one per file (at most 8 findings each, `--sweep-max N` tasks, default 5; `--sweep-plausible` adds PLAUSIBLE ones). Each fix task runs on the plan's low tier, with a narrow review that says, finding by finding, whether it was fixed. The sweep plan, with every finding it left out and why, is printed and kept in `sweep/plan.md`. `forge issues` no longer offers a finding the sweep fixed, and a fix task that fails does not fail the run.
16
+
17
+ ### Added
18
+
19
+ - Each attempt in forge-ui lists the tests, type checks, lints and builds its dwarf and reviewer ran, read from their logs, with each one's exit code, time and pass/fail counts and a link to that command in the conversation, and says which commands of the brief's acceptance criteria were never run. forge now keeps a clock beside each agent's log (<role>.clock; FORGE_LOG_CLOCK=off turns it off) so codex and grok commands are timed too.
20
+ - A banner in a run's header names an environment problem that more than one task ran into (Docker down or out of address pools, a missing container, a port in use, the sandbox's EPERM, a refused local service, no network, a full disk, a missing command), with the tasks it hit and the commands that failed on it.
21
+ - forge-ui shows a run's finding sweep: a fix task lists the findings it took with what its review said of each, the task a finding came from shows where it stands, the run's Finish says what the sweep fixed and left, and Open findings marks findings the sweep fixed as swept instead of offering to file them.
22
+ - `run --sweep-ahead` tells a task the open review findings in files it owns, to fix only when its change already goes through that code; its reviewer is told the same, and no dispatch is added.
23
+
24
+ ### Fixed
25
+
26
+ - A codex command run through zsh -lc "…" now shows without its shell wrapper in a conversation, and a message containing a Unicode line separator no longer breaks the reading of its log.
27
+ - `FORGE_FORECAST_BUDGET_S=inf` (or any budget too large to wait for, such as `1e10`) now means no time limit for the plan forecast that `run` prints, instead of silently dropping the forecast.
28
+ - A task that deletes large files no longer breaks its review: deleted files now appear in the reviewer's diff by name only, without their contents. Previously, deleting a big data directory could make the prompt too long for the reviewer's CLI, which refused it and left the task in ERROR.
29
+
30
+ ## [0.12] - 2026-10-27
31
+
32
+ Decomposed runs can now be steered while they run and stop cleanly when interrupted: drain, stop, retry or resize a live run from forge control or forge-ui, an infrastructure stop pauses only the model or CLI it hit, and verification can run as parallel lanes that rerun only what failed and name the failing tests.
33
+
34
+ ### Highlights
35
+
36
+ - A running decomposed plan can be steered: `forge control drain` lets running tasks finish and starts nothing new until `forge control resume`; `forge control stop` ends the run once running tasks are done (exit 130 without verifying, unless every task merged; not-started tasks stay pending for the next `run`), and `stop --now` interrupts them; `forge control set <plan> max-parallel N` changes how many tasks run at once.
37
+ - Verification can run as lanes: declare them in `.forge/verify.d/` (one file per lane) or with `run --verify-lane 'name[options]=command'`, and forge runs them side by side (`--verify-parallel`, 3 by default), reruns only a lane that failed, and calls a lane that passed on rerun flaky. Lanes can read JUnit or TAP reports to name the failing tests, and a baseline of known failures keeps those from failing the run. The run summary and the whole-run review name each lane and its state.
38
+ - An infrastructure stop no longer pauses the whole decomposed run: a rate limit pauses only that model and a quota or sign-in stop only that CLI, each with its own wait and --infra-retries budget, while tasks routed elsewhere keep running. `forge control show` lists the active pauses.
39
+
40
+ ### Added
41
+
42
+ - `run --infra-backoff` sets how long forge waits between infrastructure retries: `exp:<base>[,<cap>]` (the default, `exp:60`), `linear:<start>,<step>[,<cap>]` or a list of waits such as `10,20,30`. `forge control set <plan> infra-backoff` changes it while the run goes on, and each wait message names the shape it used.
43
+ - A running decomposed plan can retry a stopped or failed task, optionally on another model (`forge control retry <plan> <task> [--dwarf <spec>]`), and pick up a row you added to tasks.tsv (`forge control add <plan> <task>`) without ending the run. The scheduler applies or refuses each request at its next pass and records the outcome in control.log.
44
+ - `run --infra-fallback`: when an implementer's model is at capacity, the task moves at once to the next model of its own tier pool instead of waiting, and the move is recorded like an escalation. The busy model is still paused and counted, so a pool that is entirely at capacity still ends the run.
45
+ - forge-ui now shows a verification while it runs: its current step, last output line and idle time, and, for a lanes verification, each lane's state, runs, test counts and failing tests, with known failures marked.
46
+ - forge-ui serves every verification log, each lane's and each rerun's, as a numbered tail or in 400-line pages, so the cause of a failed verification can be read without opening the run dir.
47
+ - The verification panel in forge-ui now follows a running verification live (current step, last line, elapsed time, a warning after five silent minutes, the log's tail) and, when it fails, opens on the failing tests, marked new or known, each linking to its line in the log.
48
+ - forge-ui's Execution view shows verification lanes as their own rows, with every run and rerun at its real time, and the 3D finish node shows one light per lane; a verification that is still running reads RUNNING instead of its previous result.
49
+ - `--escalate-effort` (on `run` and `retry`, or `forge control set <plan> escalate-effort on`): when a task has failed its escalation limit on the top tier's model, forge retries it once more at the next effort that model accepts before stopping it with a split suggestion. Turning it on also releases tasks the policy already stopped.
50
+ - forge-ui's Controls panel can now drain, resume and stop a live run (gracefully or at once), change max parallel, the infrastructure backoff and the effort step, and retry a stopped task now with a chosen model. It also shows each infrastructure pause with a countdown, and whether a queued retry was applied or refused.
51
+
52
+ ### Changed
53
+
54
+ - The forecast `run` prints before dispatching lists the tasks that don't have enough history yet on one line instead of a row each, and is a single line when no task has enough history, so a new setup no longer opens every run with a table of "not enough history" rows. `forge dataset forecast <plan>` still shows every task.
55
+
56
+ ### Fixed
57
+
58
+ - When the plan forecast that `run` prints runs out of its time budget while saving, it no longer leaves a stray `.forecast.json.<pid>` file in the plan.
59
+ - Interrupting a decomposed run no longer leaves an implementer or reviewer CLI running: forge waits up to 10 s (FORGE_INTERRUPT_GRACE) for each task to stop its harness, and a harness left behind by a killed run is stopped when the next run starts.
60
+ - Interrupting `forge-parallel.sh run` (Ctrl-C or SIGTERM) no longer goes on to verify a half-merged integration branch: the run stops, frees the plan lock within seconds, exits 130 and prints the command that continues each interrupted task. A signal during verification stops the whole verify command and skips its rerun.
61
+ - A task that finished just as a decomposed run was interrupted is now reaped first: its passing work still merges and its result is kept, and only the tasks still running are marked INTERRUPTED.
62
+ - On macOS, a Ripwire context call whose output was too long or that ran too long no longer fails with a PermissionError; it is skipped with its reason, as intended.
63
+
8
64
  ## [0.11.1] - 2026-10-26
9
65
 
10
66
  A bug-fix release for forge-ui and forge issues: the Settings and Open findings views keep your edits and selections honest, forge ui open handles a read-only server with another configuration, and refused labels and warnings say what's wrong.
package/SKILL.md CHANGED
@@ -45,7 +45,9 @@ For explanation requests, explain the workflow without spending model quota.
45
45
  when requested; preserve failed task branches and worktrees. `run --retry-failed N`,
46
46
  `--infra-retries M`, `--qa-threshold Pn`, `plan --shadow-qa` (a second review of a
47
47
  sampled share of attempts, never read, to measure reviewer agreement) and
48
- `plan --reviewer-session` (continue the reviewer's session across rounds) are opt-in: offer
48
+ `plan --reviewer-session` (continue the reviewer's session across rounds) and `run --sweep Pn`
49
+ (once every task merged, fix the tolerated findings at Pn or worse in a few extra tasks, one per
50
+ file; `--sweep-ahead` instead hands a task the open findings in its files) are opt-in: offer
49
51
  them, never add them unprompted. So is `--fail-first` (solo or `plan`): the change's new
50
52
  tests also run without its non-test changes, and the reviewer is asked to report any that
51
53
  still pass as P2; it needs `.forge/verify-subset` and never changes a result by itself. `plan` explores by default (`--explore 0.2`: now and then
@@ -57,8 +59,10 @@ For explanation requests, explain the workflow without spending model quota.
57
59
  overrides a reviewer, so run it (with the user's `--reason` and
58
60
  `--approved`) only on the user's explicit instruction; never self-accept.
59
61
  - When you report a run, read `<plan>/control.log` and mention any human change made mid-run
60
- (a threshold, a budget, a model pin; `forge control show <plan>` lists them). Never set a
61
- control, pin or delete a run with `forge control` / `forge runs rm` unless the user asks.
62
+ (a threshold, a budget, a model pin, a drain, stop or queued retry; `forge control show <plan>`
63
+ lists them). Never set a control, pin, `drain|stop|retry` or delete a run with `forge control` /
64
+ `forge runs rm` unless the user asks. Exit `130` / `INTERRUPTED`: the run was signalled or
65
+ stopped; relay the `retry` lines it printed.
62
66
  - Exit `8` / status `INFRA` is a quota, auth or network stop, not a task failure and no
63
67
  attempt was spent: report it, say what to fix, and re-run only when told. For a multi-task
64
68
  plan, offer the opt-in whole-run review (`review`, or `integrate --final-review <qa-spec>`);
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.1
1
+ 0.12.1
package/docs/artifacts.md CHANGED
@@ -14,8 +14,9 @@ as if the dwarf had written it.
14
14
  <role>.prompt the exact prompt sent
15
15
  <role>.cmd the exact command line executed
16
16
  <role>.log full transcript
17
+ <role>.clock when the log grew: one `<epoch> <bytes>` line per second it grew (forge-ui times codex and grok events by it; FORGE_LOG_CLOCK=off)
17
18
  <role>.last the final message — read this first
18
- <role>.infra only after an infrastructure failure: class, retry_after, detail
19
+ <role>.infra only after an infrastructure failure: class, retry_after, detail, harness, model
19
20
  <role>.orphans only when processes were left running after the harness exited
20
21
  <role>.session session id reported by claude, openclaude or codex; absent when the dispatch published none
21
22
  <role>.continue only when the dispatch was asked to continue a reviewer session: requested=, mode=continued|failed, reason=
@@ -48,10 +49,16 @@ A decomposed run adds:
48
49
  tasks/<id>/{capsule.md,prompt.md,dwarf.*,qa.*,changes.diff,status}
49
50
  tasks/<id>/attempt, attempts.tsv attempts spent; one audit row per entry (incl. refunded stops)
50
51
  tasks/<id>/known_issues.md, qa.gate findings tolerated by --qa-threshold, and the gate's decision
52
+ sweep/plan.json, plan.md run --sweep: the fix tasks, their findings, and every finding left out with its reason
53
+ tasks/<id>/sweep.json a fix task's findings (S1, S2, ...), each with its source task and key
54
+ tasks/<id>/sweep.outcome.json what the fix task's review said of each, written when it merged; forge issues reads it
55
+ tasks/<id>/sweep.ahead.json run --sweep-ahead: the open findings this task was handed
56
+ sweep_ahead run --sweep-ahead is on for this plan
51
57
  tasks/<id>/guard.txt what forge observed about the implementer (self-commit, orphans, promises)
52
- tasks/<id>/infra.txt, resume, noretry infrastructure stop record; QA-only resume marker; no-progress marker
58
+ tasks/<id>/infra.txt, resume, noretry infrastructure stop record (<role>.infra plus stage=); QA-only resume marker; no-progress marker
59
+ tasks/<id>/<role>.harness only while a guarded dispatch runs: its harness's pid and start time, for forge-guard.py stop
53
60
  tasks/<id>/qa_threshold optional per-task blocking threshold: P0-P3, or none (exempt from the plan's)
54
- tasks/<id>/escalations.tsv epoch, attempt, from-spec, to-spec, source (policy|retry|pin); older rows have 4 columns
61
+ tasks/<id>/escalations.tsv epoch, attempt, from-spec, to-spec, source (policy|retry|pin|fallback); older rows have 4 columns
55
62
  tasks/<id>/escalation.pin a human's one-shot model for the next full retry: one dwarf spec on one line
56
63
  tasks/<id>/escalation.pin.applying the pin while a retry has claimed it; removed once the retry is recorded
57
64
  tasks/<id>/retry_findings.commit commit the carried review judged
@@ -64,18 +71,40 @@ A decomposed run adds:
64
71
  tasks/<id>/retry_budget, retries.used live per-task retry budget (a number); retries spent (kept after the run)
65
72
  results.tsv id status branch
66
73
  timeout, qa_threshold, verify_retries options remembered from run/retry flags (also escalate_after)
74
+ escalate_effort on: the retry policy's effort step (--escalate-effort; absent = off)
75
+ infra_backoff, infra_fallback --infra-backoff's shape; on while --infra-fallback is set
76
+ max_parallel the concurrency limit: written by each run from --max-parallel, changed live by forge control
67
77
  reviewer_session holds on; present while plan --reviewer-session is on
68
78
  <final-review-dir>/review.meta final-review-<epoch>-<pid>/ or integrate-*/final-review/; base=, tip=, source=, spec=, threshold=, integration=, previous=, since=; session= and session_reason= while reviewer_session is set
69
- control.log one JSON line per human change made with forge control
79
+ control.log one JSON line per human change made with forge control, and per request outcome
80
+ control.requests/ retry and add requests queued by forge control: one JSON file each, removed once settled
70
81
  scheduler.live only while a scheduler runs: {"pid", "started"}
82
+ drain, stop only while a scheduler runs: forge control drain (empty) and stop (graceful|now)
83
+ infra.paused only while something is paused on infrastructure: {"scopes": [...]}
71
84
  control.lock the lock that serialises changes to the plan's control files, created by whichever takes it first (forge control, the scheduler or an escalation record) and left in place
72
85
  retry_budget, infra_budget only while a scheduler runs: its live budgets (a number each)
73
86
  integration.base commit the integration branch started from
74
- verification.{status,exit,log,command,fingerprint} the combined verification
75
- verification.{flaky,retry.log} only when a failing command passed on rerun
87
+ verification.{status,exit,log,command,fingerprint} the combined verification; status PASS, FAIL or INTERRUPTED (a signal stopped it)
88
+ verification.{flaky,retry.log} only when a failing command passed on rerun (lanes: flaky alone, per lane)
89
+ verification.commit the integration commit that was verified
90
+ verification.runs.tsv one row per run of the verify command or of a lane (below)
91
+ verification.run-<n>.log single command: each run's own copy of its log
92
+ verification.lanes.json lanes only: every lane's state, runs, step and tests, rewritten as they change
93
+ verification.lane.<name>.log lanes only: the lane's run in progress
94
+ verification.lane.<name>.run-<k>.log lanes only: each finished run of the lane
76
95
  verification.coverage.txt suites the verify command does not run (advisory)
96
+ verify_cmd, verify.d/ the plan's --verify command, or its --verify-lane lanes (one file per lane)
97
+ verify_parallel lanes run at once (--verify-parallel; default 3)
77
98
  ```
78
99
 
100
+ `verification.runs.tsv` is tab-separated, one row per run: `n`, `kind` (`initial`, `rerun`, or
101
+ `jev_retry` for a single command), `exit`, `tree_changed` (`0`/`1`), `duration_s` and `log`. With
102
+ lanes each row has two more columns, `lane` and `started` (epoch seconds); lanes run side by
103
+ side, so `tree_changed` is `1` only when the whole verification was a single lane run that
104
+ changed the tree (`verification.lanes.json`'s `mutated` says whether it changed at all). In lanes
105
+ mode `verification.flaky` holds `lanes=<names>` and, per flaky lane, `<lane>.first_exit=` and
106
+ `<lane>.retries_used=`.
107
+
79
108
  with worktrees and branches at:
80
109
 
81
110
  ```
@@ -86,11 +115,21 @@ forge/<run-id>-integration integration branch
86
115
 
87
116
  `control.log` lines look like
88
117
  `{"at": 1761200000.5, "actor": "ui", "action": "set", "task": null, "key": "qa-threshold", "value": "P2", "previous": "P1"}`
89
- (`actor` is `cli` or `ui`; `action` is `set`, `pin` or `unpin`; `key` is the control's name, or `pin`; `task` is null for a plan-wide
90
- control). `scheduler.live`, `retry_budget`, `infra_budget` and the per-task `retry_budget` exist
91
- only while the scheduler is live: it publishes the flags it was given when it starts, re-reads them
92
- at every decision and removes them when it stops, which is why `forge control` refuses a budget
93
- change outside a live run. See [live controls](decomposed-runs.md#changing-a-run-while-it-works).
118
+ (`actor` is `cli` or `ui`; `action` is `set`, `pin`, `unpin`, `drain`, `resume`, `stop`, `retry` or
119
+ `add`; `key` is the control's name, or `pin`; `task` is null for a plan-wide control). A queued
120
+ `retry` or `add` also carries its `request` id, and the scheduler later appends the outcome under
121
+ the same id:
122
+ `{"at": 1761200030.1, "actor": "scheduler", "action": "retry", "task": "docs", "key": null, "value": "sol:high", "previous": null, "request": "…", "outcome": "refused", "reason": "the task is running"}`
123
+ (`outcome` is `applied` or `refused`). `scheduler.live`, `retry_budget`, `infra_budget`, the
124
+ per-task `retry_budget`, `drain`, `stop` and `infra.paused` exist only while the scheduler is live:
125
+ it publishes the flags it was given when it starts, re-reads them at every decision and removes
126
+ them when it stops, which is why `forge control` refuses a budget change, a drain or a stop outside
127
+ a live run. A request still queued then is refused (`run ended`, or `left by an earlier run` at the
128
+ next start). See [live controls](decomposed-runs.md#changing-a-run-while-it-works).
129
+
130
+ `infra.paused` holds one entry per paused scope: `scope` (`all`, `harness:<h>` or
131
+ `model:<h>/<m>`), `class`, `harness`, `model`, the `tasks` it holds, `cycle` (which wait this is),
132
+ `until` (epoch seconds, null while not waiting) and `exhausted` (its waits are used up).
94
133
 
95
134
  The worktree root is a **sibling of the repo, never `TMPDIR`**. Isolated worktrees are never
96
135
  pushed, so a temp root that gets cleaned takes the only copy of that work with it.
package/docs/commands.md CHANGED
@@ -16,7 +16,7 @@ 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 PLAN_DIR …` | change a live plan: `set` takes `qa-threshold`, `timeout`, `escalate-after`, `verify-retries`, `retry-budget` or `infra-retries` (the last two 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; `--json`. Every change is logged in `control.log`. 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`, `timeout`, `escalate-after`, `escalate-effort` (`on`/`off`), `verify-retries`, `infra-backoff` (a backoff shape; `none` drops it), `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) |
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, Jev, the repo's `.forge/verify`, `setup` and `verify-subset`, dataset, `FORGE_*` variables with secrets hidden); `set KEY VALUE` / `unset KEY` edit `repo.verify`, `repo.setup`, `repo.verify-subset` (must contain `{files}`) and, for `set`, `jev.enabled true\|false` (that one does not need `--repo`). `-` as a value reads stdin. Exit 2 on invalid input |
21
21
  | `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) |
22
22
  | `forge issues RUN [--apply] …` | file the review findings a run left open as GitHub issues; see [below](#forge-issues) |
@@ -64,7 +64,7 @@ the size of a `--only` selection).
64
64
 
65
65
  | Flag | Does |
66
66
  |---|---|
67
- | `--json` | machine-readable output; `findings` lists each one with its fingerprint, severity, origin (`tolerated`, `accepted`, `review` or `plausible`), task, `review`, `filed` state and `dismissed` mark. A whole-run finding's `review` is `{name, outdated, merged_since}` (`outdated` is null when the review has no verdict or the plan has no accepted integration commit; `merged_since` is empty unless the review is outdated). Every other finding has `review` null |
67
+ | `--json` | machine-readable output; `findings` lists each one with its fingerprint, severity, origin (`tolerated`, `accepted`, `review` or `plausible`), task, `review`, `swept` (`{task, finding}` when the run's finding sweep fixed it; such a finding is never drafted), `filed` state and `dismissed` mark. A whole-run finding's `review` is `{name, outdated, merged_since}` (`outdated` is null when the review has no verdict or the plan has no accepted integration commit; `merged_since` is empty unless the review is outdated). Every other finding has `review` null |
68
68
  | `--offline` | never run `gh`: no filed state, commit publication judged from local refs |
69
69
  | `--only FP` | keep only these 12-hex fingerprints (repeatable or comma-separated) |
70
70
  | `--all-runs` | read `RUN` as a repository (or a plan dir naming one) and collect every run in its registry; the newest plan wins for a finding in several |
@@ -191,8 +191,13 @@ forge-dispatch.sh dwarf <spec> --prompt-file <f> [--repo <dir>] [--run-dir <d>
191
191
  forge-dispatch.sh qa <spec> --prompt-file <f> [--repo <dir>] [--run-dir <d>] [--yolo] [--dry-run]
192
192
  [--native-review [--review-base <ref>]]
193
193
  forge-dispatch.sh planner <spec> --prompt-file <f> [--repo <dir>] [--run-dir <d>] [--dry-run]
194
+ forge-dispatch.sh efforts --spec <spec>
194
195
  ```
195
196
 
197
+ `efforts` prints the efforts the spec's pairing accepts, weakest first, one per line (nothing
198
+ when the pairing has no effort dial); a literal model id with a harness takes that harness's
199
+ whole ladder. It never dispatches and spends no quota. The retry policy's effort step reads it.
200
+
196
201
  | Option | Meaning |
197
202
  |---|---|
198
203
  | `--prompt-file <f>` | file holding the prompt (required for `dwarf`/`qa`) |
@@ -210,7 +215,7 @@ forge-dispatch.sh planner <spec> --prompt-file <f> [--repo <dir>] [--run-dir <d>
210
215
  `8` an **infrastructure failure** (quota or usage limit, auth, rate limit, network, or an
211
216
  empty answer) — nothing about the work was judged, so callers pause instead of counting a
212
217
  failure. On `8`, `<run-dir>/<role>.infra` holds `class=`, `retry_after=`, `detail=`, `rc=`,
213
- `role=`.
218
+ `role=`, `harness=`, `model=`.
214
219
 
215
220
  **Timeout precedence.** An explicit `--timeout`, then `FORGE_TIMEOUT` (an explicit `0` wins
216
221
  and disables the watchdog), then the optional fifth `timeout` column of the model's
@@ -236,6 +241,10 @@ is started in its own session, and after it exits any process still alive in tha
236
241
  listed in `<role>.orphans` and stopped, so a backgrounded measurement cannot outlive the
237
242
  dispatch. The timeout watchdog and the exit trap signal the whole session too.
238
243
 
244
+ **Log clock.** Beside the log, `<role>.clock` records when it grew (one `<epoch> <bytes>` line for
245
+ each second it did), so forge-ui can time the commands of a harness that logs no times (codex,
246
+ grok). It never changes a dispatch's outcome; `FORGE_LOG_CLOCK=off` turns it off.
247
+
239
248
  ```bash
240
249
  # what would this actually run?
241
250
  bash scripts/forge-dispatch.sh dwarf sol:ultra --prompt-file /tmp/p --dry-run
@@ -328,15 +337,23 @@ forge-parallel.sh plan <plan-dir> --repo <dir> [routing flags] [--planner <
328
337
  [--reviewer-session | --no-reviewer-session]
329
338
  [--explore E] [--ui | --no-ui] [--fail-first | --no-fail-first]
330
339
  forge-parallel.sh run <plan-dir> [--max-parallel N] [--yolo-dwarf] [--yolo-qa] [--dry-run]
331
- [--verify <cmd>] [--setup <cmd>] [--timeout S]
332
- [--retry-failed N] [--infra-retries M]
340
+ [--verify <cmd> | --verify-lane 'name[opts]=cmd' ...]
341
+ [--verify-parallel N] [--setup <cmd>] [--timeout S]
342
+ [--retry-failed N] [--infra-retries M] [--infra-backoff SHAPE]
343
+ [--infra-fallback | --no-infra-fallback]
333
344
  [--qa-threshold P0|P1|P2|P3|none] [--verify-retries N]
345
+ [--escalate-after N] [--escalate-effort | --no-escalate-effort]
346
+ [--sweep P0|P1|P2|P3 [--sweep-plausible] [--sweep-max N]]
347
+ [--sweep-ahead | --no-sweep-ahead]
334
348
  [--fractal | --no-fractal] [--fractal-<limit> <n>]
335
349
  forge-parallel.sh retry <plan-dir> <task-id> [--dwarf <spec>] [--timeout S]
336
350
  [--qa-threshold Pn|none] [--verify-retries N]
351
+ [--verify <cmd> | --verify-lane 'name[opts]=cmd' ...] [--verify-parallel N]
352
+ [--escalate-after N] [--escalate-effort | --no-escalate-effort]
337
353
  forge-parallel.sh accept <plan-dir> <task-id> --reason "<why>" --approved
338
354
  forge-parallel.sh review <plan-dir> [--qa <spec>] [--yolo-qa] [--qa-threshold Pn]
339
355
  forge-parallel.sh integrate <plan-dir> --approved [--final-review <qa-spec>] [--verify-retries N]
356
+ [--verify-parallel N]
340
357
  forge-parallel.sh split <plan-dir> <new-plan-dir> --tasks <id,id> [--dry-run]
341
358
  forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <cmd>] [--dry-run]
342
359
  ```
@@ -355,17 +372,48 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
355
372
  |---|---|---|---|
356
373
  | `--timeout S` | run, retry | `timeout` | per-dispatch timeout in seconds (`0` disables); wins over `FORGE_TIMEOUT` |
357
374
  | `--retry-failed N` | run | no — this run only | re-queue a task the reviewer rejected up to `N` more times inside the run |
358
- | `--infra-retries M` | run | no — this run only | wait out up to `M` infrastructure stops instead of pausing |
375
+ | `--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 |
376
+ | `--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`) |
377
+ | `--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) |
359
378
  | `--qa-threshold Pn` | run, retry | `qa_threshold` | least severe finding that still blocks; milder ones become known issues; `none` clears |
360
- | `--verify-retries N` | run, retry, integrate | `verify_retries` | reruns of a failed verify command (default `1`, `0` = strict single run) |
379
+ | `--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) |
380
+ | `--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) |
381
+ | `--verify-parallel N` | run, retry, integrate | `verify_parallel` | lanes run at once, 1 to 32 (default `3`) |
382
+ | `--escalate-after N` | run, retry | `escalate_after` | failed attempts on one model before the next goes a tier up (default `3`, `0` = off) |
383
+ | `--sweep Pn` | run | no — this run only | once every task has merged, fix the open findings at `Pn` or worse in a few extra tasks, one per file, each with a narrow review; the plan goes to `sweep/plan.md`. Once per plan; what it does not fix stays for `forge issues`. See [the finding sweep](reviews.md#fixing-them-in-the-run-the-finding-sweep-opt-in) |
384
+ | `--sweep-plausible` | run | no — this run only | the sweep also takes PLAUSIBLE findings of passed tasks |
385
+ | `--sweep-max N` | run | no — this run only | at most `N` fix tasks (default `5`) |
386
+ | `--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) |
387
+ | `--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) |
361
388
 
362
389
  **Exit codes:** `0` ok · `2` usage or validation · `3` precondition (not a git repo, …) ·
363
390
  `5` some task failed QA, or the combined verification failed · `6` integration conflict ·
364
391
  `8` **paused on an infrastructure failure** (quota, auth, rate limit, network): no attempt was
365
- spent and nothing was judged — fix the cause and run the same command again.
392
+ spent and nothing was judged — fix the cause and run the same command again ·
393
+ `130` **interrupted or stopped** (a signal, or `forge control stop`): the running tasks are
394
+ `INTERRUPTED` and verification was skipped or stopped; the summary prints the `retry` for each.
366
395
 
367
396
  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).
368
397
 
398
+ ## `scripts/forge-verify.py`
399
+
400
+ The verification lane runner `run`, `retry` and `integrate` use when lanes are declared. You can
401
+ run it by hand to check or try a lanes directory:
402
+
403
+ ```
404
+ forge-verify.py lanes --lanes-dir DIR [--checkout DIR] [--json]
405
+ forge-verify.py run --checkout DIR --out DIR --lanes-dir DIR [--parallel N] [--retries N]
406
+ [--fingerprint-cmd CMD]
407
+ ```
408
+
409
+ `lanes` lists the lanes with their options and checks them (with `--checkout`, also that
410
+ `reports=` and `baseline=` stay inside it and the baseline exists). `run` runs them in the
411
+ checkout as a forge run does and writes `verification.lanes.json`, `verification.runs.tsv` and
412
+ the per-lane logs into `--out` (`--parallel` default 3, `--retries` default 1).
413
+
414
+ **Exit codes:** `0` every lane passed and the tree is unchanged · `1` a lane failed, or the tree
415
+ changed · `2` configuration error (nothing ran) · `130` interrupted.
416
+
369
417
  ## `scripts/forge-memory.sh` and `scripts/forge-install.sh`
370
418
 
371
419
  See [project memory](memory.md#scriptsforge-memorysh) and [install](install.md#scriptsforge-installsh).
@@ -193,6 +193,14 @@ all their child invocations and QA. See [decomposed Fractal execution](../refere
193
193
 
194
194
  ## Resuming an interrupted run
195
195
 
196
+ Ctrl-C (or a SIGTERM) on `run` stops the running tasks' process groups, waiting up to
197
+ `FORGE_INTERRUPT_GRACE` seconds (10 by default) before killing what is left, and stops any
198
+ harness that outlived its dispatch. A task that had already finished is reaped first (a PASS
199
+ still merges); only the tasks still running become `INTERRUPTED`, with their partial work kept
200
+ in the worktree. Verification is skipped, or stopped if it had started (`verification.status`
201
+ `INTERRUPTED`, not rerun). The summary lists each interrupted task with its `retry` command,
202
+ the plan lock is released, and `run` exits 130.
203
+
196
204
  Run `run` again to skip MERGED tasks, merge saved PASS results after fingerprint checks,
197
205
  and dispatch eligible pending tasks. Tasks paused on an infrastructure failure (`INFRA`) are
198
206
  dispatched again without any flag, since nothing was wrong with the work. Failed and
@@ -200,6 +208,9 @@ interrupted tasks need an explicit `retry` (or `run --retry-failed N` for reject
200
208
  Their worktrees and pinned baselines remain available. Concurrent run/retry/integrate
201
209
  operations for the same plan are excluded by an advisory lock.
202
210
 
211
+ To pause a run on purpose, drain it instead of signalling it (see below): nothing is
212
+ interrupted, and `forge control resume` continues the same run.
213
+
203
214
  For a Fractal-backed run, use `forge fractal resume RUN_ID` to recover recorded execution
204
215
  and pipeline checkpoints. A task/subtree selector resumes only that execution scope.
205
216
  Explicit `retry` retains the backend and frozen pools; a replacement dwarf must already
@@ -213,12 +224,35 @@ belong to that pool. See [recovery](../references/fractal.md#limits-and-lifecycl
213
224
  forge control show <plan-dir> [--json] # every control, per-task overrides, pins, recent changes
214
225
  forge control set <plan-dir> qa-threshold P2 # also --task <id>; P0-P3, none, or inherit (task only)
215
226
  forge control set <plan-dir> retry-budget 3 [--task <id>] # automatic retries; live scheduler only
216
- forge control set <plan-dir> infra-retries 2 # infrastructure waits; live scheduler only
227
+ forge control set <plan-dir> infra-retries 2 # infrastructure waits per scope; live scheduler only
228
+ forge control set <plan-dir> max-parallel 2 # tasks at once, 1-64; live scheduler only
229
+ forge control set <plan-dir> infra-backoff linear:60,60 # the next infrastructure wait; none = exp:60
230
+ forge control set <plan-dir> escalate-effort on # the effort step before a policy stop
217
231
  forge control set <plan-dir> timeout|escalate-after|verify-retries <n>
218
232
  forge control pin <plan-dir> <task> sol:high:codex # the model the next full retry uses, once
219
233
  forge control unpin <plan-dir> <task>
220
234
  ```
221
235
 
236
+ And to steer the scheduler itself (each needs a live run, exit 3 otherwise):
237
+
238
+ ```bash
239
+ forge control drain <plan-dir> # start nothing new; running tasks finish, the run waits for resume
240
+ forge control resume <plan-dir> # end the drain
241
+ forge control stop <plan-dir> # finish what runs, start nothing, end the run (exit 130)
242
+ forge control stop <plan-dir> --now # interrupt the running tasks too, like Ctrl-C
243
+ forge control retry <plan-dir> docs --dwarf sol:high # queue a retry of a stopped or failed task
244
+ forge control add <plan-dir> docs-fix # queue a row you appended to tasks.tsv (with its prompt.md)
245
+ ```
246
+
247
+ A stop skips verification and exits 130, unless every task had merged by then, and a drain
248
+ with nothing left to start lets the run end as usual: both act on work still to do.
249
+ `retry` and `add` only queue a request in `control.requests/`; the scheduler applies or refuses
250
+ it at its next pass and logs the outcome in `control.log` under the same request id (`forge
251
+ control show` lists the log). A retry is prepared exactly as `forge-parallel.sh retry` prepares one,
252
+ so a task the policy stopped needs `--dwarf`; it spends no automatic retry budget. An added row
253
+ may depend only on tasks the run already knows. Neither outlives the run that was live when it
254
+ was queued, and both are refused once the run is stopping.
255
+
222
256
  Each change is validated, written under `control.lock`, and says when it applies:
223
257
 
224
258
  - **The QA threshold is read once per attempt**, at the start of the task's next attempt; the
@@ -244,8 +278,15 @@ Each change is validated, written under `control.lock`, and says when it applies
244
278
  worktree. A marker the next retry will discard is reported as `pinned`.
245
279
  Fractal plans never apply pins, and a MERGED task refuses one.
246
280
  - **Who decided an escalation.** The last column of `tasks/<id>/escalations.tsv` is `policy`
247
- (`--escalate-after`), `retry` (a typed `retry --dwarf`) or `pin`; rows from before it was added
281
+ (`--escalate-after`), `retry` (a typed `retry --dwarf`), `pin` or `fallback`
282
+ (`--infra-fallback` moved a task off a model at capacity); rows from before it was added
248
283
  have four columns and read as `policy`.
284
+ - **Max parallel and the backoff apply at the next decision.** A lower `max-parallel` lets the
285
+ running tasks finish and never stops one; `infra-backoff` shapes the next infrastructure wait,
286
+ not the one already counting down.
287
+ - **The effort step re-decides stopped tasks.** Turning `escalate-effort` on clears the policy's
288
+ stop markers, so a task stopped at the top tier is tried at its model's next effort on its
289
+ next retry.
249
290
 
250
291
  Every change is appended to `control.log` (one JSON line: `at`, `actor` `cli` or `ui`, `action`,
251
292
  `task`, `key`, `value`, `previous`) and recorded in the dataset as a `control` event, so a run's
package/docs/forge-ui.md CHANGED
@@ -55,6 +55,45 @@ following its log as it grows. It is read from the agent CLI's own log, whicheve
55
55
  wrote it (as plain text for those that log no events yet), or for an older claude run from
56
56
  Claude's session file on this machine.
57
57
 
58
+ The *Verification* node opens the run's verification in the inspector. While it runs you see
59
+ for how long, the step a lane announced (`::forge step`, see
60
+ [verification lanes](../references/decompose.md#execution-checks-and-integration-verification))
61
+ and its last printed line, a warning after five minutes with no output, and the live output of
62
+ the lane that printed last (or of the one you choose). Once it fails, the failing tests come
63
+ first, by lane and marked new or known (from the lanes' JUnit or TAP reports), each with its
64
+ message, an excerpt and a link that opens the lane's log at that line; a lane without reports
65
+ shows the end of its log and the step it ended in. Below, every lane with its state (flaky and
66
+ known called out), time, runs and test counts; a lane's name opens its output. A single verify
67
+ command shows the newest of its logs. On the *Execution*
68
+ view the verification has rows of its own after the tasks, one per lane with a bar per run and
69
+ reruns marked (a single command's runs sit back to back, dashed, because only their durations
70
+ are known), and its finish node counts the lanes and reruns.
71
+
72
+ The task table's *Now* column, and *Now* at the top of a task's inspector, say where each task
73
+ is. A running task names the dwarf or reviewer at work, the command it is running (and whether
74
+ it is a test, type check, lint or build) and for how long, and flags *quiet N min* once its log
75
+ has said nothing for five minutes. A task that is not running says why: the tasks it waits on, a
76
+ running task it shares files with, no free slot, a drain or stop, an infrastructure pause with
77
+ its countdown, or the retry policy's stop with the split it suggests. The run's inspector says
78
+ what the scheduler is doing and how many tasks wait on what.
79
+
80
+ Under each attempt's dwarf and reviewer are the checks they ran, read from their logs: each
81
+ test, type check, lint or build with its exit, its time and the counts it printed, a failed
82
+ one's last lines, and a link to that command in the conversation. Each attempt then says which
83
+ of the commands its brief's `## Acceptance criteria` names ran, ran another way, or never ran.
84
+ When a failed command met an environment problem (Docker down or out of address pools, a port in
85
+ use, the sandbox's EPERM, a refused local service, no network, a full disk, a missing command)
86
+ the attempt says so, and when more than one task met the same one, a banner in the run's header
87
+ lists them. codex and grok log no times, so forge keeps a small clock beside each agent's log
88
+ (`<role>.clock`, off with `FORGE_LOG_CLOCK=off`); runs from before it show their checks without
89
+ times.
90
+
91
+ A run with a [finding sweep](reviews.md#fixing-them-in-the-run-the-finding-sweep-opt-in) shows its fix
92
+ tasks like any other. A fix task's inspector lists the findings it took, each with a lamp for what
93
+ its review said (fixed, not fixed, not reported), and links each to the task it came from. That task
94
+ shows which of its findings the sweep took and where they stand. The run's *Finish* says how many
95
+ the sweep fixed and lists what it left for `forge issues`, with each reason.
96
+
58
97
  ### Controls
59
98
 
60
99
  forge-ui reads everything, and it changes things only by calling forge's own commands: it
@@ -64,16 +103,24 @@ indistinguishable from the same command typed in a terminal, except that `contro
64
103
  `ui` instead of `cli`. Every change asks you to confirm and says when it takes effect.
65
104
 
66
105
  - **Run controls** (a plan's inspector): the QA threshold, the per-attempt timeout, how many
67
- failures before escalating, verification retries, and, while a scheduler is live, the retry
68
- and infrastructure-retry budgets. A task has its own panel for a threshold override
69
- (including *None*, which exempts it from the run's threshold), its own retry budget, and a
70
- **model pin**: the model its next full retry uses, once. Each is `forge control`; see
71
- [decomposed runs](decomposed-runs.md#changing-a-run-while-it-works). A control that cannot
72
- apply (a budget with no live scheduler, a merged task) is disabled and says why.
106
+ failures before escalating, the effort step, verification retries, the infrastructure backoff,
107
+ and, while a scheduler is live, the retry and infrastructure-retry budgets and max parallel.
108
+ A live run also gets **Drain** (start nothing new; *Resume* ends it), **Stop** (finish what
109
+ runs, then end the run) and **Stop now** (interrupt the running tasks), and one line per
110
+ infrastructure pause: the model or harness it holds, the class, its tasks, and a countdown to
111
+ its next try, or *budget used up*. A task has its own panel for a threshold override
112
+ (including *None*, which exempts it from the run's threshold), its own retry budget, a
113
+ **model pin**: the model its next full retry uses, once, and, on a live run, **Retry now**
114
+ for a task that stopped or failed, on the policy's choice or a model you name. A retry is
115
+ queued; the panel says *queued*, then *applied* or *refused* with the scheduler's reason.
116
+ Each is `forge control`; see [decomposed runs](decomposed-runs.md#changing-a-run-while-it-works).
117
+ A control that cannot apply (a budget with no live scheduler, a merged task) is disabled and
118
+ says why.
73
119
  - **Open findings:** the review findings a run left open (tolerated by `--qa-threshold`,
74
120
  PLAUSIBLE, or left by the whole-run review), for this run or every run of its repository.
75
- Findings of an outdated review carry an "outdated review" marker, and findings a person
76
- accepted have origin `accepted`. Select some and file them as GitHub issues, or dismiss the
121
+ Findings of an outdated review carry an "outdated review" marker, findings a person
122
+ accepted have origin `accepted`, and findings the run's finding sweep fixed are *swept*: listed,
123
+ never filed. Select some and file them as GitHub issues, or dismiss the
77
124
  ones that need no work (and take that back). It runs `forge issues`, so a finding is never
78
125
  filed twice.
79
126
  - **Delete a run:** a dialog that first shows a dry run, then deletes the run directory
package/docs/reviews.md CHANGED
@@ -103,15 +103,30 @@ decomposed task then ends as **`INFRA`**, not `ERROR`/`FAIL`, and:
103
103
  - **no attempt is spent** — a dwarf-stage stop refunds the counter; a QA-stage stop keeps the
104
104
  dwarf's committed work and re-runs **QA only** next time (`tasks/<id>/resume`, revalidated
105
105
  against the branch tip and fingerprint before it is trusted);
106
- - the scheduler stops dispatching, lets running tasks drain, leaves unstarted ones `PENDING`
107
- (never `BLOCKED`) and `run` exits **8**: fix the cause, then run the same command again;
108
- - `run --infra-retries M` waits instead — up to `M` times, using the provider's retry-after
109
- hint when it gave one (capped at 6 hours) and otherwise 60 s doubling to 30 min
110
- (`FORGE_INFRA_BACKOFF` sets the base) — and resumes in the same run;
106
+ - the scheduler pauses only what the stop is about: a **rate limit** pauses that model on that
107
+ harness, a **quota** or **auth** stop pauses that harness, and anything else (network, an
108
+ empty answer) pauses everything, letting running tasks drain. A task whose next dispatch
109
+ needs a paused model or harness waits; the others keep running. Unstarted tasks stay
110
+ `PENDING` (never `BLOCKED`), and once nothing else can run `run` exits **8**: fix the cause,
111
+ then run the same command again;
112
+ - `run --infra-retries M` waits instead — up to `M` waits per paused scope, using the provider's
113
+ retry-after hint when it gave one (capped at 6 hours) and otherwise the backoff shape — and
114
+ resumes that scope's tasks in the same run. `--infra-backoff` picks the shape: `exp:60` by
115
+ default (60 s doubling to 30 min; `FORGE_INFRA_BACKOFF` sets that base), `exp:<base>,<cap>`,
116
+ `linear:<start>,<step>[,<cap>]` or `list:<a>,<b>,...`. `forge control set infra-backoff`
117
+ changes it for the next wait, and `forge control show` (and forge-ui) list each pause with
118
+ the time left;
119
+ - `run --infra-fallback` moves an implementer stopped by a rate limit to the next model of its
120
+ own tier pool that nobody paused, at once and with no attempt spent (recorded in
121
+ `escalations.tsv` with source `fallback`); a pinned task, or a pool with no healthy member,
122
+ waits as above;
111
123
  - verification is skipped for a paused run (it is unfinished); the next `run` verifies at its end.
112
124
 
125
+ For a planned outage, `forge control drain <plan>` lets the running tasks finish and starts
126
+ nothing new until `forge control resume <plan>`, inside the same run.
127
+
113
128
  `.infra` (`dwarf.infra`/`qa.infra`) holds `class=`, `retry_after=`, `detail=`, `rc=`,
114
- `role=`. Detection is deliberately strict: strong phrases only, and ordinary text that merely
129
+ `role=`, `harness=`, `model=`. Detection is deliberately strict: strong phrases only, and ordinary text that merely
115
130
  mentions "rate limit" in a reply that otherwise succeeded is never classified. A false
116
131
  positive costs a pause, not a spent attempt. Under Fractal a dwarf-side infrastructure stop
117
132
  still collapses to Fractal's own "failed" handling; QA-side stops propagate as above.
@@ -157,6 +172,39 @@ that merged after it. In `--json` each whole-run finding carries `review`: `name
157
172
  plan has no accepted integration commit, and `merged_since` is empty unless the review
158
173
  is outdated. Every other finding has `review` null.
159
174
 
175
+ ## Fixing them in the run: the finding sweep (opt-in)
176
+
177
+ `run --sweep P3` fixes the tolerated findings while the run's context is fresh, instead of leaving
178
+ them for issues. Once every task has merged, and before the combined verification, forge plans one
179
+ sweep:
180
+
181
+ - **Which findings.** The CONFIRMED findings `--qa-threshold` tolerated at `P3` or worse, and
182
+ PLAUSIBLE ones too with `--sweep-plausible`. Left out:
183
+ - findings a person accepted;
184
+ - dismissed ones (`forge issues --dismiss`), and ones with no file or whose file is gone;
185
+ - ones whose code a later task changed after the review.
186
+ - **How many tasks.** One fix task per file, worst first, at most 8 findings each and
187
+ `--sweep-max N` tasks (default 5). They run in parallel up to `--max-parallel`.
188
+ - **Which models.** Each fix task's implementer is your low tier (`--dwarf-low`, else `--dwarf`),
189
+ or the implementer of the task the finding came from. Its reviewer is that task's reviewer.
190
+ - **The plan.** It lists the groups, the findings, the dispatches and everything left out with
191
+ its reason. It is printed and kept in `<plan>/sweep/plan.md`.
192
+
193
+ A fix task's review is narrow. The reviewer says, for each finding, whether the change fixed it
194
+ (`S1: FIXED`, `S2: NOT FIXED — why`), and reports only regressions the change introduced. It passes
195
+ when at least one finding is fixed and nothing blocking broke. A finding the sweep fixed is no
196
+ longer offered as an issue. One it did not fix still is, and so is anything a sweep review found:
197
+ there is only one round. A fix task that fails does not fail the run.
198
+
199
+ The sweep uses the same `--retry-failed` budget and controls as the rest of the run, and a plan is
200
+ swept once. A run without `--sweep` behaves as before. The cost is at least two dispatches per file,
201
+ plus retries, spent on findings the threshold had said could wait, and changes land right before
202
+ the final review. That is why it is off by default.
203
+
204
+ `run --sweep-ahead` is the cheaper first step and needs no extra dispatch. A task dispatched after
205
+ others merged is told the open findings in the files it owns, at most three, to fix only when its
206
+ change already goes through that code. Its reviewer is told the same.
207
+
160
208
  ## Accepting a task despite its reviewer
161
209
 
162
210
  ```bash
@@ -297,6 +345,16 @@ intermittent failure can be a real bug, so it is never passed off as a clean pas
297
345
  that changes the tree is never retried. This deterministic rerun comes before Jev's optional
298
346
  model-assisted triage, which then does not run.
299
347
 
348
+ With [verification lanes](../references/decompose.md#execution-checks-and-integration-verification)
349
+ the rerun is per lane: only a lane that failed runs again, alone, and a lane that passes on its
350
+ rerun is `flaky`. The run is then a pass, but `run`/`retry`/`integrate` print
351
+ `FLAKY: lane <name> failed once and passed on rerun`, and `verification.flaky` records each
352
+ such lane (`lanes=`, `<lane>.first_exit=`, `<lane>.retries_used=`); a lane whose every failing
353
+ test is in its baseline prints `known failures only: lane <name>`. A whole-run review's
354
+ verification summary lists every lane with its state (`unit: pass`, `db: flaky`, ...) and says
355
+ again which lane failed, which passed only on a rerun ("so its pass is not clean") and which
356
+ failed only on known tests. In lanes mode there is no whole-command rerun and no Jev triage.
357
+
300
358
  ## Native review
301
359
 
302
360
  `--native-review` switches a codex reviewer to its purpose-built reviewer, for a diff too large
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giamme/forge",
3
- "version": "0.11.1",
3
+ "version": "0.12.1",
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",