@giamme/forge 0.16.0 → 0.18.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 (95) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/SKILL.md +16 -3
  3. package/VERSION +1 -1
  4. package/docs/artifacts.md +8 -0
  5. package/docs/commands.md +70 -6
  6. package/docs/dataset.md +13 -0
  7. package/docs/decomposed-runs.md +8 -0
  8. package/docs/forge-ui.md +23 -2
  9. package/docs/memory.md +2 -0
  10. package/docs/reviews.md +15 -1
  11. package/docs/safety.md +8 -0
  12. package/forge +24 -1
  13. package/package.json +1 -1
  14. package/references/dataset.md +143 -5
  15. package/references/decision-models.md +15 -2
  16. package/references/decompose.md +180 -11
  17. package/references/planning.md +3 -2
  18. package/references/solo.md +2 -1
  19. package/references/ui.md +5 -2
  20. package/scripts/forge-artifact.sh +14 -0
  21. package/scripts/forge-brief.py +132 -0
  22. package/scripts/forge-compare.py +11 -1
  23. package/scripts/forge-config.py +176 -9
  24. package/scripts/forge-contract.py +98 -4
  25. package/scripts/forge-control.py +86 -13
  26. package/scripts/forge-dispatch.sh +14 -10
  27. package/scripts/forge-du.py +167 -0
  28. package/scripts/forge-issues.py +4 -3
  29. package/scripts/forge-ledger.py +3 -1
  30. package/scripts/forge-lib-adopt.sh +8 -1
  31. package/scripts/forge-lib-plans.sh +5 -2
  32. package/scripts/forge-lib-review.sh +29 -1
  33. package/scripts/forge-metrics.sh +29 -3
  34. package/scripts/forge-parallel-options.sh +4 -0
  35. package/scripts/forge-parallel.sh +506 -10
  36. package/scripts/forge-plan-check.py +25 -2
  37. package/scripts/forge-planner.py +20 -6
  38. package/scripts/forge-prompt.py +120 -0
  39. package/scripts/forge-retro.py +115 -0
  40. package/scripts/forge-runs-compact.py +443 -0
  41. package/scripts/forge-runs-rm.py +2 -0
  42. package/scripts/forge-runs.py +18 -3
  43. package/scripts/forge-schedule.py +279 -4
  44. package/scripts/forge-shadow.py +35 -10
  45. package/scripts/forge-solo.sh +2 -0
  46. package/scripts/forge-summarize.py +698 -0
  47. package/scripts/forge-sweep.py +25 -10
  48. package/scripts/forge-ui-options.sh +10 -0
  49. package/scripts/forge_brief/__init__.py +587 -0
  50. package/scripts/forge_brief/answers.py +459 -0
  51. package/scripts/forge_dataset/__init__.py +10 -0
  52. package/scripts/forge_dataset/cli.py +83 -0
  53. package/scripts/forge_dataset/export.py +18 -4
  54. package/scripts/forge_dataset/facts.py +280 -0
  55. package/scripts/forge_dataset/harvest.py +56 -9
  56. package/scripts/forge_dataset/history.py +5 -3
  57. package/scripts/forge_dataset/outcomes.py +206 -58
  58. package/scripts/forge_dataset/pairs.py +174 -0
  59. package/scripts/forge_dataset/risk.py +108 -0
  60. package/scripts/forge_dataset/tiers.py +427 -0
  61. package/scripts/forge_decide/__init__.py +11 -1
  62. package/scripts/forge_decide/cli.py +23 -2
  63. package/scripts/forge_decide/labels.py +30 -6
  64. package/scripts/forge_decide/replay.py +10 -4
  65. package/scripts/forge_locations.py +366 -0
  66. package/scripts/forge_registry.py +19 -0
  67. package/scripts/forge_retro/__init__.py +417 -0
  68. package/scripts/forge_retro/issues.py +1193 -0
  69. package/scripts/forge_retro/report.py +671 -0
  70. package/scripts/forge_side/__init__.py +477 -0
  71. package/scripts/forge_storage.py +515 -0
  72. package/ui/README.md +68 -8
  73. package/ui/docs/api.md +217 -20
  74. package/ui/forge_ui/control.py +92 -11
  75. package/ui/forge_ui/export.py +31 -5
  76. package/ui/forge_ui/findings.py +4 -2
  77. package/ui/forge_ui/links.py +337 -0
  78. package/ui/forge_ui/models.py +57 -4
  79. package/ui/forge_ui/projects.py +4 -1
  80. package/ui/forge_ui/reader.py +732 -34
  81. package/ui/forge_ui/server.py +8 -0
  82. package/ui/forge_ui/static/app.js +92 -5
  83. package/ui/forge_ui/static/briefview.js +302 -0
  84. package/ui/forge_ui/static/checksview.js +6 -2
  85. package/ui/forge_ui/static/controls.js +5 -0
  86. package/ui/forge_ui/static/diffview.js +7 -3
  87. package/ui/forge_ui/static/index.html +3 -0
  88. package/ui/forge_ui/static/panel.js +311 -4
  89. package/ui/forge_ui/static/runmodel.js +13 -1
  90. package/ui/forge_ui/static/storageview.js +271 -0
  91. package/ui/forge_ui/static/style.css +100 -3
  92. package/ui/forge_ui/static/worktreesview.js +3 -3
  93. package/ui/forge_ui/storage.py +136 -0
  94. package/ui/forge_ui/transcripts.py +35 -10
  95. package/ui/forge_ui/worktrees.py +154 -13
