@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.
- package/CHANGELOG.md +33 -0
- package/README.md +1 -0
- package/SKILL.md +16 -2
- package/VERSION +1 -1
- package/docs/artifacts.md +25 -1
- package/docs/commands.md +81 -14
- package/docs/decomposed-runs.md +114 -1
- package/docs/development.md +2 -1
- package/docs/forge-ui.md +84 -15
- package/docs/memory.md +25 -4
- package/docs/models.md +8 -0
- package/docs/reviews.md +122 -0
- package/forge +20 -3
- package/package.json +2 -1
- package/references/dataset.md +20 -1
- package/references/decompose.md +621 -33
- package/references/harnesses.md +18 -3
- package/references/planning.md +43 -14
- package/references/ui.md +53 -6
- package/registry.tsv +8 -3
- package/scripts/forge-brief.py +88 -3
- package/scripts/forge-compare.py +4 -3
- package/scripts/forge-contract.py +202 -27
- package/scripts/forge-control.py +117 -5
- package/scripts/forge-dispatch.sh +34 -5
- package/scripts/forge-group.py +496 -0
- package/scripts/forge-groups.py +89 -0
- package/scripts/forge-handoff.py +1128 -0
- package/scripts/forge-lib-group.sh +641 -0
- package/scripts/forge-lib-plans.sh +339 -3
- package/scripts/forge-lib-task.sh +197 -4
- package/scripts/forge-memory.sh +245 -3
- package/scripts/forge-parallel.sh +715 -34
- package/scripts/forge-planner.py +104 -8
- package/scripts/forge-route.py +190 -12
- package/scripts/forge-runs.py +9 -5
- package/scripts/forge-schedule.py +354 -45
- package/scripts/forge-solo.sh +2 -0
- package/scripts/forge-worktrees.py +243 -0
- package/scripts/forge_brief/__init__.py +294 -50
- package/scripts/forge_brief/answers.py +58 -11
- package/scripts/forge_brief/proposals.py +1630 -0
- package/scripts/forge_dataset/efforts.py +4 -3
- package/scripts/forge_dataset/export.py +24 -12
- package/scripts/forge_dataset/facts.py +5 -3
- package/scripts/forge_dataset/forecast.py +8 -18
- package/scripts/forge_dataset/harvest.py +204 -9
- package/scripts/forge_dataset/history.py +11 -6
- package/scripts/forge_dataset/importer.py +65 -1
- package/scripts/forge_dataset/names.py +66 -0
- package/scripts/forge_dataset/reviewers.py +5 -2
- package/scripts/forge_dataset/risk.py +6 -3
- package/scripts/forge_dataset/routing.py +6 -1
- package/scripts/forge_groups/__init__.py +308 -0
- package/scripts/forge_groups/attribute.py +289 -0
- package/scripts/forge_groups/review.py +286 -0
- package/scripts/forge_owner.py +152 -0
- package/scripts/forge_side/__init__.py +12 -7
- package/ui/docs/api.md +173 -17
- package/ui/forge_ui/control.py +361 -2
- package/ui/forge_ui/executions.py +8 -1
- package/ui/forge_ui/export.py +31 -4
- package/ui/forge_ui/groups.py +264 -0
- package/ui/forge_ui/models.py +70 -8
- package/ui/forge_ui/reader.py +262 -19
- package/ui/forge_ui/server.py +4 -0
- package/ui/forge_ui/static/app.js +93 -13
- package/ui/forge_ui/static/briefview.js +350 -47
- package/ui/forge_ui/static/diffview.js +86 -1
- package/ui/forge_ui/static/groupsview.js +332 -0
- package/ui/forge_ui/static/index.html +1 -0
- package/ui/forge_ui/static/panel.js +127 -7
- package/ui/forge_ui/static/projectsview.js +189 -10
- package/ui/forge_ui/static/runmodel.js +14 -3
- package/ui/forge_ui/static/storageview.js +91 -10
- package/ui/forge_ui/static/style.css +79 -5
- package/ui/forge_ui/static/worktreesview.js +233 -12
- package/ui/forge_ui/storage.py +14 -0
package/docs/forge-ui.md
CHANGED
|
@@ -80,17 +80,46 @@ running task it shares files with, no free slot, a drain or stop, an infrastruct
|
|
|
80
80
|
its countdown, or the retry policy's stop with the split it proposes. The run's inspector says
|
|
81
81
|
what the scheduler is doing and how many tasks wait on what.
|
|
82
82
|
|
|
83
|
+
A run with `groups.tsv` shows a Groups block after the task table. Each row is the group's title
|
|
84
|
+
and goal, "one review" or "per-task review", its reviewer and its members. A review group's
|
|
85
|
+
title opens `#/runs/<key>/group/<gid>`, and that row also shows the status, the round and who
|
|
86
|
+
the last review implicated. The group page shows a decision only while the group is
|
|
87
|
+
`NEEDS_DECISION`: the first line of `decision.md`, and a `forge group retry` command to copy.
|
|
88
|
+
The page does not run it. Below that are the findings, with ambiguous ones marked, the rounds,
|
|
89
|
+
known issues, the review text and a link to its transcript. A task at `IMPLEMENTED` reads
|
|
90
|
+
"awaiting group review" in the Status column and in its inspector. The lamp class stays
|
|
91
|
+
`IMPLEMENTED`. The task table adds a Group column while the run has groups, and the inspector
|
|
92
|
+
shows a `group <id>` chip. See [the forge-ui reference](../references/ui.md).
|
|
93
|
+
|
|
83
94
|
A task's inspector opens on its header: its title and goal, its links (`#N` and GitHub issue and pull
|
|
84
95
|
request URLs; `#N` links to the repo's GitHub origin when there is one), and the Prompt, Approach and
|
|
85
96
|
Acceptance criteria buttons. Then comes its attempt trail, one line per attempt with the reason it ran
|
|
86
97
|
(for example *after review findings* or *escalated to a stronger model*). Then its Summary: the
|
|
87
98
|
generated summary, the model and time it was made, its sources, and an *Out of date* mark once the
|
|
88
|
-
task has changed since. Then its Questions: the brief questions, each with an answer box
|
|
89
|
-
|
|
90
|
-
|
|
99
|
+
task has changed since. Then its Questions: the brief questions, each with an answer box. When a
|
|
100
|
+
question belongs to a group, or one is plan-scoped, the list is split: each group's title and
|
|
101
|
+
goal, then a Plan heading, then No group for a question with no group. A list with neither stays
|
|
102
|
+
flat. Parked questions stay behind a collapsed *Parked (wider scope)* block, grouped
|
|
103
|
+
the same way. An answered parked `wave` or `plan` question has *Propose a change*. A solo run has
|
|
104
|
+
the header and the trail only. Above a plan's task table sit its open brief questions, flagged
|
|
105
|
+
first and then by projected start, in those same groups, and under them the proposals. Each
|
|
106
|
+
proposal shows its state, scope, group, summary, diff and hash. One in state `proposed` has
|
|
107
|
+
*Approve* and *Reject*; the reject reason is optional. A task an approved proposal marked carries
|
|
108
|
+
an affected badge beside its status and in its inspector: `affected by <pid>`, or `flagged:
|
|
109
|
+
already started` when the task had already started. The marker's reason (`changed`, `added` or
|
|
110
|
+
`dependent`) is the badge's tooltip. The summaries switch sits with that list.
|
|
91
111
|
A run with a retro report or notes shows a Retro section in its run details: the note counts on one line,
|
|
92
112
|
then the report, collapsed.
|
|
93
113
|
|
|
114
|
+
A task that stopped `NEEDS_INPUT` opens *Waiting for you*: the question from `tasks/<id>/needs_input.md`,
|
|
115
|
+
and a `forge-parallel.sh retry … --answer` command to copy. On a plan, when the server can write, an
|
|
116
|
+
answer field sits under that command. *Send answer* runs
|
|
117
|
+
[`forge control retry PLAN ID --answer-file -`](commands.md#the-forge-command) (`--actor ui`) and does
|
|
118
|
+
not ask first: it is not a destructive change. While a scheduler is live the page says the answer is
|
|
119
|
+
queued and the scheduler resumes the task; with no live run it says the answer is prepared for the
|
|
120
|
+
next `run`. A solo run shows the question and the command only. Under `--read-only` the field is
|
|
121
|
+
absent and the copy button stays.
|
|
122
|
+
|
|
94
123
|
Under each attempt's dwarf and reviewer are the checks they ran, read from their logs: each
|
|
95
124
|
test, type check, lint or build with its exit, its time and the counts it printed, a failed
|
|
96
125
|
one's last lines, and a link to that command in the conversation. Each attempt then says which
|
|
@@ -115,8 +144,12 @@ A review the reviewer passed but forge failed, because it listed a blocking CONF
|
|
|
115
144
|
forge-ui reads everything, and it changes things only by calling forge's own commands: it
|
|
116
145
|
never writes a run file, a repo or a config itself. That keeps one set of rules (validation,
|
|
117
146
|
locks, the audit log) whichever way you change something, and a change from the page is
|
|
118
|
-
indistinguishable from the same command typed in a terminal, except that
|
|
119
|
-
`ui` instead of `cli
|
|
147
|
+
indistinguishable from the same command typed in a terminal, except that the page passes
|
|
148
|
+
`--actor ui` (`control.log` says `ui` instead of `cli` for a control change). A destructive change
|
|
149
|
+
shows a dry run and then asks: removing worktrees, forgetting memories, compacting disk and deleting
|
|
150
|
+
a run. A brief answer, a proposal, approving or rejecting one, and *Send answer* on a task that is
|
|
151
|
+
waiting go out when you press the button, with no dry run. The HTTP shapes are in
|
|
152
|
+
[the API](../ui/docs/api.md); this page describes what you do.
|
|
120
153
|
|
|
121
154
|
- **Run controls** (a plan's inspector): the QA threshold (shown with its source, `P2 (default)`
|
|
122
155
|
or `P1 (set)`); it accepts `P0`–`P3`, *Default* (drop the setting; P2) and *None* (P3, nothing
|
|
@@ -133,23 +166,51 @@ indistinguishable from the same command typed in a terminal, except that `contro
|
|
|
133
166
|
queued; the panel says *queued*, then *applied* or *refused* with the scheduler's reason.
|
|
134
167
|
Each is `forge control`; see [decomposed runs](decomposed-runs.md#changing-a-run-while-it-works).
|
|
135
168
|
A control that cannot apply (a budget with no live scheduler, a merged task) is disabled and
|
|
136
|
-
says why.
|
|
169
|
+
says why. A task waiting `NEEDS_INPUT` is not *Retry now*: its answer field is described above
|
|
170
|
+
and runs `forge control retry --answer`.
|
|
137
171
|
- **Projects (`#/projects`):** one page per repository with its runs, every finding forge's reviews
|
|
138
172
|
wrote about it (each attempt, final reviews, shadow reviews behind a toggle), and every memory forge
|
|
139
173
|
keeps for it, whichever run or checkout they came from. A finding a later review got past is
|
|
140
174
|
`superseded`, never `fixed`; repeats across rounds are one row with a count. The Memories tab shows
|
|
141
175
|
what `memory.md` gives each role and each learning's state, as `forge memory learnings` reports it.
|
|
142
|
-
Runs and checkouts that are gone are read from the dataset, and those rows say so.
|
|
143
|
-
|
|
176
|
+
Runs and checkouts that are gone are read from the dataset, and those rows say so. When the server
|
|
177
|
+
can write, each learning on the checkout you are looking at has a checkbox, the filtered list has
|
|
178
|
+
*Select all*, and *Forget selected* runs
|
|
179
|
+
[`forge memory forget`](commands.md#forge-memory-forget) on that checkout with `--actor ui`. It
|
|
180
|
+
dry-runs first. The confirm lists the learnings (`category:key` and the text) and the `memory.md`
|
|
181
|
+
lines that go, or says that no `memory.md` line goes. Cancelling sends nothing more. The result
|
|
182
|
+
then says how many ledger rows each key lost, or that the key was not found. A learning with no
|
|
183
|
+
category or key cannot be selected. Under `--read-only` the tab still shows the learnings and
|
|
184
|
+
hides the checkboxes and the button. Reachable from the header, a run's repository name and each
|
|
185
|
+
map district.
|
|
144
186
|
- **Disk (`#/disk`):** what forge takes on disk in every repository it has runs for (each run dir's
|
|
145
187
|
review snapshots, logs and anything forge does not create, each run's worktree folder, the data home),
|
|
146
|
-
what can go without losing a run, and the command that takes it back (`forge runs compact`),
|
|
147
|
-
The same report as `forge du --all`; measured in the background when the screen opens.
|
|
188
|
+
what can go without losing a run, and the command that takes it back (`forge runs compact --logs`),
|
|
189
|
+
to copy. The same report as `forge du --all`; measured in the background when the screen opens.
|
|
190
|
+
When the server can write, a reclaimable run gets *Compact* and the whole-disk command gets
|
|
191
|
+
*Compact all*. Each one dry-runs
|
|
192
|
+
[`forge runs compact`](commands.md#forge-runs-compact) `--logs` first and the confirm says how
|
|
193
|
+
much space would be freed and across how many runs. The real call is the same command without
|
|
194
|
+
`--dry-run`. An active run is refused and the page says to compact it after it ends. Copy stays
|
|
195
|
+
beside the button. Under `--read-only` the commands are only copied. This command records
|
|
196
|
+
`run_compacted` and takes no actor.
|
|
148
197
|
- **Worktrees (`#/worktrees`):** every worktree forge created, in any repository it knows: its
|
|
149
198
|
run, task, branch, last commit, size and status (in use, uncommitted changes, locked, needed by
|
|
150
199
|
the run, failed task, finished, missing on disk, not forge's, unknown to git, removed), and the
|
|
151
|
-
command that removes it safely, to copy.
|
|
152
|
-
|
|
200
|
+
command that removes it safely, to copy. Those copied commands never use `--force` (`git worktree
|
|
201
|
+
remove`, `git branch -d` for a finished merged branch, `rm -rf` for a leftover folder, `git status`
|
|
202
|
+
or `git worktree prune` when that is the safe next step). The per-run `forge runs rm … --dry-run`
|
|
203
|
+
line is still only copied: it would delete the run directory as well. When the server can write,
|
|
204
|
+
the filtered view adds a checkbox and *Remove* on each row that can go, *Select all* for those
|
|
205
|
+
rows, *Remove selected*, and *Delete merged branches too*. *Remove* and *Remove selected* both
|
|
206
|
+
run [`forge worktrees rm`](commands.md#forge-worktrees-rm) with `--actor ui` (and `--branches`
|
|
207
|
+
when that box is checked): one dry run, a summary of what would go and what is skipped and why,
|
|
208
|
+
then a confirm, then the real call and a line per row (removed, skipped, or failed, with the
|
|
209
|
+
reason). If the dry run would remove nothing, that summary is the end of it and nothing is
|
|
210
|
+
asked. A row that cannot be removed shows why beside a disabled checkbox (its run is active,
|
|
211
|
+
uncommitted changes, locked by git, the run still needs it, already gone, not forge's, already
|
|
212
|
+
removed, or not a leftover). Under `--read-only` there is no checkbox and no Remove, and every
|
|
213
|
+
copy button stays. Removed worktrees are listed from the dataset (`worktree_created` and
|
|
153
214
|
`worktree_removed` events); worktrees from before forge recorded them are derived from run dirs,
|
|
154
215
|
without dates. With `FORGE_DATASET=off` the screen lists only what git and the run dirs say.
|
|
155
216
|
- **Open findings:** the review findings a run left open (tolerated by `--qa-threshold`,
|
|
@@ -172,16 +233,24 @@ indistinguishable from the same command typed in a terminal, except that `contro
|
|
|
172
233
|
- **Summaries:** a switch above a plan's task table turns summaries on or off for the run. A task's own
|
|
173
234
|
switch, in its Summary section, sets it to *On*, *Off* or *Inherit* (the run's setting). Each change is
|
|
174
235
|
confirmed first. Turning them on for a finished run starts `forge summarize` in the background.
|
|
175
|
-
- **Brief answers:** each brief question in a task's inspector has an answer box, and *Send* records the
|
|
236
|
+
- **Brief answers and proposals:** each brief question in a task's inspector has an answer box, and *Send* records the
|
|
176
237
|
answer (`forge brief answer`, logged as `ui`). A late answer, given after the task started, shows the
|
|
177
|
-
CLI's notice under its question.
|
|
238
|
+
CLI's notice under its question. An answered parked `wave` or `plan` question has *Propose a change*
|
|
239
|
+
(`forge brief propose`, logged as `ui`). A proposal in state `proposed` has *Approve*
|
|
240
|
+
(`forge brief apply PLAN PID --approve HASH --actor ui`, using the hash on the card) and *Reject*
|
|
241
|
+
(`forge brief reject`, with an optional reason, logged as `ui`). Answers, proposals, approvals and
|
|
242
|
+
rejections are sent at once, without a confirm.
|
|
178
243
|
|
|
179
244
|
Writing is protected, because anything that can reach the server could otherwise change your
|
|
180
245
|
runs. The server makes a random token each time it starts and puts it in the page it serves;
|
|
181
246
|
the page sends it with every change, and the server also checks the `Host` and `Origin`
|
|
182
247
|
headers, so another website open in your browser cannot make your browser change a run. Reading
|
|
183
248
|
needs no token. `--read-only` (or `FORGE_UI_READONLY=1`) turns writing off altogether: no
|
|
184
|
-
token is issued and every change is refused.
|
|
249
|
+
token is issued and every change is refused. No action button is shown: not the run controls,
|
|
250
|
+
not Remove or Forget selected or Compact, and not *Send answer*. The summaries and the questions
|
|
251
|
+
still show, without their switches, answer boxes, or Propose, Approve and Reject buttons, and
|
|
252
|
+
every copy button stays (worktree commands, compact commands, and the `retry --answer` command
|
|
253
|
+
on a waiting task). `FORGE_UI_READONLY=1 forge ui open` starts such a
|
|
185
254
|
server, and the launcher never reuses a server running in the other mode; it replaces it.
|
|
186
255
|
|
|
187
256
|
Also: replay, critical path, Fractal child-task trees, quick jump (Ctrl K, ⌘K on a Mac, or
|
package/docs/memory.md
CHANGED
|
@@ -116,12 +116,28 @@ forge-memory.sh show <repo>
|
|
|
116
116
|
forge-memory.sh prune <repo> # re-apply staleness and the cap now
|
|
117
117
|
forge-memory.sh spend <repo> [--run <run-id>] # what forge has cost this repo
|
|
118
118
|
forge-memory.sh learnings <repo> [--json] # every ledger learning and its state, as JSON (forge memory learnings)
|
|
119
|
+
forge-memory.sh forget <repo> <category:key>... # drop those ledger rows and rebuild memory.md
|
|
120
|
+
[--dry-run] [--json] [--actor ui|cli]
|
|
119
121
|
```
|
|
120
122
|
|
|
121
123
|
`record` appends to the ledger and then rebuilds `memory.md` from the whole ledger — the
|
|
122
124
|
rebuild is idempotent, so a crashed run can leave the ledger a row short but can never leave
|
|
123
|
-
memory half-written. Editing `memory.md` by hand therefore does not stick
|
|
124
|
-
|
|
125
|
+
memory half-written. Editing `memory.md` by hand therefore does not stick: the next rebuild
|
|
126
|
+
overwrites it.
|
|
127
|
+
|
|
128
|
+
`forget` is how a learning is removed. Its identity is `category:key`, the same pair the rebuild
|
|
129
|
+
groups on (category, and the text normalised to lowercase with runs of non-alphanumerics collapsed
|
|
130
|
+
to one space). `forge memory forget REPO KEY…` drops every ledger row of those keys and rebuilds
|
|
131
|
+
`memory.md` from what remains. `--dry-run` writes nothing and still lists the `- ` lines that
|
|
132
|
+
would leave. A key that is not in the ledger is not an error. A real forget that drops at least
|
|
133
|
+
one row records a `memory_forget` dataset event, including the actor (`--actor ui` or `cli`,
|
|
134
|
+
default `cli`). `--json` prints
|
|
135
|
+
`{ok, dry_run, keys: [{key, rows, found}], memory_lines_removed}`. Exit 0 ok, 2 usage. See
|
|
136
|
+
[the command](commands.md#forge-memory-forget).
|
|
137
|
+
|
|
138
|
+
forge-ui's Memories tab does this for the learnings you select: *Forget selected* dry-runs,
|
|
139
|
+
confirms with the learnings and the `memory.md` lines that go, then runs `forget` as actor `ui`
|
|
140
|
+
on the checkout the tab is showing. See [Controls](forge-ui.md#controls).
|
|
125
141
|
|
|
126
142
|
```bash
|
|
127
143
|
# what would a dwarf actually be told about this repo?
|
|
@@ -146,11 +162,16 @@ its rows, and what forge does with it now:
|
|
|
146
162
|
| `muted` | every row of it was marked not injectable (Jev's curation) |
|
|
147
163
|
|
|
148
164
|
The states come from forge-memory.sh's own rebuild, run into a scratch directory, so they cannot differ
|
|
149
|
-
from what `record` writes;
|
|
165
|
+
from what `record` writes; `learnings` itself only reads the repository. The answer also has the current `memory.md` by
|
|
150
166
|
section, with the roles each section reaches, and `rebuilt_differs` when that file is not what a rebuild
|
|
151
167
|
makes now (an older forge wrote it, or a `prune` asked Jev to drop facts). forge-ui's Projects screen
|
|
152
168
|
shows it on each repository's *Memories* tab, merged across the checkouts its runs started in and, from
|
|
153
|
-
the dataset, the learnings of checkouts that are gone.
|
|
169
|
+
the dataset, the learnings of checkouts that are gone. With write controls the tab adds a checkbox per
|
|
170
|
+
learning, *Select all* for the ones the filters show, and *Forget selected*. That dry-runs
|
|
171
|
+
`forge memory forget` on the checkout you are looking at, then asks, listing each `category:key` and
|
|
172
|
+
the `memory.md` lines that go. Under `--read-only` the list stays and those controls do not. A learning
|
|
173
|
+
is removed by `forget`, which edits the ledger and rebuilds `memory.md`; editing `memory.md` by hand
|
|
174
|
+
does not stick.
|
|
154
175
|
|
|
155
176
|
## Spend
|
|
156
177
|
|
package/docs/models.md
CHANGED
|
@@ -171,3 +171,11 @@ or absent = the built-in default). It applies only when neither `--timeout` nor
|
|
|
171
171
|
elsewhere.
|
|
172
172
|
|
|
173
173
|
Adding a model is one line in this file. Nothing else needs to change.
|
|
174
|
+
|
|
175
|
+
**Moving an alias to a newer model.** Keep the old model under a versioned alias, as
|
|
176
|
+
`terra-5.6` keeps gpt-5.6-terra now that `terra` is gpt-6.1-terra. Each dispatch records
|
|
177
|
+
the model id it ran, so the statistics that count by alias (`forge dataset reviewers`, review
|
|
178
|
+
history, forge-ui's model leaderboard) count an old `terra` dispatch under `terra-5.6`, the
|
|
179
|
+
alias that resolves to its model today, and never under the newer `terra`. Without a versioned
|
|
180
|
+
alias for the old model, its dispatches stay counted with the alias's new ones. Statistics that count by
|
|
181
|
+
model id (routing, forecasts, effort notes, shadow pairs) were already separate.
|
package/docs/reviews.md
CHANGED
|
@@ -48,6 +48,16 @@ file) is retried the same way: its verdict counts for nothing, but the committed
|
|
|
48
48
|
Untracked files a reviewer leaves in its copy, such as a test run's `__pycache__/`, do not void
|
|
49
49
|
the review.
|
|
50
50
|
|
|
51
|
+
### A large task diff
|
|
52
|
+
|
|
53
|
+
A task review inlines its diff up to 400 KB, the whole-run review's limit. Over it, the prompt
|
|
54
|
+
holds the diff's stat and the reviewer reads the diff in its working copy, which holds the attempt
|
|
55
|
+
as one commit over its base (`git diff HEAD~1 HEAD`), as the whole-run review and `adopt` already
|
|
56
|
+
do. If the reviewer's harness still refuses the prompt as too large (codex's `input_too_large`,
|
|
57
|
+
claude's "Prompt is too long"), the task ends `ERROR` with a note that names the cause and the way
|
|
58
|
+
out: a retry would send the same prompt, so review the commit with `forge-parallel.sh adopt`, or
|
|
59
|
+
split the task.
|
|
60
|
+
|
|
51
61
|
## Retrying a failed task
|
|
52
62
|
|
|
53
63
|
```bash
|
|
@@ -113,6 +123,79 @@ retried again, so a stuck task cannot burn its whole budget repeating itself.
|
|
|
113
123
|
`tasks/<id>/attempts.tsv` records every entry (epoch, attempt number, resulting status, infra
|
|
114
124
|
class).
|
|
115
125
|
|
|
126
|
+
### A budget per model: `--retry-per-model N`
|
|
127
|
+
|
|
128
|
+
`plan --retry-per-model N` (1 to 99) writes `retry_per_model`. `--no-retry-per-model` removes
|
|
129
|
+
it; a re-plan that names neither keeps the file. A task may fail N times on the model it is
|
|
130
|
+
running. After those failures the next attempt moves one rung up the pools given to `plan`,
|
|
131
|
+
and the count starts again. With `--escalate-effort`, the same N applies to each effort of
|
|
132
|
+
that model before the next effort. This replaces `--escalate-after` for the plan. When
|
|
133
|
+
`escalate_after` is also present, `run` prints `retry-per-model N replaces --escalate-after
|
|
134
|
+
for this plan` and the policy follows `retry_per_model`.
|
|
135
|
+
|
|
136
|
+
Automatic retries still need `--retry-failed` above 0. Any positive budget turns the ladder on;
|
|
137
|
+
that number is not the limit. A person's decision, `--max-attempts`, the converging stop, a
|
|
138
|
+
`noretry` marker and `escalation.stop` still apply. `forge-route.py per-model` says whether one
|
|
139
|
+
task may run again. `worst-case` is what the plan table prints: `retry per model: N`,
|
|
140
|
+
`worst case with retry-per-model N: X dispatches` (implementer, reviewer, and shadow reviews
|
|
141
|
+
when those are on), and, when the cap cuts a ladder short,
|
|
142
|
+
`max-attempts … stops these tasks before the top of their ladder`.
|
|
143
|
+
|
|
144
|
+
Pools `low`, `medium` and `high` with N=3 give a task that starts on `low` up to 9 implementer
|
|
145
|
+
attempts, three on each rung. `--max-attempts` bounds that. The default cap is 8, so the table
|
|
146
|
+
names the task unless `plan --max-attempts` raises it.
|
|
147
|
+
|
|
148
|
+
### Failures that are the plan's
|
|
149
|
+
|
|
150
|
+
Two outcomes are not a further try of the model.
|
|
151
|
+
|
|
152
|
+
**Reason `plan`.** Task, solo and group reviews ask for this brace. Sweep, adopt and final
|
|
153
|
+
reviews do not. A finding whose only fix is a file the task did not declare ends its first line
|
|
154
|
+
with `{outside=<path>}`, several paths comma-separated, in its own braces immediately before
|
|
155
|
+
the facts brace:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
- [P1][CONFIRMED] path/file.py:123 — {outside=a.py,b.py} {reach=main origin=new evidence=ran}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The implementer does not edit that file. It finishes, then ends its message with one
|
|
162
|
+
`FORGE_BLOCKED: <path>: <why>` line per path. `qa.input` shows those lines as a claim ("The
|
|
163
|
+
implementer says these fixes need files outside the task") and tells the reviewer to confirm a
|
|
164
|
+
real one with `{outside=<path>}` or refute it. Only the reviewer's brace stops the task. When
|
|
165
|
+
the status is `FAIL`, the verdict in `qa.last` is `PASS` or `FAIL`, every blocking finding
|
|
166
|
+
carries `{outside=…}`, and each path is outside the task's declared files, the decomposed task
|
|
167
|
+
stops as `NEEDS_DECISION` with reason `plan` after that attempt, before any escalation. A group
|
|
168
|
+
member's settled `FAIL` is checked the same way. A solo review is not.
|
|
169
|
+
`tasks/<id>/outside.json` lists each path with the task that declares it, or none, and that
|
|
170
|
+
task's status. `decision.md` prints `path — declared by <id> (<status>)` or
|
|
171
|
+
`path — declared by no task`, then the plan choices: add the path to this task's `files`, make
|
|
172
|
+
this task depend on the owner, or merge the two rows. Edit `tasks.tsv`, run `plan` again when
|
|
173
|
+
no run is live, then `retry --decide retry=1` with `--reason` and `--approved`.
|
|
174
|
+
|
|
175
|
+
That `FAIL` counts toward `--max-attempts`, because a review happened. It does not spend a
|
|
176
|
+
further attempt on the model: escalation does not run, and `--retry-failed` does not re-queue a
|
|
177
|
+
`NEEDS_DECISION` task. Another dispatch cannot change a file this task does not declare. A
|
|
178
|
+
tolerated or `PLAUSIBLE` finding does not block, so it does not count toward the stop. A later
|
|
179
|
+
decision restarts the escalation streak past this attempt.
|
|
180
|
+
|
|
181
|
+
**`STALE`.** `prompt.dispatched` and `approach.dispatched` are the copies taken when the
|
|
182
|
+
attempt is dispatched. A missing `approach.md` is an empty copy. If `prompt.md` or `approach.md`
|
|
183
|
+
differs at review time, the attempt is not reviewed. The status is `STALE`, the diff is
|
|
184
|
+
`stale.diff`, `control.log` records `prompt-changed` with actor `scheduler`, and the console
|
|
185
|
+
says the attempt was not reviewed and no attempt was spent. This spends nothing against the
|
|
186
|
+
model: the implementer was not judged on the text it was given, so the result says nothing
|
|
187
|
+
about it. The attempt counter is refunded, the cap skips `STALE` the way it skips `INFRA`, the
|
|
188
|
+
escalation streak treats `STALE` as neutral, and no decision is written. The scheduler
|
|
189
|
+
re-dispatches at once, unless the run is stopping, with `retry_findings.source` `prompt`.
|
|
190
|
+
`retry_findings.md` holds the new requirements and the diff, and the attempt number is reused.
|
|
191
|
+
A `STALE` task still waiting at the next `run` is prepared the same way. That re-dispatch does
|
|
192
|
+
not need `--retry-failed`. `forge control retry` accepts `STALE`; `--dwarf` is refused, because
|
|
193
|
+
the same implementer gets the new text. A plain `forge-parallel.sh retry` does not take this
|
|
194
|
+
path. The stale attempt's `changes.diff` is removed, so a
|
|
195
|
+
re-dispatch that keeps the committed work is reviewed rather than refused as identical. The
|
|
196
|
+
dataset attempt event has `prompt_changed`. `forge dataset routing`, tiers and the forecast
|
|
197
|
+
leave those attempts out. The `prompt` blob is the text the implementer was given.
|
|
198
|
+
|
|
116
199
|
## Infrastructure failures are not task failures
|
|
117
200
|
|
|
118
201
|
A quota or usage limit, an auth problem, a rate limit, a network error, or a harness that
|
|
@@ -301,6 +384,38 @@ share a commit, `since=` is that commit and the prompt says nothing changed. The
|
|
|
301
384
|
labelled-line rule applies: restate only what is still open, because every labelled line
|
|
302
385
|
is filed.
|
|
303
386
|
|
|
387
|
+
## Group review (opt-in)
|
|
388
|
+
|
|
389
|
+
`plan --groups waves --group-review` reviews several related tasks in one QA dispatch. It is
|
|
390
|
+
off unless you pass it. A planner's groups, and `--groups` without `--group-review`, are names
|
|
391
|
+
only (`review=task`): they show in the approval table, and each task is still reviewed on its
|
|
392
|
+
own. The mechanics are in
|
|
393
|
+
[Groups and group review](../references/decompose.md#groups-and-group-review-opt-in).
|
|
394
|
+
|
|
395
|
+
**Fewer dispatches, a larger prompt.** A group is one review instead of one per member, and
|
|
396
|
+
the reviewer sees those tasks together: each task's requirements, and the combined diff. The
|
|
397
|
+
prompt is larger. That is the tradeoff.
|
|
398
|
+
|
|
399
|
+
**A failure stops the group.** A blocking finding sends the implicated members back. The
|
|
400
|
+
others stay implemented and are not retried, and nothing in the group merges until those
|
|
401
|
+
members are fixed and the group passes. A member also waits for its siblings before anything
|
|
402
|
+
merges, so a task that depends on one of them starts later than it would under per-task review.
|
|
403
|
+
|
|
404
|
+
**Fewer dispatches are not a measured saving.** They do not by themselves prove a lower token
|
|
405
|
+
cost, or that the same defects are caught. The group's QA dispatch is recorded with `scope`
|
|
406
|
+
`group` and is left out of the per-task reviewer statistics. Read the `group_review` and
|
|
407
|
+
`group_merge` events. Measure with `forge dataset` before treating group review as a cost
|
|
408
|
+
saving. See [the dataset](../references/dataset.md#raw-events-not-training-examples).
|
|
409
|
+
|
|
410
|
+
**When to use it.** Many small, related, low-risk tasks. Keep a high-risk task on per-task
|
|
411
|
+
review. `--group-review` already leaves high-difficulty tasks out of the groups it derives.
|
|
412
|
+
|
|
413
|
+
A combined diff over `group_max_diff_kb` (256 KB unless the plan says otherwise) is not
|
|
414
|
+
reviewed and not truncated: the group stops for a decision. That is separate from a
|
|
415
|
+
[whole-run review](#whole-run-review-opt-in), which reads the combined result after the run
|
|
416
|
+
and does truncate. Group review runs no shadow review, does not continue a reviewer session
|
|
417
|
+
across rounds, and does not run under Fractal.
|
|
418
|
+
|
|
304
419
|
## Reviewer session (opt-in experiment)
|
|
305
420
|
|
|
306
421
|
`plan --reviewer-session` continues the same reviewer's session across rounds. It is off
|
|
@@ -311,6 +426,13 @@ when the resolved harness, model and effort are unchanged. The approval table na
|
|
|
311
426
|
Dispatch details are in
|
|
312
427
|
[continuing a reviewer session](../references/harnesses.md#continuing-a-reviewer-session).
|
|
313
428
|
|
|
429
|
+
`plan --reviewer-session-rate R` turns it on for a sampled share of the tasks only, to compare
|
|
430
|
+
the two halves in one run. Within each difficulty, `plan` picks round(R × n) tasks by a hash of
|
|
431
|
+
the run id and the task id, and writes them to `reviewer_session_tasks`. A re-plan keeps the
|
|
432
|
+
same tasks. The other tasks review fresh every round, and their `review_sessions.tsv` rows say
|
|
433
|
+
`not-sampled`. Plain `--reviewer-session` on a re-plan goes back to every task. A whole-run
|
|
434
|
+
review is not sampled.
|
|
435
|
+
|
|
314
436
|
Any round that cannot continue starts a fresh session. That is the first round, a missing
|
|
315
437
|
or malformed session id, a resolution that is missing or different, any harness other
|
|
316
438
|
than those three, a Fractal plan, and a continue that the harness refuses or that fails
|
package/forge
CHANGED
|
@@ -23,7 +23,7 @@ usage() {
|
|
|
23
23
|
' jev the old decision-model commands, replaced by decide (kept for one release)' \
|
|
24
24
|
' dataset every run'"'"'s inputs and outcomes: status, dump, import, export, outcomes, ...' \
|
|
25
25
|
' issues file the review findings a run left open as GitHub issues (plain gh)' \
|
|
26
|
-
' memory a repository'"'"'s project memory: show, learnings --json (each learning and its state), prune' \
|
|
26
|
+
' memory a repository'"'"'s project memory: show, learnings --json (each learning and its state), prune, forget' \
|
|
27
27
|
' pr a draft pull-request description for a finished run (--create opens it with gh)' \
|
|
28
28
|
' ui forge-ui, the run viewer: open [DIR], status, stop' \
|
|
29
29
|
' runs this repo'"'"'s recent runs in the terminal: state, verdicts and run dirs; compact, rm, rerun with another model, compare' \
|
|
@@ -31,6 +31,9 @@ usage() {
|
|
|
31
31
|
' retro notes on what got in a run'"'"'s way, kept on this machine' \
|
|
32
32
|
' summarize a task'"'"'s generated summary, rewritten only when its inputs change' \
|
|
33
33
|
' brief each task'"'"'s open questions, asked before it starts: write, show' \
|
|
34
|
+
' group a plan'"'"'s task groups: show, retry a review=group group, set a title or goal' \
|
|
35
|
+
' handoff a run'"'"'s state for the next session, with the commands to carry on: show (the default)' \
|
|
36
|
+
' worktrees the worktrees forge created: rm removes the safe ones by forge-ui'"'"'s rules' \
|
|
34
37
|
' watch follow runs live and get a desktop notification when one finishes or fails' \
|
|
35
38
|
' control a plan'"'"'s live controls: show, set (QA threshold, retries, timeouts), pin, unpin' \
|
|
36
39
|
' config every config source: show, and set/unset the per-repo .forge files and Jev on/off' \
|
|
@@ -107,9 +110,9 @@ case "${1:-}" in
|
|
|
107
110
|
shift
|
|
108
111
|
# only the commands its help lists: note and record are what a run writes into the ledger, not a person
|
|
109
112
|
case "${1:-}" in
|
|
110
|
-
show|learnings|prune|spend|inject|-h|--help|help) ;;
|
|
113
|
+
show|learnings|prune|spend|inject|forget|-h|--help|help) ;;
|
|
111
114
|
'') /bin/bash "$ROOT/scripts/forge-memory.sh" --help >&2; exit 2 ;;
|
|
112
|
-
*) printf 'forge memory: unknown command: %s (show, learnings, prune, spend or
|
|
115
|
+
*) printf 'forge memory: unknown command: %s (show, learnings, prune, spend, inject or forget)\n' "$1" >&2; exit 2 ;;
|
|
113
116
|
esac
|
|
114
117
|
exec /bin/bash "$ROOT/scripts/forge-memory.sh" "$@"
|
|
115
118
|
;;
|
|
@@ -145,6 +148,20 @@ case "${1:-}" in
|
|
|
145
148
|
help_if_bare $# python3 "$ROOT/scripts/forge-brief.py"
|
|
146
149
|
exec python3 "$ROOT/scripts/forge-brief.py" "$@"
|
|
147
150
|
;;
|
|
151
|
+
group)
|
|
152
|
+
shift
|
|
153
|
+
help_if_bare $# python3 "$ROOT/scripts/forge-group.py"
|
|
154
|
+
exec python3 "$ROOT/scripts/forge-group.py" "$@"
|
|
155
|
+
;;
|
|
156
|
+
handoff)
|
|
157
|
+
shift
|
|
158
|
+
exec python3 "$ROOT/scripts/forge-handoff.py" "$@"
|
|
159
|
+
;;
|
|
160
|
+
worktrees)
|
|
161
|
+
shift
|
|
162
|
+
help_if_bare $# python3 "$ROOT/scripts/forge-worktrees.py"
|
|
163
|
+
exec python3 "$ROOT/scripts/forge-worktrees.py" "$@"
|
|
164
|
+
;;
|
|
148
165
|
watch)
|
|
149
166
|
shift
|
|
150
167
|
exec python3 "$ROOT/scripts/forge-watch.py" "$@"
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giamme/forge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Multi-model coding with a reviewer that reads the code: plan, build in parallel worktrees, review every real diff, merge only what passes.",
|
|
5
5
|
"keywords": ["claude-code", "codex", "opencode", "agent-skill", "code-review", "multi-model"],
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Giamme",
|
|
8
8
|
"repository": { "type": "git", "url": "git+https://github.com/Giamme/forge.git" },
|
|
9
|
+
"homepage": "https://giamme.github.io/forge/",
|
|
9
10
|
"bin": { "forge": "forge" },
|
|
10
11
|
"os": ["darwin", "linux"],
|
|
11
12
|
"files": [
|
package/references/dataset.md
CHANGED
|
@@ -45,6 +45,8 @@ time order: an attempt that PASSed, then a merge that CONFLICTed, then a human `
|
|
|
45
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` |
|
|
46
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
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` `group_review` | one QA round of a `review=group` group | `group`, `round`, `members`, `reviewer`, `verdict`, `gated`, `implicated`, `ambiguous`, `findings`, `diff_bytes`, `prompt_bytes`. The dispatch itself is a separate `dispatch` with `scope` `group` |
|
|
49
|
+
| `event` `group_merge` | a group merge, conflict, or invalidation | `group`, `status` (`MERGED`, `CONFLICT`, or `INVALIDATED`). `MERGED` also has `commit`, `members` and `integration`. `CONFLICT` has `commit` and `conflicts`. `INVALIDATED` has `reason`. Each member's own `merge` event also carries `group` |
|
|
48
50
|
| `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
51
|
| `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
52
|
| `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 |
|
|
@@ -84,8 +86,25 @@ disk stay `side.*`. Review history, finding facts, review exports and forge-ui's
|
|
|
84
86
|
skip every `side_*` role, so a brief or summary is never counted as a review. A bare `side` is
|
|
85
87
|
the dispatch role itself, not one of these.
|
|
86
88
|
|
|
89
|
+
A group review is one QA dispatch for several tasks (`forge-dispatch.sh qa` with
|
|
90
|
+
`--run-dir <plan>/groups/<gid>`). It is recorded with `scope` `group`, an empty task,
|
|
91
|
+
`group` (the group id), `members` (the task ids from `groups.tsv`, in order) and `round`
|
|
92
|
+
(the number in `groups/<gid>/round` when the dispatch was captured live; an import reads
|
|
93
|
+
the dispatch's own `attempts/qa-*/group.round`, and for a run recorded before that file, the
|
|
94
|
+
round from `members.tsv`, matched to `qa.round-<n>.last` when that file exists). It is
|
|
95
|
+
not a task attempt. Reviewer leaderboards, `forge dataset` reviewers, pairs, routing, tiers
|
|
96
|
+
and efforts, review history, finding facts, the review rows of `forge dataset export`, and
|
|
97
|
+
forge-ui's model views skip `scope` `group` the way they skip a side dispatch. The dispatch
|
|
98
|
+
stays in the store, flagged `scope` `group`, so a later measurement of group review quality
|
|
99
|
+
and cost can use it. A member attempt the group judged is linked on import (`review_scope`
|
|
100
|
+
`group`, plus `group` and `round`) and does not keep a copy of that review's `qa.last` or
|
|
101
|
+
`qa.gate`. It has no task-level QA dispatch of its own. A plan with no group review imports
|
|
102
|
+
the same events as before.
|
|
103
|
+
|
|
87
104
|
`plan --reviewer-session` writes `$PLAN/reviewer_session` (`on`). The plan event records
|
|
88
|
-
it in `options
|
|
105
|
+
it in `options`, and `--reviewer-session-rate` adds `reviewer_session_rate`; which tasks were
|
|
106
|
+
sampled is in `$PLAN/reviewer_session_tasks`, and the others' `review_sessions.tsv` rows say
|
|
107
|
+
`not-sampled`. The file joins the plan id only when it is present, so every plan already
|
|
89
108
|
in a store keeps its id, and turning the experiment on stores a new plan event.
|
|
90
109
|
`plan --implementer-session` (`$PLAN/implementer_session`, `on`) is recorded the same way, and
|
|
91
110
|
`plan --pre-review-tests` joins the plan id the same way and is listed in `flags`. `plan-gates.json`
|