@giamme/forge 0.18.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 (78) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -0
  3. package/SKILL.md +16 -2
  4. package/VERSION +1 -1
  5. package/docs/artifacts.md +25 -1
  6. package/docs/commands.md +81 -14
  7. package/docs/decomposed-runs.md +114 -1
  8. package/docs/development.md +2 -1
  9. package/docs/forge-ui.md +84 -15
  10. package/docs/memory.md +25 -4
  11. package/docs/models.md +8 -0
  12. package/docs/reviews.md +122 -0
  13. package/forge +20 -3
  14. package/package.json +2 -1
  15. package/references/dataset.md +20 -1
  16. package/references/decompose.md +621 -33
  17. package/references/harnesses.md +18 -3
  18. package/references/planning.md +43 -14
  19. package/references/ui.md +53 -6
  20. package/registry.tsv +8 -3
  21. package/scripts/forge-brief.py +88 -3
  22. package/scripts/forge-compare.py +4 -3
  23. package/scripts/forge-contract.py +202 -27
  24. package/scripts/forge-control.py +117 -5
  25. package/scripts/forge-dispatch.sh +34 -5
  26. package/scripts/forge-group.py +496 -0
  27. package/scripts/forge-groups.py +89 -0
  28. package/scripts/forge-handoff.py +1128 -0
  29. package/scripts/forge-lib-group.sh +641 -0
  30. package/scripts/forge-lib-plans.sh +339 -3
  31. package/scripts/forge-lib-task.sh +197 -4
  32. package/scripts/forge-memory.sh +245 -3
  33. package/scripts/forge-parallel.sh +715 -34
  34. package/scripts/forge-planner.py +104 -8
  35. package/scripts/forge-route.py +190 -12
  36. package/scripts/forge-runs.py +9 -5
  37. package/scripts/forge-schedule.py +354 -45
  38. package/scripts/forge-solo.sh +2 -0
  39. package/scripts/forge-worktrees.py +243 -0
  40. package/scripts/forge_brief/__init__.py +294 -50
  41. package/scripts/forge_brief/answers.py +58 -11
  42. package/scripts/forge_brief/proposals.py +1630 -0
  43. package/scripts/forge_dataset/efforts.py +4 -3
  44. package/scripts/forge_dataset/export.py +24 -12
  45. package/scripts/forge_dataset/facts.py +5 -3
  46. package/scripts/forge_dataset/forecast.py +8 -18
  47. package/scripts/forge_dataset/harvest.py +204 -9
  48. package/scripts/forge_dataset/history.py +11 -6
  49. package/scripts/forge_dataset/importer.py +65 -1
  50. package/scripts/forge_dataset/names.py +66 -0
  51. package/scripts/forge_dataset/reviewers.py +5 -2
  52. package/scripts/forge_dataset/risk.py +6 -3
  53. package/scripts/forge_dataset/routing.py +6 -1
  54. package/scripts/forge_groups/__init__.py +308 -0
  55. package/scripts/forge_groups/attribute.py +289 -0
  56. package/scripts/forge_groups/review.py +286 -0
  57. package/scripts/forge_owner.py +152 -0
  58. package/scripts/forge_side/__init__.py +12 -7
  59. package/ui/docs/api.md +173 -17
  60. package/ui/forge_ui/control.py +361 -2
  61. package/ui/forge_ui/executions.py +8 -1
  62. package/ui/forge_ui/export.py +31 -4
  63. package/ui/forge_ui/groups.py +264 -0
  64. package/ui/forge_ui/models.py +70 -8
  65. package/ui/forge_ui/reader.py +262 -19
  66. package/ui/forge_ui/server.py +4 -0
  67. package/ui/forge_ui/static/app.js +93 -13
  68. package/ui/forge_ui/static/briefview.js +350 -47
  69. package/ui/forge_ui/static/diffview.js +86 -1
  70. package/ui/forge_ui/static/groupsview.js +332 -0
  71. package/ui/forge_ui/static/index.html +1 -0
  72. package/ui/forge_ui/static/panel.js +127 -7
  73. package/ui/forge_ui/static/projectsview.js +189 -10
  74. package/ui/forge_ui/static/runmodel.js +14 -3
  75. package/ui/forge_ui/static/storageview.js +91 -10
  76. package/ui/forge_ui/static/style.css +79 -5
  77. package/ui/forge_ui/static/worktreesview.js +233 -12
  78. package/ui/forge_ui/storage.py +14 -0