@@ -42,13 +42,18 @@ time order: an attempt that PASSed, then a merge that CONFLICTed, then a human `
42
42
  | `event` `control` | `forge control` change | a human's live change: `at`, `actor` (`cli`/`ui`), `action` (`set`, `pin`, `unpin`), `key`, `value`, `previous`; task events carry the task id. Also read back from `control.log` by `import` |
43
43
  | `event` `worktree_created` / `worktree_removed` | forge adds or removes a worktree | `path`, `branch` (`-` when detached), `kind` (`task`, `integration`, `candidate` for integrate's scratch worktree, `attribute` for the culprit search's), `repo_path`, and the task for a task worktree; `forge runs rm` adds `by`. Written at task and `_integration` creation, the merged-task cleanup at the end of `run`, integrate's candidate, every prefix of `attribute`, `combine` and `split` (a moved worktree is removed from the old run and created in the new one), and `forge runs rm --worktrees`. A worktree removed outside forge has no `worktree_removed`. forge-ui's Worktrees screen reads them through `forge dataset worktrees` |
44
44
  | `event` `run_delete_started` / `run_deleted` | `forge runs rm` | written strictly around a run's deletion: `path`, `run_id`, `archive`, and for `run_deleted` the bytes freed |
45
+ | `event` `run_compacted` | `forge runs compact` (by hand, or `auto` in the background at run start) | after the strict import and the removals, fail-open: `path`, `bytes_freed`, `snapshots_removed`, `snapshot_bytes`, `logs_compressed`, `log_bytes_freed`, `auto` |
45
46
  | `event` `shadow_review` | shadow review | how an opt-in second review ended (`done`, `invalid`, `overtime`, `orphaned`, ...), with the reviewed commit and both specs. Its dispatch is recorded with role `qa_shadow` |
47
+ | `event` `side_dispatch` | a brief or summary dispatch that `forge run`, `forge brief write`, `forge summarize` or the scheduler's summaries started, or could not start | `kind` (`brief` or `summary`), `task`, `spec`, `ok`, and `reason`: null on success, else `timeout`, `error`, `missing` or `cap`. Its dispatch is recorded with role `side_brief` or `side_summary` |
48
+ | `event` `retro_note` | a retro note stored by `forge retro note`, or by `forge retro record` after a dispatch | the note's fields (`type`, `fixable_by`, `summary`, `blocking`, `tried`, `evidence`), forge's context (`role`, `spec`, `alias`, `harness`, `effort`, `tier`, `task`, `attempt`, `run_id`, `version`, `os`, `t`) and `check` (`verified` or `claimed`). Fail-open: the plan's `retro/notes.jsonl` is the record |
49
+ | `event` `brief_question` | a brief question stored by `forge brief write` | `task`, `qid`, `scope`, `must_answer` (kept only under `gated`), and `parked`: true for a `wave` or `plan` question, which is kept in `brief.parked.json` |
50
+ | `event` `brief_answer` | an answer given with `forge brief answer` | `task`, `qid`, `actor` (`cli`, or `ui` from forge-ui), and `late`: true once the task has started. The answer is also logged in `control.log` as an `answer` change |
46
51
  | `jev` | Jev request | site, answers, usage, latency, mode. Blob: the **full request** (state and questions). Its original sha is `jev.jsonl`'s `key`. A per-attempt gate's request state carries `run`, `task` and `attempt` (`dwarf-message`, `retry-addressed`), so its key differs per attempt and per run; `attribution` carries `run` only |
47
52
  | `fractal_step` / `fractal_node` | Fractal step, node state | decomposition decision, iteration, resolved model, cost, tokens, candidate diff |
48
53
  | `ledger` | ledger row | imported `.forge/ledger.tsv` rows |
49
54
  | `forecast` | forecast shown by `run` | the plan forecast printed before dispatch (see [plan forecast](#plan-forecast)), once per run and content. Also in the plan as `forecast.json` |
50
55
  | `comparison` | `forge runs compare` | two runs of one plan side by side: `a` and `b` each with the run's uid, run id, starting commit and per-task status, attempts, tokens, time and diff size, and a `summary` (tasks merged in both, only in one, in neither). One event per pair and content; the event's run is the second one. Descriptive: nothing routes on it |
51
- | `outcome` | integrated task, per horizon | written by `forge dataset outcomes`, never by a run: how many of the lines a task added survive N days after `integrate`, and what reverted it |
56
+ | `outcome` | integrated task, per horizon | written by `forge dataset outcomes`, which the end of every `run` and `integrate` also runs for its repository: how many of the lines a task added survive N days after it landed, and what reverted it |
52
57
 
53
58
  An attempt that forge sent back without a review keeps the status `FAIL` in the dataset, and
54
59
  `sent_back` says what sent it back (`prereview`, `bounce` or `message`). `attempts.tsv` names the
@@ -73,6 +78,12 @@ the log does not say. `speed_reason` is why it was not fast (claude's
73
78
  `fast_mode_disabled_reason`, or codex's error message), or null. Each is null when absent,
74
79
  so a dispatch that predates the keys is otherwise unchanged.
75
80
 
81
+ A brief or summary is a side dispatch (`forge-dispatch.sh side`, read-only). Its dispatch is
82
+ recorded as role `side_brief` or `side_summary` (`forge_dataset.is_side_role`), and its files on
83
+ disk stay `side.*`. Review history, finding facts, review exports and forge-ui's model views
84
+ skip every `side_*` role, so a brief or summary is never counted as a review. A bare `side` is
85
+ the dispatch role itself, not one of these.
86
+
76
87
  `plan --reviewer-session` writes `$PLAN/reviewer_session` (`on`). The plan event records
77
88
  it in `options`. The file joins the plan id only when it is present, so every plan already
78
89
  in a store keeps its id, and turning the experiment on stores a new plan event.
@@ -84,6 +95,14 @@ its id, and a re-plan that changes the file's content gets a new plan event. `pl
84
95
  `forge dataset status` counts continued and failed continues for reviewers and implementers
85
96
  apart.
86
97
 
