@giamme/forge 0.22.0 → 0.23.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 (153) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +19 -12
  3. package/SKILL.md +137 -216
  4. package/VERSION +1 -1
  5. package/docs/README.md +2 -3
  6. package/docs/add-ons.md +5 -3
  7. package/docs/artifacts.md +17 -2
  8. package/docs/commands.md +85 -63
  9. package/docs/decomposed-runs.md +195 -21
  10. package/docs/development.md +11 -9
  11. package/docs/forge-ui.md +33 -4
  12. package/docs/install.md +37 -5
  13. package/docs/memory.md +6 -1
  14. package/docs/models.md +36 -10
  15. package/docs/reviews.md +44 -25
  16. package/docs/safety.md +27 -2
  17. package/docs/troubleshooting.md +7 -10
  18. package/forge +25 -4
  19. package/package.json +2 -1
  20. package/references/dataset.md +10 -9
  21. package/references/decompose-integration.md +337 -0
  22. package/references/decompose-opt-in.md +527 -0
  23. package/references/decompose-recovery.md +569 -0
  24. package/references/decompose-review.md +256 -0
  25. package/references/decompose.md +99 -1606
  26. package/references/findings.md +68 -0
  27. package/references/harnesses.md +7 -12
  28. package/references/memory.md +13 -2
  29. package/references/planning.md +48 -18
  30. package/references/ripwire.md +38 -13
  31. package/references/runtime.md +22 -33
  32. package/references/setup.md +90 -0
  33. package/references/solo.md +13 -42
  34. package/references/ui.md +12 -5
  35. package/registry.tsv +40 -22
  36. package/scripts/forge-artifact.sh +143 -12
  37. package/scripts/forge-compare.py +5 -15
  38. package/scripts/forge-config.py +14 -1
  39. package/scripts/forge-contract.py +216 -53
  40. package/scripts/forge-control.py +777 -54
  41. package/scripts/forge-dispatch.sh +95 -12
  42. package/scripts/forge-du.py +13 -3
  43. package/scripts/forge-handoff.py +221 -39
  44. package/scripts/forge-install-ripwire.sh +100 -24
  45. package/scripts/forge-install.sh +18 -32
  46. package/scripts/forge-issues.py +6 -4
  47. package/scripts/forge-jev-options.sh +3 -5
  48. package/scripts/forge-lib-adopt.sh +169 -5
  49. package/scripts/forge-lib-attribute.sh +10 -3
  50. package/scripts/forge-lib-decompose.sh +454 -0
  51. package/scripts/forge-lib-env.sh +21 -0
  52. package/scripts/forge-lib-group.sh +4 -1
  53. package/scripts/forge-lib-plans.sh +30 -18
  54. package/scripts/forge-lib-review.sh +28 -8
  55. package/scripts/forge-lib-task.sh +225 -56
  56. package/scripts/forge-lib-verify.sh +59 -10
  57. package/scripts/forge-memory.sh +81 -4
  58. package/scripts/forge-metrics.sh +4 -2
  59. package/scripts/forge-parallel-options.sh +23 -4
  60. package/scripts/forge-parallel.sh +447 -175
  61. package/scripts/forge-plan-check.py +71 -8
  62. package/scripts/forge-planner.py +303 -17
  63. package/scripts/forge-pr.py +9 -1
  64. package/scripts/forge-prompt.py +2 -2
  65. package/scripts/forge-review-links.py +248 -0
  66. package/scripts/forge-ripwire.py +234 -16
  67. package/scripts/forge-route.py +19 -27
  68. package/scripts/forge-runs-rm.py +92 -21
  69. package/scripts/forge-runs.py +46 -5
  70. package/scripts/forge-runtime.py +37 -12
  71. package/scripts/forge-schedule.py +124 -33
  72. package/scripts/forge-setup-stale.py +236 -0
  73. package/scripts/forge-setup.py +804 -0
  74. package/scripts/forge-shadow.py +2 -20
  75. package/scripts/forge-solo-lock.py +46 -0
  76. package/scripts/forge-solo.sh +33 -56
  77. package/scripts/forge-sweep.py +2 -1
  78. package/scripts/forge-ui.py +8 -1
  79. package/scripts/forge-update.sh +2 -2
  80. package/scripts/forge-verify.py +16 -1
  81. package/scripts/forge-version.py +13 -1
  82. package/scripts/forge-watch.py +7 -2
  83. package/scripts/forge_dataset/__init__.py +1 -1
  84. package/scripts/forge_dataset/capture.py +0 -34
  85. package/scripts/forge_dataset/checks.py +0 -1
  86. package/scripts/forge_dataset/cli.py +5 -1
  87. package/scripts/forge_dataset/export.py +28 -6
  88. package/scripts/forge_dataset/facts.py +1 -2
  89. package/scripts/forge_dataset/forecast.py +1 -1
  90. package/scripts/forge_dataset/harvest.py +107 -7
  91. package/scripts/forge_dataset/importer.py +3 -2
  92. package/scripts/forge_dataset/pairs.py +3 -3
  93. package/scripts/forge_dataset/reviewers.py +4 -3
  94. package/scripts/forge_dataset/routing.py +6 -3
  95. package/scripts/forge_dataset/tiers.py +1 -1
  96. package/scripts/forge_decide/__init__.py +1 -1
  97. package/scripts/forge_decide/profiles.py +11 -14
  98. package/scripts/forge_decompose.py +987 -0
  99. package/scripts/forge_groups/review.py +6 -1
  100. package/scripts/forge_jev/__init__.py +1 -1
  101. package/scripts/forge_jev/cli.py +10 -1
  102. package/scripts/forge_jev/gates.py +10 -1
  103. package/scripts/forge_jev/verify.py +10 -2
  104. package/scripts/forge_legacy.py +86 -0
  105. package/scripts/forge_memory_home.py +57 -0
  106. package/scripts/forge_models.py +151 -0
  107. package/scripts/forge_prefs.py +138 -0
  108. package/scripts/forge_side/__init__.py +10 -0
  109. package/scripts/forge_storage.py +28 -15
  110. package/ui/README.md +22 -10
  111. package/ui/docs/api.md +121 -99
  112. package/ui/forge_ui/control.py +46 -14
  113. package/ui/forge_ui/export.py +0 -10
  114. package/ui/forge_ui/models.py +15 -2
  115. package/ui/forge_ui/projects.py +4 -1
  116. package/ui/forge_ui/reader.py +456 -59
  117. package/ui/forge_ui/server.py +0 -10
  118. package/ui/forge_ui/static/app.js +28 -9
  119. package/ui/forge_ui/static/checksview.js +12 -3
  120. package/ui/forge_ui/static/controls.js +147 -11
  121. package/ui/forge_ui/static/convo.js +5 -2
  122. package/ui/forge_ui/static/diffview.js +4 -5
  123. package/ui/forge_ui/static/panel.js +180 -77
  124. package/ui/forge_ui/static/projectsview.js +16 -2
  125. package/ui/forge_ui/static/runmodel.js +18 -4
  126. package/ui/forge_ui/static/scene3d.js +29 -29
  127. package/ui/forge_ui/static/settings.js +1 -1
  128. package/ui/forge_ui/static/storageview.js +2 -2
  129. package/ui/forge_ui/static/style.css +23 -6
  130. package/ui/forge_ui/static/worktreesview.js +8 -4
  131. package/ui/forge_ui/transcripts.py +6 -0
  132. package/ui/forge_ui/worktrees.py +13 -1
  133. package/docs/fractal.md +0 -181
  134. package/references/fractal-dashboard.md +0 -21
  135. package/references/fractal.md +0 -307
  136. package/scripts/forge-fractal-dispatch.sh +0 -4
  137. package/scripts/forge-fractal-options.sh +0 -54
  138. package/scripts/forge-fractal.py +0 -6
  139. package/scripts/forge-install-fractal.sh +0 -4
  140. package/scripts/forge_fractal/__init__.py +0 -88
  141. package/scripts/forge_fractal/bridge.py +0 -46
  142. package/scripts/forge_fractal/cli.py +0 -224
  143. package/scripts/forge_fractal/dashboard.css +0 -138
  144. package/scripts/forge_fractal/dashboard.html +0 -41
  145. package/scripts/forge_fractal/dashboard.js +0 -687
  146. package/scripts/forge_fractal/decomposition.py +0 -262
  147. package/scripts/forge_fractal/execution.py +0 -659
  148. package/scripts/forge_fractal/inspection.py +0 -261
  149. package/scripts/forge_fractal/install.py +0 -158
  150. package/scripts/forge_fractal/invocation.py +0 -95
  151. package/scripts/forge_fractal/pipeline.py +0 -125
  152. package/scripts/forge_fractal/selection.py +0 -180
  153. package/ui/forge_ui/fractal.py +0 -582