@@ -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
package/references/ui.md CHANGED
@@ -30,12 +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`.
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`.
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.
35
47
  - **Open findings and issues:** the findings a run (or all of its repository's runs) left open,
36
48
  filed as GitHub issues or dismissed through `forge issues`.
37
49
  - **Delete a run:** a dry run, then `forge runs rm`: the dataset keeps the traces, an archive is
38
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.
39
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,
40
63
  the per-repo files, the dataset and `FORGE_*` variables, with edits where the server can write.
41
64
  - **Export a run:** one HTML file to share that opens without forge-ui; prompts, diffs, reports
@@ -62,6 +85,18 @@ run goes on, with the same exit code.
62
85
  output, or why a task waits (dependencies, shared files, no free slot, a drain or stop, an
63
86
  infrastructure pause with its countdown, the retry policy's stop and its split). The run
64
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).
65
100
  - **Checks:** each attempt's tests, type checks, lints and builds, read from its dwarf's and
66
101
  reviewer's logs, with exits, times and counts, a failed one's last lines, and which of the
67
102
  commands its `## Acceptance criteria` name never ran. codex and grok logs carry no times, so
@@ -71,7 +106,7 @@ run goes on, with the same exit code.
71
106
  - **Opening a node** shows its attempts, dwarves and reviews, and an inspector with the prompt
72
107
  that launched each one, the model, timings by phase, tokens, verdicts and the P0–P3 findings
73
108
  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
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
75
110
  when retro mode wrote one.
76
111
  - **Solo run:** one task: its attempts, specs, prompts and the final messages.
77
112
  - It refreshes every two seconds while something runs (five otherwise) while the tab is
@@ -85,7 +120,10 @@ limit's reset is known. A pause that needs the user says "needs you" with the fi
85
120
  sideways move is a "moved sideways" line under Models. A task at `NEEDS_DECISION` is waiting, not
86
121
  failed: its inspector gives the reasons, the attempts against the cap, the review ledger, and the
87
122
  text of `tasks/<id>/decision.md`. forge-ui shows those commands and does not run them, and it does
88
- 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`.
89
127
 
90
128
  The 3D view loads three.js from cdn.jsdelivr.net when first used; offline, the page shows the
91
129
  same run in 2D. The full page description is in [ui/README.md](../ui/README.md).
@@ -146,6 +184,12 @@ bash <skill_dir>/scripts/forge-solo.sh "$FORGE_RUN" --repo "$REPO" --dwarf <spec
146
184
  - `forge ui status` exits 0 when the server runs and 1 when not; `--json` prints
147
185
  `{"running": ...}` with pid, port, url, version, build, started and log.
148
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).
149
193
 
150
194
  | Variable | Meaning |
151
195
  |---|---|
@@ -186,8 +230,10 @@ review text from private repos. A running server keeps serving them, including r
186
230
  later rerun with `--no-ui`.
187
231
 
188
232
  **Changing needs one.** The server never writes a run file, a repo or a config itself: every
189
- change is a call of forge's own CLI (`forge control`, `forge issues`, `forge runs rm`,
190
- `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
191
237
  random token and puts it in the page it serves; every change must send it back, from a `Host` of
192
238
  `127.0.0.1` or `localhost` and with an `Origin` equal to that host when the browser sends one, or
193
239
  it is refused before any CLI runs. There are no CORS headers, so another site in your browser
@@ -195,6 +241,7 @@ can neither send nor read a change. Any process that can fetch the page can read
195
241
  it can read the runs, so on a shared machine start the server **read-only**: `--read-only`
196
242
  (`python3 -m forge_ui`) or `FORGE_UI_READONLY=1` (also for `forge ui open`). A read-only server
197
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.
198
245
  `forge ui open` never reuses a server in the other mode: it replaces it, as it does one running
199
246
  old code, and `forge ui status` shows the mode.
200
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 -
@@ -16,8 +16,33 @@
16
16
  a file outside the task's declared files. A declared directory covers the paths
17
17
  under it.
18
18
 
19
- Exit codes: 0 ok, 2 usage or an unknown task or question (the message lists the valid
20
- ids), 3 PLAN is not a plan dir or, for write and show, brief is off for it.
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).
21
46
  """
22
47
  from __future__ import annotations
23
48
 
@@ -29,12 +54,14 @@ from pathlib import Path
29
54
  sys.path.insert(0, str(Path(__file__).resolve().parent))
30
55
  import forge_brief # noqa: E402
31
56
  import forge_brief.answers as answers # noqa: E402
57
+ import forge_brief.proposals as proposals # noqa: E402
32
58
 
33
59
  REASONS = {
34
60
  'env': 'FORGE_BRIEF=off is set',
35
61
  'off': 'brief mode is off for this plan (plan --brief advisory|gated|strict)',
36
62
  'never-send': "the repository's privacy is never-send",
37
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',
38
65
  }
39
66
 
40
67
 
@@ -63,6 +90,26 @@ def _parser() -> argparse.ArgumentParser:
63
90
  stale = sub.add_parser('stale', help="flag dependents' open questions after a merge outside its files")
64
91
  stale.add_argument('plan', help='the plan directory')
65
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)')
66
113
  return parser
67
114
 
68
115
 
@@ -101,6 +148,38 @@ def main(argv=None) -> int:
101
148
  for task, qid in answers.stale(args.plan, args.task):
102
149
  sys.stdout.write('%s/%s\n' % (task, qid))
103
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
104
183
  found = forge_brief.collect(args.plan, task=args.task)
105
184
  except forge_brief.NotAPlan as error:
106
185
  sys.stderr.write('forge brief: not a plan dir: %s\n' % error)
@@ -121,10 +200,16 @@ def main(argv=None) -> int:
121
200
  except answers.Usage as error:
122
201
  sys.stderr.write('forge brief: %s\n' % error)
123
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
124
209
  if args.as_json:
125
210
  sys.stdout.write(json.dumps(found, ensure_ascii=False, indent=2, sort_keys=True) + '\n')
126
211
  else:
127
- sys.stdout.write(forge_brief.render(found))
212
+ sys.stdout.write(forge_brief.render(found, args.plan))
128
213
  return 0
129
214
 
130
215
 
@@ -37,10 +37,11 @@ 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',
43
- 'retro_mode', 'brief', 'brief_scope', 'brief_model', 'summaries', 'summaries_model')
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')
44
45
  # The feature files are rewritten from the source's effective settings (copy_plan), not only copied.
45
46
  FEATURE_FILES = ('retro_mode', 'brief', 'brief_scope', 'brief_model', 'summaries', 'summaries_model')
46
47
  PLAN_FILES = ('repo.identity', 'goal.txt', 'request.md')