@giamme/forge 0.21.0 → 0.23.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 +81 -0
- package/README.md +25 -15
- package/SKILL.md +137 -216
- package/VERSION +1 -1
- package/bin/forge.js +104 -0
- package/docs/README.md +2 -3
- package/docs/add-ons.md +5 -3
- package/docs/artifacts.md +17 -2
- package/docs/commands.md +85 -63
- package/docs/decomposed-runs.md +195 -21
- package/docs/development.md +12 -10
- package/docs/forge-ui.md +33 -4
- package/docs/install.md +127 -6
- package/docs/memory.md +6 -1
- package/docs/models.md +36 -10
- package/docs/reviews.md +50 -29
- package/docs/safety.md +27 -2
- package/docs/troubleshooting.md +8 -11
- package/forge +29 -4
- package/forge.cmd +56 -0
- package/package.json +6 -3
- package/references/dataset.md +10 -9
- package/references/decompose-integration.md +337 -0
- package/references/decompose-opt-in.md +527 -0
- package/references/decompose-recovery.md +569 -0
- package/references/decompose-review.md +256 -0
- package/references/decompose.md +99 -1606
- package/references/findings.md +68 -0
- package/references/harnesses.md +7 -12
- package/references/memory.md +13 -2
- package/references/planning.md +48 -18
- package/references/ripwire.md +38 -13
- package/references/runtime.md +22 -33
- package/references/setup.md +90 -0
- package/references/solo.md +13 -42
- package/references/ui.md +12 -5
- package/registry.tsv +40 -22
- package/scripts/forge-artifact.sh +148 -13
- package/scripts/forge-compare.py +5 -15
- package/scripts/forge-config.py +14 -1
- package/scripts/forge-contract.py +216 -53
- package/scripts/forge-control.py +781 -51
- package/scripts/forge-dispatch.sh +202 -42
- package/scripts/forge-du.py +13 -3
- package/scripts/forge-guard.py +137 -6
- package/scripts/forge-handoff.py +221 -39
- package/scripts/forge-install-ripwire.sh +100 -24
- package/scripts/forge-install.sh +100 -41
- package/scripts/forge-issues.py +6 -4
- package/scripts/forge-jev-options.sh +3 -5
- package/scripts/forge-lib-adopt.sh +169 -5
- package/scripts/forge-lib-attribute.sh +10 -3
- package/scripts/forge-lib-decompose.sh +454 -0
- package/scripts/forge-lib-env.sh +179 -0
- package/scripts/forge-lib-group.sh +9 -6
- package/scripts/forge-lib-plans.sh +38 -21
- package/scripts/forge-lib-review.sh +28 -8
- package/scripts/forge-lib-task.sh +263 -69
- package/scripts/forge-lib-verify.sh +59 -10
- package/scripts/forge-memory.sh +83 -4
- package/scripts/forge-metrics.sh +10 -3
- package/scripts/forge-parallel-options.sh +23 -4
- package/scripts/forge-parallel.sh +602 -217
- package/scripts/forge-plan-check.py +71 -8
- package/scripts/forge-planner.py +303 -17
- package/scripts/forge-pr.py +9 -1
- package/scripts/forge-prompt.py +2 -2
- package/scripts/forge-review-links.py +248 -0
- package/scripts/forge-ripwire.py +234 -16
- package/scripts/forge-route.py +19 -27
- package/scripts/forge-runs-rm.py +92 -21
- package/scripts/forge-runs.py +46 -5
- package/scripts/forge-runtime.py +39 -14
- package/scripts/forge-schedule.py +141 -33
- package/scripts/forge-setup-stale.py +236 -0
- package/scripts/forge-setup.py +804 -0
- package/scripts/forge-shadow.py +2 -20
- package/scripts/forge-solo-lock.py +46 -0
- package/scripts/forge-solo.sh +39 -58
- package/scripts/forge-sweep.py +3 -2
- package/scripts/forge-ui.py +8 -1
- package/scripts/forge-update.sh +8 -3
- package/scripts/forge-verify.py +17 -1
- package/scripts/forge-version.py +13 -1
- package/scripts/forge-watch.py +7 -2
- package/scripts/forge-win.sh +156 -0
- package/scripts/forge_brief/__init__.py +6 -1
- package/scripts/forge_brief/proposals.py +6 -1
- package/scripts/forge_dataset/__init__.py +1 -1
- package/scripts/forge_dataset/capture.py +0 -34
- package/scripts/forge_dataset/checks.py +0 -1
- package/scripts/forge_dataset/cli.py +5 -1
- package/scripts/forge_dataset/export.py +28 -6
- package/scripts/forge_dataset/facts.py +1 -2
- package/scripts/forge_dataset/forecast.py +1 -1
- package/scripts/forge_dataset/harvest.py +107 -7
- package/scripts/forge_dataset/importer.py +3 -2
- package/scripts/forge_dataset/pairs.py +3 -3
- package/scripts/forge_dataset/reviewers.py +4 -3
- package/scripts/forge_dataset/routing.py +6 -3
- package/scripts/forge_dataset/tiers.py +1 -1
- package/scripts/forge_decide/__init__.py +1 -1
- package/scripts/forge_decide/budget.py +12 -7
- package/scripts/forge_decide/profiles.py +11 -14
- package/scripts/forge_decide/replay.py +9 -4
- package/scripts/forge_decompose.py +987 -0
- package/scripts/forge_flock.py +17 -2
- package/scripts/forge_groups/review.py +6 -1
- package/scripts/forge_jev/__init__.py +1 -1
- package/scripts/forge_jev/cli.py +10 -1
- package/scripts/forge_jev/gates.py +10 -1
- package/scripts/forge_jev/verify.py +10 -2
- package/scripts/forge_legacy.py +86 -0
- package/scripts/forge_memory_home.py +57 -0
- package/scripts/forge_models.py +151 -0
- package/scripts/forge_posix.py +17 -0
- package/scripts/forge_prefs.py +138 -0
- package/scripts/forge_proc.py +108 -0
- package/scripts/forge_registry.py +2 -2
- package/scripts/forge_side/__init__.py +23 -4
- package/scripts/forge_storage.py +28 -15
- package/ui/README.md +22 -10
- package/ui/docs/api.md +121 -99
- package/ui/forge_ui/control.py +53 -16
- package/ui/forge_ui/export.py +0 -10
- package/ui/forge_ui/models.py +15 -2
- package/ui/forge_ui/projects.py +4 -1
- package/ui/forge_ui/reader.py +462 -60
- package/ui/forge_ui/server.py +0 -10
- package/ui/forge_ui/static/app.js +28 -9
- package/ui/forge_ui/static/checksview.js +12 -3
- package/ui/forge_ui/static/controls.js +147 -11
- package/ui/forge_ui/static/convo.js +5 -2
- package/ui/forge_ui/static/diffview.js +4 -5
- package/ui/forge_ui/static/panel.js +180 -77
- package/ui/forge_ui/static/projectsview.js +16 -2
- package/ui/forge_ui/static/runmodel.js +18 -4
- package/ui/forge_ui/static/scene3d.js +52 -31
- package/ui/forge_ui/static/settings.js +1 -1
- package/ui/forge_ui/static/storageview.js +2 -2
- package/ui/forge_ui/static/style.css +23 -6
- package/ui/forge_ui/static/worktreesview.js +8 -4
- package/ui/forge_ui/transcripts.py +6 -0
- package/ui/forge_ui/worktrees.py +13 -1
- package/docs/fractal.md +0 -181
- package/references/fractal-dashboard.md +0 -21
- package/references/fractal.md +0 -307
- package/scripts/forge-fractal-dispatch.sh +0 -4
- package/scripts/forge-fractal-options.sh +0 -54
- package/scripts/forge-fractal.py +0 -6
- package/scripts/forge-install-fractal.sh +0 -4
- package/scripts/forge_fractal/__init__.py +0 -88
- package/scripts/forge_fractal/bridge.py +0 -46
- package/scripts/forge_fractal/cli.py +0 -224
- package/scripts/forge_fractal/dashboard.css +0 -138
- package/scripts/forge_fractal/dashboard.html +0 -41
- package/scripts/forge_fractal/dashboard.js +0 -687
- package/scripts/forge_fractal/decomposition.py +0 -262
- package/scripts/forge_fractal/execution.py +0 -659
- package/scripts/forge_fractal/inspection.py +0 -261
- package/scripts/forge_fractal/install.py +0 -158
- package/scripts/forge_fractal/invocation.py +0 -95
- package/scripts/forge_fractal/pipeline.py +0 -125
- package/scripts/forge_fractal/selection.py +0 -180
- package/ui/forge_ui/fractal.py +0 -582
package/docs/decomposed-runs.md
CHANGED
|
@@ -127,7 +127,7 @@ reviews: 4 (2 groups replace 5 task reviews)
|
|
|
127
127
|
The reviews line is `reviews: N (G groups replace M task reviews)`. The word stays `groups`
|
|
128
128
|
when there is one. The count is tasks, minus members of review groups, plus the number of
|
|
129
129
|
those groups. What the run then does is in
|
|
130
|
-
[Groups and group review](../references/decompose.md#groups-and-group-review-opt-in). The
|
|
130
|
+
[Groups and group review](../references/decompose-opt-in.md#groups-and-group-review-opt-in). The
|
|
131
131
|
tradeoff is in [group review](reviews.md#group-review-opt-in).
|
|
132
132
|
|
|
133
133
|
## Fresh session per task, plus a capsule
|
|
@@ -222,10 +222,25 @@ bash scripts/forge-parallel.sh integrate "$PLAN" --approved
|
|
|
222
222
|
first-try PASS rate per task, with tasks unlikely to pass first time flagged. It is advisory only,
|
|
223
223
|
and `--no-forecast` turns it off. See [plan forecast](../references/dataset.md#plan-forecast).
|
|
224
224
|
|
|
225
|
+
While it works, `run` prints a line when it dispatches a task (`forge: dispatched <task> -> <worktree>`),
|
|
226
|
+
when it retries one, and when a task stops for you while the others go on:
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
forge: needs you: auth NEEDS_DECISION (plan) -> /tmp/forge-auth/tasks/auth/decision.md
|
|
230
|
+
forge: needs you: docs NEEDS_INPUT (a question to answer) -> /tmp/forge-auth/tasks/docs/needs_input.md
|
|
231
|
+
forge: stopped: api INFRA (rate_limit, no attempt spent) -> /tmp/forge-auth/tasks/api/infra.txt
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
An agent that started the run in the background and cannot read its output as it comes can follow
|
|
235
|
+
it with `forge watch "$PLAN"` instead: one line per task status change, ending when the run does
|
|
236
|
+
(see [`forge watch`](commands.md#forge-watch)). Either way it learns of the stop at once and can put
|
|
237
|
+
the decision to you while the run continues. Re-reading the logs or the task statuses in a loop is
|
|
238
|
+
the polling the skill avoids; these two are not.
|
|
239
|
+
|
|
225
240
|
`integrate` refuses without `--approved`, and refuses on a dirty working tree.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
241
|
+
A task that turns out to be several pieces can be split into subtasks without editing the plan:
|
|
242
|
+
see [Splitting a task into subtasks](#splitting-a-task-into-subtasks). `--max-parallel` bounds the
|
|
243
|
+
whole run, subtasks included.
|
|
229
244
|
|
|
230
245
|
A plan can start from a finished plan's integration branch. `A` and `B` are plan directories:
|
|
231
246
|
|
|
@@ -240,7 +255,7 @@ branch tip is `A`'s `accepted.integration`, and `A`'s scheduler is not live. It
|
|
|
240
255
|
and `integration.base`, and creates `B`'s integration branch at that tip. `run` exits 3 if `A`
|
|
241
256
|
moved and `B` has not yet merged a task. `integrate` prints `this brings plans` and the run
|
|
242
257
|
ids, oldest first. `forge runs` shows `after <run>` on `B`. See
|
|
243
|
-
[Chained plans](../references/decompose.md#chained-plans).
|
|
258
|
+
[Chained plans](../references/decompose-integration.md#chained-plans).
|
|
244
259
|
|
|
245
260
|
## Resuming an interrupted run
|
|
246
261
|
|
|
@@ -250,7 +265,8 @@ harness that outlived its dispatch. A task that had already finished is reaped f
|
|
|
250
265
|
still merges); only the tasks still running become `INTERRUPTED`, with their partial work kept
|
|
251
266
|
in the worktree. Verification is skipped, or stopped if it had started (`verification.status`
|
|
252
267
|
`INTERRUPTED`, not rerun). The summary lists each interrupted task with its `retry` command,
|
|
253
|
-
the plan lock is released, and `run` exits 130.
|
|
268
|
+
the plan lock is released, and `run` exits 130. A task stopped while its committed attempt was
|
|
269
|
+
under review is retried with that review only, when its worktree still matches the commit.
|
|
254
270
|
|
|
255
271
|
Run `run` again to skip MERGED tasks, merge saved PASS results after fingerprint checks,
|
|
256
272
|
and dispatch eligible pending tasks. Tasks paused on an infrastructure failure (`INFRA`) are
|
|
@@ -262,10 +278,14 @@ operations for the same plan are excluded by an advisory lock.
|
|
|
262
278
|
To pause a run on purpose, drain it instead of signalling it (see below): nothing is
|
|
263
279
|
interrupted, and `forge control resume` continues the same run.
|
|
264
280
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
281
|
+
A split task resumes the same way. Its subtasks are a plan of their own
|
|
282
|
+
(`<plan-dir>/tasks/<id>/sub`): `run <plan-dir>` enters the task again, runs the subtasks that
|
|
283
|
+
have not merged, and never makes a subtask twice. A failed subtask is retried in that plan
|
|
284
|
+
(`retry <plan-dir>/tasks/<id>/sub <subtask>`).
|
|
285
|
+
|
|
286
|
+
A plan made with Fractal, the backend forge 0.23 removed, can still be read (`forge runs`,
|
|
287
|
+
forge-ui) but `run`, `retry` and `forge handoff resume` refuse it (exit 3). Start a new run for
|
|
288
|
+
the work that is left.
|
|
269
289
|
|
|
270
290
|
### From another session or harness
|
|
271
291
|
|
|
@@ -284,22 +304,33 @@ matching run exits 3.
|
|
|
284
304
|
`forge handoff resume RUN_DIR` carries a decomposed run on. It claims the run first; a
|
|
285
305
|
refused claim exits 3 and changes nothing else. A live scheduler is followed and nothing is
|
|
286
306
|
started — leave that run to `forge control show`, and do not start `run` beside it. A
|
|
287
|
-
Fractal
|
|
288
|
-
|
|
307
|
+
plan made with Fractal (removed in forge 0.23) is not restarted, and resume says so. When another forge
|
|
308
|
+
command holds the plan's lock (`schedule.lock`), resume says which and changes and starts
|
|
309
|
+
nothing; otherwise it holds that lock while it recovers, so a `run` started meanwhile is refused
|
|
310
|
+
instead of racing the reset. Each task still `RUNNING` is then recovered, and only when its worktree is exactly `<wt_root>/<id>`
|
|
289
311
|
on `forge/<run_id>/<id>` and any leftover `dwarf.harness` or `qa.harness` has been stopped:
|
|
290
312
|
the uncommitted work, untracked files included, is saved to
|
|
291
313
|
`tasks/<id>/interrupted-<epoch>.diff`, and only then is the worktree reset and cleaned, the
|
|
292
314
|
status set to `INTERRUPTED`, and the attempt counter rewound when `attempts.tsv` has no row
|
|
293
|
-
for that attempt, so the attempt is not counted twice.
|
|
294
|
-
|
|
315
|
+
for that attempt, so the attempt is not counted twice. An attempt that had already committed
|
|
316
|
+
its work was stopped during its review: it keeps its number, and the retry re-runs only the
|
|
317
|
+
review (as for a reviewer that gave no verdict), so its unchanged code is not refused as
|
|
318
|
+
identical to the previous attempt. A guard that fails leaves that worktree untouched.
|
|
319
|
+
Every `INTERRUPTED` task, including one that was already interrupted,
|
|
295
320
|
is prepared with `retry --no-dispatch`. `run` then starts again, detached, from
|
|
296
321
|
`run.flags.json`. Output goes to `resume-<epoch>.log`; the exit code is written to
|
|
297
322
|
`resume-<epoch>.done` when the run ends. A launch that fails exits 1.
|
|
298
323
|
|
|
324
|
+
The same recovery is done one level down, in the sub-plan of every split task whose subtasks
|
|
325
|
+
have not merged into the task yet: a subtask left `RUNNING` is saved, reset and marked
|
|
326
|
+
`INTERRUPTED` under that sub-plan's own lock, and every `INTERRUPTED` subtask is prepared.
|
|
327
|
+
Those rows carry `plan`, the sub-plan's directory. A sub-plan another command holds is left
|
|
328
|
+
alone, with a warning.
|
|
329
|
+
|
|
299
330
|
`run` writes `run.flags.json` at each real start. A dry run and a `retry` do not, and a
|
|
300
331
|
split or rerun does not copy it. The fields are `retry_failed`, `infra_retries`, `sweep`,
|
|
301
332
|
`sweep_max`, `sweep_plausible`, `sweep_ahead`, `max_parallel`, `timeout`, `verify`,
|
|
302
|
-
`
|
|
333
|
+
`argv` and `at`. `retry_failed` and `infra_retries` are the budgets the
|
|
303
334
|
scheduler removes when it stops (`retry_budget`, `infra_budget`, and each task's
|
|
304
335
|
`retry_budget`), so resume can pass them again. Resume rebuilds the `run` command from
|
|
305
336
|
those fields; it does not replay `argv` as typed. A run from before 0.19 has no file:
|
|
@@ -355,6 +386,39 @@ forge control add <plan-dir> docs-fix # queue a row you appended to
|
|
|
355
386
|
forge control accept <plan-dir> docs --reason "the P2 is a test-only nit" --approved # queue an accept
|
|
356
387
|
```
|
|
357
388
|
|
|
389
|
+
To tell an implementer something, queue a message for the task's next attempt (no live run needed):
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
forge control steer <plan-dir> docs "keep the old function name; callers outside this repo use it"
|
|
393
|
+
forge control steer <plan-dir> docs --file note.md # or --file - for stdin; 1 to 8000 characters
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
A message starts nothing. It waits in `tasks/<id>/steer.jsonl` until the task's next implementer
|
|
397
|
+
attempt starts, whatever starts it (the run's own retry, `forge control retry`, a resume), and goes
|
|
398
|
+
into that attempt's prompt beside any review findings; the reviewer of that attempt sees it too, as
|
|
399
|
+
part of the requirements. A running attempt is not interrupted. `control.log` records `steer` (the
|
|
400
|
+
length and a hash, never the text) and `steer-delivered` with the attempt.
|
|
401
|
+
|
|
402
|
+
A claude or openclaude implementer also takes a message **while it runs** (#252):
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
forge control steer <plan-dir> docs "the fixture is wrong, not the code" --now
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
`--now` gives the message to the task's running implementer at its next tool call, inside the same
|
|
409
|
+
turn, without stopping it. Those implementers start with `--input-format stream-json
|
|
410
|
+
--replay-user-messages`: forge feeds the prompt as the first message, then each `--now` message, and
|
|
411
|
+
the log replays each one where the CLI took it in. `--now` is refused (exit 3) when the task has no
|
|
412
|
+
implementer running live, so nothing is queued by mistake: another harness, Windows, a CLI whose help
|
|
413
|
+
lacks the flags, `FORGE_LIVE_STEER=off`, or no attempt running. A message that arrives after the
|
|
414
|
+
model's final result goes back to the queue for the next attempt. `control.log` records `steer`
|
|
415
|
+
(value `live`) and `steer-sent` with the attempt, and the message joins that attempt's messages with
|
|
416
|
+
`mode: live`, so its reviewer sees it too. Because the CLI's input stays open, forge ends the
|
|
417
|
+
implementer `FORGE_LIVE_GRACE` seconds (default 10) after its final result when no background task is
|
|
418
|
+
open; with one open, the result grace below applies. The attempt is marked steered in forge-ui and in the dataset,
|
|
419
|
+
and `forge dataset routing`, `reviewers`, `pairs` and `export` leave a steered task out from its
|
|
420
|
+
first steered attempt on unless given `--include-steered`. forge-ui's leaderboard censors those attempts.
|
|
421
|
+
|
|
358
422
|
A stop skips verification and exits 130, unless every task had merged by then, and a drain
|
|
359
423
|
with nothing left to start lets the run end as usual: both act on work still to do.
|
|
360
424
|
`retry` and `add` only queue a request in `control.requests/`; the scheduler applies or refuses
|
|
@@ -373,8 +437,11 @@ live run which `forge control` command to use instead.
|
|
|
373
437
|
|
|
374
438
|
Editing a task's `prompt.md` or `approach.md` while a run is going is allowed. An attempt
|
|
375
439
|
already running is not reviewed against the new text: it is marked `STALE` and re-dispatched
|
|
376
|
-
with the new requirements, and the attempt is not spent.
|
|
377
|
-
|
|
440
|
+
with the new requirements, and the attempt is not spent. An edit made while the attempt is
|
|
441
|
+
being reviewed is treated the same way: that review's verdict does not count, and its findings go to
|
|
442
|
+
the next attempt for reference. `control.log` records `prompt-changed` with actor `scheduler` for
|
|
443
|
+
every brief change, whenever it lands: one made between attempts or while the task waits is logged
|
|
444
|
+
when its next attempt starts. See [failures that are the plan's](reviews.md#failures-that-are-the-plans).
|
|
378
445
|
|
|
379
446
|
Each change is validated, written under `control.lock`, and says when it applies:
|
|
380
447
|
|
|
@@ -399,7 +466,7 @@ Each change is validated, written under `control.lock`, and says when it applies
|
|
|
399
466
|
says a pin waits (`pinned; after the QA-only re-run`) only when the next entry really
|
|
400
467
|
re-runs QA: a `resume` marker, or an unreviewed verdict, that still matches the
|
|
401
468
|
worktree. A marker the next retry will discard is reported as `pinned`.
|
|
402
|
-
|
|
469
|
+
A MERGED task refuses one.
|
|
403
470
|
- **Who decided an escalation.** The last column of `tasks/<id>/escalations.tsv` is `policy`
|
|
404
471
|
(`--escalate-after`), `retry` (a typed `retry --dwarf`), `pin` or `fallback`
|
|
405
472
|
(`--infra-fallback` moved a task off a model at capacity); rows from before it was added
|
|
@@ -416,6 +483,110 @@ Every change is appended to `control.log` (one JSON line: `at`, `actor` `cli` or
|
|
|
416
483
|
human interventions are on the record next to what the policy did. Setting a control to the
|
|
417
484
|
value it already has changes and logs nothing.
|
|
418
485
|
|
|
486
|
+
## Splitting a task into subtasks
|
|
487
|
+
|
|
488
|
+
A task can itself be split, and so can each of its subtasks: goal, plans, tasks and subtasks
|
|
489
|
+
follow one rule at every level. Nothing outside forge is needed.
|
|
490
|
+
|
|
491
|
+
A split task's subtasks are a plan of their own, in `<plan-dir>/tasks/<id>/sub`. They are routed
|
|
492
|
+
with the plan's difficulty pools, each owns paths inside the task's `files`, they depend only on
|
|
493
|
+
each other, and they run on the same scheduler under the run's one `--max-parallel`. Each
|
|
494
|
+
subtask is built in its own worktree and reviewed against its own prompt. When every subtask has
|
|
495
|
+
merged, their work is brought onto the task's branch and **the task is reviewed once more, on
|
|
496
|
+
the whole diff**, against the task's own prompt. Only then does the task merge into the run.
|
|
497
|
+
|
|
498
|
+
There are three ways a task gets split. None is forced: keeping a task whole is always a valid
|
|
499
|
+
answer, and it is recorded with its reason.
|
|
500
|
+
|
|
501
|
+
| Who | How | Recorded as decided by |
|
|
502
|
+
|---|---|---|
|
|
503
|
+
| the planner, when it plans | a task of its reply carries `subtasks` (and a one-line `reason`); `plan` makes the sub-plan and shows it under the table | `planner` |
|
|
504
|
+
| you, for a task that stopped | `retry <plan-dir> <id> --decide split --subtasks FILE --reason "…" --approved`, or `--planner SPEC` instead of the file to ask a planner | `user` |
|
|
505
|
+
| the run, when you asked for it | `run --auto-split [--split-planner SPEC]`: a task that stops for a decision with `split` among its reasons is split by the planner without waiting | `auto` |
|
|
506
|
+
|
|
507
|
+
Without `--auto-split`, a task that stops on `split` waits for your choice, as every
|
|
508
|
+
`NEEDS_DECISION` does. Its `decision.md` names the split among the choices.
|
|
509
|
+
|
|
510
|
+
```bash
|
|
511
|
+
# the subtasks, as a forge-plan block or its bare JSON (forge-planner.py node-prompt describes it)
|
|
512
|
+
cat > /tmp/halves.md <<'JSON'
|
|
513
|
+
{"reason": "the parser and the docs can be reviewed apart",
|
|
514
|
+
"tasks": [
|
|
515
|
+
{"id": "parser", "deps": [], "difficulty": "medium", "files": ["src/config.py"],
|
|
516
|
+
"title": "Parse the limits section", "approach": "",
|
|
517
|
+
"prompt": "…\n\n## Acceptance criteria\n\n- …"},
|
|
518
|
+
{"id": "docs", "deps": ["parser"], "difficulty": "low", "files": ["docs/config.md"],
|
|
519
|
+
"title": "Document the limits section", "approach": "",
|
|
520
|
+
"prompt": "…\n\n## Acceptance criteria\n\n- …"}]}
|
|
521
|
+
JSON
|
|
522
|
+
bash scripts/forge-parallel.sh retry "$PLAN" config --decide split --subtasks /tmp/halves.md \
|
|
523
|
+
--reason "two halves that can be reviewed apart" --approved
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
`retry --decide split` makes the sub-plan and runs it, then reviews the task. With
|
|
527
|
+
`--no-dispatch` it only makes it, and the next `run` runs it. On a live run, use
|
|
528
|
+
`forge control retry <plan-dir> <id> --decide split --subtasks FILE --reason "…" --approved`:
|
|
529
|
+
the scheduler makes the split and runs it. The split is refused, and nothing changes, when a
|
|
530
|
+
subtask's file is outside the task's `files`, a dependency is not a sibling, the ids repeat or
|
|
531
|
+
form a cycle, or the task is `MERGED`, `RUNNING` or already split. One task in the answer means
|
|
532
|
+
"keep it whole": that is recorded, and the task stays as it was.
|
|
533
|
+
|
|
534
|
+
**The task's existing work.** `--decide split` keeps it: the subtasks start from the task's
|
|
535
|
+
branch as it stands and are told what the last review found. `--decide split=fresh` starts over
|
|
536
|
+
from the task's base; the earlier work stays on `refs/forge/kept/<run>/<id>`.
|
|
537
|
+
|
|
538
|
+
**Limits.** Three limits bound every split. `plan` shows them under the task table, so they are
|
|
539
|
+
approved with the plan, and the first `run` freezes them: a later `plan` that would change one is
|
|
540
|
+
refused.
|
|
541
|
+
|
|
542
|
+
| Flag (on `plan`) | Default | Bounds |
|
|
543
|
+
|---|---|---|
|
|
544
|
+
| `--split-depth N` | 2 | levels of subtasks below a task of the plan; `0` turns splitting off |
|
|
545
|
+
| `--split-children N` | 6 | subtasks one split may make |
|
|
546
|
+
| `--split-nodes N` | 24 | subtasks in the whole run, over every level |
|
|
547
|
+
|
|
548
|
+
A split that would pass a limit is not made. The task is recorded as `bounded`, with the limit
|
|
549
|
+
it met, and runs as one task.
|
|
550
|
+
|
|
551
|
+
**When a subtask fails.** The task waits (`BLOCKED`, with the subtasks it waits for in
|
|
552
|
+
`tasks/<id>/sub.waiting`); no attempt of the task is spent. Retry the subtask in its own plan,
|
|
553
|
+
then run the plan again:
|
|
554
|
+
|
|
555
|
+
```bash
|
|
556
|
+
bash scripts/forge-parallel.sh retry "$PLAN/tasks/config/sub" docs
|
|
557
|
+
bash scripts/forge-parallel.sh run "$PLAN"
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
`run --retry-failed N` and `--infra-retries M` apply to the subtasks too. Retrying the task
|
|
561
|
+
itself continues its subtasks: accepted decisions are kept and no subtask is made twice.
|
|
562
|
+
|
|
563
|
+
**Reading the tree.** `forge runs tree <plan-dir>` prints every level with each node's status,
|
|
564
|
+
decision and reason, and where each sub-plan is. `forge control show`, `forge handoff` and
|
|
565
|
+
`forge watch` list subtasks by path (`config/docs`). forge-ui shows the tree on the task, with
|
|
566
|
+
the decision, who made it, its reason, the model, the tokens and the diff of every node. A
|
|
567
|
+
subtask is a task of its sub-plan, so every command that takes a plan dir and a task id works
|
|
568
|
+
on it: `forge control pin <plan-dir>/tasks/config/sub docs sol:high`.
|
|
569
|
+
|
|
570
|
+
The record is `decomposition.json` in each plan of the tree: one node per task with `decision`
|
|
571
|
+
(`atomic`, `split` or `bounded`), `reason`, `by` (`planner`, `user`, `auto` or `default`) and
|
|
572
|
+
the limits in force when it was decided. The root plan's file also holds `limits` and `frozen`.
|
|
573
|
+
|
|
574
|
+
## A goal larger than one plan
|
|
575
|
+
|
|
576
|
+
A planner that finds the goal too large for one plan plans the first coherent stage and lists
|
|
577
|
+
the stages that follow in `later` (a title and a goal each). `plan` shows them under the table.
|
|
578
|
+
When the plan has merged, plan the next stage:
|
|
579
|
+
|
|
580
|
+
```bash
|
|
581
|
+
bash scripts/forge-parallel.sh next "$PLAN" # the new plan dir is <first plan dir>-<stage>, or name one
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
`next` refuses unless every task of `$PLAN` is `MERGED`. The new plan starts from `$PLAN`'s
|
|
585
|
+
integration branch (as `plan --after` does), takes its pools, options and limits, and is planned
|
|
586
|
+
by the same planner (`--planner SPEC` names another) from the code as it now is. It stops at the
|
|
587
|
+
table: each plan of a chain is approved on its own, then run. `integrate --approved` on the
|
|
588
|
+
last plan brings the whole chain.
|
|
589
|
+
|
|
419
590
|
## Splitting and combining plans
|
|
420
591
|
|
|
421
592
|
`run --retry-failed N` removes most of the reason to split a plan (a failed task no longer holds
|
|
@@ -427,8 +598,8 @@ instead of hand-built git plumbing:
|
|
|
427
598
|
findings, reviewed commit, status) into a new plan: their branches and worktrees are renamed to
|
|
428
599
|
the new run (`forge/<new>/<id>`), the new integration branch starts at the source's accepted
|
|
429
600
|
tip, dependencies on already-merged tasks are dropped, and the source forgets the moved rows
|
|
430
|
-
(`split-<new>.txt` records them). It refuses — changing nothing — for a
|
|
431
|
-
MERGED or RUNNING task, a selection that leaves a dependent behind, or a dependency that is
|
|
601
|
+
(`split-<new>.txt` records them). It refuses — changing nothing — for a plan made with Fractal
|
|
602
|
+
(removed in forge 0.23), a MERGED or RUNNING task, a selection that leaves a dependent behind, or a dependency that is
|
|
432
603
|
neither moving nor merged. Copy first, delete last; an interrupted split rolls back.
|
|
433
604
|
- `combine <new-plan> <plan-a> <plan-b>…` joins plans whose tasks are **all `MERGED`** into one
|
|
434
605
|
plan: a new integration branch merges each source's, the per-task records are copied, and
|
|
@@ -446,9 +617,12 @@ in the summary and in the QA prompt:
|
|
|
446
617
|
|
|
447
618
|
```
|
|
448
619
|
scope drift (touched files the task did not declare):
|
|
449
|
-
auth src/db.py
|
|
620
|
+
auth src/db.py docs/auth.md (named in the brief)
|
|
450
621
|
```
|
|
451
622
|
|
|
623
|
+
A path the task's brief names, as when you added it to `prompt.md` mid-run, is marked
|
|
624
|
+
`(named in the brief)`, so an approved scope change reads apart from drift nothing explains.
|
|
625
|
+
|
|
452
626
|
Never a failure — a dwarf that genuinely needed one more file did the right thing. What it
|
|
453
627
|
buys is that a merge `CONFLICT` two waves later arrives with its cause already named.
|
|
454
628
|
|
package/docs/development.md
CHANGED
|
@@ -14,7 +14,7 @@ forge/
|
|
|
14
14
|
├── docs/ the full documentation, one page per topic
|
|
15
15
|
├── LICENSE MIT
|
|
16
16
|
├── package.json the npm package: its name, version and the files it ships
|
|
17
|
-
├── forge launcher, on PATH from npm: `forge install`, `
|
|
17
|
+
├── forge launcher, on PATH from npm: `forge install`, `jev`, `dataset` and `ui`
|
|
18
18
|
├── scripts/
|
|
19
19
|
│ ├── forge-dispatch.sh resolve a spec → run one role on one harness
|
|
20
20
|
│ ├── forge-solo.sh the whole single-task run: dwarf → diff → qa
|
|
@@ -29,11 +29,10 @@ forge/
|
|
|
29
29
|
│ ├── forge-guard.py implementer guards: session wrapper, orphan reaping, promise scan
|
|
30
30
|
│ ├── forge-verify-coverage.py suites the project defines that the verify command skips
|
|
31
31
|
│ ├── forge-memory.sh inject / note / record / spend project memory
|
|
32
|
-
│ ├── forge-
|
|
33
|
-
│ ├──
|
|
34
|
-
│ ├── forge-
|
|
35
|
-
│ ├──
|
|
36
|
-
│ ├── forge_fractal/ nested execution, recovery, inspection and dashboard
|
|
32
|
+
│ ├── forge-lib-decompose.sh subtasks: a split task's sub-plan, `retry --decide split`, `run --auto-split`, `next`
|
|
33
|
+
│ ├── forge_decompose.py the node model of a split: limits, validation, the tree, `decomposition.json`
|
|
34
|
+
│ ├── forge-planner.py the planner's prompt and the strict parse of its reply (tasks, subtasks, later stages)
|
|
35
|
+
│ ├── forge_legacy.py read-only compatibility for runs made with Fractal, removed in 0.23
|
|
37
36
|
│ ├── forge-compare.py `forge runs rerun|compare`: a plan under another implementer, side by side
|
|
38
37
|
│ ├── forge-ui.py `forge ui open|status|stop`: the one shared forge-ui server
|
|
39
38
|
│ ├── forge-ui-options.sh `--ui|--no-ui` and the fail-open launch, sourced by the runners
|
|
@@ -43,13 +42,16 @@ forge/
|
|
|
43
42
|
│ ├── forge_dataset/ the run dataset: capture hooks, readers, importer, status checks
|
|
44
43
|
│ ├── forge-pr.py `forge pr`: a draft PR description for a finished run (reads with forge-ui's reader)
|
|
45
44
|
│ └── forge-install.sh install into every harness that needs it (opencode and grok find it themselves)
|
|
46
|
-
├── ui/ forge-ui:
|
|
45
|
+
├── ui/ forge-ui: local run viewer (`forge_ui` package, tests, API contract)
|
|
47
46
|
├── site/ the website and plain-language docs, published by GitHub Pages (see site/README.md)
|
|
48
47
|
└── references/
|
|
49
48
|
├── ui.md forge-ui: commands, env vars, shared server, state, privacy
|
|
50
49
|
├── harnesses.md per-harness invocation, ladders, failure modes
|
|
51
|
-
├── decompose.md tasks.tsv
|
|
52
|
-
├──
|
|
50
|
+
├── decompose.md planning a decomposed run: tasks.tsv, routing, waves, plan gates, plan shape
|
|
51
|
+
├── decompose-review.md QA verdicts, opt-in review modes, severity and known issues
|
|
52
|
+
├── decompose-recovery.md retries, NEEDS_DECISION, INFRA stops, accept, split and combine
|
|
53
|
+
├── decompose-integration.md chained plans, branches and worktrees, verification
|
|
54
|
+
├── decompose-opt-in.md groups, retro notes, brief mode, task summaries
|
|
53
55
|
├── memory.md FORGE_LEARNING grammar, promotion and pruning rules
|
|
54
56
|
└── dataset.md the run dataset: what is captured, where, and its invariants
|
|
55
57
|
```
|
|
@@ -57,7 +59,7 @@ forge/
|
|
|
57
59
|
## Offline checks
|
|
58
60
|
|
|
59
61
|
Run `bash tests/check.sh` for offline regression checks. See [tests](../tests/README.md) for skill
|
|
60
|
-
invocation scenarios and verification limits. Three CI workflows: `.github/workflows/test.yml` runs `tests/check.sh` on every pull request (Ubuntu
|
|
62
|
+
invocation scenarios and verification limits. Three CI workflows: `.github/workflows/test.yml` runs `tests/check.sh` on every pull request (Ubuntu with Python 3.9, and Windows with Git Bash; documentation-only changes skip it) and on every push to `dev` (also the latest 3.x on Ubuntu, and macOS with the system Bash 3.2), `.github/workflows/pages.yml` builds and publishes the website ([site/README.md](../site/README.md)), and `.github/workflows/npm-publish.yml` publishes the package to npm when a GitHub Release is published (npm trusted publishing, no token).
|
|
61
63
|
|
|
62
64
|
## Runtime efficiency and measurement
|
|
63
65
|
|
package/docs/forge-ui.md
CHANGED
|
@@ -60,7 +60,7 @@ Claude's session file on this machine.
|
|
|
60
60
|
|
|
61
61
|
The *Verification* node opens the run's verification in the inspector. While it runs you see
|
|
62
62
|
for how long, the step a lane announced (`::forge step`, see
|
|
63
|
-
[verification lanes](../references/decompose.md#execution-checks-and-integration-verification))
|
|
63
|
+
[verification lanes](../references/decompose-integration.md#execution-checks-and-integration-verification))
|
|
64
64
|
and its last printed line, a warning after five minutes with no output, and the live output of
|
|
65
65
|
the lane that printed last (or of the one you choose). Once it fails, the failing tests come
|
|
66
66
|
first, by lane and marked new or known (from the lanes' JUnit or TAP reports), each with its
|
|
@@ -80,6 +80,10 @@ 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 whose scheduler died (a crash, a killed terminal) reads as stopped: the tasks it left running
|
|
84
|
+
show as `INTERRUPTED`, *stopped: no live scheduler*, with `forge handoff resume <plan>` to pick it
|
|
85
|
+
up; the clock stops, Projects no longer counts the run as live and its worktrees are no longer in use.
|
|
86
|
+
|
|
83
87
|
A run with `groups.tsv` shows a Groups block after the task table. Each row is the group's title
|
|
84
88
|
and goal, "one review" or "per-task review", its reviewer and its members. A review group's
|
|
85
89
|
title opens `#/runs/<key>/group/<gid>`, and that row also shows the status, the round and who
|
|
@@ -110,6 +114,9 @@ already started` when the task had already started. The marker's reason (`change
|
|
|
110
114
|
`dependent`) is the badge's tooltip. The summaries switch sits with that list.
|
|
111
115
|
A run with a retro report or notes shows a Retro section in its run details: the note counts on one line,
|
|
112
116
|
then the report, collapsed.
|
|
117
|
+
A run someone drove with `forge handoff` shows a Handoff section there too: the driver (harness,
|
|
118
|
+
session, since when, last seen, and *stale* once it is over 12 hours old, when another session may
|
|
119
|
+
claim the run), then the session notes, newest first.
|
|
113
120
|
|
|
114
121
|
A task that stopped `NEEDS_INPUT` opens *Waiting for you*: the question from `tasks/<id>/needs_input.md`,
|
|
115
122
|
and a `forge-parallel.sh retry … --answer` command to copy. On a plan, when the server can write, an
|
|
@@ -139,6 +146,19 @@ the sweep fixed and lists what it left for `forge issues`, with each reason.
|
|
|
139
146
|
|
|
140
147
|
A review the reviewer passed but forge failed, because it listed a blocking CONFIRMED finding, shows a red `forge: FAIL (reviewer said PASS)` chip in the *Review findings* section.
|
|
141
148
|
|
|
149
|
+
A task that was [split into subtasks](decomposed-runs.md#splitting-a-task-into-subtasks) has a
|
|
150
|
+
*Decomposition* section: the decision (split, kept whole, or kept whole at a limit), who made it
|
|
151
|
+
(the planner, you, or the run with `--auto-split`) and its reason, then every subtask below it
|
|
152
|
+
as a tree, through every level. Each node shows its status, model, difficulty, attempts and
|
|
153
|
+
tokens (forge records tokens, not prices) and links to its diff; a node opens as a task of its
|
|
154
|
+
own, with its attempts, reviews and controls. The section says whether the subtasks' work is on
|
|
155
|
+
the task's branch yet, which subtasks the task is waiting for, and whether the split started
|
|
156
|
+
over from the task's base. Rest the pointer on a decision to read what it means. A task the
|
|
157
|
+
planner kept whole shows the reason it gave; a task nobody decided about shows nothing. The
|
|
158
|
+
run's details show the limits every split works within and how much of the run was split, and,
|
|
159
|
+
for a goal larger than one plan, which stage this plan is and the stages after it. A sub-plan is
|
|
160
|
+
not listed among the runs: it opens from its task, and links back to it.
|
|
161
|
+
|
|
142
162
|
### Controls
|
|
143
163
|
|
|
144
164
|
forge-ui reads everything, and it changes things only by calling forge's own commands: it
|
|
@@ -231,8 +251,8 @@ press the button, with no dry run. The HTTP shapes are in
|
|
|
231
251
|
Each asks you to confirm first, with no dry run; the confirm names the checkouts and, for an edit,
|
|
232
252
|
the old text and the new. Add and edit are documented with
|
|
233
253
|
[`forge memory forget`](commands.md#forge-memory-forget). Under `--read-only` the tab still shows
|
|
234
|
-
the learnings, hides the checkboxes, Forget, Add and Edit, and
|
|
235
|
-
to copy. Reachable from the header, a run's repository name and each map district.
|
|
254
|
+
the learnings, hides the checkboxes, Forget, Add and Edit, and gives each row a *Commands*
|
|
255
|
+
button that shows its `forge memory edit` and `add` commands to copy, one row at a time. Reachable from the header, a run's repository name and each map district.
|
|
236
256
|
- **Disk (`#/disk`):** what forge takes on disk in every repository it has runs for (each run dir's
|
|
237
257
|
review snapshots, logs and anything forge does not create, each run's worktree folder, the data home),
|
|
238
258
|
what can go without losing a run, and the command that takes it back (`forge runs compact --logs`),
|
|
@@ -283,6 +303,15 @@ press the button, with no dry run. The HTTP shapes are in
|
|
|
283
303
|
- **Summaries:** a switch above a plan's task table turns summaries on or off for the run. A task's own
|
|
284
304
|
switch, in its Summary section, sets it to *On*, *Off* or *Inherit* (the run's setting). Each change is
|
|
285
305
|
confirmed first. Turning them on for a finished run starts `forge summarize` in the background.
|
|
306
|
+
Beside the run's switch, the model they use (or *no model set*) and a field that sets the run's own
|
|
307
|
+
(`forge control set summaries-model`): a planned run never reads `forge config set summaries.model`
|
|
308
|
+
again, and *On* is refused, with that reason, while the run has no model.
|
|
309
|
+
- **Message for the next attempt:** a task that has not merged has a box that queues a message for its
|
|
310
|
+
next implementer attempt (`forge control steer`), and lists the ones waiting. It starts nothing. An
|
|
311
|
+
attempt that got messages has a *steered* mark on its line of the attempt trail. While the task's
|
|
312
|
+
claude or openclaude implementer runs live, the box also has *Send now* (`forge control steer
|
|
313
|
+
--now`), which gives it the message at its next tool call, and the conversation shows each message
|
|
314
|
+
sent that way where the implementer took it in (*Your message*, *sent live*).
|
|
286
315
|
- **Brief answers and proposals:** each brief question in a task's inspector has an answer box, and *Send* records the
|
|
287
316
|
answer (`forge brief answer`, logged as `ui`). A late answer, given after the task started, shows the
|
|
288
317
|
CLI's notice under its question. An answered parked `wave` or `plan` question has *Propose a change*
|
|
@@ -304,7 +333,7 @@ button stays (worktree commands, compact commands, the `forge findings` and `for
|
|
|
304
333
|
commands, the triage commands, and the `retry --answer` command on a waiting task). `FORGE_UI_READONLY=1 forge ui open` starts such a
|
|
305
334
|
server, and the launcher never reuses a server running in the other mode; it replaces it.
|
|
306
335
|
|
|
307
|
-
Also: replay, critical path,
|
|
336
|
+
Also: replay, critical path, the tree of a split task's subtasks, quick jump (Ctrl K, ⌘K on a Mac, or
|
|
308
337
|
`/`), a bell for runs that finish or fail, failed tasks and final-review verdicts (with opt-in
|
|
309
338
|
browser notifications), and a run exported as one HTML file that opens without forge-ui, with
|
|
310
339
|
prompts, diffs and local paths left out unless you choose them.
|
package/docs/install.md
CHANGED
|
@@ -6,10 +6,38 @@ Install forge from npm or a git checkout, check which agent CLIs it can reach, a
|
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
9
|
-
forge runs on macOS and
|
|
10
|
-
CLIs you route models through; the doctor below shows which ones it finds. Installing from
|
|
9
|
+
forge runs on macOS, Linux, and Windows. It needs bash, git and Python 3.9 or later, plus the
|
|
10
|
+
agent CLIs you route models through; the doctor below shows which ones it finds. Installing from
|
|
11
11
|
npm brings none of these with it.
|
|
12
12
|
|
|
13
|
+
### Windows
|
|
14
|
+
|
|
15
|
+
On Windows, forge runs natively through Git Bash (`bin/forge.js` for npm, `forge.cmd` for CMD or
|
|
16
|
+
PowerShell) and standard Windows Python 3.9+ (no WSL or MSYS2 Python install is required).
|
|
17
|
+
This is native mode, the default. MSYS2 mode, opt-in, runs forge inside MSYS2 instead:
|
|
18
|
+
see [Windows: MSYS2 mode](#windows-msys2-mode).
|
|
19
|
+
|
|
20
|
+
- **Prerequisites:** [Git for Windows](https://gitforwindows.org/) (provides `git` and Git Bash)
|
|
21
|
+
and native Python 3.9 or later on `PATH` (or discoverable via `py -3`).
|
|
22
|
+
- **`FORGE_BASH`:** If Git Bash lives in a non-standard location, set `FORGE_BASH` to the full
|
|
23
|
+
path of your `bash.exe`; forge ignores Windows `System32\bash.exe` / `WindowsApps` WSL stubs.
|
|
24
|
+
- **`python3` shim:** When `python3` resolves to the Microsoft Store alias, forge writes a
|
|
25
|
+
per-user wrapper in `%LOCALAPPDATA%\forge\bin` (`python3` and `python3.cmd`) pointing at your
|
|
26
|
+
installed `python` or `py -3`.
|
|
27
|
+
- **Known platform differences:**
|
|
28
|
+
- Skill links under `.claude`, `.codex`, and `.openclaude` use NTFS directory junctions
|
|
29
|
+
(`mklink /J`), which do not require Administrator privileges or Developer Mode; Antigravity still
|
|
30
|
+
receives a copied directory, so re-run `forge install` / `forge update` after pulling changes.
|
|
31
|
+
- Process-tree termination (timeouts, Ctrl-C, orphan reaping) uses Win32 Job Objects and
|
|
32
|
+
`TerminateProcess` because Windows lacks POSIX `SIGTERM`/`os.killpg`, so background helpers are
|
|
33
|
+
ended forcefully rather than via a graceful shutdown signal. Because `ProcessJob.attach` runs
|
|
34
|
+
right after `Popen`, a grandchild spawned in the first few milliseconds can escape the job
|
|
35
|
+
(cleanup is best-effort), and killing the scheduler abruptly ends running tasks attached to its
|
|
36
|
+
Job Object rather than leaving them in separate sessions as on macOS/Linux.
|
|
37
|
+
- `O_NOFOLLOW` / `O_DIRECTORY` symlink checks fall back to `os.lstat` (reparse-point) checks
|
|
38
|
+
before open, which is best-effort rather than kernel-atomic, and POSIX `chmod` permission bits
|
|
39
|
+
are not enforced natively on Windows.
|
|
40
|
+
|
|
13
41
|
## From npm
|
|
14
42
|
|
|
15
43
|
```bash
|
|
@@ -46,9 +74,88 @@ Clone anywhere you like — the installer works out its own location and links f
|
|
|
46
74
|
`~/.claude/skills/forge` is just the tidiest home: claude reads that path directly, and
|
|
47
75
|
opencode and grok scan it on their own.
|
|
48
76
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
77
|
+
On a terminal, the installer ends with `forge setup`: one short pass over what a first run needs
|
|
78
|
+
(the models that build and review, review preferences, brief and summaries, forge-ui, project
|
|
79
|
+
memory, decision models, storage, the update check and Ripwire), saved as defaults so the first
|
|
80
|
+
`/forge` run asks none of it. Once it is done the installer skips it, and `forge update`
|
|
81
|
+
never runs it. Without a terminal the installer prints the command instead.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
forge setup # change the answers; Enter keeps each one
|
|
85
|
+
forge setup show # every answer, where it lives, and the command that changes it
|
|
86
|
+
forge setup --defaults # the recommended answers, no prompts
|
|
87
|
+
forge setup export > s.json # the same answers for another machine: forge setup --from s.json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Setup never calls a model and sends nothing anywhere unless an answer says it will. Declining an
|
|
91
|
+
add-on, or one failing to install, never fails the install. See [setup](../references/setup.md)
|
|
92
|
+
for every answer.
|
|
93
|
+
|
|
94
|
+
forge needs no runtime beyond the harness CLIs. Fractal, the optional backend earlier versions
|
|
95
|
+
could install, was removed in forge 0.23: splitting a task into subtasks is part of forge
|
|
96
|
+
itself ([Splitting a task into subtasks](decomposed-runs.md#splitting-a-task-into-subtasks)).
|
|
97
|
+
`forge du` shows what an old Fractal runtime left on disk.
|
|
98
|
+
|
|
99
|
+
## Windows: MSYS2 mode
|
|
100
|
+
|
|
101
|
+
On Windows forge has two modes. Native mode, the default, runs it in Git Bash with Windows' own
|
|
102
|
+
Python. MSYS2 mode runs it inside [MSYS2](https://www.msys2.org/) instead, where bash, git,
|
|
103
|
+
python3 and ps agree on process IDs, process groups, signals, `flock` and symlinks as they do on
|
|
104
|
+
Linux. MSYS2 mode is opt-in:
|
|
105
|
+
|
|
106
|
+
- Set `FORGE_WIN_MODE=msys2` where forge starts, and start forge from Git Bash as usual: each
|
|
107
|
+
entry script re-runs itself inside MSYS2, and the agent CLIs still get the `PATH` they had in
|
|
108
|
+
Git Bash. For Claude Code, put the variable under `"env"` in `~/.claude/settings.json`; for a
|
|
109
|
+
terminal, in your shell profile.
|
|
110
|
+
- Or start forge from an MSYS2 shell. There it always runs in MSYS2 mode.
|
|
111
|
+
|
|
112
|
+
`FORGE_WIN_MODE` is `native` (the default) or `msys2`; any other value stops forge with an error.
|
|
113
|
+
|
|
114
|
+
To set MSYS2 mode up:
|
|
115
|
+
|
|
116
|
+
1. Install MSYS2 in `C:\msys64`, or set `FORGE_MSYS2_ROOT` to where it is. In an MSYS2 shell:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pacman -Syu
|
|
120
|
+
pacman -S python git procps-ng diffutils
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
2. Use Git 2.48 or newer, both MSYS2's and the Git for Windows the agent CLIs use. forge's
|
|
124
|
+
worktrees link back to your repository with relative paths, which marks the repository as
|
|
125
|
+
needing Git 2.48 (`extensions.relativeWorktrees` in its config): older Git, and libgit2- or
|
|
126
|
+
JGit-based tools such as some IDEs, then refuse to open it. forge checks both versions and
|
|
127
|
+
stops with a message when one is older.
|
|
128
|
+
3. Keep a native Windows Python on the Git Bash `PATH` (`python3`, `python` or `py`): the
|
|
129
|
+
hand-over to MSYS2 goes through it, because two MSYS runtimes cannot pass their environment
|
|
130
|
+
to each other directly.
|
|
131
|
+
4. Turn on Developer Mode in Windows settings, so MSYS2 can create real symlinks.
|
|
132
|
+
5. Clone forge where Claude Code reads skills:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
git clone https://github.com/Giamme/forge.git ~/.claude/skills/forge
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
MSYS2 mode has only been tried from a git checkout: neither the npm package nor
|
|
139
|
+
`scripts/forge-install.sh` (links into the other harnesses) has been tried
|
|
140
|
+
in it.
|
|
141
|
+
|
|
142
|
+
What differs in MSYS2 mode:
|
|
143
|
+
|
|
144
|
+
- File modes are not enforced: MSYS2 mounts Windows drives with `noacl`, so files forge writes
|
|
145
|
+
as 0600 (provider keys, settings) are as private as your user profile, no more.
|
|
146
|
+
- A script task's `tasks/<id>/run` counts as executable when it starts with `#!`.
|
|
147
|
+
- `forge watch` raises no desktop notification, and Ripwire has no Windows build.
|
|
148
|
+
- `stop` recognises a harness by its start time, which Cygwin gives to the second for the first
|
|
149
|
+
24 hours and only to the day after that: past a day, a harness is recognised by the day it
|
|
150
|
+
started.
|
|
151
|
+
|
|
152
|
+
If MSYS2 programs fail at random to start (`0xC0000142`, or `fork: Resource temporarily
|
|
153
|
+
unavailable`), look at Windows' Exploit protection. Cygwin's `fork` rebuilds the parent's memory
|
|
154
|
+
layout in the child, and forced ASLR gets in its way. First exempt MSYS2's own programs: in
|
|
155
|
+
Windows Security, App & browser control, Exploit protection, Program settings, add the programs
|
|
156
|
+
in `C:\msys64\usr\bin` and turn off "Force randomization for images (Mandatory ASLR)" and
|
|
157
|
+
"Randomize memory allocations (Bottom-up ASLR)" for them. Change those settings system-wide only
|
|
158
|
+
as a last resort: that weakens every program on the machine.
|
|
52
159
|
|
|
53
160
|
## Check what forge can reach
|
|
54
161
|
|
|
@@ -91,15 +198,29 @@ with the listed check rather than trusting file placement.
|
|
|
91
198
|
| codex | symlink into **`~/.codex/skills/`** | `codex exec "do you have a skill named forge?"` |
|
|
92
199
|
| opencode | **nothing** — it scans `~/.claude/` itself | `opencode debug skill` |
|
|
93
200
|
| antigravity | `agy plugin install` of a generated wrapper | `agy --print='/forge'` |
|
|
201
|
+
| grok | **nothing** — it lists `~/.claude/skills` itself | `skills` in a headless `init` line |
|
|
94
202
|
|
|
95
203
|
> **The one ongoing caveat:** `agy plugin install` *copies* the files instead of referencing
|
|
96
|
-
> them. The other
|
|
204
|
+
> them. The other five track the source directory live, so an edit reaches them instantly —
|
|
97
205
|
> antigravity keeps running whatever it copied. **Re-run `forge-install.sh` after any edit**,
|
|
98
206
|
> or agy silently runs a stale version.
|
|
99
207
|
|
|
100
208
|
`forge-install.sh --dry-run` prints what it would do and touches nothing. It never clobbers
|
|
101
209
|
a real directory that isn't a symlink.
|
|
102
210
|
|
|
211
|
+
### What invoking the skill pre-approves
|
|
212
|
+
|
|
213
|
+
`SKILL.md`'s `allowed-tools` lists what Claude Code may run without asking during the turn that
|
|
214
|
+
invokes `/forge`: `Read`, and shell commands that start with forge's own entry points (`forge …`,
|
|
215
|
+
`bash <skill dir>/scripts/…`, `python3 <skill dir>/scripts/…`, `<skill dir>/forge …`). Any other
|
|
216
|
+
command, and `Edit` / `Write`, follow your normal permission settings. The field grants, it does not
|
|
217
|
+
restrict: it never takes a tool away. The grant ends at your next message, so the `run` you approve
|
|
218
|
+
after seeing the task table is asked for as usual.
|
|
219
|
+
|
|
220
|
+
openclaude, built from Claude Code, is expected to read the field the same way. Codex, opencode,
|
|
221
|
+
antigravity and grok are not known to read it, so there each command follows that harness's own approval
|
|
222
|
+
settings. This has not been checked against every CLI's current version.
|
|
223
|
+
|
|
103
224
|
## Updating all harness installations
|
|
104
225
|
|
|
105
226
|
Run the updater from your Forge checkout (or through one of its skill symlinks):
|