@@ -0,0 +1,256 @@
1
+ # Decomposed runs: reviews and verdicts
2
+
3
+ How a decomposed task's review reaches a verdict, the opt-in review modes, and what the
4
+ threshold does with findings. Part of the decomposition reference; planning is in
5
+ [decompose.md](decompose.md).
6
+
7
+ ## Contents
8
+
9
+ - [QA verdicts](#qa-verdicts)
10
+ - [Severity, thresholds and known issues](#severity-thresholds-and-known-issues)
11
+
12
+ ## QA verdicts
13
+
14
+ Decompose-mode QA prompts require a final line:
15
+
16
+ ```
17
+ FORGE_VERDICT: PASS — no CONFIRMED finding at the blocking threshold (P2 or worse)
18
+ FORGE_VERDICT: FAIL — at least one CONFIRMED finding at the blocking threshold (P2 or worse)
19
+ ```
20
+
21
+ forge decides the verdict from the findings, at a blocking threshold: `P2` unless
22
+ `--qa-threshold` sets another. A CONFIRMED finding at the threshold or worse, or one with no
23
+ severity, blocks: a PASS that lists one becomes FAIL. A CONFIRMED finding below the threshold
24
+ never blocks: a FAIL made only of those is accepted, and either way they are recorded in
25
+ `known_issues.md`, which `forge issues` and the sweep pick up. PLAUSIBLE findings never block.
26
+ `--qa-threshold P3` (or `none`) makes every CONFIRMED finding block.
27
+
28
+ The runner accepts only a standalone verdict on the final nonempty line (the shared parser
29
+ also tolerates the dash gloss the prompt prints after each verdict, trailing whitespace and
30
+ CRLF). A missing verdict is `UNKNOWN` and is treated exactly
31
+ like a failure — excluded from integration and flagged. Merging a diff whose reviewer never
32
+ reached a conclusion would defeat the point of reviewing it, so the ambiguous case fails
33
+ safe rather than optimistically.
34
+
35
+ A failing task is excluded and its branch preserved; the rest of the run proceeds. There is
36
+ no automatic repair pass unless the run was started with `--retry-failed N`, consistent with
37
+ forge's rule that a dwarf → QA cycle does not loop on its own initiative.
38
+
39
+ The prompt contract (preamble, findings format, severity definitions and the verdict lines)
40
+ comes from one place, `scripts/forge-contract.py`, shared by solo, decomposed and the final
41
+ review; the implementer rules appended to every dwarf prompt come from the same module.
42
+ When the run verifies the repository (`--verify`, verification lanes or `.forge/verify`), those
43
+ rules tell the implementer never to run the whole suite, even when the task's acceptance
44
+ criteria name it, and to report it as left to forge: verification runs once at the end of the
45
+ run on the combined result (not after each merge; if it fails, `forge-parallel.sh attribute`
46
+ searches the merge order). Without verification, the implementer runs the whole suite only
47
+ when the task asks for it.
48
+
49
+ ### Fail-first evidence (opt-in)
50
+
51
+ `plan --fail-first` (and `forge-solo.sh --fail-first`) checks that the tests a change adds
52
+ or edits can fail. Before each review, forge exports the reviewed commit and, separately,
53
+ the task's base plus only the change's test-path files (tests, their fixtures and helpers),
54
+ then runs `.forge/verify-subset` (a per-file test command that contains `{files}`, such as
55
+ `pytest -q {files}` or `npm test -- {files}`; it is a separate file from `.forge/verify` because
56
+ there is no general way to restrict an arbitrary command to a file list) once per new or
57
+ edited test file in each. Every file gets one result in
58
+ `tasks/<id>/failfirst.json` (solo: `<run>/failfirst.json`):
59
+
60
+ - `proven`: passes with the change, fails without it;
61
+ - `passes_without_change`: passes both ways, so it does not prove the change;
62
+ - `inconclusive`: fails even with the change (a broken test or a missing dependency);
63
+ - `error`: could not run (export failure, or `FORGE_FAIL_FIRST_TIMEOUT`, default 600 s, per run).
64
+
65
+ The reviewer's prompt lists the results and asks for a `[P2][CONFIRMED]` finding for each
66
+ test that passes without the change, unless the reviewer explains why it need not fail
67
+ (a refactor kept green). It is advice: forge never changes a status or verdict from it, and
68
+ a P2 only blocks through the reviewer and the usual threshold gate (`P2` by default, see [QA verdicts](#qa-verdicts)). The exports are
69
+ throwaway directories outside the review snapshot, so no fingerprint changes. forge-ui
70
+ shows the evidence under the task's review findings, and each check is recorded in the
71
+ run dataset as a `fail_first` event with the JSON attached. Without
72
+ `.forge/verify-subset` the check records `skipped` and the prompt says nothing.
73
+ `plan --no-fail-first` turns it off again.
74
+
75
+ ### Pre-review tests (opt-in)
76
+
77
+ `plan --pre-review-tests` runs **only the tests an attempt affects** before paying for its
78
+ review, never the whole suite (that stays the run's end-of-run verification). After an attempt is
79
+ committed, forge exports the reviewed commit and runs `.forge/verify-subset` on a selection:
80
+
81
+ 1. the test files the change adds or edits;
82
+ 2. for each changed source file, the tests from the first source that answers: `.forge/test-map`,
83
+ then the naming convention (`foo.py` → `test_foo.py`, `foo_test.py`, `foo.test.js`, ...), then
84
+ a reverse lookup (test files that name the changed module);
85
+ 3. with `{changed}` in the command instead of `{files}`, the changed paths themselves, for a runner
86
+ that finds the related tests on its own (`npx jest --findRelatedTests {changed}`).
87
+
88
+ `.forge/test-map` is the reliable source; one rule per line, `#` comments, globs where `*` also
89
+ matches `/`, and `-` for "no tests":
90
+
91
+ ```
92
+ scripts/forge-issues.py tests/test_issues.py tests/test_sweep.py
93
+ ui/forge_ui/*.py ui/tests/test_*.py
94
+ docs/* -
95
+ ```
96
+
97
+ A change to shared test infrastructure (a conftest, a test helper, a lockfile, a build file),
98
+ more than 20 selected files (`FORGE_PRE_REVIEW_MAX_FILES`) or a run past 120 s
99
+ (`FORGE_PRE_REVIEW_TIMEOUT`) makes the check `skipped` as too broad. A failing run is rerun file
100
+ by file (a file that passes alone is `flaky`), and each file that still fails is run on the task
101
+ base: one that fails there too is `pre-existing` and does not count against the attempt.
102
+
103
+ - **Red** (`failed`): the attempt is `FAIL` without a review. Its retry findings are the failing
104
+ tests and the end of their output, labelled as forge's (`tasks/<id>/prereview.md`). It counts
105
+ toward `--retry-failed` and `--escalate-after` like a rejected attempt.
106
+ - **Green**, `flaky` or `pre-existing`: the review runs, and the reviewer's prompt says what forge
107
+ ran and found.
108
+ - **Skipped or broken** (no `.forge/verify-subset`, nothing selected, too broad, a command error):
109
+ the review runs exactly as without the option. The check never blocks on its own failure.
110
+
111
+ The implementer is told forge will run them, so it need not repeat them exhaustively. Checks run
112
+ in throwaway exports, so neither the task worktree nor any fingerprint changes; at most 2 run at
113
+ once across the plan's tasks (`plan --pre-review-parallel N`, 1-64). A QA-only resume reuses the
114
+ check of the commit it re-reviews. `tasks/<id>/prereview.json` records the selection, every run
115
+ and the outcome; forge-ui shows it under the task's review findings, and the dataset records a
116
+ `pre_review` event. `forge control set <plan> pre-review-tests on|off` and `pre-review-parallel N`
117
+ change both while a run works; `plan --no-pre-review-tests` turns it off.
118
+
119
+ ### Implementer session (opt-in)
120
+
121
+ `plan --implementer-session` makes a retry **continue the implementer's own session** instead of
122
+ starting one that re-reads the same files: the dwarf keeps what it learned, and the retry's prompt
123
+ (the task, the findings, the rules) arrives as the next turn, after a short note that its work is
124
+ as it left it. It applies to claude and openclaude. codex's `exec resume` takes no sandbox flag, so
125
+ a codex implementer could be resumed only by a config override nobody verifies, and it stays fresh.
126
+
127
+ A retry continues only when all of these hold; anything else is a fresh session, as without the
128
+ option:
129
+
130
+ - it carries findings from a review, or from pre-review tests, of a commit this session made;
131
+ - the worktree is still exactly that commit: no edits since (a timed-out or interrupted attempt
132
+ leaves some), nothing committed on top;
133
+ - the dwarf resolves to the same harness, model and effort, so an escalation (`--escalate-after`,
134
+ a pin, `retry --dwarf`) starts fresh.
135
+
136
+ A continue the harness refuses or that fails at once (dispatch exit **9**, nothing changed in the
137
+ worktree) is followed by a fresh dispatch of the same prompt, which decides the attempt. One that
138
+ fails after it already changed files is a failed implementer (`ERROR`), as a fresh one would be:
139
+ running another on top would pay for the attempt twice. One row per attempt goes to
140
+ `tasks/<id>/implementer_sessions.tsv`: row, attempt, `continued`, `fresh` or `failed`, the reason
141
+ (`same-spec`, `first-attempt`, `no-findings`, `work-changed`, `no-session`, `invalid-session`,
142
+ `spec-changed`, `harness-unsupported`, `continue-unsupported`, `continue-failed`; `fractal` only in rows from before 0.23) and
143
+ the session id it considered. The dataset tags a continued dwarf dispatch `session_continue`, and
144
+ `forge dataset status` counts implementer continues apart from reviewer ones.
145
+ `plan --no-implementer-session` turns it off; `split` and `combine` carry it (combine only when
146
+ every source has it).
147
+
148
+ ### Shadow reviews (opt-in)
149
+
150
+ `plan --shadow-qa <spec>[,<spec>...] [--shadow-rate R]` sends a sampled share of
151
+ reviewed attempts (R, default 0.1) to a second, independent reviewer. Its verdict is
152
+ recorded in the run dataset and never read by the run. It exists to measure how often two
153
+ reviewers agree on one diff, which is the noise in every review-based label. The approval
154
+ table shows the reviewers, the rate and the expected extra reviews, and `--shadow-qa none`
155
+ turns shadow reviews off again.
156
+
157
+ - **Which reviewer:** the first listed spec whose model family (Claude, GPT, Gemini, ...)
158
+ differs from the task's reviewer, so the two do not share one blind spot. If none
159
+ differs, the first listed spec that does not resolve to the reviewer's own harness, model
160
+ and effort: the same model at another effort (`same_model`) or another model of the
161
+ family. Only when every listed spec is identical to the reviewer does it run as a
162
+ `control`, two reviews with one setting, which measures noise and never counts as an
163
+ effort comparison (a reviewer pool can hand a task the shadow's own spec). Forge only
164
+ ever uses the specs you list. A spec that cannot run here (`doctor` fails) is dropped
165
+ with a note and never fails the run.
166
+ - **Measuring an effort:** list only specs of the reviewers' own model at another effort,
167
+ for example `--shadow-qa sol:medium` beside `sol:high` reviewers, with a rate high enough
168
+ for at least 30 pairs per comparison. Each pair is one more review, so agree on its cost first.
169
+ - **Which attempts:** a deterministic sample per (run, task, attempt), so a QA-only
170
+ resume decides the same way.
171
+ - **Same evidence, separate everything else.** The shadow reviews a byte-identical copy of
172
+ the primary's prompt, in its own snapshot, from its own dir
173
+ (`<plan>/shadow/<task>/<attempt>-<k>/`). Nothing reads that dir. It writes no status,
174
+ memory, ledger, gate or retry findings, and a reviewer that edits its snapshot is
175
+ recorded as `invalid`.
176
+ - **Bounded:** it runs beside the primary, and the task waits for it before writing any
177
+ status. Once the primary is done, the shadow gets as long again as the primary took
178
+ (at least 5 minutes), then it is stopped. It dies with its task, including on Ctrl-C of
179
+ a manual `retry`.
180
+ - **Scope:** parallel mode only.
181
+
182
+ `./forge dataset status` reports the agreement rate, overall and per model pair, and
183
+ `./forge dataset pairs` splits it by what differs between the two reviewers: effort within one
184
+ model, another model of the family, another family, and controls. For each pair of settings it
185
+ gives verdict agreement with a 95% interval, the blocking findings only one side found, and the
186
+ token and time ratio (see [the dataset reference](dataset.md#paired-reviews)). The export
187
+ adds `shadow` and `consensus` to the matching review cases' metadata.
188
+
189
+ ## Severity, thresholds and known issues
190
+
191
+ QA labels each finding `- [P0..P3][CONFIRMED|PLAUSIBLE] file:line — what breaks (input)`:
192
+ P0 data loss, security hole, crash or wrong result on the main path; P1 wrong behaviour on
193
+ realistic input or a broken existing contract; P2 edge-case bug, unusual-timing race, missing
194
+ hardening; P3 minor. Severity is impact; CONFIRMED/PLAUSIBLE is confidence.
195
+
196
+ `--qa-threshold Pn` on `plan`, `run`, `retry` or `review` (remembered in `<plan>/qa_threshold`; `none`
197
+ means P3, `default` removes the setting) changes the default `P2`, the **least severe level that
198
+ still blocks** (see [QA verdicts](#qa-verdicts)). `tasks/<id>/qa_threshold` overrides it per task (a
199
+ per-task `none` means P3, so it exempts the task from a looser plan threshold; `forge control set ... qa-threshold`
200
+ writes both and takes effect at the next attempt) —
201
+ the way to give a dev-tooling or investigation task a looser bar than production code,
202
+ which otherwise gets a new finding in a new corner of a non-default option every round and
203
+ only a human decision ends it. The orchestrator decides *deterministically* (`forge-contract.py gate`),
204
+ and does not take the reviewer's word in either direction: a `FAIL` becomes `PASS` with known
205
+ issues only when there is at least one CONFIRMED finding, every CONFIRMED finding carries a
206
+ `P0..P3` label, and all of them are strictly milder than the threshold; a `PASS` that lists a
207
+ blocking finding becomes `FAIL`. Anything unlabelled, any blocking finding, or a `FAIL` with no
208
+ CONFIRMED finding stays a failure. The task's status is then the literal `PASS`; `known_issues.md`,
209
+ `qa.gate` and the summary say what was tolerated.
210
+
211
+ ### The finding sweep (opt-in)
212
+
213
+ Tolerated findings are recorded, not fixed. `run --sweep Pn` fixes them inside the run instead: once
214
+ every task has merged, and before the combined verification, the scheduler runs `forge-sweep.py plan`.
215
+ The sweep is once per finding, not once per plan. Round 1 is `<plan>/sweep/plan.json`; round N (N ≥ 2)
216
+ is `<plan>/sweep/rounds/<N>/plan.json`. A finding an earlier round attempted is not swept again, whatever
217
+ that attempt's outcome. The first round is planned once every task that is not a fix task has merged.
218
+ A later round starts when those tasks have merged, every fix task of the previous round is `MERGED`,
219
+ `FAIL`, `NEEDS_DECISION` or `INFRA`, and new eligible findings exist. At most one round starts per
220
+ scheduler pass. A later `plan` with nothing new writes and prints nothing. The scheduler records that
221
+ check in `<plan>/sweep/nothing.json`, and the run's summary prints
222
+ `sweep: nothing new to sweep (N finding(s) already swept or attempted, M left for forge issues)`.
223
+ It collects the open findings at `Pn` or worse (the ones the threshold tolerated, plus
224
+ PLAUSIBLE ones with `--sweep-plausible`), with `forge issues`' own collector, and leaves out:
225
+
226
+ - findings a person accepted with `accept` or kept with `adopt --approved` (listed as `accepted`), and
227
+ findings of fix tasks (what a sweep review finds goes to `forge issues`, never into another sweep);
228
+ - dismissed ones (`forge issues --dismiss`), ones the finding record marks `fixed`, `filed` or
229
+ `duplicate`, and ones an earlier round already attempted;
230
+ - ones with no file, and ones whose file is gone;
231
+ - ones whose line, as the reviewer saw it, a later merge changed (`changed`, naming those merges).
232
+
233
+ Every finding left out is listed in the plan with its reason. The rest become fix tasks, one per file,
234
+ worst first, at most 8 findings each and `--sweep-max N` (default 5) tasks. Each fix task is a row
235
+ `sweep-<n>` in `tasks.tsv` with `prompt.md` and `sweep.json`. Its implementer is the plan's low tier
236
+ (the first spec of `--dwarf-low`, else of `--dwarf`; checked at `run` start), else the implementer of
237
+ the task the worst finding came from. Its reviewer is that task's reviewer. What an adopted range's review
238
+ tolerated is swept too: its fix task's reviewer is the adoption's, and below the low tier its implementer
239
+ is the run's first task's. The plan (groups, findings,
240
+ dispatches) is printed and kept next to that round's `plan.json`, as `plan.md`. Round 1 lives in
241
+ `<plan>/sweep/`; each later round lives in `<plan>/sweep/rounds/<N>/`.
242
+
243
+ Fix tasks share the run's scheduling, controls and `--retry-failed` budget. Their review is narrow
244
+ (`forge-contract.py qa --kind sweep`): one `S<n>: FIXED` or `S<n>: NOT FIXED` line per finding, plus
245
+ regressions as findings. It passes when at least one finding is fixed and there is no blocking
246
+ regression. When a fix task merges, its review's lines go to `tasks/<id>/sweep.outcome.json`, and
247
+ `forge issues` leaves out what it fixed (`swept` in `--json`). Each finding that review marked fixed
248
+ also gets a `fixed` record, actor `sweep`, reason `sweep <task>`, and the merge commit when
249
+ `<plan>/accepted.integration` is 7 to 40 lowercase hex characters. A fix task that fails leaves its
250
+ findings for `forge issues` and does not fail the run. The run's summary says what each round fixed,
251
+ and the whole-run review that follows reads the sweep's changes like any other task's.
252
+
253
+ `run --sweep-ahead` (kept in `<plan>/sweep_ahead`; `--no-sweep-ahead` turns it off) is the cheaper
254
+ first step. A task dispatched after others merged is told the open findings in files it owns (at
255
+ most 3, picked once in `tasks/<id>/sweep.ahead.json`), to fix only on its way, and its reviewer is
256
+ told the same. It adds no dispatch. A later sweep counts the ones whose line changed as `changed`.