@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
@@ -119,6 +119,18 @@ and [Claude headless guide](https://code.claude.com/docs/en/headless).
119
119
  `--approve-for-me` and `--dangerously-bypass-approvals-and-sandbox` are mutually exclusive,
120
120
  and `--approve-for-me` additionally conflicts with an explicit `-s/--sandbox`.
121
121
 
122
+ **A read-only role's temp dir.** Every read-only role (QA, including shadow, group, whole-run and
123
+ adopt reviews, the planner and side dispatches) gets a temp dir of its own, `<run dir>/.<role>-tmp.*`,
124
+ outside the repository, exported as `TMPDIR`, `TMP` and `TEMP` and removed when the dispatch
125
+ ends. Test runners such as Vitest stop with `EPERM` without one. On codex the read-only sandbox
126
+ allows no write at all, so a read-only role is passed as config overrides:
127
+ `-c 'sandbox_mode="read-only"' -c 'default_permissions="forge-read-only"'
128
+ -c 'permissions.forge-read-only.filesystem={"/"="read", "<temp dir>"="write"}'`. The profile reads
129
+ everything and writes only the temp dir, so the repository and its fingerprint stay as they were
130
+ (probed with `codex sandbox -P` and `codex debug prompt-input` on 0.164). A codex without permission
131
+ profiles keeps the plain read-only sandbox from the first override. Claude, openclaude and grok
132
+ reviewers write through Bash anyway, and the variable is what they need.
133
+
122
134
  **Native review** (`codex exec review`) has two constraints worth knowing:
123
135
 
124
136
  - Its scope flags (`--uncommitted`, `--base`, `--commit`) are **mutually exclusive with a
@@ -310,8 +322,11 @@ GitHub Copilot) as a second row.
310
322
  `cancelled`), still exiting 0.
311
323
  - **What forge records:** class `cancelled` in `<role>.infra`, with the refused command, and
312
324
  a note in the run output.
313
- - **It is not an infrastructure stop:** the dwarf's diff so far still goes to review, and a
314
- reviewer cut off before its verdict is UNKNOWN, which re-runs only the review.
325
+ - **It is not an infrastructure stop when there is work to judge:** the dwarf's diff so far
326
+ still goes to review, and a reviewer cut off before its verdict is UNKNOWN, which re-runs
327
+ only the review. A dwarf cancelled before it changed anything is an infrastructure stop
328
+ (status `INFRA`, no attempt spent), not a failed attempt with an empty diff.
329
+ - **Also seen:** a multi-line scratch script starting `tmp=$(mktemp -d)`.
315
330
  - **Untested:** whether `--permission-mode dontAsk` (deny without cancelling) together with
316
331
  explicit Edit/Write/Bash allows would avoid the cancel. Nothing changes until that is
317
332
  proven live.
@@ -367,7 +382,7 @@ Probed 2026-10-22 (claude 2.1.307, codex 0.162.0):
367
382
  | Harness | Argv | Notes |
368
383
  |---|---|---|
369
384
  | claude, openclaude | the fresh QA argv plus `--resume <id>` | Continues from a different working directory and keeps the same session id. Permission flags and the read-only restriction stay; the prompt is still on stdin. |
370
- | codex | `codex exec resume <id> --json -m MODEL --skip-git-repo-check -o LAST [-c model_reasoning_effort=…] -c 'sandbox_mode="read-only"' -` | Continues from a different working directory. `exec resume` has **no `-C/--cd` and no `-s/--sandbox`**, so the dispatch's own `cd "$REPO"` sets the directory and the sandbox is passed as a config override (the quotes are TOML). The first turn's sandbox was inherited when probed (read-only); the override makes it explicit. Under `--yolo` the bypass flag replaces the override. |
385
+ | codex | `codex exec resume <id> --json -m MODEL --skip-git-repo-check -o LAST [-c model_reasoning_effort=…] -c 'sandbox_mode="read-only"' [the temp-dir profile overrides] -` | Continues from a different working directory. `exec resume` has **no `-C/--cd` and no `-s/--sandbox`**, so the dispatch's own `cd "$REPO"` sets the directory and the sandbox is passed as a config override (the quotes are TOML). The first turn's sandbox was inherited when probed (read-only); the override makes it explicit. Under `--yolo` the bypass flag replaces the override. |
371
386
 
