@giamme/forge 0.17.0 → 0.19.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 (110) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +1 -0
  3. package/SKILL.md +32 -5
  4. package/VERSION +1 -1
  5. package/docs/artifacts.md +33 -1
  6. package/docs/commands.md +147 -16
  7. package/docs/dataset.md +5 -0
  8. package/docs/decomposed-runs.md +122 -1
  9. package/docs/development.md +2 -1
  10. package/docs/forge-ui.md +98 -8
  11. package/docs/memory.md +27 -4
  12. package/docs/models.md +8 -0
  13. package/docs/reviews.md +122 -0
  14. package/docs/safety.md +8 -0
  15. package/forge +44 -4
  16. package/package.json +2 -1
  17. package/references/dataset.md +39 -1
  18. package/references/decompose.md +737 -16
  19. package/references/harnesses.md +18 -3
  20. package/references/planning.md +43 -14
  21. package/references/solo.md +2 -1
  22. package/references/ui.md +56 -6
  23. package/registry.tsv +8 -3
  24. package/scripts/forge-artifact.sh +14 -0
  25. package/scripts/forge-brief.py +217 -0
  26. package/scripts/forge-compare.py +13 -2
  27. package/scripts/forge-config.py +176 -9
  28. package/scripts/forge-contract.py +246 -28
  29. package/scripts/forge-control.py +200 -15
  30. package/scripts/forge-dispatch.sh +48 -15
  31. package/scripts/forge-du.py +167 -0
  32. package/scripts/forge-group.py +496 -0
  33. package/scripts/forge-groups.py +89 -0
  34. package/scripts/forge-handoff.py +1128 -0
  35. package/scripts/forge-lib-adopt.sh +1 -0
  36. package/scripts/forge-lib-group.sh +641 -0
  37. package/scripts/forge-lib-plans.sh +343 -4
  38. package/scripts/forge-lib-review.sh +29 -1
  39. package/scripts/forge-lib-task.sh +197 -4
  40. package/scripts/forge-memory.sh +245 -3
  41. package/scripts/forge-metrics.sh +7 -3
  42. package/scripts/forge-parallel-options.sh +4 -0
  43. package/scripts/forge-parallel.sh +1216 -41
  44. package/scripts/forge-planner.py +104 -8
  45. package/scripts/forge-prompt.py +120 -0
  46. package/scripts/forge-retro.py +115 -0
  47. package/scripts/forge-route.py +190 -12
  48. package/scripts/forge-runs-compact.py +443 -0
  49. package/scripts/forge-runs-rm.py +2 -0
  50. package/scripts/forge-runs.py +27 -8
  51. package/scripts/forge-schedule.py +633 -49
  52. package/scripts/forge-shadow.py +7 -1
  53. package/scripts/forge-solo.sh +4 -0
  54. package/scripts/forge-summarize.py +698 -0
  55. package/scripts/forge-ui-options.sh +10 -0
  56. package/scripts/forge-worktrees.py +243 -0
  57. package/scripts/forge_brief/__init__.py +831 -0
  58. package/scripts/forge_brief/answers.py +506 -0
  59. package/scripts/forge_brief/proposals.py +1630 -0
  60. package/scripts/forge_dataset/__init__.py +10 -0
  61. package/scripts/forge_dataset/efforts.py +4 -3
  62. package/scripts/forge_dataset/export.py +36 -10
  63. package/scripts/forge_dataset/facts.py +8 -4
  64. package/scripts/forge_dataset/forecast.py +8 -18
  65. package/scripts/forge_dataset/harvest.py +241 -12
  66. package/scripts/forge_dataset/history.py +13 -6
  67. package/scripts/forge_dataset/importer.py +65 -1
  68. package/scripts/forge_dataset/names.py +66 -0
  69. package/scripts/forge_dataset/reviewers.py +5 -2
  70. package/scripts/forge_dataset/risk.py +6 -3
  71. package/scripts/forge_dataset/routing.py +6 -1
  72. package/scripts/forge_decide/__init__.py +11 -1
  73. package/scripts/forge_groups/__init__.py +308 -0
  74. package/scripts/forge_groups/attribute.py +289 -0
  75. package/scripts/forge_groups/review.py +286 -0
  76. package/scripts/forge_locations.py +366 -0
  77. package/scripts/forge_owner.py +152 -0
  78. package/scripts/forge_registry.py +19 -0
  79. package/scripts/forge_retro/__init__.py +417 -0
  80. package/scripts/forge_retro/issues.py +1193 -0
  81. package/scripts/forge_retro/report.py +671 -0
  82. package/scripts/forge_side/__init__.py +482 -0
  83. package/scripts/forge_storage.py +515 -0
  84. package/ui/README.md +68 -8
  85. package/ui/docs/api.md +375 -31
  86. package/ui/forge_ui/control.py +451 -11
  87. package/ui/forge_ui/executions.py +8 -1
  88. package/ui/forge_ui/export.py +53 -7
  89. package/ui/forge_ui/groups.py +264 -0
  90. package/ui/forge_ui/links.py +337 -0
  91. package/ui/forge_ui/models.py +125 -10
  92. package/ui/forge_ui/projects.py +4 -1
  93. package/ui/forge_ui/reader.py +919 -45
  94. package/ui/forge_ui/server.py +4 -0
  95. package/ui/forge_ui/static/app.js +173 -11
  96. package/ui/forge_ui/static/briefview.js +605 -0
  97. package/ui/forge_ui/static/checksview.js +6 -2
  98. package/ui/forge_ui/static/controls.js +5 -0
  99. package/ui/forge_ui/static/diffview.js +86 -1
  100. package/ui/forge_ui/static/groupsview.js +332 -0
  101. package/ui/forge_ui/static/index.html +4 -0
  102. package/ui/forge_ui/static/panel.js +394 -8
  103. package/ui/forge_ui/static/projectsview.js +189 -10
  104. package/ui/forge_ui/static/runmodel.js +27 -4
  105. package/ui/forge_ui/static/storageview.js +352 -0
  106. package/ui/forge_ui/static/style.css +176 -6
  107. package/ui/forge_ui/static/worktreesview.js +235 -14
  108. package/ui/forge_ui/storage.py +150 -0
  109. package/ui/forge_ui/transcripts.py +35 -10
  110. package/ui/forge_ui/worktrees.py +154 -13