98
+ The feature files `retro_mode`, `brief`, `brief_scope`, `brief_model`, `summaries` and
99
+ `summaries_model` join the plan id the same way, and the plan event's `options` records each
100
+ one under its file name. `brief_scope` and `brief_model` exist only when brief is on, and
101
+ `summaries_model` only when summaries is on. `retro_mode`, `brief` and `summaries` hold `off`
102
+ after an explicit off (`--no-retro`, `--brief off`, `--summaries off`); with no choice they
103
+ are absent. See [retro notes](decompose.md#retro-notes-opt-in), [brief mode](decompose.md#brief-mode-opt-in)
104
+ and [task summaries](decompose.md#task-summaries-opt-in).
105
+
87
106
  Each blob reference carries `sha` (the stored bytes), `original_sha`, `n` (the original
88
107
  size), `kept`, and `cut`. A cut keeps the head and the tail, because a QA prompt ends with
89
108
  the diff and a log ends with the failure. Caps: prompt 1 MiB, diff 2 MiB, message 256 KiB,
@@ -160,9 +179,14 @@ forge still running keeps writing.
160
179
  ./forge dataset blob <sha> # print one stored blob
161
180
  ./forge dataset import <dir|archive|legacy-dir>... [--registry] [--fractal] [--ledger REPO] [--dry-run]
162
181
  ./forge dataset export [--slice S]... [--limit N] [--seed N] [--out DIR] # labeled decision cases
163
- ./forge dataset outcomes [--horizon-days 14] [--repo PATH] [--dry-run] # what integrated work became
182
+ ./forge dataset outcomes [--horizon-days 14] [--repo PATH] [--dry-run] [--deadline S] [--quiet] # what integrated work became
164
183
  ./forge dataset routing [--repo PATH] [--since DAYS] [--json] # pass rate and runtime per tier and model
165
184
  ./forge dataset reviewers [--horizon-days 14] [--repo PATH] [--json] # how each reviewer's PASSed work held up
185
+ ./forge dataset risk [--repo PATH] [--json] # tasks by difficulty and risk together, and how each pair fared
186
+ ./forge dataset tiers [--repo PATH] [--tier T] [--json] # what explains results inside each tier, held out by run
187
+ ./forge dataset tiers --sample N --out DIR | --blind DIR # past prompts to rate blind, then agreement with the recorded tier
188
+ ./forge dataset pairs [--repo PATH] [--json] # two reviewers of one attempt, by what differs (effort, model, family)
189
+ ./forge dataset facts [--repo PATH] [--json] # findings' reach, origin and evidence: agreement, and rules replayed
166
190
  ./forge dataset forecast <plan> [--repo PATH] [--json] # likely cost and first-try PASS rate per task
167
191
  ./forge dataset worktrees [--json] # the worktrees forge created and removed (forge-ui's Worktrees screen)
168
192
  ./forge dataset history [--json] # every review's findings and every learning, by run (forge-ui's Projects screen)
@@ -336,11 +360,31 @@ For every integration, and every task it brought in, the harvester records:
336
360
  integration, dated before `integrate` + N days. The branch is resolved once, and the
337
361
  chain is walked by position, so commit dates out of order cannot skip a commit.
338
362
 
339
- Two cases leave a task without a survival count:
363
+ **Followed where it went** (#120). When the branch `integrate` advanced is gone, or the
364
+ integration is no longer on its first-parent chain, the harvester looks for it in every other
365
+ branch (local, then remote, never forge's own `forge/` branches): the commit where it entered
366
+ a branch's first-parent chain, a merge or the integration itself, is where the horizon is walked
367
+ from, on that branch. The outcome records `followed` (the branch) and `landed` (that commit). A
368
+ feature branch that a pull request merged and then deleted is followed this way. A run nobody
369
+ ran `integrate` for, its integration branch merged by hand, is followed the same way from its
370
+ last integration commit, and its horizon counts from when it landed (`merged_by_hand`).
371
+
372
+ Three cases leave a task without a survival count:
340
373
  - **Pending:** the horizon has not been reached and no later commit has passed it yet.
341
374
  Nothing is written, and the next harvest tries again.
342
- - **Lost:** a rebase, squash or reset took the integration off the branch. This means
343
- unobservable, not failed.
375
+ - **Not landed:** a run merged by hand whose integration no branch contains: not merged yet,
376
+ or squashed. Nothing is written, and the next harvest tries again.
377
+ - **Lost:** an `integrate` that a squash, rebase or reset took off every branch. This means
378
+ unobservable, not failed; `lost_cause` says whether its branch was deleted (`branch_gone`)
379
+ or rewritten (`off_branch`).
380
+
381
+ **When it runs.** The end of every `run` (unless it was interrupted) and every `integrate`
382
+ harvests that plan's repository: bounded by `FORGE_OUTCOMES_TIMEOUT` seconds (default 20; it
383
+ starts no new integration after that, and is killed 10 s later), never changing the exit code,
384
+ with its errors in `errors.log`. `FORGE_OUTCOMES=off`, or the dataset off, skips it. A new
385
+ integration cannot have reached its horizon, so what it records is older work coming due. Every
386
+ harvest that writes leaves `outcomes.last` in the dataset dir, and `forge dataset status`
387
+ prints the outcomes recorded by status and what the last harvest did.
344
388
 
345
389
  The rid names the integration, the reviewed commit and the horizon, so harvesting again
346
390
  adds nothing, and two horizons are two outcomes. Survival describes the diff that landed,
@@ -372,6 +416,100 @@ or its model when no alias was recorded, as the forge-ui Models view keys it. A
372
416
  forge-ui shows the rate as the Reviewers table's **Did not hold** column, through
373
417
  `GET /api/models/reviewers`, which runs this command with `--json`.
374
418
 
419
+ ## Risk beside difficulty
420
+
421
+ A plan event's `tasks.<id>.risk` is the task's `tasks/<id>/risk` rating (`low`, `medium`,
422
+ `high`, or null when it was not rated), recorded beside its difficulty. Nothing routes on it.
423
+ `forge dataset risk` counts each task once, as its run's latest plan revision rated it:
424
+
425
+ - how many tasks are rated, how many have a risk equal to their difficulty, and Cohen's kappa
426
+ between the two. A rating that only echoes difficulty adds nothing, and the question stops there.
427
+ - per (difficulty, risk) cell: tasks; first attempts that passed; tasks whose primary review
428
+ found a CONFIRMED P0 or P1; landed work (`forge dataset outcomes`, the longest horizon followed)
429
+ and how much of it did not hold. A cell under 10 tasks is flagged rather than read as an answer:
430
+ outcomes take 14 days, and low difficulty with high risk, the case that matters, is rare.
431
+
432
+ ## Inside a tier
433
+
434
+ `forge dataset tiers` asks whether a tier, `high` above all, mixes tasks that behave very
435
+ differently, before anyone adds a tier. It reads the tasks `routing` counts (first attempt says
436
+ something about the implementer, fractal runs left out) and changes nothing in a run. Facts come in
437
+ two kinds, reported apart:
438
+
439
+ - **plan time**, known before dispatch, so a rule could route on them: declared files,
440
+ dependencies, wave, and the size of the task's prompt in KB;
441
+ - **afterwards**, known only once the first attempt ran, so they can explain a result but never
442
+ route one: lines in that attempt's diff and files it changed.
443
+
444
+ Outcomes are first attempt passed, attempts taken, and unfinished (never passed, not accepted).
445
+ Per tier and fact:
446
+
447
+ - **bins**: the tier in thirds of the fact, each with tasks, runs, first pass (Wilson 95%), mean
448
+ attempts and unfinished. Descriptive only: a run's tasks are correlated and routing chose who
449
+ ran what.
450
+ - **held out by run**: runs go to 5 folds by a hash of their id. On the other folds, each
451
+ threshold at the training values' quartiles is scored on outcomes adjusted for the implementer
452
+ (an outcome minus its model's mean in the tier, shrunk toward the tier mean by 5 tasks), so a
453
+ weaker model mix is not read as harder tasks. The best threshold and its direction are applied
454
+ to the held-out runs. `lift` is the held-out difference between the side predicted higher and
455
+ the other, in the outcome's units (points for rates, attempts for attempts): above 0 means the
456
+ direction learned elsewhere held. The interval resamples held-out runs. It is omitted under 10
457
+ runs, or when no threshold leaves 5 tasks on each side.
458
+ - **repos**: first pass per repo with 10 or more tasks in the tier, and the implementer-adjusted
459
+ residual with a run bootstrap. Not held out: a repo's runs mostly stay in it.
460
+
461
+ Label noise is measured blind and never by the report itself, since rating costs model calls or a
462
+ person's time. `--sample N --out DIR` writes N past prompts, one task per run before any run gives
463
+ a second, to `DIR/prompts/<n>.md`, with `DIR/sample.tsv` mapping each number to its run and task.
464
+ The tier is not in either file, but a prompt can name it (2 of 663 did on one machine), so tell the
465
+ rater to ignore that. The rater writes `DIR/ratings.tsv` as `<n><TAB>low|medium|high`, and
466
+ `--blind DIR` reports the agreement rate with the recorded tier (Wilson 95%), Cohen's kappa and the
467
+ confusion table. Lines naming an unknown number or an invalid tier are counted, not guessed.
468
+
469
+ ## Paired reviews
470
+
471
+ `forge dataset pairs` reads the usable shadow pairs (as `status` counts them) and groups them by
472
+ the two reviewers' recorded harness, model and effort, each pair ordered lower effort first
473
+ (side `a`), then by model name:
474
+
475
+ - `effort`: the same model, at another effort or through another harness
476
+ - `model`: another model of the same family (`forge-shadow.py`'s families)
477
+ - `family`: another family
478
+ - `control`: identical settings. Their disagreement is the noise the others are read against,
479
+ and a control is never an effort comparison
480
+
481
+ Per pair of settings: `pairs`, `agree`, `agreement` with its Wilson 95% interval `ci`, and
482
+ `enough` from 30 pairs, the bar `forge dataset routing` uses. `only_a` and `only_b` count
483
+ blocking findings (CONFIRMED at the attempt's threshold or worse, or unlabelled) that the other
484
+ side did not name: nothing of it in the same file within 10 lines. An unlocated finding is always
485
+ unique, and a finding both sides name at different severities is not. `tokens_ratio` and
486
+ `time_ratio` are the medians over pairs of b's input plus output tokens and elapsed time as a
487
+ multiple of a's. A unique find is not a correct one: whether it was real is judged afterwards,
488
+ from outcomes or hidden tests. It only advises.
489
+
490
+ ## Finding facts
491
+
492
+ A reviewer ends each finding's first line with `{reach=… origin=… evidence=…}`. Each QA dispatch
493
+ records it beside the finding's severity and status as `findings[].facts` = `{reach, origin,
494
+ evidence}` (a value that is not one of the fact's words is null), and the finding's `head` has the
495
+ suffix cut. A finding without the suffix has no `facts` key. Nothing in forge decides on them yet:
496
+ `forge dataset facts` measures whether a gate should.
497
+
498
+ - **Coverage**: findings and reviews that carry facts, each fact's values, and reach by severity.
499
+ - **Agreement**: for every usable shadow pair (as `status` counts them), the findings both
500
+ reviewers name (same file, lines at most 10 apart, nearest first). Severity and each fact are
501
+ compared where both reviewers gave a value, as a raw share and as Cohen's kappa: severity has
502
+ four values and reach three, so raw agreement alone would flatter reach.
503
+ - **Rules**: the review each task attempt ended on, replayed through the severity gate with and
504
+ without a rule (the threshold its `qa.gate` recorded, else the plan's). `unusual`: reach=unusual
505
+ does not block unless P0. `existing`: origin=existing does not block. `both`. A rule only
506
+ releases a CONFIRMED or UNSTATED finding that has a severity; an unlabelled one still blocks.
507
+ Counted: reviews that would have passed, and the attempts after the first such review that
508
+ would not have run. Up to 50 released findings are listed with their run, task, attempt and head.
509
+
510
+ The replay without a rule is the gate itself. It agreed with every recorded gate decision on one
511
+ machine's store (545 of 545), so a difference is the rule's.
512
+
375
513
  ## Plan forecast
376
514
 
377
515
  `forge dataset forecast <plan>` reads the plan's `tasks.tsv` (the declared tier from
@@ -549,11 +549,24 @@ On the judged half of the runs (the newer half, see [Promotion](#promotion)), `-
549
549
  - precision, recall and the number flagged at the site's threshold, against its floor;
550
550
  - `PASSES: passes`, or `does not pass:` with the first rule that failed.
551
551
 
552
+ An inverted site's threshold is shown as configured, with the score it cuts at beside it:
553
+ `prompt_warn 0.55 (inverted: a score at or above 0.45)`.
554
+
552
555
  A replay is not charged to the run or daily budget, and its requests are not written to
553
556
  `jev.jsonl` or the dataset. Each `--send` is a deliberate call to the provider.
554
557
 
555
- Exit codes: 2 for an unknown site, a site with no label, an unknown provider or a bad flag; 1
556
- when the provider has no key and is not local.
558
+ `--label V` judges the answers already stored on another label of the site, to check a past
559
+ result against the current one. It sends nothing and records nothing, so `gate on` only ever
560
+ reads a site's own label; `--label` with `--send` is refused. Requests that only the other label
561
+ labels and that were never answered are left out, and the output says how many were judged out of
562
+ how many. One variant exists:
563
+
564
+ - `jev-drift --label first-attempt`: the file is in attempt 1's changed files, passed or not.
565
+ It is the label of the 2026-10-16 replay. The site's own label is the final passing attempt's,
566
+ which has fewer positives.
567
+
568
+ Exit codes: 2 for an unknown site, a site with no label, an unknown provider, an unknown label
569
+ variant or a bad flag; 1 when the provider has no key and is not local.
557
570
 
558
571
  ### Promotion
559
572
 
@@ -20,6 +20,9 @@ run leaves branches behind.
20
20
  - [Planning](#planning)
21
21
  - [Plan shape](#plan-shape)
22
22
  - [QA verdicts](#qa-verdicts)
23
+ - [Retro notes (opt-in)](#retro-notes-opt-in)
24
+ - [Brief mode (opt-in)](#brief-mode-opt-in)
25
+ - [Task summaries (opt-in)](#task-summaries-opt-in)
23
26
  - [Severity, thresholds and known issues](#severity-thresholds-and-known-issues)
24
27
  - [Retrying, and resuming an interrupted run](#retrying-and-resuming-an-interrupted-run)
25
28
  - [Infrastructure failures](#infrastructure-failures)
@@ -65,6 +68,22 @@ by diff length instead of by judgment required is the main way difficulty routin
65
68
  paying off — it sends the cheap model at the subtle problem and the expensive one at the
66
69
  boilerplate, which is worse than not routing at all.
67
70
 
71
+ **`risk`** is a separate rating, recorded in shadow (#122): what a mistake that gets through
72
+ would cost — what breaks, for whom, and how hard it is to undo. It changes no model, reviewer
73
+ or verdict yet; `forge dataset risk` measures whether it predicts problems difficulty misses.
74
+
75
+ | Risk | Means |
76
+ |------|-------|
77
+ | `low` | local, and easy to see and revert: docs, a test, an internal helper. |
78
+ | `medium` | wrong behaviour users would notice, undone by a revert. |
79
+ | `high` | hard to undo or reaching everyone: release and CI files, migrations and persisted data, auth and permissions, public APIs. |
80
+
81
+ A one-line change to a release script is low difficulty and high risk. Write the rating as
82
+ `low`, `medium` or `high` on the first line of `tasks/<id>/risk` before `plan` (the planner
83
+ writes it from its reply). A plan without ratings behaves exactly as before, and `tasks.tsv`
84
+ keeps its columns. A collapsed chain gets the highest of its parts' ratings, or none when a
85
+ part was not rated.
86
+
68
87
  ## tasks.tsv
69
88
 
70
89
  Tab-separated, one row per task, written by whoever decomposes the goal:
@@ -131,8 +150,9 @@ outright. Forge does not invent a model when the user has not said which one sho
131
150
  their quota.
132
151
 
133
152
  QA has no tier rules by default and falls back to `opus` at `high`, matching single-task forge.
134
- When the user names no reviewers, offer reviewers sized to the task's risk (never add them
135
- unprompted): `--qa-low sonnet:medium --qa-medium sonnet:high --qa-high opus:high`. In the
153
+ When the user names no reviewers, offer reviewers sized to the task's difficulty, which is what
154
+ the `--qa-<tier>` rules key on (a task's [risk](#the-two-axes-decompose-level-and-difficulty) is
155
+ recorded but routes nothing yet; never add them unprompted): `--qa-low sonnet:medium --qa-medium sonnet:high --qa-high opus:high`. In the
136
156
  SWE-bench Pro benchmark (#89) Sonnet reviewers gave no false PASS at about a seventh of an
137
157
  `opus:xhigh` review's cost.
138
158
 
@@ -593,8 +613,16 @@ turns shadow reviews off again.
593
613
 
594
614
  - **Which reviewer:** the first listed spec whose model family (Claude, GPT, Gemini, ...)
595
615
  differs from the task's reviewer, so the two do not share one blind spot. If none
596
- differs, the first listed spec. Forge only ever uses the specs you list. A spec that
597
- cannot run here (`doctor` fails) is dropped with a note and never fails the run.
616
+ differs, the first listed spec that does not resolve to the reviewer's own harness, model
617
+ and effort: the same model at another effort (`same_model`) or another model of the
618
+ family. Only when every listed spec is identical to the reviewer does it run as a
619
+ `control`, two reviews with one setting, which measures noise and never counts as an
620
+ effort comparison (a reviewer pool can hand a task the shadow's own spec). Forge only
621
+ ever uses the specs you list. A spec that cannot run here (`doctor` fails) is dropped
622
+ with a note and never fails the run.
623
+ - **Measuring an effort:** list only specs of the reviewers' own model at another effort,
624
+ for example `--shadow-qa sol:medium` beside `sol:high` reviewers, with a rate high enough
625
+ for at least 30 pairs per comparison. Each pair is one more review, so agree on its cost first.
598
626
  - **Which attempts:** a deterministic sample per (run, task, attempt), so a QA-only
599
627
  resume decides the same way.
600
628
  - **Same evidence, separate everything else.** The shadow reviews a byte-identical copy of
@@ -608,9 +636,135 @@ turns shadow reviews off again.
608
636
  a manual `retry`.
609
637
  - **Scope:** parallel mode only, and never under Fractal.
610
638
 
611
- `./forge dataset status` reports the agreement rate, overall and per model pair. The export
639
+ `./forge dataset status` reports the agreement rate, overall and per model pair, and
640
+ `./forge dataset pairs` splits it by what differs between the two reviewers: effort within one
641
+ model, another model of the family, another family, and controls. For each pair of settings it
642
+ gives verdict agreement with a 95% interval, the blocking findings only one side found, and the
643
+ token and time ratio (see [the dataset reference](dataset.md#paired-reviews)). The export
612
644
  adds `shadow` and `consensus` to the matching review cases' metadata.
613
645
 
646
+ ## Retro notes (opt-in)
647
+
648
+ `plan --retro` makes each agent record what got in its way: a sandbox that blocked a command, a
649
+ tool that is not installed, an instruction it could not follow, a forge fault. A note says what
650
+ happened and who can fix it. Without a flag a plan keeps its earlier choice, and a first plan
651
+ takes the user setting (`forge config set retro on`). `plan --no-retro` turns it off.
652
+
653
+ - **What an agent writes.** Most tasks have nothing to report, and a hard task is not a note.
654
+ A note is one `FORGE_RETRO: {json}` line in the final message. The planner, QA and the
655
+ whole-run review write it the same way. A dwarf blocked before it finishes also appends the
656
+ same JSON to `.forge/retro-inbox.jsonl` in its worktree, which forge reads when the dispatch
657
+ ends. The fields are `type` (`environment`, `sandbox`, `tooling`, `prompt`, `forge-bug` or
658
+ `other`), `fixable_by` (`user`, `forge` or `unsure`), `summary`, `evidence` (the command, its
659
+ exit code and the error, up to 2 KB), `blocking` and `tried`.
660
+ - **Checked against the log.** forge looks for the note's command and the first line of its
661
+ error in that dispatch's log. When both are there the note is `verified`; otherwise `claimed`.
662
+ - **Orchestrator notes.** `forge retro note PLAN --type T --fixable-by F --summary S` records
663
+ one note of the run's own, with `--command`, `--exit`, `--error`, `--blocking` and `--tried`
664
+ as needed. It is always `claimed`, and it does not check the retro setting.
665
+ - **Where it goes.** `<plan>/retro/notes.jsonl`, `tasks/<id>/retro.json` for a task, and one
666
+ `retro_note` dataset event per note. `forge retro report PLAN` writes `<plan>/retro.md`.
667
+ Notes with the same type and the same normalised command form one pattern; a note with no
668
+ command is matched on its normalised summary instead. Each pattern
669
+ goes to the group its majority `fixable_by` names: **You can fix this on this machine**
670
+ (`user`), **forge should fix this** (`forge`), or **Not sure who should fix this** (`unsure`,
671
+ also on a tie). A run prints one line with the pattern count and the path when there are any
672
+ patterns. The first plan with retro on says what is recorded, once per user.
673
+ - **Filing.** `forge retro issues PLAN` drafts one redacted issue per `forge` pattern, for
674
+ forge's own repository, and posts nothing. The dry run prints the texts and their hash.
675
+ `forge retro issues PLAN --apply --approve HASH` posts only when the hash matches those texts
676
+ and the `--choice rN=new|comment:N|skip` choices. It needs an authenticated `gh`, and it
677
+ refuses a never-send repository. Both refusals exit `3`.
678
+ - **Never memory.** Notes never go into `.forge/memory.md` or the ledger, and no prompt reads
679
+ them back. A retro plan does add a short instruction block to each prompt, at its end.
680
+ - **Off.** With retro off (`--no-retro`, no setting, or `FORGE_RETRO=off`) no instruction is
681
+ added to any prompt, the inbox is not read, and forge stores no note from a dispatch. Its
682
+ prompts stay as they were without the feature. `forge retro note` still records a note when
683
+ it is called, because it does not check the setting.
684
+
685
+ Files it adds: `retro_mode` (plan file), `retro/notes.jsonl`, `retro/.lock`, `retro.md`,
686
+ `tasks/<id>/retro.json`, and `.forge/retro-inbox.jsonl` in a worktree (removed once its notes
687
+ are stored). It costs no model call of its own.
688
+
689
+ ## Brief mode (opt-in)
690
+
691
+ With `plan --brief advisory|gated|strict --brief-model SPEC`, a read-only side dispatch writes
692
+ the questions each task needs answered before it starts. Each question has a default. A task
693
+ with no answer follows the default. The user answers with `forge brief answer`,
694
+ and each answer goes into that task's prompt. forge never answers for the user.
695
+
696
+ - **Cost.** One dispatch per task that has no `brief.json`, at effort `low`, four at a time.
697
+ A reply that is not valid JSON, or has the wrong shape, is retried once; a second failure
698
+ stores no questions and the reason in `brief.json`'s `error`. Answers and stale flags call no
699
+ model.
700
+ - **When.** `run` writes the missing briefs when it starts. `strict` waits for them; `advisory`
701
+ and `gated` write them alongside the scheduler. `forge brief write PLAN [--task ID] [--jobs N]
702
+ [--force]` does the same by hand, and `--force` redoes a task that already has a brief.
703
+ - **Levels.**
704
+ - `advisory`: the run does not wait. Open questions reach the prompt under "Open questions:
705
+ follow the stated default", with each default.
706
+ - `gated`: a task with an unanswered must-answer question is held. The run prints
707
+ `forge: <task> waits for your answer to <qid>` with the `forge brief answer` line. A task
708
+ whose brief is still being written waits too.
709
+ - `strict`: `run` exits `3` before any task starts while a question of an unstarted task is
710
+ open. It prints each question, its default and the answer command. Answer them and run again.
711
+ - **Answers.** `forge brief answer PLAN TASK QID TEXT` (or `--file F`; `-` reads stdin). Before
712
+ the task starts, the answer goes to `brief.answers.json` and to the prompt under "Decisions the
713
+ user made", which overrides what the requirements say. After it starts, the answer goes to
714
+ `brief.late.json` and changes nothing in the run. The command then prints the `tasks.tsv` row,
715
+ the `prompt.md` a follow-up needs, and the `forge control add` line that queues it.
716
+ - **Scope.** `--brief-scope task` (the default) is the only scope that acts. A `wave` or `plan`
717
+ question is parked in `brief.parked.json` and acts on nothing.
718
+ - **Stale.** After a task merges, a merge that changed files outside that task's declared files
719
+ flags the open questions of its dependents that have not started (`possibly_stale`). `forge
720
+ brief stale PLAN TASK` does this by hand.
721
+ - **Model.** `--brief-model SPEC` is required with brief on, and it must resolve; otherwise
722
+ `plan` exits `2`. forge never picks the model.
723
+ - **Privacy.** A never-send repository gets no brief dispatch (`never-send`), so its tasks have
724
+ no questions and nothing holds them.
725
+ - **Off.** With `--brief off`, no setting, or `FORGE_BRIEF=off`, there is no writer, no hold and
726
+ no prompt addition. `forge-prompt.py` adds nothing without a `brief` file. `forge brief write`
727
+ and `forge brief show` exit `3` for such a plan.
728
+
729
+ Files it adds: the plan files `brief`, `brief_scope` and `brief_model`; `brief.out` (the
730
+ writer's output) and `brief.pid` (while the writer runs); and per task `tasks/<id>/brief.json`,
731
+ `brief.parked.json`, `brief.answers.json` and `brief.late.json`. Its events are `brief_question`,
732
+ `brief_answer` and `side_dispatch` (kind `brief`).
733
+
734
+ ## Task summaries (opt-in)
735
+
736
+ `plan --summaries on --summaries-model SPEC` writes a short summary of each task to
737
+ `tasks/<id>/summary.json`. The model sees only the task's facts: its status, its attempt trail
738
+ (attempt, dwarf spec, verdict, findings count, worst severity, retry reason), the latest review's
739
+ finding titles and severities, its known issues, and its dependencies and dependents. The facts
740
+ are capped at 8 KB. The model never sees the repository, the diff or the task prompt.
741
+
742
+ - **Cost.** One read-only dispatch per task, at effort `low`, when its facts change. Unchanged
743
+ facts are not dispatched again, because `inputs_hash` matches the stored summary. Each kind
744
+ of side dispatch is capped per run at `max(10, 3 × tasks)`.
745
+ - **When.** During `run`, the scheduler starts a detached `forge summarize PLAN --task ID` for
746
+ each task whose status, dwarf reply, attempt trail, verdict or retry count changed since its
747
+ last look. The first look at a task only remembers it. The scheduler never waits for a
748
+ summary, and a failed one changes nothing in the run. On a finished run, `forge control set
749
+ PLAN summaries on` starts `forge summarize` itself, with its output in `summaries.out`.
750
+ - **Output.** `summary.json` holds `text`, `sentence`, `model`, `generated_at`, `inputs_hash`
751
+ and `sources` (the attempts and findings the facts came from). The prompt asks for 3 to 5
752
+ short lines. A reply that is not a JSON object with `text` and `sentence`, or whose text runs
753
+ past 8 lines, is rejected: the previous `summary.json` stays and `summary.error` says why.
754
+ - **Commands.** `forge summarize PLAN [--task ID] [--force] [--json]`. `--force` dispatches even
755
+ when the facts did not change. `--json` prints one object per task: `task`, `status`, `reason`.
756
+ `forge control set PLAN summaries on|off` sets the plan. `--task ID on|off|inherit` sets one
757
+ task; its own `on` or `off` overrides the plan, and `inherit` drops that override.
758
+ - **Model.** `--summaries-model SPEC` is required with summaries on, and it must resolve;
759
+ otherwise `plan` exits `2`. Set a user default with `forge config set summaries.model SPEC`.
760
+ - **Off.** With `--summaries off`, no setting, or `FORGE_SUMMARIES=off`, there is no dispatch and
761
+ no `summary.json`.
762
+
763
+ Files it adds: the plan files `summaries` and `summaries_model`; `summaries.out`; and per task
764
+ `tasks/<id>/summary.json`, `summary.error` (after a failed reply) and `tasks/<id>/summaries`
765
+ (`on` or `off`, the task's override). Its events are `side_dispatch` (kind `summary`) and the
766
+ `side_summary` role in the dataset.
767
+
614
768
  ## Severity, thresholds and known issues
615
769
 
616
770
  QA labels each finding `- [P0..P3][CONFIRMED|PLAUSIBLE] file:line — what breaks (input)`:
@@ -640,8 +794,9 @@ every task has merged, and before the combined verification, the scheduler runs
640
794
  once. It collects the open findings at `Pn` or worse (the ones the threshold tolerated, plus
641
795
  PLAUSIBLE ones with `--sweep-plausible`), with `forge issues`' own collector, and leaves out:
642
796
 
643
- - findings a person accepted with `accept`, and findings of fix tasks (one round: what a sweep review
644
- finds goes to `forge issues`, never into another sweep);
797
+ - findings a person accepted with `accept` or kept with `adopt --approved` (listed as `accepted`), and
798
+ findings of fix tasks (one round: what a sweep review finds goes to `forge issues`, never into another
799
+ sweep);
645
800
  - dismissed ones (`forge issues --dismiss`), ones with no file, and ones whose file is gone;
646
801
  - ones whose line, as the reviewer saw it, a later merge changed (`changed`, naming those merges).
647
802
 
@@ -649,7 +804,9 @@ Every finding left out is listed in the plan with its reason. The rest become fi
649
804
  worst first, at most 8 findings each and `--sweep-max N` (default 5) tasks. Each fix task is a row
650
805
  `sweep-<n>` in `tasks.tsv` with `prompt.md` and `sweep.json`. Its implementer is the plan's low tier
651
806
  (the first spec of `--dwarf-low`, else of `--dwarf`; checked at `run` start), else the implementer of
652
- the task the worst finding came from. Its reviewer is that task's reviewer. The plan (groups, findings,
807
+ the task the worst finding came from. Its reviewer is that task's reviewer. What an adopted range's review
808
+ tolerated is swept too: its fix task's reviewer is the adoption's, and below the low tier its implementer
809
+ is the run's first task's. The plan (groups, findings,
653
810
  dispatches) is printed and kept in `<plan>/sweep/plan.md` and `plan.json`. A plan is swept at most once.
654
811
 
655
812
  Fix tasks share the run's scheduling, controls and `--retry-failed` budget. Their review is narrow
@@ -716,6 +873,11 @@ as `retry` does (same findings carry-forward, same pinned base, same cumulative
716
873
  tasks keep running; dependents wait for the task to merge. It applies per invocation (not
717
874
  remembered), never to `TIMEOUT`/`ERROR`/`CONFLICT` or an `INVALIDATED` merge, and never after a retry that
718
875
  changed nothing (`tasks/<id>/noretry`). Every entry is logged in `tasks/<id>/attempts.tsv`.
876
+ An attempt that carries retry findings also gets one row in `tasks/<id>/retry_sources.tsv`:
877
+ the attempt number, the source of those findings (`review`, `prereview`, `bounce`, `message` or
878
+ `answer`) and the epoch time. A row for the same attempt replaces the earlier one, because an
879
+ infrastructure stop refunds the attempt and its restart runs the same number again. forge-ui's
880
+ attempt trail reads this file.
719
881
 
720
882
  **Escalation after repeated failures.** In forge's history the first three attempts at a task
721
883
  pass review at about the same rate (43%, 42%, 47%), and the fourth and later at 29%, whether
@@ -836,7 +998,9 @@ The choices:
836
998
  ([below](#accepting-splitting-combining-and-the-whole-run-review)).
837
999
 
838
1000
  A live scheduler takes the same decision as `forge control retry <plan> <id> --decide …` (or
839
- `--dwarf`), with `--reason` and `--approved`; that only queues the request. The answer is appended
1001
+ `--dwarf`), and an accept as `forge control accept <plan> <id>`, each with `--reason` and
1002
+ `--approved`; that only queues the request. An accepted task merges and its dependents start in
1003
+ the same run (#138). The answer is appended
840
1004
  to `tasks/<id>/decisions.tsv` (epoch, attempt, choice, reason). The run summary lists these tasks
841
1005
  under `waiting for your decision:`. A run that ends with such a task unmerged exits 5.
842
1006
 
@@ -1048,13 +1212,16 @@ Four subcommands act on plans after tasks have run. Full usage and refusal condi
1048
1212
  reason) and to `control.log`, writes an `adopt` dataset event, and verifies as a retry does. A FAIL or
1049
1213
  UNKNOWN puts the branch back and exits 5, unless `--approved` keeps it, which writes the findings to the
1050
1214
  adoption's `known_issues.md` as `accept` does; `forge issues` and the run's report read that file (as
1051
- accepted findings, the reason with them), and the sweep does not. A review that concluded nothing always puts it back: a crash or timeout exits 5, an
1215
+ accepted findings, the reason with them), and the sweep lists them as `accepted` without fixing them;
1216
+ what the review tolerated under the threshold the sweep fixes like a task's. The reviewer is told the
1217
+ run's verification command (or its lanes' commands), which runs only after the review. A review that concluded nothing always puts it back: a crash or timeout exits 5, an
1052
1218
  infrastructure stop exits 8, a signal exits 130 or 143. If the worktree changed during the review it is
1053
1219
  left as it is, with the commands to go on. A range that lived only on the branch stays at
1054
1220
  `refs/forge/adopt-refused/<dir>`. A merge commit is refused, and a range that does not apply exits 6. A
1055
1221
  diff over 400 KB is read in the snapshot rather than inlined, as in a final review.
1056
1222
  There is no task row, because no model implemented it; the final review reads the whole range and is told
1057
- about it, `attribute` treats it as a step of its own, and forge-ui lists it above the final review.
1223
+ about it, `attribute` treats it as a step of its own, and forge-ui lists it above the final review, each
1224
+ row opening its review, its findings and the range's diff with the findings pinned.
1058
1225
  `adopt-<epoch>-<pid>/` keeps the review.
1059
1226
  - **`accept <plan> <task> --reason … --approved`** overrides a `FAIL`/`UNKNOWN` reviewer only
1060
1227
  when the reviewed commit is still the branch tip and the worktree still matches
@@ -1081,6 +1248,8 @@ removes what it created.
1081
1248
 
1082
1249
  ```
1083
1250
  <plan-dir>/tasks/<id>/approach.md intended approach, if planned
1251
+ <plan-dir>/tasks/<id>/risk low|medium|high, recorded only (#122), if rated
1252
+ <plan-dir>/tasks/<id>/retry_sources.tsv attempt, source, epoch: why each retried attempt ran (#133)
1084
1253
  <repo>/.forge/ project memory (survives the run)
1085
1254
  <repo>/../.forge-worktrees/<run-id>/<task-id> task worktree
1086
1255
  <repo>/../.forge-worktrees/<run-id>/_integration integration worktree
@@ -75,7 +75,7 @@ given this same prompt file as `--prompt-file`.
75
75
  **The reply** holds exactly one fenced block opened by ```` ```forge-plan ```` whose body is JSON:
76
76
 
77
77
  ```
78
- {"tasks": [{"id": "parse-config", "deps": [], "difficulty": "medium",
78
+ {"tasks": [{"id": "parse-config", "deps": [], "difficulty": "medium", "risk": "low",
79
79
  "files": ["src/config.py", "tests/test_config.py"],
80
80
  "title": "Parse the new config section", "approach": "…",
81
81
  "prompt": "… ## Acceptance criteria …"}]}
@@ -88,7 +88,8 @@ matches `^[a-z0-9][a-z0-9-]{0,39}$` and is unique; `deps` are known ids with no
88
88
  `difficulty` is `low`, `medium` or `high`; `files` is a non-empty list of repo-relative paths (no
89
89
  absolute path, no `..`, no tab, comma or newline); `title` is one non-empty line without a tab;
90
90
  `approach` is a string (it may be empty); `prompt` is non-empty and has a `## Acceptance
91
- criteria` heading.
91
+ criteria` heading. `risk` (#122) is the one optional key and never refuses a reply: `low`,
92
+ `medium` or `high` is written to `tasks/<id>/risk`, anything else (or no key) writes nothing.
92
93
 
93
94
  On success it writes `tasks.tsv` (dwarf and qa `-`), `tasks/<id>/prompt.md` (the task's prompt,
94
95
  then `## The whole request` and `$PLAN/request.md` verbatim, so no requirement is lost) and, for
@@ -86,7 +86,8 @@ execution instructions. Review snapshots use self-contained object packs and one
86
86
  the repo's dependency directories (`node_modules`, `.venv`, `vendor`, Mix's `deps` and the others
87
87
  listed under [worktree setup](decompose.md#worktree-setup)) linked in, at the root and in workspace
88
88
  packages, when it has them; the prompt says what is there, and the reviewer reports `FORGE_TESTS` as in
89
- [worktree setup](decompose.md#worktree-setup).
89
+ [worktree setup](decompose.md#worktree-setup). The snapshot is removed when the review ends
90
+ (`FORGE_KEEP_SNAPSHOTS=1` keeps it).
90
91
 
91
92
  Optional [Ripwire context](ripwire.md) is enabled by default. Use `--no-ripwire`
92
93
  or `FORGE_RIPWIRE=off` to disable preparation and installation offers.
package/references/ui.md CHANGED
@@ -31,6 +31,7 @@ run goes on, with the same exit code.
31
31
  request until the scheduler applies or refuses it. Each infrastructure pause gets a line: what
32
32
  is paused, why, its tasks and the time left. Each is one `forge control` call; the change is
33
33
  confirmed first and logged in `control.log`.
34
+ - **Brief questions and summaries:** forge-ui can answer a brief question and turn summaries on or off (for a run or one task), both through forge commands: `forge brief answer` and `forge control set summaries`.
34
35
  - **Open findings and issues:** the findings a run (or all of its repository's runs) left open,
35
36
  filed as GitHub issues or dismissed through `forge issues`.
36
37
  - **Delete a run:** a dry run, then `forge runs rm`: the dataset keeps the traces, an archive is
@@ -69,7 +70,9 @@ run goes on, with the same exit code.
69
70
  port in use, …) that several tasks' failed commands met gets one banner in the run header.
70
71
  - **Opening a node** shows its attempts, dwarves and reviews, and an inspector with the prompt
71
72
  that launched each one, the model, timings by phase, tokens, verdicts and the P0–P3 findings
72
- of every review (the final review's included).
73
+ of every review (the final review's included). A task's inspector opens on its header, its attempt trail
74
+ with each attempt's reason, its Summary and its Questions (brief questions); Run details has a Retro section
75
+ when retro mode wrote one.
73
76
  - **Solo run:** one task: its attempts, specs, prompts and the final messages.
74
77
  - It refreshes every two seconds while something runs (five otherwise) while the tab is
75
78
  visible, so a run can be watched as it goes. A run can also be replayed from its record.
@@ -150,7 +153,7 @@ bash <skill_dir>/scripts/forge-solo.sh "$FORGE_RUN" --repo "$REPO" --dwarf <spec
150
153
  | `FORGE_UI_BROWSER=off` | print the link, never open a browser |
151
154
  | `FORGE_UI_PORT` | preferred port, default `8765`; `--port` wins; a taken port falls back to a free one |
152
155
  | `FORGE_UI_IDLE_S` | idle seconds before the server exits, default `14400`; `0` never |
153
- | `FORGE_RUN_REGISTRY=off` | runs stop registering themselves (`--ui` and `forge ui open DIR` still register the run they open) |
156
+ | `FORGE_RUN_REGISTRY=off` | runs stop registering themselves (`--ui` and `forge ui open DIR` still register the run they open), and stop writing forge's location list (`<config home>/forge/locations.jsonl`) |
154
157
 
155
158
  ## One shared server
156
159
 
@@ -59,6 +59,20 @@ forge_review_snapshot() ( # source, baseline tree, final tree, destination
59
59
 
60
60
  )
61
61
 
62
+ # A review snapshot is a full export of the reviewed tree plus a git store, as large as the repository's
63
+ # tree, and nothing reads it once its review is over: the fingerprint check that ends the review is its
64
+ # last use (#139). review.base, review.deps, the prompt, the log and the verdict sit beside it and stay.
65
+ # FORGE_KEEP_SNAPSHOTS=1 keeps it, for debugging. Only a directory named like a snapshot is removed, never
66
+ # a link (rm -rf does not follow the dependency links forge_review_deps put inside it).
67
+ forge_drop_snapshot() { # review snapshot dir; always returns 0
68
+ local dir="${1:-}"
69
+ [ -n "$dir" ] && [ "${FORGE_KEEP_SNAPSHOTS:-0}" != 1 ] || return 0
70
+ case "${dir##*/}" in review|review-*) ;; *) return 0 ;; esac
71
+ [ -d "$dir" ] && [ ! -L "$dir" ] || return 0
72
+ rm -rf -- "$dir" 2>/dev/null
73
+ return 0
74
+ }
75
+
62
76
  # Where package managers install into a checkout: npm and bower, Python virtualenvs, Go, PHP and Ruby
63
77
  # vendor dirs, Bundler's config, CocoaPods, Mix (deps, _build), Dart, Elm and SwiftPM (#127). The same
64
78
  # names as forge-fail-first.py's DEP_DIRS. Only a directory the snapshot does not hold is linked, so a