372
387
  The prompt is preceded by a short fixed preamble (this continues your earlier review, the work has changed,
373
388
  the working directory is now `<repo>`, re-read files, this round's instructions win). `<role>.prompt` includes
@@ -72,31 +72,60 @@ low-difficulty task assembling the required file; each task prompt ends with `##
72
72
  criteria` and never asks for the whole suite. A planner you dispatch by hand (above) can be
73
73
  given this same prompt file as `--prompt-file`.
74
74
 
75
- **The reply** holds exactly one fenced block opened by ```` ```forge-plan ```` whose body is JSON:
75
+ **The reply** holds exactly one fenced block opened by ```` ```forge-plan ```` whose body is JSON
76
+ with the key `tasks` and, optionally, `groups`:
76
77
 
77
78
  ```
78
79
  {"tasks": [{"id": "parse-config", "deps": [], "difficulty": "medium", "risk": "low",
79
80
  "files": ["src/config.py", "tests/test_config.py"],
80
81
  "title": "Parse the new config section", "approach": "…",
81
- "prompt": "… ## Acceptance criteria …"}]}
82
+ "prompt": "… ## Acceptance criteria …"}],
83
+ "groups": [{"id": "config-limits", "title": "Config limits",
84
+ "goal": "The limits section is read into Config with the defaults the request names.",
85
+ "members": ["parse-config"]}]}
82
86
  ```
83
87
 
88
+ `groups` names steps the user will think of as one: tasks that together deliver one goal, usually
89
+ one group per wave of the plan's dependency order. Each group has a short title and a goal
90
+ sentence that says what is true once its tasks are done. A group may hold one task, and a task
91
+ may be left out of every group. Omit the key to return no groups.
92
+
84
93
  **`parse`** is strict and never guesses or repairs. It refuses a reply unless: there is exactly
85
- one `forge-plan` block whose body is an object with exactly the key `tasks`; `tasks` is 1 to 20
86
- objects with exactly the keys `id, deps, difficulty, files, title, approach, prompt`; each `id`
87
- matches `^[a-z0-9][a-z0-9-]{0,39}$` and is unique; `deps` are known ids with no cycle;
88
- `difficulty` is `low`, `medium` or `high`; `files` is a non-empty list of repo-relative paths (no
89
- absolute path, no `..`, no tab, comma or newline); `title` is one non-empty line without a tab;
90
- `approach` is a string (it may be empty); `prompt` is non-empty and has a `## Acceptance
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.
94
+ one `forge-plan` block whose body is an object with the key `tasks` and no keys other than the
95
+ optional `groups`; `tasks` is 1 to 20 objects with exactly the keys `id, deps, difficulty, files,
96
+ title, approach, prompt`; each `id` matches `^[a-z0-9][a-z0-9-]{0,39}$` and is unique; `deps` are
97
+ known ids with no cycle; `difficulty` is `low`, `medium` or `high`; `files` is a non-empty list of
98
+ repo-relative paths (no absolute path, no `..`, no tab, comma or newline); `title` is one
99
+ non-empty line without a tab; `approach` is a string (it may be empty); `prompt` is non-empty and
100
+ has a `## Acceptance criteria` heading. `risk` (#122) is the one optional task key and never
101
+ refuses a reply: `low`, `medium` or `high` is written to `tasks/<id>/risk`, anything else (or no
102
+ key) writes nothing.
103
+
104
+ `groups`, when present, is a list of objects with exactly the keys `id`, `title`, `goal` and
105
+ `members`. `id` matches the same slug as a task id, is unique among the groups, and is not a task
106
+ id. `title` and `goal` are one non-empty line each, at most 200 characters, with no tab or other
107
+ control character. `members` is a non-empty list of task ids from this reply, kept in reply order;
108
+ a member that is not a task of the reply, a task in two groups (or listed twice in one), a
109
+ duplicate id, an id equal to a task id, a missing field, or a multi-line title or goal refuses
110
+ the reply. The planner never sets
111
+ `review`: every row is written `review` `task` and `qa` `-`. Group review is the user's opt-in.
93
112
 
94
113
  On success it writes `tasks.tsv` (dwarf and qa `-`), `tasks/<id>/prompt.md` (the task's prompt,
95
114
  then `## The whole request` and `$PLAN/request.md` verbatim, so no requirement is lost) and, for
96
- a non-empty approach, `tasks/<id>/approach.md`. `$PLAN/request.md` must hold the user's request
97
- (exit 2 when missing). On a refusal it writes only `$PLAN/planner.refused` (the first reason and
98
- the reply's path), prints both and exits 4; fix the reply (or re-dispatch the planner with the
99
- reason appended) and run `parse` again.
115
+ a non-empty approach, `tasks/<id>/approach.md`. When the reply includes `groups`, it also writes
116
+ `groups.tsv` (`id`, `review`, `qa`, `members`, `title`, `goal`; a header alone when the list is
117
+ empty) in that same pass. A reply with no `groups` key writes no `groups.tsv`, and the other
118
+ files are unchanged. `$PLAN/request.md` must hold the user's request (exit 2 when missing). On a
119
+ refusal it writes only `$PLAN/planner.refused` (the first reason and the reply's path), prints
120
+ both and exits 4; nothing else is written, including `groups.tsv`. Fix the reply (or re-dispatch
121
+ the planner with the reason appended) and run `parse` again.
122
+
123
+ Those rows are how a wave gets a purpose. Brief mode's wave questions are about a group: the
124
+ title is the step and the goal is what the question is deciding. The approval table prints a
125
+ `groups:` block under the tasks (id, title, goal, members). `plan --group-review` opts the groups
126
+ into one review each (`review` becomes `group`, one QA pass for the members). Without that flag
127
+ every group stays `review` `task` and `qa` `-`, and each member is reviewed on its own. Editing
128
+ `groups.tsv` is the other way to opt in.
100
129
 
101
130
  **`gate`** decides before any planner is paid for: `one-task` when the request has at most 1500
102
131
  characters and at most 6 requirements (counted by `split_requirements` of
@@ -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
@@ -30,11 +30,35 @@ run goes on, with the same exit code.
30
30
  *Retry now* for a stopped or failed task (optionally on a chosen model), which shows its queued
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
- confirmed first and logged in `control.log`.
33
+ confirmed first and logged in `control.log`. A `NEEDS_INPUT` task has an answer field instead of
34
+ *Retry now*: *Send answer* runs `forge control retry --answer` (queued while a scheduler is live,
35
+ otherwise prepared for the next `run`), with no confirm. The copyable `retry --answer` command
36
+ stays either way.
37
+ - **Brief questions and summaries:** forge-ui can answer a brief question, propose a change from an
38
+ answered parked `wave` or `plan` question, and approve or reject that proposal. It can also turn
39
+ summaries on or off, for a run or one task. Each one is a forge command: `forge brief answer`,
40
+ `forge brief propose`, `forge brief apply --approve HASH`, `forge brief reject` and
41
+ `forge control set summaries`. On a plan, when a question belongs to a group, or one is
42
+ plan-scoped, the list is split: each group's title and goal, then a Plan heading, then No group
43
+ for a question with no group. A list with neither sits flat. Proposals sit under that list.
44
+ One in state `proposed` has Approve and Reject. A task an approved proposal marked shows an
45
+ affected badge: `affected by <pid>`, or `flagged: already started` when the task had already
46
+ started.
34
47
  - **Open findings and issues:** the findings a run (or all of its repository's runs) left open,
35
48
  filed as GitHub issues or dismissed through `forge issues`.
36
49
  - **Delete a run:** a dry run, then `forge runs rm`: the dataset keeps the traces, an archive is
37
50
  written unless declined, and clean worktrees and unchecked-out branches can go with it.
51
+ - **Worktrees:** every worktree forge created, plus a safe command to copy (never `--force`).
52
+ When the server can write, *Remove* on a row and *Remove selected* (checkboxes and select-all
53
+ on the filtered view) run `forge worktrees rm` (`--actor ui`) after one dry run and a confirm.
54
+ *Delete merged branches too* is `--branches` (`git branch -d` on a finished merged branch).
55
+ A row that cannot go shows why. The per-run `forge runs rm` line stays a command to copy.
56
+ - **Disk:** the `forge du --all` report, and the `forge runs compact --logs` command to copy.
57
+ *Compact* (one run) and *Compact all* dry-run first, say how much space would be freed, then
58
+ confirm. That command records `run_compacted` and takes no actor.
59
+ - **Memories** (Projects): each learning's state, as `forge memory learnings` reports it.
60
+ *Forget selected* dry-runs `forge memory forget` on the checkout shown (`--actor ui`), then
61
+ confirms with the learnings and the `memory.md` lines that go.
38
62
  - **Settings:** `forge config show` in one view: the registry, decision-model gates (each says what it does, when, what it sends and what `on` changes, and **How to set this up** opens a setup guide), profiles,
39
63
  the per-repo files, the dataset and `FORGE_*` variables, with edits where the server can write.
40
64
  - **Export a run:** one HTML file to share that opens without forge-ui; prompts, diffs, reports
@@ -61,6 +85,18 @@ run goes on, with the same exit code.
61
85
  output, or why a task waits (dependencies, shared files, no free slot, a drain or stop, an
62
86
  infrastructure pause with its countdown, the retry policy's stop and its split). The run
63
87
  inspector says what the scheduler is doing.
88
+ - **Groups:** when the run has `groups.tsv`, the run page shows a Groups block. Each row is the
89
+ title, the goal or "(no goal)", "one review" or "per-task review", the reviewer, and the
90
+ member chips. A `review=group` row also shows its status, round and implicated members, and
91
+ its title opens `#/runs/<key>/group/<gid>`. A `review=task` title is not a link. The task
92
+ table gains a Group column, and a task's inspector shows a `group <id>` chip. A task at
93
+ `IMPLEMENTED` is labelled "awaiting group review"; the lamp class stays `IMPLEMENTED`. The
94
+ group page has the header, a Decision section only while the status is `NEEDS_DECISION` (the
95
+ first line of `decision.md`, and a copyable `forge group retry <plan> <gid> --tasks <members>`;
96
+ the page does not run it), the findings from `attribution.json` with ambiguous rows marked,
97
+ the rounds with each member's commit and attempt, known issues, `qa.last`, and a link to the
98
+ review transcript. The group's QA dispatch lives in `groups/<gid>/attempts`. See
99
+ [Groups and group review](decompose.md#groups-and-group-review-opt-in).
64
100
  - **Checks:** each attempt's tests, type checks, lints and builds, read from its dwarf's and
65
101
  reviewer's logs, with exits, times and counts, a failed one's last lines, and which of the
66
102
  commands its `## Acceptance criteria` name never ran. codex and grok logs carry no times, so
@@ -69,7 +105,9 @@ run goes on, with the same exit code.
69
105
  port in use, …) that several tasks' failed commands met gets one banner in the run header.
70
106
  - **Opening a node** shows its attempts, dwarves and reviews, and an inspector with the prompt
71
107
  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).
108
+ of every review (the final review's included). A task's inspector opens on its header, its attempt trail
109
+ with each attempt's reason, its Summary and its Questions (brief questions, grouped the same way, with parked ones collapsed). An affected task also carries that badge in its chips. Run details has a Retro section
110
+ when retro mode wrote one.
73
111
  - **Solo run:** one task: its attempts, specs, prompts and the final messages.
74
112
  - It refreshes every two seconds while something runs (five otherwise) while the tab is
75
113
  visible, so a run can be watched as it goes. A run can also be replayed from its record.
@@ -82,7 +120,10 @@ limit's reset is known. A pause that needs the user says "needs you" with the fi
82
120
  sideways move is a "moved sideways" line under Models. A task at `NEEDS_DECISION` is waiting, not
83
121
  failed: its inspector gives the reasons, the attempts against the cap, the review ledger, and the
84
122
  text of `tasks/<id>/decision.md`. forge-ui shows those commands and does not run them, and it does
85
- not offer Retry now. A run whose unfinished tasks are all waiting is `WAITING`.
123
+ not offer Retry now. A `NEEDS_INPUT` task is the exception: the inspector can send the answer
124
+ (`forge control retry --answer`) and still copies the command. A group at `NEEDS_DECISION` still only shows
125
+ `forge group retry` and does not run it. A run whose
126
+ unfinished tasks are all waiting is `WAITING`.
86
127
 
87
128
  The 3D view loads three.js from cdn.jsdelivr.net when first used; offline, the page shows the
88
129
  same run in 2D. The full page description is in [ui/README.md](../ui/README.md).
@@ -143,6 +184,12 @@ bash <skill_dir>/scripts/forge-solo.sh "$FORGE_RUN" --repo "$REPO" --dwarf <spec
143
184
  - `forge ui status` exits 0 when the server runs and 1 when not; `--json` prints
144
185
  `{"running": ...}` with pid, port, url, version, build, started and log.
145
186
  - `forge ui stop` stops it; it exits 0 when nothing was running.
187
+ - When the server can write, the page's own actions are forge commands too, each with `--actor ui`
188
+ except compact: Worktrees *Remove* is `forge worktrees rm`, Memories *Forget selected* is
189
+ `forge memory forget`, a waiting task's *Send answer* is `forge control retry --answer-file -`,
190
+ and Disk *Compact* / *Compact all* is `forge runs compact --logs`. Removing, forgetting and
191
+ compacting dry-run and ask first; sending an answer does not. `--read-only` hides those buttons
192
+ and leaves every copy button. See [forge-ui](../docs/forge-ui.md#controls).
146
193
 
147
194
  | Variable | Meaning |
148
195
  |---|---|
@@ -150,7 +197,7 @@ bash <skill_dir>/scripts/forge-solo.sh "$FORGE_RUN" --repo "$REPO" --dwarf <spec
150
197
  | `FORGE_UI_BROWSER=off` | print the link, never open a browser |
151
198
  | `FORGE_UI_PORT` | preferred port, default `8765`; `--port` wins; a taken port falls back to a free one |
152
199
  | `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) |
200
+ | `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
201
 
155
202
  ## One shared server
156
203
 
@@ -183,8 +230,10 @@ review text from private repos. A running server keeps serving them, including r
183
230
  later rerun with `--no-ui`.
184
231
 
185
232
  **Changing needs one.** The server never writes a run file, a repo or a config itself: every
186
- change is a call of forge's own CLI (`forge control`, `forge issues`, `forge runs rm`,
187
- `forge config`), so validation, locks and the audit log are the CLI's. Each server start makes a
233
+ change is a call of forge's own CLI (`forge control`, `forge brief`, `forge issues`, `forge runs rm`,
234
+ `forge runs compact`, `forge worktrees rm`, `forge memory forget`, `forge config`), so validation,
235
+ locks and the audit log are the CLI's. Reading a run, the worktree list, the disk report and a
236
+ project's memories stays a read. Each server start makes a
188
237
  random token and puts it in the page it serves; every change must send it back, from a `Host` of
189
238
  `127.0.0.1` or `localhost` and with an `Origin` equal to that host when the browser sends one, or
190
239
  it is refused before any CLI runs. There are no CORS headers, so another site in your browser
@@ -192,6 +241,7 @@ can neither send nor read a change. Any process that can fetch the page can read
192
241
  it can read the runs, so on a shared machine start the server **read-only**: `--read-only`
193
242
  (`python3 -m forge_ui`) or `FORGE_UI_READONLY=1` (also for `forge ui open`). A read-only server
194
243
  issues no token and answers every change with 405; its `/api/health` says `"controls": false`.
244
+ No Remove, Forget selected, Compact or Send answer button is shown, and every copy button stays.
195
245
  `forge ui open` never reuses a server in the other mode: it replaces it, as it does one running
196
246
  old code, and `forge ui status` shows the mode.
197
247
 
package/registry.tsv CHANGED
@@ -45,9 +45,14 @@ sol opencode github-copilot/gpt-6.1-sol -
45
45
  astra codex gpt-6-astra <=ultra
46
46
  astra openclaude gpt-6-astra <=max
47
47
  astra opencode github-copilot/gpt-6-astra -
48
- terra codex gpt-5.6-terra <=ultra
49
- terra openclaude gpt-5.6-terra <=max
50
- terra opencode github-copilot/gpt-5.6-terra -
48
+ terra codex gpt-6.1-terra <=ultra
49
+ terra openclaude gpt-6.1-terra <=max
50
+ terra opencode github-copilot/gpt-6.1-terra -
51
+ # The terra before 6.1. Dispatches recorded as `terra` on this model are counted under
52
+ # terra-5.6, not under the newer terra (forge_dataset/names.py).
53
+ terra-5.6 codex gpt-5.6-terra <=ultra
54
+ terra-5.6 openclaude gpt-5.6-terra <=max
55
+ terra-5.6 opencode github-copilot/gpt-5.6-terra -
51
56
  luna codex gpt-6-luna <=max
52
57
  luna openclaude gpt-6-luna <=max
53
58
  luna opencode opencode-go/gpt-6-luna -
@@ -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
@@ -0,0 +1,217 @@
1
+ #!/usr/bin/env python3
2
+ """Brief mode: each task's open questions, asked before the task starts.
3
+
4
+ write PLAN [--task ID] [--jobs N] [--force]
5
+ One read-only side dispatch per task that has no brief.json (earliest projected
6
+ start first), stored as tasks/<id>/brief.json and brief.parked.json.
7
+ show PLAN [--task ID] [--json]
8
+ Every question with its state, flagged open questions first.
9
+ answer PLAN TASK QID TEXT [--actor A] [--file F]
10
+ Record an answer. Before the task starts it goes to brief.answers.json; after,
11
+ to brief.late.json. A late answer prints the tasks.tsv row and the prompt.md
12
+ a follow-up needs, then the `forge control add` line that queues that row.
13
+ --file F reads the text (- is stdin).
14
+ stale PLAN MERGED-TASK
15
+ Flag open questions of dependents that have not started, when the merge changed
16
+ a file outside the task's declared files. A declared directory covers the paths
17
+ under it.
18
+
19
+ propose PLAN TASK QID [--actor A]
20
+ Turn the answer to a parked wave or plan question into a proposal: one read-only dispatch
21
+ asks the brief model what it changes, and the diff is stored under PLAN/proposals/<pid>/.
22
+ A wave proposal is confined to the unstarted members of the question's group (prompt,
23
+ approach, files). A plan proposal (brief scope plan) may also add, remove and split tasks
24
+ and change deps: anything that is not a valid plan makes the whole proposal `refused`.
25
+ Nothing else changes.
26
+ proposals PLAN [--json]
27
+ Every proposal with its state, scope, group, summary, diff and the exact apply command.
28
+ apply PLAN PID --approve HASH [--actor A] [--no-regenerate]
29
+ Write the proposal's diff, re-validate and re-freeze the groups. Refuses, changing
30
+ nothing, when the hash differs, the proposal is not `proposed`, a target started or a
31
+ target file changed since. A `files` change is refused while a run is live. A plan
32
+ proposal with no live run edits tasks.tsv, groups.tsv and the task dirs (a removed task's
33
+ dir moves to tasks/.removed/) and says to run `plan` again: groups.frozen is not
34
+ refreshed, so `run` refuses until then. With a live run only added tasks apply, each
35
+ through `forge control add`; every other change refuses until the run ends.
36
+ After a successful apply, changed, added and dependent unstarted tasks are marked
37
+ `brief.affected` and their questions are regenerated (one dispatch each). Tasks that
38
+ have already started are marked and not touched. `--no-regenerate` writes the markers
39
+ and does not dispatch; `forge brief write --task` regenerates later.
40
+ reject PLAN PID [--reason TEXT] [--actor A]
41
+ Mark the proposal rejected; no plan file is touched.
42
+
43
+ Exit codes: 0 ok, 2 usage or an unknown task, question or proposal (the message lists the
44
+ valid ids), 3 PLAN is not a plan dir, brief is off (write, show, propose), or a proposal is
45
+ refused (propose, apply, reject).
46
+ """
47
+ from __future__ import annotations
48
+
49
+ import argparse
50
+ import json
51
+ import sys
52
+ from pathlib import Path
53
+
54
+ sys.path.insert(0, str(Path(__file__).resolve().parent))
55
+ import forge_brief # noqa: E402
56
+ import forge_brief.answers as answers # noqa: E402
57
+ import forge_brief.proposals as proposals # noqa: E402
58
+
59
+ REASONS = {
60
+ 'env': 'FORGE_BRIEF=off is set',
61
+ 'off': 'brief mode is off for this plan (plan --brief advisory|gated|strict)',
62
+ 'never-send': "the repository's privacy is never-send",
63
+ 'no-model': 'no brief model (plan --brief-model SPEC, or forge config set brief.model SPEC)',
64
+ 'cap': 'the brief-change dispatch cap for this run is reached',
65
+ }
66
+
67
+
68
+ def _parser() -> argparse.ArgumentParser:
69
+ parser = argparse.ArgumentParser(
70
+ prog='forge brief',
71
+ description="Each task's open questions, asked before the task starts.")
72
+ sub = parser.add_subparsers(dest='command', required=True)
73
+ write = sub.add_parser('write', help='write the questions of the tasks that have none yet')
74
+ write.add_argument('plan', help='the plan directory')
75
+ write.add_argument('--task', help='only this task')
76
+ write.add_argument('--jobs', type=int, default=forge_brief.DEFAULT_JOBS,
77
+ help='dispatches at once (default %(default)s)')
78
+ write.add_argument('--force', action='store_true', help='redo a task that already has a brief.json')
79
+ show = sub.add_parser('show', help='every question with its state, flagged first')
80
+ show.add_argument('plan', help='the plan directory')
81
+ show.add_argument('--task', help='only this task')
82
+ show.add_argument('--json', action='store_true', dest='as_json', help='machine-readable output')
83
+ answer = sub.add_parser('answer', help='record an answer to one question')
84
+ answer.add_argument('plan', help='the plan directory')
85
+ answer.add_argument('task', help='the task the question belongs to')
86
+ answer.add_argument('qid', help='the question id, such as q1')
87
+ answer.add_argument('text', nargs='?', default=None, help='the answer (or pass --file)')
88
+ answer.add_argument('--actor', default='cli', help='who is answering (default cli; forge-ui passes ui)')
89
+ answer.add_argument('--file', default=None, help='read the answer from this file, or - for stdin')
90
+ stale = sub.add_parser('stale', help="flag dependents' open questions after a merge outside its files")
91
+ stale.add_argument('plan', help='the plan directory')
92
+ stale.add_argument('task', help='the task that merged')
93
+ propose = sub.add_parser('propose', help='turn the answer to a parked wave question into a proposal')
94
+ propose.add_argument('plan', help='the plan directory')
95
+ propose.add_argument('task', help='the task the question belongs to')
96
+ propose.add_argument('qid', help='the parked question id, such as q2')
97
+ propose.add_argument('--actor', default='cli', help='who is proposing (default cli)')
98
+ listed = sub.add_parser('proposals', help='every proposal with its diff and apply command')
99
+ listed.add_argument('plan', help='the plan directory')
100
+ listed.add_argument('--json', action='store_true', dest='as_json', help='machine-readable output')
101
+ apply = sub.add_parser('apply', help='write an approved proposal')
102
+ apply.add_argument('plan', help='the plan directory')
103
+ apply.add_argument('pid', help='the proposal id, such as p1')
104
+ apply.add_argument('--approve', required=True, metavar='HASH', help="the proposal's hash, as `proposals` shows it")
105
+ apply.add_argument('--actor', default='cli', help='who is approving (default cli; forge-ui passes ui)')
106
+ apply.add_argument('--no-regenerate', action='store_true',
107
+ help='mark affected tasks but do not regenerate their questions')
108
+ reject = sub.add_parser('reject', help='reject a proposal; no plan file is touched')
109
+ reject.add_argument('plan', help='the plan directory')
110
+ reject.add_argument('pid', help='the proposal id, such as p1')
111
+ reject.add_argument('--reason', default=None, help='why')
112
+ reject.add_argument('--actor', default='cli', help='who is rejecting (default cli; forge-ui passes ui)')
113
+ return parser
114
+
115
+
116
+ def _say(result: dict) -> None:
117
+ if result['status'] == 'written':
118
+ detail = '%d question(s)' % result['questions']
119
+ if result['parked']:
120
+ detail += ', %d parked' % result['parked']
121
+ elif result['status'] == 'error':
122
+ detail = 'writer failed (%s); no questions' % result['reason']
123
+ else:
124
+ detail = 'skipped (%s)' % result['reason']
125
+ sys.stdout.write('%s: %s\n' % (result['task'], detail))
126
+ sys.stdout.flush()
127
+
128
+
129
+ def _ids(ids) -> str:
130
+ return ', '.join(ids) if ids else '(none)'
131
+
132
+
133
+ def main(argv=None) -> int:
134
+ args = _parser().parse_args(argv)
135
+ if args.command == 'write' and args.jobs < 1:
136
+ sys.stderr.write('forge brief write: --jobs must be at least 1\n')
137
+ return 2
138
+ try:
139
+ if args.command == 'write':
140
+ forge_brief.write(args.plan, task=args.task, jobs=args.jobs, force=args.force, progress=_say)
141
+ return 0
142
+ if args.command == 'answer':
143
+ result = answers.answer(args.plan, args.task, args.qid, text=args.text,
144
+ actor=args.actor, file=args.file)
145
+ sys.stdout.write(result['message'])
146
+ return 0
147
+ if args.command == 'stale':
148
+ for task, qid in answers.stale(args.plan, args.task):
149
+ sys.stdout.write('%s/%s\n' % (task, qid))
150
+ return 0
151
+ if args.command == 'propose':
152
+ record = proposals.propose(args.plan, args.task, args.qid, actor=args.actor)
153
+ item = next(i for i in proposals.listing(args.plan) if i['pid'] == record['pid'])
154
+ sys.stdout.write(proposals.render_one(item))
155
+ if record['state'] == 'refused':
156
+ sys.stderr.write('forge brief: proposal %s is refused: %s\n' % (record['pid'], record['reason']))
157
+ return 3
158
+ return 0
159
+ if args.command == 'proposals':
160
+ if not Path(args.plan).is_dir():
161
+ raise forge_brief.NotAPlan(args.plan)
162
+ items = proposals.listing(args.plan)
163
+ if args.as_json:
164
+ sys.stdout.write(json.dumps(items, ensure_ascii=False, indent=2, sort_keys=True) + '\n')
165
+ else:
166
+ sys.stdout.write(proposals.render(items))
167
+ return 0
168
+ if args.command == 'apply':
169
+ result = proposals.apply(args.plan, args.pid, args.approve, actor=args.actor,
170
+ regenerate=not args.no_regenerate)
171
+ sys.stdout.write('%s applied: %s\n' % (result['pid'], ', '.join(result['files']) or 'nothing'))
172
+ for note in result.get('notes') or []:
173
+ sys.stdout.write('%s\n' % note)
174
+ if result.get('message'):
175
+ sys.stdout.write('%s\n' % result['message'])
176
+ if result['warning']:
177
+ sys.stderr.write('forge brief: %s\n' % result['warning'])
178
+ return 0
179
+ if args.command == 'reject':
180
+ record = proposals.reject(args.plan, args.pid, actor=args.actor, reason=args.reason)
181
+ sys.stdout.write('%s rejected\n' % record['pid'])
182
+ return 0
183
+ found = forge_brief.collect(args.plan, task=args.task)
184
+ except forge_brief.NotAPlan as error:
185
+ sys.stderr.write('forge brief: not a plan dir: %s\n' % error)
186
+ return 3
187
+ except forge_brief.BriefOff as error:
188
+ sys.stderr.write('forge brief: %s\n' % REASONS.get(error.reason, error.reason))
189
+ return 3
190
+ except forge_brief.UnknownTask as error:
191
+ sys.stderr.write('forge brief: no such task: %s\n' % error)
192
+ return 2
193
+ except answers.NoSuchTask as error:
194
+ sys.stderr.write('forge brief: no such task: %s\nvalid tasks: %s\n' % (error.task, _ids(error.valid)))
195
+ return 2
196
+ except answers.NoSuchQuestion as error:
197
+ sys.stderr.write('forge brief: no such question: %s\nvalid questions for %s: %s\n'
198
+ % (error.qid, error.task, _ids(error.valid)))
199
+ return 2
200
+ except answers.Usage as error:
201
+ sys.stderr.write('forge brief: %s\n' % error)
202
+ return 2
203
+ except proposals.NoSuchProposal as error:
204
+ sys.stderr.write('forge brief: no such proposal: %s\nvalid proposals: %s\n' % (error.pid, _ids(error.valid)))
205
+ return 2
206
+ except proposals.Refused as error:
207
+ sys.stderr.write('forge brief: refused: %s\n' % error.reason)
208
+ return 3
209
+ if args.as_json:
210
+ sys.stdout.write(json.dumps(found, ensure_ascii=False, indent=2, sort_keys=True) + '\n')
211
+ else:
212
+ sys.stdout.write(forge_brief.render(found, args.plan))
213
+ return 0
214
+
215
+
216
+ if __name__ == '__main__':
217
+ sys.exit(main())
@@ -37,9 +37,13 @@ sys.path.insert(0, str(SKILL / 'ui'))
37
37
 
38
38
  # Plan options that travel with a rerun, so it is judged the way the original was. Not the ones
39
39
  # `plan` writes itself (routing, Jev's frozen selection) or that a fresh plan decides (exploration).
40
- OPTION_FILES = ('no_ripwire', 'no_memory', 'yolo_dwarf', 'yolo_qa', 'reviewer_session', 'implementer_session', 'fast',
40
+ OPTION_FILES = ('no_ripwire', 'no_memory', 'yolo_dwarf', 'yolo_qa', 'reviewer_session', 'reviewer_session_rate', 'reviewer_session_tasks', 'implementer_session', 'fast',
41
41
  'pre_review_tests', 'pre_review_parallel', 'qa_threshold', 'timeout', 'verify_retries', 'verify_cmd',
42
- 'verify_parallel', 'setup_cmd', 'final_qa', 'shadow_qa', 'shadow_rate', 'escalate_after', 'fail_first', 'profile.json')
42
+ 'verify_parallel', 'setup_cmd', 'final_qa', 'shadow_qa', 'shadow_rate', 'escalate_after', 'retry_per_model', 'fail_first', 'profile.json',
43
+ 'retro_mode', 'brief', 'brief_scope', 'brief_model', 'summaries', 'summaries_model',
44
+ 'groups.tsv', 'groups.frozen', 'group_max_tasks', 'group_max_diff_kb', 'after')
45
+ # The feature files are rewritten from the source's effective settings (copy_plan), not only copied.
46
+ FEATURE_FILES = ('retro_mode', 'brief', 'brief_scope', 'brief_model', 'summaries', 'summaries_model')
43
47
  PLAN_FILES = ('repo.identity', 'goal.txt', 'request.md')
44
48
  TASK_FILES = ('prompt.md', 'approach.md')
45
49
  NAME = re.compile(r'[^A-Za-z0-9._-]+')
@@ -199,6 +203,13 @@ def copy_plan(src: dict, new: dict, rows: list) -> None:
199
203
  shutil.copy2(plan / name, out / name)
200
204
  if (plan / 'verify.d').is_dir():
201
205
  shutil.copytree(plan / 'verify.d', out / 'verify.d')
206
+ # Retro, brief and summaries as the source resolved them, `off` included: the new plan has
207
+ # no waves.tsv yet, so a missing file would let its `plan` take the user setting instead.
208
+ from forge_side import plan_files
209
+ for name in FEATURE_FILES:
210
+ (out / name).unlink(missing_ok=True)
211
+ for name, value in plan_files(plan).items():
212
+ (out / name).write_text(value + '\n')
202
213
  for row in rows:
203
214
  for name in TASK_FILES:
204
215
  if (plan / 'tasks' / row['id'] / name).is_file():