@@ -102,6 +102,34 @@ as prerequisites merge and capacity becomes available, while excluding overlappi
102
102
  paths. Merges are serialized. Each task pins the integration commit at dispatch; retries keep
103
103
  that baseline, and QA sees only baseline membership recorded for that task.
104
104
 
105
+ ## Groups in the approval table
106
+
107
+ When the plan has `groups.tsv`, the table adds a `groups:` block after the waves. One line
108
+ per group: id, `review=task` or `review=group`, the QA spec as `qa=<spec>` or `-`, the
109
+ members, and the goal (or `(no goal)`).
110
+
111
+ ```
112
+ groups:
113
+ g1 review=group qa=opus:medium a, b, c — Every command can write JSON and TSV
114
+ g2 review=group qa=sonnet d, e — (no goal)
115
+ w3 review=task - f, g — (no goal)
116
+ ```
117
+
118
+ A `review=task` group is a name only. It does not change the estimate. When any group has
119
+ `review=group`, the estimate counts one review for the group instead of one per member, and
120
+ prints both lines. Seven tasks and two review groups covering five members look like this:
121
+
122
+ ```
123
+ tasks: 7 waves: 1 estimated dispatches: 11 (7 dwarf + 4 qa)
124
+ reviews: 4 (2 groups replace 5 task reviews)
125
+ ```
126
+
127
+ The reviews line is `reviews: N (G groups replace M task reviews)`. The word stays `groups`
128
+ when there is one. The count is tasks, minus members of review groups, plus the number of
129
+ those groups. What the run then does is in
130
+ [Groups and group review](../references/decompose.md#groups-and-group-review-opt-in). The
131
+ tradeoff is in [group review](reviews.md#group-review-opt-in).
132
+
105
133
  ## Fresh session per task, plus a capsule
106
134
 
107
135
  Every dispatch is a **clean slate** — forge never passes `--continue`, `--resume`, or
@@ -199,6 +227,21 @@ For Fractal execution, pass tier pools to `plan` and backend/limit flags to `run
199
227
  `--max-parallel` limits task pipelines; the shared `--fractal-concurrency` limit includes
200
228
  all their child invocations and QA. See [decomposed Fractal execution](../references/decompose.md#fractal-within-decomposed-tasks).
201
229
 
230
+ A plan can start from a finished plan's integration branch. `A` and `B` are plan directories:
231
+
232
+ ```
233
+ plan B --after A
234
+ run B
235
+ integrate B --approved
236
+ ```
237
+
238
+ `plan` exits 2 unless `A` is a plan of the same repo, every task is `MERGED`, the integration
239
+ branch tip is `A`'s `accepted.integration`, and `A`'s scheduler is not live. It writes `after`
240
+ and `integration.base`, and creates `B`'s integration branch at that tip. `run` exits 3 if `A`
241
+ moved and `B` has not yet merged a task. `integrate` prints `this brings plans` and the run
242
+ ids, oldest first. `forge runs` shows `after <run>` on `B`. See
243
+ [Chained plans](../references/decompose.md#chained-plans).
244
+
202
245
  ## Resuming an interrupted run
203
246
 
204
247
  Ctrl-C (or a SIGTERM) on `run` stops the running tasks' process groups, waiting up to
@@ -224,6 +267,65 @@ and pipeline checkpoints. A task/subtree selector resumes only that execution sc
224
267
  Explicit `retry` retains the backend and frozen pools; a replacement dwarf must already
225
268
  belong to that pool. See [recovery](../references/fractal.md#limits-and-lifecycle).
226
269
 
270
+ ### From another session or harness
271
+
272
+ Start with `forge handoff`. With no argument inside a checkout, or with `--repo DIR`, it
273
+ reports that repository's newest registered plan that is live or still has a task not
274
+ `MERGED` (run-dir mtime; a plan is one with `tasks.tsv`). `forge handoff [show] RUN_DIR
275
+ [--json]` reports the run you name and writes nothing: id, kind, the first five non-empty
276
+ lines of `request.md`, the plan dir, repo, worktree root and integration branch, plus the
277
+ recorded base and accepted commits; the option files and `run.flags.json`; whether the
278
+ scheduler is live; each task; what needs a person (a `NEEDS_INPUT` question verbatim, the
279
+ first line of a `NEEDS_DECISION`'s `decision.md`, an `INFRA` cause and hint); the last
280
+ `control.log` changes; tasks left `RUNNING` with no live scheduler; session notes, newest
281
+ first; the driver; and the exact next commands. A path that is not a run dir exits 2. No
282
+ matching run exits 3.
283
+
284
+ `forge handoff resume RUN_DIR` carries a decomposed run on. It claims the run first; a
285
+ refused claim exits 3 and changes nothing else. A live scheduler is followed and nothing is
286
+ started — leave that run to `forge control show`, and do not start `run` beside it. A
287
+ Fractal plan is not restarted here; resume names `forge fractal resume`. Otherwise each
288
+ task still `RUNNING` is recovered, and only when its worktree is exactly `<wt_root>/<id>`
289
+ on `forge/<run_id>/<id>` and any leftover `dwarf.harness` or `qa.harness` has been stopped:
290
+ the uncommitted work, untracked files included, is saved to
291
+ `tasks/<id>/interrupted-<epoch>.diff`, and only then is the worktree reset and cleaned, the
292
+ status set to `INTERRUPTED`, and the attempt counter rewound when `attempts.tsv` has no row
293
+ for that attempt, so the attempt is not counted twice. A guard that fails leaves that
294
+ worktree untouched. Every `INTERRUPTED` task, including one that was already interrupted,
295
+ is prepared with `retry --no-dispatch`. `run` then starts again, detached, from
296
+ `run.flags.json`. Output goes to `resume-<epoch>.log`; the exit code is written to
297
+ `resume-<epoch>.done` when the run ends. A launch that fails exits 1.
298
+
299
+ `run` writes `run.flags.json` at each real start. A dry run and a `retry` do not, and a
300
+ split or rerun does not copy it. The fields are `retry_failed`, `infra_retries`, `sweep`,
301
+ `sweep_max`, `sweep_plausible`, `sweep_ahead`, `max_parallel`, `timeout`, `verify`,
302
+ `fractal`, `argv` and `at`. `retry_failed` and `infra_retries` are the budgets the
303
+ scheduler removes when it stops (`retry_budget`, `infra_budget`, and each task's
304
+ `retry_budget`), so resume can pass them again. Resume rebuilds the `run` command from
305
+ those fields; it does not replay `argv` as typed. A run from before 0.19 has no file:
306
+ resume still saves and prepares, then prints the `run` command to finish by hand and
307
+ starts nothing. An unreadable file does the same, and says the file cannot be read.
308
+
309
+ `forge handoff note RUN_DIR TEXT [--actor A]` appends one JSON line to
310
+ `handoff.notes.jsonl` (`at`, `actor`, `text`): a decision the user made, or a hand fix
311
+ under way, that is not in the plan. Whitespace collapses to single spaces. Empty text,
312
+ text over 2000 characters, and text that is not UTF-8 are refused. `--actor` defaults to
313
+ `cli`.
314
+
315
+ `forge handoff claim RUN_DIR --harness H [--session S]` writes `handoff.driver.json`
316
+ (`harness`, `session`, `since`, `last_seen`). `--harness` matches `[a-z0-9._-]{1,40}`.
317
+ `--session` is an id with no whitespace, at most 200 characters. `resume` claims the same
318
+ way, and its `--harness` defaults to `unknown`. The same harness and session keep `since`
319
+ and refresh `last_seen`. A different driver last seen under 12 hours ago is refused
320
+ (exit 3) unless `--take-over`. One last seen 12 hours ago or earlier is replaced without that flag.
321
+ Replacing a driver appends one `control.log` line (`action` `take-over`, `actor` `cli`,
322
+ `key` `driver`) and a dataset `control` event. When `control.log` is not a regular file
323
+ the replacement is refused before the driver file changes. Take over only when asked.
324
+
325
+ Running `run` again, and an explicit `retry` for a failed or interrupted task, stays
326
+ the way to finish by hand. That is also the command resume prints when
327
+ `run.flags.json` is missing.
328
+
227
329
  ## Changing a run while it works
228
330
 
229
331
  `forge control` changes a plan's knobs without stopping it (forge-ui calls the same command):
@@ -250,6 +352,7 @@ forge control stop <plan-dir> # finish what runs, start noth
250
352
  forge control stop <plan-dir> --now # interrupt the running tasks too, like Ctrl-C
251
353
  forge control retry <plan-dir> docs --dwarf sol:high # queue a retry of a stopped or failed task
252
354
  forge control add <plan-dir> docs-fix # queue a row you appended to tasks.tsv (with its prompt.md)
355
+ forge control accept <plan-dir> docs --reason "the P2 is a test-only nit" --approved # queue an accept
253
356
  ```
254
357
 
255
358
  A stop skips verification and exits 130, unless every task had merged by then, and a drain
@@ -260,6 +363,18 @@ control show` lists the log). A retry is prepared exactly as `forge-parallel.sh
260
363
  so a task the policy stopped needs `--dwarf`; it spends no automatic retry budget. An added row
261
364
  may depend only on tasks the run already knows. Neither outlives the run that was live when it
262
365
  was queued, and both are refused once the run is stopping.
366
+ `accept` is `forge-parallel.sh accept` for a live run, which holds the plan lock that command
367
+ needs. It takes a `FAIL`, `UNKNOWN` or `NEEDS_DECISION` task that is neither running nor queued,
368
+ with `--reason` and `--approved`: the findings become known issues, the task merges, and the tasks
369
+ waiting on it start in the same run. `control.log` records who asked (`--actor`) and why, and
370
+ `tasks/<id>/accepted.by` the same. With no live run it is refused and names the plain `accept`.
371
+ A forge command the plan lock refuses says which command holds it (pid and since when), and on a
372
+ live run which `forge control` command to use instead.
373
+
374
+ Editing a task's `prompt.md` or `approach.md` while a run is going is allowed. An attempt
375
+ already running is not reviewed against the new text: it is marked `STALE` and re-dispatched
376
+ with the new requirements, and the attempt is not spent. `control.log` records `prompt-changed`
377
+ with actor `scheduler`. See [failures that are the plan's](reviews.md#failures-that-are-the-plans).
263
378
 
264
379
  Each change is validated, written under `control.lock`, and says when it applies:
265
380
 
@@ -355,7 +470,7 @@ docs - low README.md - - Document the auth flow
355
470
  | `deps` | comma-list of task ids that must land first, or `-` |
356
471
  | `difficulty` | `low` \| `medium` \| `high` |
357
472
  | `files` | expected touch set, comma-separated — **drives disjointness** |
358
- | `dwarf` / `qa` | `-` to resolve from the routing rules; an explicit spec always wins |
473
+ | `dwarf` / `qa` | `-` to resolve from the routing rules; an explicit spec always wins. `script` in `dwarf` runs `tasks/<id>/run` |
359
474
  | `title` | one line, shown in the approval table and the capsule |
360
475
 
361
476
  Each task also needs `tasks/<id>/prompt.md`, written the same way a single-task forge goal is.
@@ -367,3 +482,9 @@ understated `files` is how two dwarves end up in the same file.
367
482
  `plan` writes resolved specs back into the `dwarf`/`qa` columns, so `run` never consults the
368
483
  routing rules — and an explicit value survives a re-plan, which is what makes a gate override
369
484
  durable. (`UNASSIGNED` is treated as a leftover marker and re-resolved.)
485
+
486
+ A `dwarf` value of `script` runs the executable `tasks/<id>/run` and is not given a model.
487
+ `plan` exits 2 when that file is missing or not executable, shows the row, and counts no
488
+ implementer dispatch. A non-zero exit or a timeout is `FAIL` with no review and no escalation.
489
+ A retry runs the command again from the base, so the way to change the diff is to edit `run`.
490
+ See [Scripted tasks](../references/decompose.md#scripted-tasks).
@@ -44,6 +44,7 @@ forge/
44
44
  │ ├── forge-pr.py `forge pr`: a draft PR description for a finished run (reads with forge-ui's reader)
45
45
  │ └── forge-install.sh install into every harness that needs it (opencode and grok find it themselves)
46
46
  ├── ui/ forge-ui: read-only local run viewer (`forge_ui` package, tests, API contract)
47
+ ├── site/ the website and plain-language docs, published by GitHub Pages (see site/README.md)
47
48
  └── references/
48
49
  ├── ui.md forge-ui: commands, env vars, shared server, state, privacy
49
50
  ├── harnesses.md per-harness invocation, ladders, failure modes
@@ -56,7 +57,7 @@ forge/
56
57
  ## Offline checks
57
58
 
58
59
  Run `bash tests/check.sh` for offline regression checks. See [tests](../tests/README.md) for skill
59
- invocation scenarios and verification limits. There is currently no CI workflow.
60
+ invocation scenarios and verification limits. Two CI workflows, neither of which runs the tests: one builds and publishes the website ([site/README.md](../site/README.md)), and `.github/workflows/npm-publish.yml` publishes the package to npm when a GitHub Release is published (npm trusted publishing, no token).
60
61
 
61
62
  ## Runtime efficiency and measurement
62
63
 
package/docs/forge-ui.md CHANGED
@@ -80,6 +80,46 @@ running task it shares files with, no free slot, a drain or stop, an infrastruct
80
80
  its countdown, or the retry policy's stop with the split it proposes. The run's inspector says
81
81
  what the scheduler is doing and how many tasks wait on what.
82
82
 
83
+ A run with `groups.tsv` shows a Groups block after the task table. Each row is the group's title
84
+ and goal, "one review" or "per-task review", its reviewer and its members. A review group's
85
+ title opens `#/runs/<key>/group/<gid>`, and that row also shows the status, the round and who
86
+ the last review implicated. The group page shows a decision only while the group is
87
+ `NEEDS_DECISION`: the first line of `decision.md`, and a `forge group retry` command to copy.
88
+ The page does not run it. Below that are the findings, with ambiguous ones marked, the rounds,
89
+ known issues, the review text and a link to its transcript. A task at `IMPLEMENTED` reads
90
+ "awaiting group review" in the Status column and in its inspector. The lamp class stays
91
+ `IMPLEMENTED`. The task table adds a Group column while the run has groups, and the inspector
92
+ shows a `group <id>` chip. See [the forge-ui reference](../references/ui.md).
93
+
94
+ A task's inspector opens on its header: its title and goal, its links (`#N` and GitHub issue and pull
95
+ request URLs; `#N` links to the repo's GitHub origin when there is one), and the Prompt, Approach and
96
+ Acceptance criteria buttons. Then comes its attempt trail, one line per attempt with the reason it ran
97
+ (for example *after review findings* or *escalated to a stronger model*). Then its Summary: the
98
+ generated summary, the model and time it was made, its sources, and an *Out of date* mark once the
99
+ task has changed since. Then its Questions: the brief questions, each with an answer box. When a
100
+ question belongs to a group, or one is plan-scoped, the list is split: each group's title and
101
+ goal, then a Plan heading, then No group for a question with no group. A list with neither stays
102
+ flat. Parked questions stay behind a collapsed *Parked (wider scope)* block, grouped
103
+ the same way. An answered parked `wave` or `plan` question has *Propose a change*. A solo run has
104
+ the header and the trail only. Above a plan's task table sit its open brief questions, flagged
105
+ first and then by projected start, in those same groups, and under them the proposals. Each
106
+ proposal shows its state, scope, group, summary, diff and hash. One in state `proposed` has
107
+ *Approve* and *Reject*; the reject reason is optional. A task an approved proposal marked carries
108
+ an affected badge beside its status and in its inspector: `affected by <pid>`, or `flagged:
109
+ already started` when the task had already started. The marker's reason (`changed`, `added` or
110
+ `dependent`) is the badge's tooltip. The summaries switch sits with that list.
111
+ A run with a retro report or notes shows a Retro section in its run details: the note counts on one line,
112
+ then the report, collapsed.
113
+
114
+ A task that stopped `NEEDS_INPUT` opens *Waiting for you*: the question from `tasks/<id>/needs_input.md`,
115
+ and a `forge-parallel.sh retry … --answer` command to copy. On a plan, when the server can write, an
116
+ answer field sits under that command. *Send answer* runs
117
+ [`forge control retry PLAN ID --answer-file -`](commands.md#the-forge-command) (`--actor ui`) and does
118
+ not ask first: it is not a destructive change. While a scheduler is live the page says the answer is
119
+ queued and the scheduler resumes the task; with no live run it says the answer is prepared for the
120
+ next `run`. A solo run shows the question and the command only. Under `--read-only` the field is
121
+ absent and the copy button stays.
122
+
83
123
  Under each attempt's dwarf and reviewer are the checks they ran, read from their logs: each
84
124
  test, type check, lint or build with its exit, its time and the counts it printed, a failed
85
125
  one's last lines, and a link to that command in the conversation. Each attempt then says which
@@ -104,8 +144,12 @@ A review the reviewer passed but forge failed, because it listed a blocking CONF
104
144
  forge-ui reads everything, and it changes things only by calling forge's own commands: it
105
145
  never writes a run file, a repo or a config itself. That keeps one set of rules (validation,
106
146
  locks, the audit log) whichever way you change something, and a change from the page is
107
- indistinguishable from the same command typed in a terminal, except that `control.log` says
108
- `ui` instead of `cli`. Every change asks you to confirm and says when it takes effect.
147
+ indistinguishable from the same command typed in a terminal, except that the page passes
148
+ `--actor ui` (`control.log` says `ui` instead of `cli` for a control change). A destructive change
149
+ shows a dry run and then asks: removing worktrees, forgetting memories, compacting disk and deleting
150
+ a run. A brief answer, a proposal, approving or rejecting one, and *Send answer* on a task that is
151
+ waiting go out when you press the button, with no dry run. The HTTP shapes are in
152
+ [the API](../ui/docs/api.md); this page describes what you do.
109
153
 
110
154
  - **Run controls** (a plan's inspector): the QA threshold (shown with its source, `P2 (default)`
111
155
  or `P1 (set)`); it accepts `P0`–`P3`, *Default* (drop the setting; P2) and *None* (P3, nothing
@@ -122,19 +166,51 @@ indistinguishable from the same command typed in a terminal, except that `contro
122
166
  queued; the panel says *queued*, then *applied* or *refused* with the scheduler's reason.
123
167
  Each is `forge control`; see [decomposed runs](decomposed-runs.md#changing-a-run-while-it-works).
124
168
  A control that cannot apply (a budget with no live scheduler, a merged task) is disabled and
125
- says why.
169
+ says why. A task waiting `NEEDS_INPUT` is not *Retry now*: its answer field is described above
170
+ and runs `forge control retry --answer`.
126
171
  - **Projects (`#/projects`):** one page per repository with its runs, every finding forge's reviews
127
172
  wrote about it (each attempt, final reviews, shadow reviews behind a toggle), and every memory forge
128
173
  keeps for it, whichever run or checkout they came from. A finding a later review got past is
129
174
  `superseded`, never `fixed`; repeats across rounds are one row with a count. The Memories tab shows
130
175
  what `memory.md` gives each role and each learning's state, as `forge memory learnings` reports it.
131
- Runs and checkouts that are gone are read from the dataset, and those rows say so. Reachable from the
132
- header, a run's repository name and each map district.
176
+ Runs and checkouts that are gone are read from the dataset, and those rows say so. When the server
177
+ can write, each learning on the checkout you are looking at has a checkbox, the filtered list has
178
+ *Select all*, and *Forget selected* runs
179
+ [`forge memory forget`](commands.md#forge-memory-forget) on that checkout with `--actor ui`. It
180
+ dry-runs first. The confirm lists the learnings (`category:key` and the text) and the `memory.md`
181
+ lines that go, or says that no `memory.md` line goes. Cancelling sends nothing more. The result
182
+ then says how many ledger rows each key lost, or that the key was not found. A learning with no
183
+ category or key cannot be selected. Under `--read-only` the tab still shows the learnings and
184
+ hides the checkboxes and the button. Reachable from the header, a run's repository name and each
185
+ map district.
186
+ - **Disk (`#/disk`):** what forge takes on disk in every repository it has runs for (each run dir's
187
+ review snapshots, logs and anything forge does not create, each run's worktree folder, the data home),
188
+ what can go without losing a run, and the command that takes it back (`forge runs compact --logs`),
189
+ to copy. The same report as `forge du --all`; measured in the background when the screen opens.
190
+ When the server can write, a reclaimable run gets *Compact* and the whole-disk command gets
191
+ *Compact all*. Each one dry-runs
192
+ [`forge runs compact`](commands.md#forge-runs-compact) `--logs` first and the confirm says how
193
+ much space would be freed and across how many runs. The real call is the same command without
194
+ `--dry-run`. An active run is refused and the page says to compact it after it ends. Copy stays
195
+ beside the button. Under `--read-only` the commands are only copied. This command records
196
+ `run_compacted` and takes no actor.
133
197
  - **Worktrees (`#/worktrees`):** every worktree forge created, in any repository it knows: its
134
198
  run, task, branch, last commit, size and status (in use, uncommitted changes, locked, needed by
135
199
  the run, failed task, finished, missing on disk, not forge's, unknown to git, removed), and the
136
- command that removes it safely, to copy. The commands never use `--force` and the page runs
137
- none of them. Removed worktrees are listed from the dataset (`worktree_created` and
200
+ command that removes it safely, to copy. Those copied commands never use `--force` (`git worktree
201
+ remove`, `git branch -d` for a finished merged branch, `rm -rf` for a leftover folder, `git status`
202
+ or `git worktree prune` when that is the safe next step). The per-run `forge runs rm … --dry-run`
203
+ line is still only copied: it would delete the run directory as well. When the server can write,
204
+ the filtered view adds a checkbox and *Remove* on each row that can go, *Select all* for those
205
+ rows, *Remove selected*, and *Delete merged branches too*. *Remove* and *Remove selected* both
206
+ run [`forge worktrees rm`](commands.md#forge-worktrees-rm) with `--actor ui` (and `--branches`
207
+ when that box is checked): one dry run, a summary of what would go and what is skipped and why,
208
+ then a confirm, then the real call and a line per row (removed, skipped, or failed, with the
209
+ reason). If the dry run would remove nothing, that summary is the end of it and nothing is
210
+ asked. A row that cannot be removed shows why beside a disabled checkbox (its run is active,
211
+ uncommitted changes, locked by git, the run still needs it, already gone, not forge's, already
212
+ removed, or not a leftover). Under `--read-only` there is no checkbox and no Remove, and every
213
+ copy button stays. Removed worktrees are listed from the dataset (`worktree_created` and
138
214
  `worktree_removed` events); worktrees from before forge recorded them are derived from run dirs,
139
215
  without dates. With `FORGE_DATASET=off` the screen lists only what git and the run dirs say.
140
216
  - **Open findings:** the review findings a run left open (tolerated by `--qa-threshold`,
@@ -154,13 +230,27 @@ indistinguishable from the same command typed in a terminal, except that `contro
154
230
  the repository through one of its runs, from a list grouped by repository that shows each
155
231
  run's worktree and branch (arrow keys and typing work in it), and the page names the
156
232
  directory the configuration was read from.
233
+ - **Summaries:** a switch above a plan's task table turns summaries on or off for the run. A task's own
234
+ switch, in its Summary section, sets it to *On*, *Off* or *Inherit* (the run's setting). Each change is
235
+ confirmed first. Turning them on for a finished run starts `forge summarize` in the background.
236
+ - **Brief answers and proposals:** each brief question in a task's inspector has an answer box, and *Send* records the
237
+ answer (`forge brief answer`, logged as `ui`). A late answer, given after the task started, shows the
238
+ CLI's notice under its question. An answered parked `wave` or `plan` question has *Propose a change*
239
+ (`forge brief propose`, logged as `ui`). A proposal in state `proposed` has *Approve*
240
+ (`forge brief apply PLAN PID --approve HASH --actor ui`, using the hash on the card) and *Reject*
241
+ (`forge brief reject`, with an optional reason, logged as `ui`). Answers, proposals, approvals and
242
+ rejections are sent at once, without a confirm.
157
243
 
158
244
  Writing is protected, because anything that can reach the server could otherwise change your
159
245
  runs. The server makes a random token each time it starts and puts it in the page it serves;
160
246
  the page sends it with every change, and the server also checks the `Host` and `Origin`
161
247
  headers, so another website open in your browser cannot make your browser change a run. Reading
162
248
  needs no token. `--read-only` (or `FORGE_UI_READONLY=1`) turns writing off altogether: no
163
- token is issued and every change is refused. `FORGE_UI_READONLY=1 forge ui open` starts such a
249
+ token is issued and every change is refused. No action button is shown: not the run controls,
250
+ not Remove or Forget selected or Compact, and not *Send answer*. The summaries and the questions
251
+ still show, without their switches, answer boxes, or Propose, Approve and Reject buttons, and
252
+ every copy button stays (worktree commands, compact commands, and the `retry --answer` command
253
+ on a waiting task). `FORGE_UI_READONLY=1 forge ui open` starts such a
164
254
  server, and the launcher never reuses a server running in the other mode; it replaces it.
165
255
 
166
256
  Also: replay, critical path, Fractal child-task trees, quick jump (Ctrl K, ⌘K on a Mac, or
package/docs/memory.md CHANGED
@@ -62,6 +62,8 @@ Only `verify` and `trap` are kept on first sighting — those are facts, true th
62
62
  QA is not told the build command; it is not building anything. It *is* told the recurring
63
63
  findings, so it can notice this is the fourth time the same bug shipped.
64
64
 
65
+ Retro notes are not memory: they never go to `.forge/memory.md` or the ledger, and no prompt reads them back ([retro notes](../references/decompose.md#retro-notes-opt-in)).
66
+
65
67
  `.forge/` is the **only** thing forge writes into your working tree rather than onto a branch
66
68
  of its own. It is excluded from every captured diff, so a reviewer never sees it as the
67
69
  dwarf's work — but it *will* show up as untracked in `git status` after your first run.
@@ -114,12 +116,28 @@ forge-memory.sh show <repo>
114
116
  forge-memory.sh prune <repo> # re-apply staleness and the cap now
115
117
  forge-memory.sh spend <repo> [--run <run-id>] # what forge has cost this repo
116
118
  forge-memory.sh learnings <repo> [--json] # every ledger learning and its state, as JSON (forge memory learnings)
119
+ forge-memory.sh forget <repo> <category:key>... # drop those ledger rows and rebuild memory.md
120
+ [--dry-run] [--json] [--actor ui|cli]
117
121
  ```
118
122
 
119
123
  `record` appends to the ledger and then rebuilds `memory.md` from the whole ledger — the
120
124
  rebuild is idempotent, so a crashed run can leave the ledger a row short but can never leave
121
- memory half-written. Editing `memory.md` by hand therefore does not stick; remove the ledger
122
- rows instead.
125
+ memory half-written. Editing `memory.md` by hand therefore does not stick: the next rebuild
126
+ overwrites it.
127
+
128
+ `forget` is how a learning is removed. Its identity is `category:key`, the same pair the rebuild
129
+ groups on (category, and the text normalised to lowercase with runs of non-alphanumerics collapsed
130
+ to one space). `forge memory forget REPO KEY…` drops every ledger row of those keys and rebuilds
131
+ `memory.md` from what remains. `--dry-run` writes nothing and still lists the `- ` lines that
132
+ would leave. A key that is not in the ledger is not an error. A real forget that drops at least
133
+ one row records a `memory_forget` dataset event, including the actor (`--actor ui` or `cli`,
134
+ default `cli`). `--json` prints
135
+ `{ok, dry_run, keys: [{key, rows, found}], memory_lines_removed}`. Exit 0 ok, 2 usage. See
136
+ [the command](commands.md#forge-memory-forget).
137
+
138
+ forge-ui's Memories tab does this for the learnings you select: *Forget selected* dry-runs,
139
+ confirms with the learnings and the `memory.md` lines that go, then runs `forget` as actor `ui`
140
+ on the checkout the tab is showing. See [Controls](forge-ui.md#controls).
123
141
 
124
142
  ```bash
125
143
  # what would a dwarf actually be told about this repo?
@@ -144,11 +162,16 @@ its rows, and what forge does with it now:
144
162
  | `muted` | every row of it was marked not injectable (Jev's curation) |
145
163
 
146
164
  The states come from forge-memory.sh's own rebuild, run into a scratch directory, so they cannot differ
147
- from what `record` writes; the repository is only read. The answer also has the current `memory.md` by
165
+ from what `record` writes; `learnings` itself only reads the repository. The answer also has the current `memory.md` by
148
166
  section, with the roles each section reaches, and `rebuilt_differs` when that file is not what a rebuild
149
167
  makes now (an older forge wrote it, or a `prune` asked Jev to drop facts). forge-ui's Projects screen
150
168
  shows it on each repository's *Memories* tab, merged across the checkouts its runs started in and, from
151
- the dataset, the learnings of checkouts that are gone.
169
+ the dataset, the learnings of checkouts that are gone. With write controls the tab adds a checkbox per
170
+ learning, *Select all* for the ones the filters show, and *Forget selected*. That dry-runs
171
+ `forge memory forget` on the checkout you are looking at, then asks, listing each `category:key` and
172
+ the `memory.md` lines that go. Under `--read-only` the list stays and those controls do not. A learning
173
+ is removed by `forget`, which edits the ledger and rebuilds `memory.md`; editing `memory.md` by hand
174
+ does not stick.
152
175
 
153
176
  ## Spend
154
177
 
package/docs/models.md CHANGED
@@ -171,3 +171,11 @@ or absent = the built-in default). It applies only when neither `--timeout` nor
171
171
  elsewhere.
172
172
 
173
173
  Adding a model is one line in this file. Nothing else needs to change.
174
+
175
+ **Moving an alias to a newer model.** Keep the old model under a versioned alias, as
176
+ `terra-5.6` keeps gpt-5.6-terra now that `terra` is gpt-6.1-terra. Each dispatch records
177
+ the model id it ran, so the statistics that count by alias (`forge dataset reviewers`, review
178
+ history, forge-ui's model leaderboard) count an old `terra` dispatch under `terra-5.6`, the
179
+ alias that resolves to its model today, and never under the newer `terra`. Without a versioned
180
+ alias for the old model, its dispatches stay counted with the alias's new ones. Statistics that count by
181
+ model id (routing, forecasts, effort notes, shadow pairs) were already separate.
package/docs/reviews.md CHANGED
@@ -48,6 +48,16 @@ file) is retried the same way: its verdict counts for nothing, but the committed
48
48
  Untracked files a reviewer leaves in its copy, such as a test run's `__pycache__/`, do not void
49
49
  the review.
50
50
 
51
+ ### A large task diff
52
+
53
+ A task review inlines its diff up to 400 KB, the whole-run review's limit. Over it, the prompt
54
+ holds the diff's stat and the reviewer reads the diff in its working copy, which holds the attempt
55
+ as one commit over its base (`git diff HEAD~1 HEAD`), as the whole-run review and `adopt` already
56
+ do. If the reviewer's harness still refuses the prompt as too large (codex's `input_too_large`,
57
+ claude's "Prompt is too long"), the task ends `ERROR` with a note that names the cause and the way
58
+ out: a retry would send the same prompt, so review the commit with `forge-parallel.sh adopt`, or
59
+ split the task.
60
+
51
61
  ## Retrying a failed task
52
62
 
53
63
  ```bash
@@ -113,6 +123,79 @@ retried again, so a stuck task cannot burn its whole budget repeating itself.
113
123
  `tasks/<id>/attempts.tsv` records every entry (epoch, attempt number, resulting status, infra
114
124
  class).
115
125
 
126
+ ### A budget per model: `--retry-per-model N`
127
+
128
+ `plan --retry-per-model N` (1 to 99) writes `retry_per_model`. `--no-retry-per-model` removes
129
+ it; a re-plan that names neither keeps the file. A task may fail N times on the model it is
130
+ running. After those failures the next attempt moves one rung up the pools given to `plan`,
131
+ and the count starts again. With `--escalate-effort`, the same N applies to each effort of
132
+ that model before the next effort. This replaces `--escalate-after` for the plan. When
133
+ `escalate_after` is also present, `run` prints `retry-per-model N replaces --escalate-after
134
+ for this plan` and the policy follows `retry_per_model`.
135
+
136
+ Automatic retries still need `--retry-failed` above 0. Any positive budget turns the ladder on;
137
+ that number is not the limit. A person's decision, `--max-attempts`, the converging stop, a
138
+ `noretry` marker and `escalation.stop` still apply. `forge-route.py per-model` says whether one
139
+ task may run again. `worst-case` is what the plan table prints: `retry per model: N`,
140
+ `worst case with retry-per-model N: X dispatches` (implementer, reviewer, and shadow reviews
141
+ when those are on), and, when the cap cuts a ladder short,
142
+ `max-attempts … stops these tasks before the top of their ladder`.
143
+
144
+ Pools `low`, `medium` and `high` with N=3 give a task that starts on `low` up to 9 implementer
145
+ attempts, three on each rung. `--max-attempts` bounds that. The default cap is 8, so the table
146
+ names the task unless `plan --max-attempts` raises it.
147
+
148
+ ### Failures that are the plan's
149
+
150
+ Two outcomes are not a further try of the model.
151
+
152
+ **Reason `plan`.** Task, solo and group reviews ask for this brace. Sweep, adopt and final
153
+ reviews do not. A finding whose only fix is a file the task did not declare ends its first line
154
+ with `{outside=<path>}`, several paths comma-separated, in its own braces immediately before
155
+ the facts brace:
156
+
157
+ ```
158
+ - [P1][CONFIRMED] path/file.py:123 — {outside=a.py,b.py} {reach=main origin=new evidence=ran}
159
+ ```
160
+
161
+ The implementer does not edit that file. It finishes, then ends its message with one
162
+ `FORGE_BLOCKED: <path>: <why>` line per path. `qa.input` shows those lines as a claim ("The
163
+ implementer says these fixes need files outside the task") and tells the reviewer to confirm a
164
+ real one with `{outside=<path>}` or refute it. Only the reviewer's brace stops the task. When
165
+ the status is `FAIL`, the verdict in `qa.last` is `PASS` or `FAIL`, every blocking finding
166
+ carries `{outside=…}`, and each path is outside the task's declared files, the decomposed task
167
+ stops as `NEEDS_DECISION` with reason `plan` after that attempt, before any escalation. A group
168
+ member's settled `FAIL` is checked the same way. A solo review is not.
169
+ `tasks/<id>/outside.json` lists each path with the task that declares it, or none, and that
170
+ task's status. `decision.md` prints `path — declared by <id> (<status>)` or
171
+ `path — declared by no task`, then the plan choices: add the path to this task's `files`, make
172
+ this task depend on the owner, or merge the two rows. Edit `tasks.tsv`, run `plan` again when
173
+ no run is live, then `retry --decide retry=1` with `--reason` and `--approved`.
174
+
175
+ That `FAIL` counts toward `--max-attempts`, because a review happened. It does not spend a
176
+ further attempt on the model: escalation does not run, and `--retry-failed` does not re-queue a
177
+ `NEEDS_DECISION` task. Another dispatch cannot change a file this task does not declare. A
178
+ tolerated or `PLAUSIBLE` finding does not block, so it does not count toward the stop. A later
179
+ decision restarts the escalation streak past this attempt.
180
+
181
+ **`STALE`.** `prompt.dispatched` and `approach.dispatched` are the copies taken when the
182
+ attempt is dispatched. A missing `approach.md` is an empty copy. If `prompt.md` or `approach.md`
183
+ differs at review time, the attempt is not reviewed. The status is `STALE`, the diff is
184
+ `stale.diff`, `control.log` records `prompt-changed` with actor `scheduler`, and the console
185
+ says the attempt was not reviewed and no attempt was spent. This spends nothing against the
186
+ model: the implementer was not judged on the text it was given, so the result says nothing
187
+ about it. The attempt counter is refunded, the cap skips `STALE` the way it skips `INFRA`, the
188
+ escalation streak treats `STALE` as neutral, and no decision is written. The scheduler
189
+ re-dispatches at once, unless the run is stopping, with `retry_findings.source` `prompt`.
190
+ `retry_findings.md` holds the new requirements and the diff, and the attempt number is reused.
191
+ A `STALE` task still waiting at the next `run` is prepared the same way. That re-dispatch does
192
+ not need `--retry-failed`. `forge control retry` accepts `STALE`; `--dwarf` is refused, because
193
+ the same implementer gets the new text. A plain `forge-parallel.sh retry` does not take this
194
+ path. The stale attempt's `changes.diff` is removed, so a
195
+ re-dispatch that keeps the committed work is reviewed rather than refused as identical. The
196
+ dataset attempt event has `prompt_changed`. `forge dataset routing`, tiers and the forecast
197
+ leave those attempts out. The `prompt` blob is the text the implementer was given.
198
+
116
199
  ## Infrastructure failures are not task failures
117
200
 
118
201
  A quota or usage limit, an auth problem, a rate limit, a network error, or a harness that
@@ -301,6 +384,38 @@ share a commit, `since=` is that commit and the prompt says nothing changed. The
301
384
  labelled-line rule applies: restate only what is still open, because every labelled line
302
385
  is filed.
303
386
 
387
+ ## Group review (opt-in)
388
+
389
+ `plan --groups waves --group-review` reviews several related tasks in one QA dispatch. It is
390
+ off unless you pass it. A planner's groups, and `--groups` without `--group-review`, are names
391
+ only (`review=task`): they show in the approval table, and each task is still reviewed on its
392
+ own. The mechanics are in
393
+ [Groups and group review](../references/decompose.md#groups-and-group-review-opt-in).
394
+
395
+ **Fewer dispatches, a larger prompt.** A group is one review instead of one per member, and
396
+ the reviewer sees those tasks together: each task's requirements, and the combined diff. The
397
+ prompt is larger. That is the tradeoff.
398
+
399
+ **A failure stops the group.** A blocking finding sends the implicated members back. The
400
+ others stay implemented and are not retried, and nothing in the group merges until those
401
+ members are fixed and the group passes. A member also waits for its siblings before anything
402
+ merges, so a task that depends on one of them starts later than it would under per-task review.
403
+
404
+ **Fewer dispatches are not a measured saving.** They do not by themselves prove a lower token
405
+ cost, or that the same defects are caught. The group's QA dispatch is recorded with `scope`
406
+ `group` and is left out of the per-task reviewer statistics. Read the `group_review` and
407
+ `group_merge` events. Measure with `forge dataset` before treating group review as a cost
408
+ saving. See [the dataset](../references/dataset.md#raw-events-not-training-examples).
409
+
410
+ **When to use it.** Many small, related, low-risk tasks. Keep a high-risk task on per-task
411
+ review. `--group-review` already leaves high-difficulty tasks out of the groups it derives.
412
+
413
+ A combined diff over `group_max_diff_kb` (256 KB unless the plan says otherwise) is not
414
+ reviewed and not truncated: the group stops for a decision. That is separate from a
415
+ [whole-run review](#whole-run-review-opt-in), which reads the combined result after the run
416
+ and does truncate. Group review runs no shadow review, does not continue a reviewer session
417
+ across rounds, and does not run under Fractal.
418
+
304
419
  ## Reviewer session (opt-in experiment)
305
420
 
306
421
  `plan --reviewer-session` continues the same reviewer's session across rounds. It is off
@@ -311,6 +426,13 @@ when the resolved harness, model and effort are unchanged. The approval table na
311
426
  Dispatch details are in
312
427
  [continuing a reviewer session](../references/harnesses.md#continuing-a-reviewer-session).
313
428
 
429
+ `plan --reviewer-session-rate R` turns it on for a sampled share of the tasks only, to compare
430
+ the two halves in one run. Within each difficulty, `plan` picks round(R × n) tasks by a hash of
431
+ the run id and the task id, and writes them to `reviewer_session_tasks`. A re-plan keeps the
432
+ same tasks. The other tasks review fresh every round, and their `review_sessions.tsv` rows say
433
+ `not-sampled`. Plain `--reviewer-session` on a re-plan goes back to every task. A whole-run
434
+ review is not sampled.
435
+
314
436
  Any round that cannot continue starts a fresh session. That is the first round, a missing
315
437
  or malformed session id, a resolution that is missing or different, any harness other
316
438
  than those three, a Fractal plan, and a continue that the harness refuses or that fails
package/docs/safety.md CHANGED
@@ -22,6 +22,14 @@ What forge never does to your branch and working tree, what it refuses to run on
22
22
  after `results.tsv` is written and read back.
23
23
  - QA runs in a disposable repository. Mutations to the source or review snapshot invalidate
24
24
  acceptance. Disabled editing tools alone do not prevent writes through Bash.
25
+ - A review snapshot is as large as the repository's tree, so forge removes it once its review
26
+ ends: task, final, shadow, solo and adopt reviews, whatever the outcome. `review.base`,
27
+ `review.deps`, the prompt, the log and the verdict stay beside it. `FORGE_KEEP_SNAPSHOTS=1`
28
+ keeps snapshots, for debugging. A review ended by a signal can leave its snapshot behind; the
29
+ task's next review, or the plan's next final review, removes it, and so does `forge runs compact`.
30
+ - `forge runs compact` and the background compaction at run start never touch an active run (they
31
+ hold its lock), a worktree, or a file forge does not create, and they import the run into the
32
+ dataset strictly before anything goes. Log copies are gzipped, never deleted.
25
33
 
26
34
  ## Preconditions
27
35