@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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,39 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and versions follow the format `{major}.{minor}[.{patch}]` ([...] parts appear only when non-zero).
|
|
7
7
|
|
|
8
|
+
## [0.19] - 2026-11-15
|
|
9
|
+
|
|
10
|
+
Group review and wider brief answers; a retry budget per model, scripted tasks, chained plans and forge handoff; early stops for a fix outside the task and for a prompt edited mid-attempt; forge-ui runs its own commands; and forge's website.
|
|
11
|
+
|
|
12
|
+
### Highlights
|
|
13
|
+
|
|
14
|
+
- forge has a website: https://giamme.github.io/forge/, with plain-language docs from install to steering a live run, a route map of a run, and the full reference one link away. It is built from `site/` with no dependencies and published by GitHub Pages; the npm package links to it.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `plan --reviewer-session-rate R` turns the reviewer-session experiment on for a sampled share of the tasks, balanced by difficulty and fixed at plan time, so one run can compare continued and fresh review rounds. The other tasks log `not-sampled` in `review_sessions.tsv`.
|
|
19
|
+
- Brief mode part 2: a task's questions name its group, `--brief-scope wave|plan` lets you answer wider questions, and the answer becomes a proposal (`forge brief propose`). Nothing in the plan changes until you approve its exact diff with `forge brief apply PLAN PID --approve HASH`, or reject it. A wave proposal changes only that group's unstarted tasks; a plan proposal can also add, remove or split tasks. Affected tasks get their questions asked again. Proposals can be approved or rejected in forge-ui too.
|
|
20
|
+
- Opt-in group review (`plan --groups waves --group-review`): related tasks share one QA dispatch over their combined diff. Each finding goes back only to the member whose files it names (or the members a `{tasks=…}` tag names), the group merges in one step once it passes, and a finding that names no member stops the group for your decision (`forge group show|retry`). Groups and their review show in forge-ui. Group dispatches are recorded as `scope=group` and kept out of reviewer statistics. Fewer dispatches are not yet a measured saving.
|
|
21
|
+
- Groups derived with `plan --groups waves` get a title (`Wave N`). The approval table shows each group's title and goal, says which groups have no goal, and `forge group set PLAN GID --goal "…"` (or `--title`) sets one and freezes the groups again, logged in `control.log`.
|
|
22
|
+
- Chained plans (`plan <dir> --after <prev>`): a plan can start from an earlier plan's integration branch, so a second milestone builds on the first before either is integrated. `run` refuses when the earlier plan moved, and `integrate` names the whole chain it brings in.
|
|
23
|
+
- `forge handoff`: another session or another harness can pick up a run. `show` reports what the run is doing and what needs a person, `note` leaves a line for the next session, `claim` records who drives it (a 12-hour lease, `--take-over` to override), and `resume` follows a live scheduler or restarts a stopped run detached with its recorded flags, after saving and resetting tasks left `RUNNING`.
|
|
24
|
+
- A task whose every blocking finding needs a file it does not declare now stops early as `NEEDS_DECISION` (reason `plan`) instead of spending more attempts. The reviewer marks such a finding `{outside=path}`; the implementer can claim one with a `FORGE_BLOCKED: <path>: <why>` line for the reviewer to confirm or refute. `decision.md` names the task that owns each path and the plan edits that fix it (add the file, depend on the owner, or merge the rows).
|
|
25
|
+
- Editing a task's `prompt.md` or `approach.md` while its attempt runs no longer gets the old work reviewed against the new text: the attempt becomes `STALE`, spends nothing, and the implementer is re-dispatched with the new requirements and a diff of what changed. `control.log` records it as `prompt-changed`, and the dataset keeps such attempts out of pass rates.
|
|
26
|
+
- Retry budget per model (`plan --retry-per-model N`): a task may fail N times on each model the retry policy gives it before it moves a tier up, replacing `--escalate-after`. The approval table prints the worst case: the most implementer, reviewer and shadow dispatches the plan can spend if every rung fails.
|
|
27
|
+
- Scripted tasks: a `tasks.tsv` row whose dwarf column is `script` runs the executable `tasks/<id>/run` in its worktree instead of a model, from the task's base on every attempt, under the plan's timeout. A non-zero exit fails the task with no review; otherwise the result is reviewed as a script's output. Codemods and generated files no longer need a model to type them.
|
|
28
|
+
- forge-ui runs its own commands when controls are on: remove finished or failed worktrees in bulk (`forge worktrees rm`), forget memory learnings (`forge memory forget REPO category:key`), compact one run or all runs from the Disk screen, and answer a waiting task's question from the task panel (`forge control retry --answer`, which also prepares the retry itself when no run is live). Read-only mode shows each command to copy instead.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- `terra` now resolves to gpt-6.1-terra. The previous model is still available as `terra-5.6`, and dispatches recorded on it are counted under `terra-5.6` in `forge dataset reviewers`, review history and forge-ui's model leaderboard, never mixed into the new `terra`.
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- forge-ui: each run on the Disk screen links to its run page again. The screen matched runs by path, and its real path often differed from the one the run list uses; it now gets each run's key from the server, and a run dir the run list does not show stays plain text.
|
|
37
|
+
- Reviewers can run tests that need a temporary directory: every read-only dispatch gets a writable temp dir of its own outside the repository (`TMPDIR`, `TMP`, `TEMP`), removed when it ends. On codex the read-only sandbox now allows writes to that directory alone, so test runners such as Vitest no longer stop with `EPERM`.
|
|
38
|
+
- A task whose diff is over 400 KB is reviewed: the reviewer gets the diff's stat and reads the diff in its snapshot, as the whole-run review already does, instead of a prompt its harness refuses. If a harness still refuses a prompt as too large, the task's note says so and points to `adopt` or a split, since a retry would send the same prompt.
|
|
39
|
+
- An implementer whose CLI cancelled its session before it changed anything (grok does this when a tool call needs an approval a headless run cannot give) is now an infrastructure stop: the task waits as `INFRA` with no attempt spent. It used to fail as an empty diff marked never to retry, which also blocked every task that depended on it.
|
|
40
|
+
|
|
8
41
|
## [0.18] - 2026-11-13
|
|
9
42
|
|
|
10
43
|
Around each task and on disk: retro notes, brief mode, task summaries and the task inspector; review snapshots removed after each review, forge runs compact, forge du and the Disk screen, and a list of everything forge puts on disk.
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
<a href="#quick-start">Quick start</a> ·
|
|
19
19
|
<a href="#how-it-works">How it works</a> ·
|
|
20
20
|
<a href="#forge-ui">forge-ui</a> ·
|
|
21
|
+
<a href="https://giamme.github.io/forge/">Website</a> ·
|
|
21
22
|
<a href="docs/README.md">Docs</a> ·
|
|
22
23
|
<a href="CHANGELOG.md">Changelog</a>
|
|
23
24
|
</p>
|
package/SKILL.md
CHANGED
|
@@ -77,7 +77,10 @@ For explanation requests, explain the workflow without spending model quota.
|
|
|
77
77
|
tests also run without its non-test changes, and the reviewer is asked to report any that
|
|
78
78
|
still pass as P2; it needs `.forge/verify-subset` and never changes a result by itself. So is
|
|
79
79
|
`plan --pre-review-tests`: before each review forge runs only the tests the attempt affects
|
|
80
|
-
(`.forge/verify-subset`), and a red attempt goes back to its implementer unreviewed.
|
|
80
|
+
(`.forge/verify-subset`), and a red attempt goes back to its implementer unreviewed. So are
|
|
81
|
+
`plan --groups` and `plan --group-review`: one review can cover several small, related,
|
|
82
|
+
low-risk tasks. Offer them, never add them unprompted, and keep a high-risk task on per-task
|
|
83
|
+
review. Read [Groups and group review](references/decompose.md#groups-and-group-review-opt-in). `plan` explores by default (`--explore 0.2`: now and then
|
|
81
84
|
a row left to forge gets its neighbouring tier's model from the user's pools, odds
|
|
82
85
|
recorded for `forge dataset routing`); say so with the table and pass `--explore 0` when
|
|
83
86
|
the user declines. Retries follow a policy: after three failed attempts on one model the
|
|
@@ -89,7 +92,14 @@ For explanation requests, explain the workflow without spending model quota.
|
|
|
89
92
|
(a threshold, a budget, a model pin, a drain, stop or queued retry; `forge control show <plan>`
|
|
90
93
|
lists them). Never set a control, pin, `drain|stop|retry`, delete a run or compact one with
|
|
91
94
|
`forge control` / `forge runs rm` / `forge runs compact` unless the user asks; `forge du` only reads. Exit `130` / `INTERRUPTED`: the run was signalled or
|
|
92
|
-
stopped; relay the `retry` lines it printed.
|
|
95
|
+
stopped; `forge handoff resume <plan>` carries it on, and relay the `retry` lines it printed to finish by hand.
|
|
96
|
+
- When a session starts on a repo with an active or unfinished run, or the user names one, run
|
|
97
|
+
`forge handoff` first and work from its output. Never start `run` for a run whose scheduler is
|
|
98
|
+
live; continue with `forge handoff resume <plan> --harness <this harness>`, which follows a live
|
|
99
|
+
run and restarts a stopped one with its recorded flags. A Fractal plan is left to `forge fractal
|
|
100
|
+
resume`. Claim the run with the session's harness. Take over another driver only on the user's
|
|
101
|
+
word (`--take-over`). Record what is not on disk (a decision the user made, a hand fix under way)
|
|
102
|
+
with `forge handoff note`.
|
|
93
103
|
- A `waiting for your answer:` block is status `NEEDS_INPUT`: relay each question verbatim and
|
|
94
104
|
pass it with `retry <plan> <id> --answer "<reply>"`. Never answer for the user; nothing else
|
|
95
105
|
resumes it.
|
|
@@ -100,6 +110,10 @@ For explanation requests, explain the workflow without spending model quota.
|
|
|
100
110
|
split choice replaces the row in `tasks.tsv` and is a later `run`
|
|
101
111
|
([when reviews don't converge](references/decompose.md#when-reviews-dont-converge)); do that
|
|
102
112
|
only when the user asks.
|
|
113
|
+
- A group at `NEEDS_DECISION` waits for the user. Present `forge group show <plan>`. Run
|
|
114
|
+
`forge group retry <plan> <gid> --tasks <ids>` only on the user's word: that answers an
|
|
115
|
+
ambiguous decision. An oversized group is split in `groups.tsv` and planned again; do not
|
|
116
|
+
retry it. Nothing else resumes it.
|
|
103
117
|
- Exit `8` / status `INFRA` is an infrastructure stop (`capacity`, `rate_limit`, `usage_limit`,
|
|
104
118
|
`budget`, `auth`, `network`, `provider_down`, `empty` or `cancelled`; an old run may say
|
|
105
119
|
`quota`), not a task failure, and no attempt was spent. Report each "needs you" item with its
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.19
|
package/docs/artifacts.md
CHANGED
|
@@ -58,7 +58,25 @@ A decomposed run adds:
|
|
|
58
58
|
tasks.tsv
|
|
59
59
|
waves.tsv, deferrals.txt
|
|
60
60
|
tasks/<id>/{capsule.md,prompt.md,dwarf.*,qa.*,changes.diff,status}
|
|
61
|
+
tasks/<id>/run executable a dwarf cell of `script` runs
|
|
62
|
+
tasks/<id>/script.log stdout and stderr of that command
|
|
63
|
+
tasks/<id>/attempts/script-<hex>/ one script run (16 hex digits): script.log, the run file, metrics.json
|
|
61
64
|
tasks/<id>/attempt, attempts.tsv attempts spent; one audit row per entry (incl. refunded stops)
|
|
65
|
+
groups.tsv id, review, qa, members, title, goal; absent unless groups are on
|
|
66
|
+
groups.frozen sha256 of the six columns, then each member's deps and files
|
|
67
|
+
group_max_tasks, group_max_diff_kb review-group bounds (defaults 6 members and 256 KB when absent)
|
|
68
|
+
groups/<gid>/status, round, rounds.tsv, merged
|
|
69
|
+
a review=group group's outcome; rounds.tsv is round, epoch, status, implicated, qa spec
|
|
70
|
+
groups/<gid>/candidate.base, candidate.commit, fingerprint, members.tsv, members.paths, combined.diff
|
|
71
|
+
the candidate the one review read; members.tsv is round, task, commit, attempt
|
|
72
|
+
groups/<gid>/qa.input, qa.last, qa.out, qa.gate, qa.round-<n>.last, known_issues.md, infra.txt
|
|
73
|
+
groups/<gid>/attribution.json, decision.md, decision.<round>.md, conflict.files
|
|
74
|
+
groups/<gid>/attempts/qa-<id>/group.round
|
|
75
|
+
the round that QA dispatch reviewed, read by a dataset import
|
|
76
|
+
groups/<gid>/settled.round, settle.tasks, retries.used, invalidated.reason, review.base, merge.out, group.out
|
|
77
|
+
tasks/<id>/reviewed.commit, source.fingerprint
|
|
78
|
+
the commit and worktree fingerprint a review=group member stopped at
|
|
79
|
+
tasks/<id>/settled.group gid and round, once a group FAIL judged this member
|
|
62
80
|
tasks/<id>/known_issues.md, qa.gate findings the threshold tolerated, and the gate's decision (accept, fail or keep)
|
|
63
81
|
sweep/plan.json, plan.md run --sweep: the fix tasks, their findings, and every finding left out with its reason
|
|
64
82
|
tasks/<id>/sweep.json a fix task's findings (S1, S2, ...), each with its source task and key
|
|
@@ -79,7 +97,7 @@ A decomposed run adds:
|
|
|
79
97
|
tasks/<id>/changes.since.diff diff from that commit to the one under review; omitted when there is no such range
|
|
80
98
|
tasks/<id>/changes.since.range the two commits, full hashes
|
|
81
99
|
tasks/<id>/changes.since.stat diff --stat of that range
|
|
82
|
-
tasks/<id>/review_sessions.tsv one row per review round while plan --reviewer-session is on: round, attempt, mode, reason, session id
|
|
100
|
+
tasks/<id>/review_sessions.tsv one row per review round while plan --reviewer-session is on: round, attempt, mode, reason (not-sampled for a task --reviewer-session-rate left out), session id
|
|
83
101
|
tasks/<id>/implementer_sessions.tsv one row per attempt while plan --implementer-session is on: row, attempt, mode (continued|fresh|failed), reason, session id
|
|
84
102
|
tasks/<id>/reviewed.dwarf.{session,resolved} the implementer session that made reviewed.commit, and what it ran as
|
|
85
103
|
tasks/<id>/retry_findings.dwarf.{session,resolved} the same, carried beside the retry findings; what --implementer-session continues
|
|
@@ -90,6 +108,7 @@ A decomposed run adds:
|
|
|
90
108
|
infra_backoff, infra_fallback --infra-backoff's shape; on while --infra-fallback is set
|
|
91
109
|
max_parallel the concurrency limit: written by each run from --max-parallel, changed live by forge control
|
|
92
110
|
reviewer_session holds on; present while plan --reviewer-session is on
|
|
111
|
+
reviewer_session_rate, reviewer_session_tasks --reviewer-session-rate's share, and the task ids it picked (one per line)
|
|
93
112
|
implementer_session holds on; present while plan --implementer-session is on
|
|
94
113
|
<final-review-dir>/review.meta final-review-<epoch>-<pid>/ or integrate-*/final-review/; base=, tip=, source=, spec=, threshold=, integration=, previous=, since=; session= and session_reason= while reviewer_session is set
|
|
95
114
|
control.log one JSON line per human change made with forge control, and per request outcome
|
|
@@ -99,6 +118,7 @@ A decomposed run adds:
|
|
|
99
118
|
infra.paused only while something is paused on infrastructure: {"scopes": [...]}
|
|
100
119
|
control.lock the lock that serialises changes to the plan's control files, created by whichever takes it first (forge control, the scheduler or an escalation record) and left in place
|
|
101
120
|
retry_budget, infra_budget only while a scheduler runs: its live budgets (a number each)
|
|
121
|
+
after absolute path of the plan this one follows (`plan --after`)
|
|
102
122
|
integration.base commit the integration branch started from
|
|
103
123
|
verification.{status,exit,log,command,fingerprint} the combined verification; status PASS, FAIL or INTERRUPTED (a signal stopped it)
|
|
104
124
|
verification.{flaky,retry.log} only when a failing command passed on rerun (lanes: flaky alone, per lane)
|
|
@@ -125,10 +145,14 @@ with worktrees and branches at:
|
|
|
125
145
|
|
|
126
146
|
```
|
|
127
147
|
<repo>/../.forge-worktrees/<run-id>/<task-id> worktree
|
|
148
|
+
<repo>/../.forge-worktrees/<run-id>/_group-<gid> group-review candidate; kept for the merge
|
|
128
149
|
forge/<run-id>/<task-id> task branch
|
|
129
150
|
forge/<run-id>-integration integration branch
|
|
130
151
|
```
|
|
131
152
|
|
|
153
|
+
A group review's files are what each outcome writes. The rules are in
|
|
154
|
+
[Groups and group review](../references/decompose.md#groups-and-group-review-opt-in).
|
|
155
|
+
|
|
132
156
|
`control.log` lines look like
|
|
133
157
|
`{"at": 1761200000.5, "actor": "ui", "action": "set", "task": null, "key": "qa-threshold", "value": "P2", "previous": "P1"}`
|
|
134
158
|
(`actor` is `cli` or `ui`; `action` is `set`, `pin`, `unpin`, `drain`, `resume`, `stop`, `retry` or
|
package/docs/commands.md
CHANGED
|
@@ -15,21 +15,24 @@ harness (`/forge`); this command installs forge and drives its optional tools.
|
|
|
15
15
|
| `forge update` | fast-forward a git checkout and refresh every harness installation; on an npm install it names the npm command instead. See [updating](install.md#updating-all-harness-installations) |
|
|
16
16
|
| `forge version [--check]` | the installed version, and whether a newer release is out |
|
|
17
17
|
| `forge fractal …` | opt-in Fractal execution; see [the command group](fractal.md#forge-fractal-command-group) |
|
|
18
|
-
| `forge runs [--repo DIR \| --all] [--limit N] [--json]` | this repo's recent runs, newest first: run id, kind, age, task states, verification and final review, goal, and the run dir. Read-only; the same summaries forge-ui shows |
|
|
19
|
-
| `forge
|
|
18
|
+
| `forge runs [--repo DIR \| --all] [--limit N] [--json]` | this repo's recent runs, newest first: run id, kind, age, task states, verification and final review, goal, `after <run>` when the plan was chained, and the run dir. Read-only; the same summaries forge-ui shows |
|
|
19
|
+
| `forge handoff [show] [RUN_DIR \| --repo DIR] [--json]` / `note RUN_DIR TEXT [--actor A] [--json]` / `claim RUN_DIR --harness H [--session S] [--take-over] [--json]` / `resume RUN_DIR [--take-over] [--harness H] [--session S] [--json]` | the run for the next session. `show` is the default (`forge handoff` and `forge handoff RUN_DIR`); it writes nothing. `--repo DIR`, or no argument inside a checkout, reports that repo's newest registered plan that is live or still has a task not `MERGED`. The report has the run, its option files and `run.flags.json`, scheduler liveness, task states, what needs a person, the last `control.log` changes, tasks left `RUNNING`, notes newest first, the driver and the next commands. `note` appends one line to `handoff.notes.jsonl` (`--actor` defaults to `cli`; whitespace collapses; empty text, text over 2000 characters and text that is not UTF-8 are refused). `claim` requires `--harness H` (`[a-z0-9._-]{1,40}`) and writes `handoff.driver.json` (`harness`, `session`, `since`, `last_seen`); `--session S` is an id with no whitespace, at most 200 characters. A different driver last seen under 12 hours ago is refused unless `--take-over` (one `control.log` line, action `take-over`, actor `cli`, and a dataset `control` event). `resume` claims (`--harness` defaults to `unknown`), follows a live scheduler and starts nothing, names `forge fractal resume` for a Fractal plan, and otherwise saves each stale `RUNNING` task's diff, resets that worktree, marks it `INTERRUPTED` without counting the attempt twice, prepares every `INTERRUPTED` task and restarts `run` detached from `run.flags.json`. Exit 0 ok, 2 usage or not a run dir, 3 no run to report or another driver holds the run; a restart that cannot be launched exits 1. See [from another session](decomposed-runs.md#from-another-session-or-harness) |
|
|
20
|
+
| `forge control show\|set\|pin\|unpin\|drain\|resume\|stop\|retry\|add PLAN_DIR …` | change a live plan: `set` takes `qa-threshold` (`P0`..`P3`, `none` or `default` for the plan, `inherit` per task), `timeout`, `escalate-after`, `escalate-effort` (`on`/`off`), `verify-retries`, `infra-backoff` (a backoff shape; `none` drops it), `infra-fallback` (`on`/`off`), `max-attempts` (a non-negative integer, `0` = no cap, and only with `--confirm`), `converge-window` (a non-negative integer), `pre-review-tests` (`on`/`off`), `pre-review-parallel` (1-64), `summaries` (`on`/`off`; on a finished run it also starts `forge summarize`), `retry-budget`, `infra-retries` or `max-parallel` (1-64) (the last three only while a scheduler runs; `--task ID` for `qa-threshold`, `retry-budget` and `summaries`, value `inherit` drops the override); `pin PLAN_DIR TASK SPEC` sets the model the task's next full retry uses once, `unpin` drops it. While a scheduler runs: `drain` starts nothing new until `resume` (a run with nothing left to start ends as usual); `stop [--now]` ends the run once the running tasks finish (`--now` interrupts them; `run` exits 130 without verifying, unless every task had merged by then: it then verifies and exits 0 as usual); `retry PLAN_DIR TASK [--dwarf SPEC]` queues a retry, including a `STALE` task (its `prompt.md` or `approach.md` changed during the attempt: it is re-dispatched with the new text on the same implementer, and `--dwarf` is refused). `retry PLAN_DIR TASK --answer TEXT` (or `--answer-file F`, `-` for stdin) answers a `NEEDS_INPUT` task: 1 to 8000 characters after stripping, no NUL, and not combined with `--dwarf` or `--decide`. On a live run it is queued and the scheduler writes `tasks/<id>/answer.md` and resumes the task; with no live run it prepares the task through `forge-parallel.sh retry --answer-file --no-dispatch` for the next `run` (`forge-parallel.sh retry --answer` itself is unchanged). `--json` prints `{"queued": true, "request"}` when queued and `{"queued": false, "prepared": true}` when prepared. `control.log` records the value `answer` and `answer_chars`, never the text (`--actor` `ui` or `cli`, default `cli`). A `NEEDS_DECISION` task instead needs `--decide retry=N` or `--decide threshold=Pn`, or `--dwarf SPEC`, each with `--reason TEXT --approved`; `add PLAN_DIR TASK` (a row appended to `tasks.tsv`) queues a request the scheduler applies or refuses. `show` (`--json` for JSON) also says whether the run is drained or stopping, prints an `INFRA` task's cause, and, while a scheduler is live, lists each infrastructure pause with its reset and "needs you". The text table lists each task's attempts against its cap (`9/8`, or `9/-` when there is no cap). Every change and every request's outcome is logged in `control.log`. Exit 2 invalid input, 3 refused. See [live controls](decomposed-runs.md#changing-a-run-while-it-works) |
|
|
20
21
|
| `forge config show [--repo DIR] [--json]` / `forge config set <key> <value> [--repo DIR] [--json]` / `forge config unset <key> [--repo DIR] [--json]` | one view of every config source (registry, the legacy Jev file, decide, the user `features`, the repo's `.forge/verify`, `setup` and `verify-subset`, dataset, `FORGE_*` variables with secrets hidden); `set` / `unset` edit `repo.verify`, `repo.setup`, `repo.verify-subset` (must contain `{files}` or `{changed}`; `--repo` required) and `decide.gate.<gate>`, `decide.gate.<gate>.provider`, `decide.gate.<gate>.model` (`off`, `shadow` or `on`; those write the user level and do not need `--repo`). They also set the user feature keys: `retro` (`off` or `on`), `brief` (`off`, `advisory`, `gated` or `strict`), `brief.scope` (`task`, `wave` or `plan`), `brief.model` (a spec), `summaries` (`off` or `on`), `summaries.model` (a spec), `storage.compact` (`auto`, the default, or `off`) and `storage.warn-gb` (gigabytes, `20` by default, or `off`; see [forge du](#forge-du)). Those write the user file and ignore `--repo`; `unset` removes one key. A bad value exits 2 and writes nothing. A model spec is checked for its form when it is set; whether it resolves is checked when `plan` uses it. Unset of a `decide.gate.*` key is refused: set the mode to `off`. `-` as a value reads stdin for the per-repo files. Exit 2 on invalid input |
|
|
21
22
|
| `forge config profile list\|show\|create\|edit\|set\|unset\|rm\|use` | named bundles of routing, policy, gates and budget in `decide.json`; see [below](#forge-config-profile) |
|
|
22
23
|
| `forge watch [RUN_DIR \| --repo DIR \| --all] [--interval S] [--settle S] [--until-done] [--no-notify] [--exec CMD]` | follow runs live: a line for every task status change, and a desktop notification, `--exec CMD` and the repo's `.forge/on-finish` when a run finishes or fails, a task fails or a final review gives its verdict; see [below](#forge-watch). Read-only |
|
|
23
24
|
| `forge runs rm RUN_DIR [--dry-run] [--yes] [--no-archive] [--worktrees] [--branches] [--json]` | delete a run directory but keep what it taught the dataset; see [below](#forge-runs-rm) |
|
|
24
25
|
| `forge runs compact [RUN_DIR … \| --repo DIR \| --all] [--logs] [--older-than DAYS] [--dry-run] [--json]` | keep every run and take back what it holds for nothing: leftover review snapshots and, with `--logs`, gzipped log copies; see [below](#forge-runs-compact) |
|
|
25
26
|
| `forge du [--repo DIR \| --all] [--top N] [--json]` | what forge takes on disk (run dirs, worktree folders, its data home) and the command that takes each part back; see [below](#forge-du). Read-only |
|
|
27
|
+
| `forge worktrees rm PATH… [--branches] [--dry-run] [--json] [--actor {cli,ui}]` | remove `failed` and `finished` worktrees, and leftover folders, by forge-ui's rules (never `--force`; `--branches` is `git branch -d` on a finished worktree's merged branch). Exit 0 when no row failed, 4 when one did, 2 usage. See [below](#forge-worktrees-rm) |
|
|
26
28
|
| `forge runs rerun RUN_DIR --dwarf SPEC [--qa SPEC] [--to DIR] [--max-parallel N] [--dry-run] [--run --yes]` | set up the same plan again with another implementer, from the same starting commit; spends nothing unless `--run --yes`; never merges. See [below](#forge-runs-rerun-and-compare) |
|
|
27
29
|
| `forge runs compare RUN_A RUN_B [--json] [--no-record]` | two runs of one plan, side by side, per task; records the pair in the dataset |
|
|
28
|
-
| `forge memory show\|learnings\|prune\|spend REPO …` | a repository's project memory; `learnings REPO --json` lists every learning in its ledger with what forge does with it (`in_memory`, `waiting` for a second run, `stale`, `capped`, `muted`), from forge-memory.sh's own rebuild, without changing the repository. See [project memory](memory.md) |
|
|
30
|
+
| `forge memory show\|learnings\|prune\|spend\|forget REPO …` | a repository's project memory; `learnings REPO --json` lists every learning in its ledger with what forge does with it (`in_memory`, `waiting` for a second run, `stale`, `capped`, `muted`), from forge-memory.sh's own rebuild, without changing the repository. `forget REPO KEY…` (`KEY` is `category:key`; `--dry-run`, `--json`, `--actor ui\|cli`) drops those ledger rows and rebuilds `memory.md`. A missing key is not an error. `--json` prints `{ok, dry_run, keys: [{key, rows, found}], memory_lines_removed}`. Exit 0 ok, 2 usage. See [below](#forge-memory-forget) and [project memory](memory.md) |
|
|
29
31
|
| `forge issues RUN [--apply] …` | file the review findings a run left open as GitHub issues; see [below](#forge-issues) |
|
|
30
32
|
| `forge pr [RUN_DIR \| --repo DIR] [--texts] [--paths] [--out FILE] [--create [--base B] [--head B]]` | a draft pull-request description for a finished run, on stdout; `--create` opens it as a draft PR with `gh`; see [below](#forge-pr) |
|
|
31
33
|
| `forge retro note\|report\|issues PLAN …` | retro notes on what got in a run's way (`plan --retro`): `note` records one by hand (`--type`, `--fixable-by`, `--summary`, and `--command`, `--exit`, `--error`, `--blocking`, `--tried` as needed), `report` writes `retro.md`, and `issues` drafts GitHub issues for forge's own repository and posts only with `--apply --approve HASH`. `record` is forge's own call after a dispatch. Exit 2 usage, 3 refused. See [retro notes](../references/decompose.md#retro-notes-opt-in) |
|
|
32
|
-
| `forge brief write\|show\|answer\|stale PLAN …` | each task's open questions, asked before it starts (`plan --brief`)
|
|
34
|
+
| `forge brief write\|show\|answer\|stale\|propose\|proposals\|apply\|reject PLAN …` | each task's open questions, asked before it starts (`plan --brief`), and the diff a wider answer waits on. `write` asks the missing ones (`--task ID`, `--jobs N`; `--force` redoes a task that already has `brief.json`). `show` lists them (`--task`, `--json`), parked questions by group and tasks marked `affected by <pid>`. `answer PLAN TASK QID TEXT` records an answer (`--file F`, `--actor`). A task answer goes into the prompt before the task starts and is late after. A parked `wave` or `plan` question is answerable only when `--brief-scope` is at least that wide; the answer is stored and the command prints `forge brief propose`. `stale PLAN TASK` flags dependents' open questions after a merge. `propose PLAN TASK QID` (`--actor`) turns that parked answer into `proposals/<pid>/`, one read-only dispatch. `proposals PLAN` (`--json`) lists every proposal with its state, scope, group, summary, diff and, while `proposed`, the apply line. `apply PLAN PID --approve HASH` (`--actor`, `--no-regenerate`) writes that diff. `--no-regenerate` marks affected tasks and does not regenerate their questions. `reject PLAN PID` (`--reason TEXT`, `--actor`) marks it `rejected` and touches no plan file. Exit 2 usage or an unknown task, question or proposal; 3 when PLAN is not a plan dir, when brief is off (`write`, `show`, `propose`), or when a proposal is refused (`propose`, `apply`, `reject`). See [brief mode](../references/decompose.md#brief-mode-opt-in) |
|
|
35
|
+
| `forge group show\|retry\|set PLAN …` | a plan's task groups (`plan --groups`, and `plan --group-review`). `show PLAN [--group GID] [--json]` is read-only: every group, and for a `review=group` group its round, status, implicated tasks and, when `NEEDS_DECISION`, the first line of `decision.md`. Exit 3 when there is no `groups.tsv`; exit 2 for an unknown group. `retry PLAN GID [--tasks a,b] [--reason TEXT]` answers an ambiguous `NEEDS_DECISION` (`--tasks` is required; those members become `FAIL`, and so does any member with its own blocking finding) or rearms `UNKNOWN`, `INFRA`, `TIMEOUT`, `INTERRUPTED` or `ERROR` to `INTERRUPTED` so the next run reviews again, with no member attempt spent. An oversized group is refused: split `groups.tsv` and run `plan` again. `set PLAN GID [--title T] [--goal G] [--reason TEXT]` rewrites a group's title or goal (one line each, at most 500 characters, empty for none) and freezes the groups again, logged as `group-set`; refused (exit 3) when the groups or a member's deps or files changed since `plan`. `--reason` is at most 2000 characters, logged in `control.log` with `actor` `cli`. Exit 0 ok, 2 usage or an unknown group or task (including `retry` with no `groups.tsv`), 3 refused (a state this command does not retry, or the control lock busy). A settle that fails returns that command's exit code. See [group review](reviews.md#group-review-opt-in) |
|
|
33
36
|
| `forge summarize PLAN [--task ID] [--force] [--json]` | a generated summary per task (`plan --summaries on`), in `tasks/<id>/summary.json`, rewritten only when its facts change. Exit 2 usage, 3 when PLAN is not a directory. See [task summaries](../references/decompose.md#task-summaries-opt-in) |
|
|
34
37
|
| `forge ui open\|status\|stop` | forge-ui, the run viewer; see [the command group](forge-ui.md#forge-ui-command-group) |
|
|
35
38
|
| `forge dataset …` | every run's inputs and outcomes; see [run dataset](dataset.md) |
|
|
@@ -143,7 +146,56 @@ forge does not create, and what `forge runs compact --logs` would take back), ea
|
|
|
143
146
|
folder, and forge's data home (the dataset and its blobs, which are kept, archives, exports, legacy
|
|
144
147
|
files). It ends with the commands that take each part back. Sizes are disk usage, as `du` counts it;
|
|
145
148
|
every file is visited, so a large tree takes a while. It reads only, apart from keeping the totals for
|
|
146
|
-
the `storage.warn-gb` check. forge-ui's **Disk** screen shows the same report.
|
|
149
|
+
the `storage.warn-gb` check. forge-ui's **Disk** screen shows the same report and, when the server can write, compacts from it after a dry run ([Controls](forge-ui.md#controls)).
|
|
150
|
+
|
|
151
|
+
### `forge worktrees rm`
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
forge worktrees rm PATH… [--branches] [--dry-run] [--json] [--actor {cli,ui}]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Removes worktrees by the rules of forge-ui's Worktrees screen (`ui/forge_ui/worktrees.py` `compute`), the one rule set. It never passes `--force`.
|
|
158
|
+
|
|
159
|
+
- A `failed` or `finished` worktree whose repository is known is `git worktree remove`. `--branches` also runs `git branch -d` (never `-D`) on a `finished` worktree whose branch is merged. A `failed` worktree's branch stays, and so does an unmerged one: `-d` refuses it.
|
|
160
|
+
- An `unknown` row that is a leftover folder (git no longer lists it as a worktree) is deleted as a folder, after checking again that git does not list it and that it still sits under `.forge-worktrees`.
|
|
161
|
+
- Every other status is skipped with its reason: its run is active, it has uncommitted changes, it is locked by git, it is the integration worktree of a run not integrated yet, its folder is gone (`git worktree prune`), it is not forge's worktree, it is already removed, it is not a leftover, the path is not a worktree forge knows, or its repository is not known.
|
|
162
|
+
|
|
163
|
+
The same path given twice is one row. `--dry-run` computes the same actions and changes nothing. `--actor` is who asked, `cli` (the default) or `ui`, recorded with a real removal: a `worktree_removed` dataset event (the actor on the event) and a gone entry in the location list, `forge worktrees rm (<actor>)`. A skip and a dry run record nothing.
|
|
164
|
+
|
|
165
|
+
`--json` prints one object on stdout, on failure too:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{"ok": true, "dry_run": false,
|
|
169
|
+
"rows": [{"path": "…", "action": "remove", "status": "removed", "reason": null}]}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
`action` is `remove`, `remove+branch`, `delete-folder` or `none`. `status` is `removed`, `skipped`, `failed` or `would-remove` (the dry run). `reason` is a string, or null when there is nothing to say. `ok` is false when any row is `failed`. A worktree that was removed and whose branch then refused `-d` is `failed`, with the reason that the worktree is gone and the branch stays.
|
|
173
|
+
|
|
174
|
+
Exit 0 when no row failed (a skip is not a failure), 4 when a row failed, 2 usage. forge-ui's Remove runs this with `--actor ui`. See [Controls](forge-ui.md#controls).
|
|
175
|
+
|
|
176
|
+
### `forge memory forget`
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
forge memory forget REPO KEY… [--dry-run] [--json] [--actor {ui,cli}]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
`KEY` is `category:key`, the identity the rebuild and `learnings` already use. Each part is normalised (lowercase, every run of non-alphanumerics collapsed to one space) and neither part may be empty. A repeated key, or two spellings that normalise to one, is a single entry.
|
|
183
|
+
|
|
184
|
+
It removes those learnings' rows from `.forge/ledger.tsv` and rebuilds `.forge/memory.md` from the ledger that remains. `--dry-run` touches neither file. A key that is not in the ledger is not an error. The command runs when `FORGE_MEMORY=off` too: it is an edit you asked for, not an automatic write.
|
|
185
|
+
|
|
186
|
+
`--json` prints one object:
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{"ok": true, "dry_run": false,
|
|
190
|
+
"keys": [{"key": "trap:alpha thing", "rows": 2, "found": true}],
|
|
191
|
+
"memory_lines_removed": ["- alpha thing [a.py]"]}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`rows` is how many ledger rows matched that key. `found` is false when none did. `memory_lines_removed` is the `- ` fact lines a rebuild of `memory.md` loses, in their old order, not a count and not the section headings. `ok` is true on that object. A usage error prints to stderr and exits before any JSON.
|
|
195
|
+
|
|
196
|
+
A real forget that drops at least one row records a `memory_forget` dataset event (`keys`, `rows`, `actor`). A dry run, and a forget that matches nothing, record nothing. `--actor` is `cli` (the default) or `ui`.
|
|
197
|
+
|
|
198
|
+
Exit 0 ok, 2 usage (a bad key, an unknown option, a missing repo, or no key). See [project memory](memory.md#scriptsforge-memorysh).
|
|
147
199
|
|
|
148
200
|
### `forge runs rerun` and `forge runs compare`
|
|
149
201
|
|
|
@@ -653,16 +705,19 @@ Decomposed runs: many dwarves in isolated worktrees, per-task QA, only passing w
|
|
|
653
705
|
Bash 3.2 entrypoints use a Python standard-library coordinator to schedule eligible tasks.
|
|
654
706
|
|
|
655
707
|
```
|
|
656
|
-
forge-parallel.sh plan <plan-dir> --repo <dir> [routing flags] [--planner <spec>] [--no-memory]
|
|
708
|
+
forge-parallel.sh plan <plan-dir> --repo <dir> [--after <plan-dir>] [routing flags] [--planner <spec>] [--no-memory]
|
|
657
709
|
[--gate NAME=MODE[,...]] [--no-gates] [--decide-budget tokens=N[,usd=X]]
|
|
658
710
|
[--decompose-level L] [--shadow-qa <spec>[,..]|none] [--shadow-rate R]
|
|
659
|
-
[--reviewer-session | --no-reviewer-session]
|
|
711
|
+
[--reviewer-session | --reviewer-session-rate R | --no-reviewer-session]
|
|
660
712
|
[--implementer-session | --no-implementer-session]
|
|
661
713
|
[--explore E] [--ui | --no-ui] [--fail-first | --no-fail-first]
|
|
662
714
|
[--pre-review-tests | --no-pre-review-tests] [--pre-review-parallel N]
|
|
663
715
|
[--qa-threshold P0|P1|P2|P3|none|default]
|
|
664
716
|
[--profile NAME | --no-profile] [--fast ROLES] [--collapse-chains]
|
|
665
|
-
[--
|
|
717
|
+
[--groups waves|FILE] [--group-review]
|
|
718
|
+
[--group-max-tasks N] [--group-max-diff-kb N]
|
|
719
|
+
[--max-attempts N] [--retry-per-model N | --no-retry-per-model]
|
|
720
|
+
[--converge-window N] [--no-infra-fallback]
|
|
666
721
|
[--retro | --no-retro] [--brief advisory|gated|strict|off] [--brief-scope task|wave|plan]
|
|
667
722
|
[--brief-model SPEC] [--summaries on|off] [--summaries-model SPEC]
|
|
668
723
|
forge-parallel.sh auto <plan-dir> --repo <dir> --goal-file <file> [--planner <spec>]
|
|
@@ -697,7 +752,7 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
|
|
|
697
752
|
|
|
698
753
|
| Subcommand | Does |
|
|
699
754
|
|---|---|
|
|
700
|
-
| `plan` | validate `tasks.tsv`, resolve difficulty → concrete dwarf/qa specs, compute waves, render the approval table |
|
|
755
|
+
| `plan` | validate `tasks.tsv`, resolve difficulty → concrete dwarf/qa specs, compute waves, and with `groups.tsv` or `--groups` validate, resolve and freeze the groups; render the approval table. A `dwarf` cell of `script` is kept: that task runs the executable `tasks/<id>/run` |
|
|
701
756
|
| `auto` | from a goal file to that table in one blocking command; with `--approved`, also `run`. The orchestrator's job is mechanical, so a small model can drive it. See [below](#forge-parallelsh-auto) |
|
|
702
757
|
| `run` | schedule ready tasks; per task: worktree → dwarf → diff → QA → status; merge passing tasks onto the integration branch |
|
|
703
758
|
| `retry` | re-run **one** failed task in the worktree it already has, with its reviewer's findings in the prompt; with `--answer` or `--answer-file`, answer a `NEEDS_INPUT` task and run it; with `--decide` or `--dwarf` plus `--reason` and `--approved`, decide a `NEEDS_DECISION` task and run it |
|
|
@@ -707,6 +762,8 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
|
|
|
707
762
|
| `review` | **opt-in, spends QA quota** — one reviewer reads the whole combined result; read-only |
|
|
708
763
|
| `split` / `combine` | move tasks into a plan of their own / join fully merged plans into one |
|
|
709
764
|
|
|
765
|
+
A `tasks.tsv` row whose `dwarf` column is `script` runs the executable `tasks/<id>/run`. `plan` exits 2 when that file is missing or not executable, does not route the row, skips its implementer doctor, shows it in the table and counts no implementer dispatch. The `qa` column is still a model. See [Scripted tasks](../references/decompose.md#scripted-tasks).
|
|
766
|
+
|
|
710
767
|
| Flag | Subcommands | Remembered in the plan | Means |
|
|
711
768
|
|---|---|---|---|
|
|
712
769
|
| `--gate NAME=MODE[,NAME=MODE...]` | plan | `jev-selection.json` | set decision-model gates for this run; repeatable, a later one wins. When the file exists, `run` and `retry` keep it; with no file they apply the flags passed then and freeze them |
|
|
@@ -721,12 +778,13 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
|
|
|
721
778
|
| `--no-infra-fallback` | plan, run | `infra_fallback` | turn lateral recovery off. A plan with no file stays off, and a re-plan keeps the setting it has |
|
|
722
779
|
| `--converge-window N` | plan | `converge_window` | reviews the non-converging signal looks at (default `4` when the file is absent; below `2` it never fires). Changing it later is `forge control set converge-window N` |
|
|
723
780
|
| `--max-attempts N` | plan | `max_attempts` | attempts a task may spend across runs before it stops for a decision (default `8` when the file is absent; `0` means no cap). Changing it later is `forge control set max-attempts N --confirm` |
|
|
781
|
+
| `--retry-per-model N` / `--no-retry-per-model` | plan | `retry_per_model` | a task may fail `N` times (1 to 99) on each model the retry policy gives it, then it moves one rung up and the count starts again. With `escalate_effort` on, the same `N` applies to each effort of that model. Replaces `--escalate-after` for this plan: when `escalate_after` is also present, `run` says so and follows `retry_per_model`. `--no-retry-per-model` removes the file; a re-plan with neither keeps it. Automatic retries still need `--retry-failed` above 0. See [a budget per model](reviews.md#a-budget-per-model---retry-per-model-n) |
|
|
724
782
|
| `--decide retry=N` / `--decide threshold=Pn` | retry | no — this retry only | resume a `NEEDS_DECISION` task: `N` more attempts (`N` from 1 to 20) or this task's blocking threshold (`P0`..`P3`) and then one retry. Needs `--reason` and `--approved`. Refused on any other status |
|
|
725
783
|
| `--qa-threshold P0\|P1\|P2\|P3\|none\|default` | plan, run, retry, review | `qa_threshold` | the least severe CONFIRMED finding that still blocks (default `P2`); milder ones become known issues; `none` means P3, `default` removes the setting. Solo takes `P0`..`P3` or `none`. See [the verdict rule](reviews.md#verdicts-and-failure) |
|
|
726
784
|
| `--verify-retries N` | run, retry, integrate | `verify_retries` | reruns of a failed verify command, or of each failed lane (default `1`, `0` = strict single run); with `.forge/verify-subset`, a failed command's failing test files run alone first and confirm a regression without a full rerun |
|
|
727
785
|
| `--verify-lane 'name[opts]=cmd'` | run, retry | `verify.d/<name>` | one verification lane; repeatable. Options as in a lane file, comma-separated (`group=g`, `first`, `retries=n`, `reports=dir`, `baseline=file`). The first one of an invocation replaces the plan's earlier lanes and `--verify`; see [verification lanes](../references/decompose.md#execution-checks-and-integration-verification) |
|
|
728
786
|
| `--verify-parallel N` | run, retry, integrate | `verify_parallel` | lanes run at once, 1 to 32 (default `3`) |
|
|
729
|
-
| `--escalate-after N` | run, retry | `escalate_after` | failed attempts on one model before the next goes a tier up (default `3`, `0` = off) |
|
|
787
|
+
| `--escalate-after N` | run, retry | `escalate_after` | failed attempts on one model before the next goes a tier up (default `3`, `0` = off). When `retry_per_model` is set, that count is the trigger instead |
|
|
730
788
|
| `--pre-review-tests` | plan | `pre_review_tests` | before each review, run only the tests the attempt affects; a red attempt goes back to its implementer unreviewed (off by default; `--no-pre-review-tests` turns it off). See [pre-review tests](../references/decompose.md#pre-review-tests-opt-in) |
|
|
731
789
|
| `--pre-review-parallel N` | plan | `pre_review_parallel` | how many of those checks run at once across tasks, 1 to 64 (default `2`) |
|
|
732
790
|
| `--sweep Pn` | run | no — this run only | once every task has merged, fix the open findings at `Pn` or worse in a few extra tasks, one per file, each with a narrow review; the plan goes to `sweep/plan.md`. Once per plan; what it does not fix stays for `forge issues`. See [the finding sweep](reviews.md#fixing-them-in-the-run-the-finding-sweep-opt-in) |
|
|
@@ -739,9 +797,14 @@ forge-parallel.sh combine <new-plan-dir> <plan-dir> <plan-dir>... [--verify <c
|
|
|
739
797
|
| `--no-profile` | plan | removes `profile.json` | no profile. `routed.json` stays |
|
|
740
798
|
| `--fast ROLES` | plan | `fast` | which of `dwarf`, `qa`, `planner`, `review` ask for the fast tier (`all` or `none`). Omitted on a re-plan, the file stays; `none` removes it. See [below](#the-fast-tier) |
|
|
741
799
|
| `--collapse-chains` | plan | no — this call only | merge a chain into one task named `combined`, after validation and before routing. A one-task or branching plan is unchanged. An already collapsed plan is not an error. See [below](#collapse-chains) |
|
|
800
|
+
| `--after DIR` | plan | `after`, `integration.base` | start from plan DIR's integration branch. DIR is a plan of the same repo whose tasks are all `MERGED`, whose integration tip equals `accepted.integration`, and whose scheduler is not live. Otherwise exit 2, and the plan directory and branches stay as they were. Creates `forge/<run>-integration` at that tip. A later `plan` without the flag keeps it. `run` exits 3 if DIR moved before this plan has merged a task. See [Chained plans](../references/decompose.md#chained-plans) |
|
|
801
|
+
| `--groups waves\|FILE` | plan | `groups.tsv`, `groups.frozen` | opt-in. `waves` writes one group per computed wave of at least two tasks; `FILE` copies that `groups.tsv`. An existing `groups.tsv` and no flag is kept. Then validated, its group QA resolved, and frozen. `run` refuses when the file or a member's deps or files changed. See [Groups and group review](../references/decompose.md#groups-and-group-review-opt-in) |
|
|
802
|
+
| `--group-review` | plan | the `review` column | with `--groups waves` only: those groups are `review=group` (one QA review for the group). High-difficulty tasks stay out. Without `waves`, `plan` exits 2 |
|
|
803
|
+
| `--group-max-tasks N` | plan | `group_max_tasks`, only when given | most members of a review group (default 6). A positive integer. Deriving waves needs at least 2 |
|
|
804
|
+
| `--group-max-diff-kb N` | plan | `group_max_diff_kb`, only when given | largest combined diff a group review will read, in KB (default 256). Over it, the group stops for a decision and nothing is truncated |
|
|
742
805
|
| `--retro` / `--no-retro` | plan | `retro_mode` | agents record what got in their way, as retro notes. Off by default. Without either flag the plan keeps its earlier choice; a first plan takes the user setting (`forge config set retro on`). See [retro notes](../references/decompose.md#retro-notes-opt-in) |
|
|
743
806
|
| `--brief advisory\|gated\|strict\|off` | plan | `brief` | one read-only dispatch per task writes its open questions before the task starts. `advisory` lets the run go on, `gated` holds a task with an unanswered must-answer question, and `strict` makes `run` exit `3` while any question is open. `off` turns it off. On needs `--brief-model` (or `forge config set brief.model`), else exit `2`. See [brief mode](../references/decompose.md#brief-mode-opt-in) |
|
|
744
|
-
| `--brief-scope task\|wave\|plan` | plan | `brief_scope` | which questions
|
|
807
|
+
| `--brief-scope task\|wave\|plan` | plan | `brief_scope` | which parked questions can be answered. Default `task`: a task answer goes into that task's prompt, and a `wave` or `plan` question stays in `brief.parked.json` until a proposal is approved. `wave` also answers wave questions; the proposal may change the prompt, approach and files of unstarted members of that question's group, which must be in `groups.tsv`. `plan` answers wave and plan questions; a plan proposal may also add, remove and split tasks and change deps. See [brief mode](../references/decompose.md#brief-mode-opt-in). Only with brief on |
|
|
745
808
|
| `--brief-model SPEC` | plan | `brief_model` | the model that writes the questions. Required with brief on; forge never picks one |
|
|
746
809
|
| `--summaries on\|off` | plan | `summaries` | a generated summary per task in `tasks/<id>/summary.json`, rewritten only when its facts change. Off by default. See [task summaries](../references/decompose.md#task-summaries-opt-in) |
|
|
747
810
|
| `--summaries-model SPEC` | plan | `summaries_model` | the model that writes the summaries. Required with summaries on; forge never picks one |
|
|
@@ -982,8 +1045,11 @@ Exit `0` when the search finished, culprit or not, `1` when a step could not run
|
|
|
982
1045
|
only the user can answer, kept in `tasks/<id>/needs_input.md`. The run summary lists it under
|
|
983
1046
|
`waiting for your answer:` with the first line of the question and the command to answer it, and
|
|
984
1047
|
the retry hint does not count it as failed. Its dependents end `BLOCKED`, and neither a later
|
|
985
|
-
`run`, `--retry-failed` nor `forge control retry` resumes it. Only
|
|
986
|
-
`retry <plan> <id> --answer "<text>"` (or `--answer-file F`)
|
|
1048
|
+
`run`, `--retry-failed` nor a plain `forge control retry` resumes it. Only an answer does:
|
|
1049
|
+
`retry <plan> <id> --answer "<text>"` (or `--answer-file F`), and on a live run
|
|
1050
|
+
`forge control retry <plan> <id> --answer TEXT` (or `--answer-file F`, `-` for stdin), which queues
|
|
1051
|
+
that answer for the scheduler. With no live run, `forge control retry --answer` prepares the task
|
|
1052
|
+
the way `retry … --answer-file --no-dispatch` does. The question and the answer
|
|
987
1053
|
join the findings of the next attempt, a normal new attempt. Without an answer, or with one older
|
|
988
1054
|
than the question, `retry` exits `2` and changes nothing; if escalation refuses the retry, the
|
|
989
1055
|
question and the answer stay for the same `--answer` to be tried again. A run that ends with such a
|
|
@@ -992,7 +1058,8 @@ sets this status.
|
|
|
992
1058
|
|
|
993
1059
|
**`NEEDS_DECISION`** is the same kind of stop for a choice rather than a question. The reviews in
|
|
994
1060
|
the last window all failed and kept finding new problems, or the retry policy has no stronger
|
|
995
|
-
model, or
|
|
1061
|
+
model, or every blocking finding needs a file the task does not declare (reason `plan`), or the
|
|
1062
|
+
task has spent its attempt cap (`plan --max-attempts N`, default 8 across runs;
|
|
996
1063
|
`forge control set max-attempts N --confirm` changes it, and `0` means no cap). The reasons and
|
|
997
1064
|
the `retry` and `accept` commands are in `tasks/<id>/decision.md`. The run summary lists them under
|
|
998
1065
|
`waiting for your decision:`. Neither a later `run`, `--retry-failed`, a retry budget nor a pin
|
package/docs/decomposed-runs.md
CHANGED
|
@@ -102,6 +102,34 @@ as prerequisites merge and capacity becomes available, while excluding overlappi
|
|
|
102
102
|
paths. Merges are serialized. Each task pins the integration commit at dispatch; retries keep
|
|
103
103
|
that baseline, and QA sees only baseline membership recorded for that task.
|
|
104
104
|
|
|
105
|
+
## Groups in the approval table
|
|
106
|
+
|
|
107
|
+
When the plan has `groups.tsv`, the table adds a `groups:` block after the waves. One line
|
|
108
|
+
per group: id, `review=task` or `review=group`, the QA spec as `qa=<spec>` or `-`, the
|
|
109
|
+
members, and the goal (or `(no goal)`).
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
groups:
|
|
113
|
+
g1 review=group qa=opus:medium a, b, c — Every command can write JSON and TSV
|
|
114
|
+
g2 review=group qa=sonnet d, e — (no goal)
|
|
115
|
+
w3 review=task - f, g — (no goal)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
A `review=task` group is a name only. It does not change the estimate. When any group has
|
|
119
|
+
`review=group`, the estimate counts one review for the group instead of one per member, and
|
|
120
|
+
prints both lines. Seven tasks and two review groups covering five members look like this:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
tasks: 7 waves: 1 estimated dispatches: 11 (7 dwarf + 4 qa)
|
|
124
|
+
reviews: 4 (2 groups replace 5 task reviews)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The reviews line is `reviews: N (G groups replace M task reviews)`. The word stays `groups`
|
|
128
|
+
when there is one. The count is tasks, minus members of review groups, plus the number of
|
|
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
|
|
131
|
+
tradeoff is in [group review](reviews.md#group-review-opt-in).
|
|
132
|
+
|
|
105
133
|
## Fresh session per task, plus a capsule
|
|
106
134
|
|
|
107
135
|
Every dispatch is a **clean slate** — forge never passes `--continue`, `--resume`, or
|
|
@@ -199,6 +227,21 @@ For Fractal execution, pass tier pools to `plan` and backend/limit flags to `run
|
|
|
199
227
|
`--max-parallel` limits task pipelines; the shared `--fractal-concurrency` limit includes
|
|
200
228
|
all their child invocations and QA. See [decomposed Fractal execution](../references/decompose.md#fractal-within-decomposed-tasks).
|
|
201
229
|
|
|
230
|
+
A plan can start from a finished plan's integration branch. `A` and `B` are plan directories:
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
plan B --after A
|
|
234
|
+
run B
|
|
235
|
+
integrate B --approved
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
`plan` exits 2 unless `A` is a plan of the same repo, every task is `MERGED`, the integration
|
|
239
|
+
branch tip is `A`'s `accepted.integration`, and `A`'s scheduler is not live. It writes `after`
|
|
240
|
+
and `integration.base`, and creates `B`'s integration branch at that tip. `run` exits 3 if `A`
|
|
241
|
+
moved and `B` has not yet merged a task. `integrate` prints `this brings plans` and the run
|
|
242
|
+
ids, oldest first. `forge runs` shows `after <run>` on `B`. See
|
|
243
|
+
[Chained plans](../references/decompose.md#chained-plans).
|
|
244
|
+
|
|
202
245
|
## Resuming an interrupted run
|
|
203
246
|
|
|
204
247
|
Ctrl-C (or a SIGTERM) on `run` stops the running tasks' process groups, waiting up to
|
|
@@ -224,6 +267,65 @@ and pipeline checkpoints. A task/subtree selector resumes only that execution sc
|
|
|
224
267
|
Explicit `retry` retains the backend and frozen pools; a replacement dwarf must already
|
|
225
268
|
belong to that pool. See [recovery](../references/fractal.md#limits-and-lifecycle).
|
|
226
269
|
|
|
270
|
+
### From another session or harness
|
|
271
|
+
|
|
272
|
+
Start with `forge handoff`. With no argument inside a checkout, or with `--repo DIR`, it
|
|
273
|
+
reports that repository's newest registered plan that is live or still has a task not
|
|
274
|
+
`MERGED` (run-dir mtime; a plan is one with `tasks.tsv`). `forge handoff [show] RUN_DIR
|
|
275
|
+
[--json]` reports the run you name and writes nothing: id, kind, the first five non-empty
|
|
276
|
+
lines of `request.md`, the plan dir, repo, worktree root and integration branch, plus the
|
|
277
|
+
recorded base and accepted commits; the option files and `run.flags.json`; whether the
|
|
278
|
+
scheduler is live; each task; what needs a person (a `NEEDS_INPUT` question verbatim, the
|
|
279
|
+
first line of a `NEEDS_DECISION`'s `decision.md`, an `INFRA` cause and hint); the last
|
|
280
|
+
`control.log` changes; tasks left `RUNNING` with no live scheduler; session notes, newest
|
|
281
|
+
first; the driver; and the exact next commands. A path that is not a run dir exits 2. No
|
|
282
|
+
matching run exits 3.
|
|
283
|
+
|
|
284
|
+
`forge handoff resume RUN_DIR` carries a decomposed run on. It claims the run first; a
|
|
285
|
+
refused claim exits 3 and changes nothing else. A live scheduler is followed and nothing is
|
|
286
|
+
started — leave that run to `forge control show`, and do not start `run` beside it. A
|
|
287
|
+
Fractal plan is not restarted here; resume names `forge fractal resume`. Otherwise each
|
|
288
|
+
task still `RUNNING` is recovered, and only when its worktree is exactly `<wt_root>/<id>`
|
|
289
|
+
on `forge/<run_id>/<id>` and any leftover `dwarf.harness` or `qa.harness` has been stopped:
|
|
290
|
+
the uncommitted work, untracked files included, is saved to
|
|
291
|
+
`tasks/<id>/interrupted-<epoch>.diff`, and only then is the worktree reset and cleaned, the
|
|
292
|
+
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. A guard that fails leaves that
|
|
294
|
+
worktree untouched. Every `INTERRUPTED` task, including one that was already interrupted,
|
|
295
|
+
is prepared with `retry --no-dispatch`. `run` then starts again, detached, from
|
|
296
|
+
`run.flags.json`. Output goes to `resume-<epoch>.log`; the exit code is written to
|
|
297
|
+
`resume-<epoch>.done` when the run ends. A launch that fails exits 1.
|
|
298
|
+
|
|
299
|
+
`run` writes `run.flags.json` at each real start. A dry run and a `retry` do not, and a
|
|
300
|
+
split or rerun does not copy it. The fields are `retry_failed`, `infra_retries`, `sweep`,
|
|
301
|
+
`sweep_max`, `sweep_plausible`, `sweep_ahead`, `max_parallel`, `timeout`, `verify`,
|
|
302
|
+
`fractal`, `argv` and `at`. `retry_failed` and `infra_retries` are the budgets the
|
|
303
|
+
scheduler removes when it stops (`retry_budget`, `infra_budget`, and each task's
|
|
304
|
+
`retry_budget`), so resume can pass them again. Resume rebuilds the `run` command from
|
|
305
|
+
those fields; it does not replay `argv` as typed. A run from before 0.19 has no file:
|
|
306
|
+
resume still saves and prepares, then prints the `run` command to finish by hand and
|
|
307
|
+
starts nothing. An unreadable file does the same, and says the file cannot be read.
|
|
308
|
+
|
|
309
|
+
`forge handoff note RUN_DIR TEXT [--actor A]` appends one JSON line to
|
|
310
|
+
`handoff.notes.jsonl` (`at`, `actor`, `text`): a decision the user made, or a hand fix
|
|
311
|
+
under way, that is not in the plan. Whitespace collapses to single spaces. Empty text,
|
|
312
|
+
text over 2000 characters, and text that is not UTF-8 are refused. `--actor` defaults to
|
|
313
|
+
`cli`.
|
|
314
|
+
|
|
315
|
+
`forge handoff claim RUN_DIR --harness H [--session S]` writes `handoff.driver.json`
|
|
316
|
+
(`harness`, `session`, `since`, `last_seen`). `--harness` matches `[a-z0-9._-]{1,40}`.
|
|
317
|
+
`--session` is an id with no whitespace, at most 200 characters. `resume` claims the same
|
|
318
|
+
way, and its `--harness` defaults to `unknown`. The same harness and session keep `since`
|
|
319
|
+
and refresh `last_seen`. A different driver last seen under 12 hours ago is refused
|
|
320
|
+
(exit 3) unless `--take-over`. One last seen 12 hours ago or earlier is replaced without that flag.
|
|
321
|
+
Replacing a driver appends one `control.log` line (`action` `take-over`, `actor` `cli`,
|
|
322
|
+
`key` `driver`) and a dataset `control` event. When `control.log` is not a regular file
|
|
323
|
+
the replacement is refused before the driver file changes. Take over only when asked.
|
|
324
|
+
|
|
325
|
+
Running `run` again, and an explicit `retry` for a failed or interrupted task, stays
|
|
326
|
+
the way to finish by hand. That is also the command resume prints when
|
|
327
|
+
`run.flags.json` is missing.
|
|
328
|
+
|
|
227
329
|
## Changing a run while it works
|
|
228
330
|
|
|
229
331
|
`forge control` changes a plan's knobs without stopping it (forge-ui calls the same command):
|
|
@@ -269,6 +371,11 @@ waiting on it start in the same run. `control.log` records who asked (`--actor`)
|
|
|
269
371
|
A forge command the plan lock refuses says which command holds it (pid and since when), and on a
|
|
270
372
|
live run which `forge control` command to use instead.
|
|
271
373
|
|
|
374
|
+
Editing a task's `prompt.md` or `approach.md` while a run is going is allowed. An attempt
|
|
375
|
+
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. `control.log` records `prompt-changed`
|
|
377
|
+
with actor `scheduler`. See [failures that are the plan's](reviews.md#failures-that-are-the-plans).
|
|
378
|
+
|
|
272
379
|
Each change is validated, written under `control.lock`, and says when it applies:
|
|
273
380
|
|
|
274
381
|
- **The QA threshold is read once per attempt**, at the start of the task's next attempt; the
|
|
@@ -363,7 +470,7 @@ docs - low README.md - - Document the auth flow
|
|
|
363
470
|
| `deps` | comma-list of task ids that must land first, or `-` |
|
|
364
471
|
| `difficulty` | `low` \| `medium` \| `high` |
|
|
365
472
|
| `files` | expected touch set, comma-separated — **drives disjointness** |
|
|
366
|
-
| `dwarf` / `qa` | `-` to resolve from the routing rules; an explicit spec always wins |
|
|
473
|
+
| `dwarf` / `qa` | `-` to resolve from the routing rules; an explicit spec always wins. `script` in `dwarf` runs `tasks/<id>/run` |
|
|
367
474
|
| `title` | one line, shown in the approval table and the capsule |
|
|
368
475
|
|
|
369
476
|
Each task also needs `tasks/<id>/prompt.md`, written the same way a single-task forge goal is.
|
|
@@ -375,3 +482,9 @@ understated `files` is how two dwarves end up in the same file.
|
|
|
375
482
|
`plan` writes resolved specs back into the `dwarf`/`qa` columns, so `run` never consults the
|
|
376
483
|
routing rules — and an explicit value survives a re-plan, which is what makes a gate override
|
|
377
484
|
durable. (`UNASSIGNED` is treated as a leftover marker and re-resolved.)
|
|
485
|
+
|
|
486
|
+
A `dwarf` value of `script` runs the executable `tasks/<id>/run` and is not given a model.
|
|
487
|
+
`plan` exits 2 when that file is missing or not executable, shows the row, and counts no
|
|
488
|
+
implementer dispatch. A non-zero exit or a timeout is `FAIL` with no review and no escalation.
|
|
489
|
+
A retry runs the command again from the base, so the way to change the diff is to edit `run`.
|
|
490
|
+
See [Scripted tasks](../references/decompose.md#scripted-tasks).
|
package/docs/development.md
CHANGED
|
@@ -44,6 +44,7 @@ forge/
|
|
|
44
44
|
│ ├── forge-pr.py `forge pr`: a draft PR description for a finished run (reads with forge-ui's reader)
|
|
45
45
|
│ └── forge-install.sh install into every harness that needs it (opencode and grok find it themselves)
|
|
46
46
|
├── ui/ forge-ui: read-only local run viewer (`forge_ui` package, tests, API contract)
|
|
47
|
+
├── site/ the website and plain-language docs, published by GitHub Pages (see site/README.md)
|
|
47
48
|
└── references/
|
|
48
49
|
├── ui.md forge-ui: commands, env vars, shared server, state, privacy
|
|
49
50
|
├── harnesses.md per-harness invocation, ladders, failure modes
|
|
@@ -56,7 +57,7 @@ forge/
|
|
|
56
57
|
## Offline checks
|
|
57
58
|
|
|
58
59
|
Run `bash tests/check.sh` for offline regression checks. See [tests](../tests/README.md) for skill
|
|
59
|
-
invocation scenarios and verification limits.
|
|
60
|
+
invocation scenarios and verification limits. Two CI workflows, neither of which runs the tests: one 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).
|
|
60
61
|
|
|
61
62
|
## Runtime efficiency and measurement
|
|
62
63
|
|