@giamme/forge 0.12.1 → 0.13.1
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 +66 -0
- package/README.md +1 -1
- package/SKILL.md +29 -12
- package/VERSION +1 -1
- package/docs/add-ons.md +11 -6
- package/docs/artifacts.md +12 -6
- package/docs/commands.md +179 -17
- package/docs/decomposed-runs.md +13 -5
- package/docs/forge-ui.md +14 -4
- package/docs/memory.md +2 -1
- package/docs/models.md +4 -2
- package/docs/reviews.md +49 -20
- package/docs/troubleshooting.md +3 -1
- package/forge +17 -1
- package/package.json +1 -1
- package/references/dataset.md +39 -13
- package/references/decision-models.md +763 -0
- package/references/decompose.md +166 -29
- package/references/harnesses.md +10 -3
- package/references/planning.md +8 -0
- package/references/solo.md +13 -3
- package/scripts/forge-artifact.sh +30 -4
- package/scripts/forge-config.py +238 -29
- package/scripts/forge-contract.py +95 -56
- package/scripts/forge-control.py +40 -9
- package/scripts/forge-decide.py +6 -0
- package/scripts/forge-dispatch.sh +38 -16
- package/scripts/forge-fail-first.py +2 -2
- package/scripts/forge-gate-addressed.sh +40 -0
- package/scripts/forge-gate-message.sh +64 -0
- package/scripts/forge-issues.py +321 -33
- package/scripts/forge-jev-options.sh +269 -42
- package/scripts/forge-lib-attribute.sh +447 -0
- package/scripts/forge-lib-gates.sh +32 -0
- package/scripts/forge-lib-plans.sh +22 -6
- package/scripts/forge-lib-review.sh +22 -17
- package/scripts/forge-lib-task.sh +217 -38
- package/scripts/forge-lib-verify.sh +45 -8
- package/scripts/forge-memory.sh +3 -3
- package/scripts/forge-parallel-options.sh +18 -5
- package/scripts/forge-parallel.sh +457 -303
- package/scripts/forge-plan-check.py +35 -1
- package/scripts/forge-pre-review.py +437 -0
- package/scripts/forge-prompt.py +25 -5
- package/scripts/forge-route.py +2 -2
- package/scripts/forge-runtime.py +10 -4
- package/scripts/forge-schedule.py +21 -5
- package/scripts/forge-shadow.py +2 -2
- package/scripts/forge-solo.sh +39 -9
- package/scripts/forge-submodules.py +389 -0
- package/scripts/forge-ui-options.sh +25 -0
- package/scripts/forge_dataset/cli.py +12 -6
- package/scripts/forge_dataset/export.py +140 -84
- package/scripts/forge_dataset/harvest.py +33 -5
- package/scripts/{forge_jev/outcome.py → forge_dataset/states.py} +21 -7
- package/scripts/forge_decide/__init__.py +141 -0
- package/scripts/forge_decide/budget.py +180 -0
- package/scripts/forge_decide/cache.py +66 -0
- package/scripts/forge_decide/cli.py +953 -0
- package/scripts/forge_decide/doctor.py +270 -0
- package/scripts/forge_decide/label_addressed.py +75 -0
- package/scripts/forge_decide/label_attribution.py +62 -0
- package/scripts/forge_decide/label_coverage.py +81 -0
- package/scripts/forge_decide/label_message.py +38 -0
- package/scripts/forge_decide/label_prompt.py +139 -0
- package/scripts/forge_decide/labels.py +328 -0
- package/scripts/forge_decide/metrics.py +125 -0
- package/scripts/forge_decide/migrate.py +226 -0
- package/scripts/forge_decide/providers.py +292 -0
- package/scripts/forge_decide/replay.py +350 -0
- package/scripts/forge_decide/report.py +382 -0
- package/scripts/forge_decide/resolve.py +397 -0
- package/scripts/forge_decide/sites.py +377 -0
- package/scripts/forge_jev/__init__.py +202 -104
- package/scripts/forge_jev/addressed.py +171 -0
- package/scripts/forge_jev/attribution.py +198 -0
- package/scripts/forge_jev/cli.py +460 -382
- package/scripts/forge_jev/client.py +155 -77
- package/scripts/forge_jev/coupling.py +19 -87
- package/scripts/forge_jev/coverage.py +303 -0
- package/scripts/forge_jev/findings.py +219 -0
- package/scripts/forge_jev/gates.py +225 -27
- package/scripts/forge_jev/memory.py +65 -4
- package/scripts/forge_jev/message.py +134 -0
- package/scripts/forge_jev/plan_gates.py +294 -0
- package/scripts/forge_jev/questions.py +173 -313
- package/scripts/forge_jev/verify.py +130 -104
- package/ui/README.md +2 -2
- package/ui/docs/api.md +92 -39
- package/ui/forge_ui/control.py +71 -14
- package/ui/forge_ui/export.py +2 -1
- package/ui/forge_ui/models.py +17 -16
- package/ui/forge_ui/reader.py +132 -21
- package/ui/forge_ui/repos.py +428 -0
- package/ui/forge_ui/static/app.js +24 -5
- package/ui/forge_ui/static/cloudmodel.js +8 -5
- package/ui/forge_ui/static/controls.js +20 -13
- package/ui/forge_ui/static/modelstats.js +12 -8
- package/ui/forge_ui/static/panel.js +63 -17
- package/ui/forge_ui/static/runmodel.js +48 -7
- package/ui/forge_ui/static/scene3d.js +2 -15
- package/ui/forge_ui/static/settings.js +481 -68
- package/ui/forge_ui/static/style.css +56 -9
- package/references/jev.md +0 -865
- package/scripts/forge_jev/backtest.py +0 -322
- package/scripts/forge_jev/corpus.py +0 -156
- package/scripts/forge_jev/features.py +0 -24
- package/scripts/forge_jev/predict.py +0 -204
- package/scripts/forge_jev/review.py +0 -73
- package/scripts/forge_jev/routing.py +0 -271
- package/scripts/forge_jev/subset.py +0 -123
package/references/decompose.md
CHANGED
|
@@ -14,6 +14,7 @@ run leaves branches behind.
|
|
|
14
14
|
- [Fractal within decomposed tasks](#fractal-within-decomposed-tasks)
|
|
15
15
|
- [Waves and disjointness](#waves-and-disjointness)
|
|
16
16
|
- [Task size and acceptance criteria](#task-size-and-acceptance-criteria)
|
|
17
|
+
- [Plan gates: sent back, and the block under the table](#plan-gates-sent-back-and-the-block-under-the-table)
|
|
17
18
|
- [The capsule](#the-capsule)
|
|
18
19
|
- [Planning](#planning)
|
|
19
20
|
- [QA verdicts](#qa-verdicts)
|
|
@@ -121,7 +122,11 @@ none of those exist, `UNASSIGNED`. An `UNASSIGNED` task makes `plan` exit 2 and
|
|
|
121
122
|
outright. Forge does not invent a model when the user has not said which one should spend
|
|
122
123
|
their quota.
|
|
123
124
|
|
|
124
|
-
QA has no tier rules by default and falls back to `opus`, matching single-task forge.
|
|
125
|
+
QA has no tier rules by default and falls back to `opus` at `high`, matching single-task forge.
|
|
126
|
+
When the user names no reviewers, offer reviewers sized to the task's risk (never add them
|
|
127
|
+
unprompted): `--qa-low sonnet:medium --qa-medium sonnet:high --qa-high opus:high`. In the
|
|
128
|
+
SWE-bench Pro benchmark (#89) Sonnet reviewers gave no false PASS at about a seventh of an
|
|
129
|
+
`opus:xhigh` review's cost.
|
|
125
130
|
|
|
126
131
|
### Exploratory routing (on by default)
|
|
127
132
|
|
|
@@ -159,7 +164,7 @@ needs some randomized picks, so `plan` makes a few: `--explore E`, with E betwee
|
|
|
159
164
|
keeps such a task in the arm it was assigned and reports it as not followed.
|
|
160
165
|
|
|
161
166
|
`forge dataset routing` reads the draws back: per (tier, pool pick, neighbour) pair, each
|
|
162
|
-
arm's first-pass rate (inverse-propensity weighted, every task in the arm it was assigned),
|
|
167
|
+
arm's first-try pass rate (inverse-propensity weighted, every task in the arm it was assigned),
|
|
163
168
|
attrition, runtime and a run-clustered interval, judged at the first of 30, 60 or 120
|
|
164
169
|
neighbour assignments it reaches. See [Dataset](dataset.md#routing). At the default rate
|
|
165
170
|
that is weeks of normal use per pair; a pair that matters can be given more with
|
|
@@ -263,11 +268,42 @@ So:
|
|
|
263
268
|
criteria. A heading inside a code fence, or with nothing under it, does not count. The
|
|
264
269
|
block never changes the table or the exit code.
|
|
265
270
|
|
|
271
|
+
## Plan gates: sent back, and the block under the table
|
|
272
|
+
|
|
273
|
+
With the prompt or coverage gate `on` (`forge decide gate <gate> on`; see
|
|
274
|
+
[decision models](decision-models.md)), `plan` can **exit 4**. That means: the gates sent work
|
|
275
|
+
back, nothing was validated and no `waves.tsv` was written by this call. Read
|
|
276
|
+
`<plan>/plan.sendback.md`, which `plan` also prints:
|
|
277
|
+
|
|
278
|
+
- **Task prompts a reviewer could not judge** (prompt gate): rewrite each listed
|
|
279
|
+
`tasks/<id>/prompt.md` so a reviewer can verify it, with checkable acceptance criteria.
|
|
280
|
+
- **Requirements no task covers** (coverage gate): extend a task's `## Acceptance criteria`
|
|
281
|
+
or add a task for each listed requirement of `request.md`.
|
|
282
|
+
|
|
283
|
+
Then run `plan` again, **once**. Forge sends each task and requirement back only once: what
|
|
284
|
+
is still flagged on the second call is listed under the table instead, and `plan` goes on.
|
|
285
|
+
With a dispatched planner (`--planner`), re-dispatch it with `plan.sendback.md` appended to
|
|
286
|
+
its prompt rather than editing the tasks yourself. In `shadow` a gate records and sends
|
|
287
|
+
nothing back, and with the gates `off` or decision models off `plan` never exits 4.
|
|
288
|
+
|
|
289
|
+
Under the table, `plan` prints a `decision-model gates:` block from `plan-gates.json` when a
|
|
290
|
+
gate recorded anything:
|
|
291
|
+
|
|
292
|
+
- `drift added to <task>: <files>`: drift `on` appended files to the task's `files` column
|
|
293
|
+
(`tasks.declared.tsv` keeps your table), so waves treat them as declared. Shadow lines say
|
|
294
|
+
*would add* and change nothing.
|
|
295
|
+
- `forward added a dependency: <a> now waits for <b>`: forward `on` made `a` depend on `b`
|
|
296
|
+
and recomputed the waves; a pair that would form a cycle is listed as skipped. Delete the
|
|
297
|
+
dep from `tasks.tsv` to undo it.
|
|
298
|
+
- `prompt still below … after its rewrite` and `requirements no task covers`: flagged items
|
|
299
|
+
that were already sent back once.
|
|
300
|
+
|
|
266
301
|
## The capsule
|
|
267
302
|
|
|
268
303
|
Every dispatch is a clean slate — forge never passes `--continue`, `--resume`, or
|
|
269
304
|
`codex exec resume`, except the opt-in `plan --reviewer-session` experiment (it continues
|
|
270
|
-
a reviewer's session across rounds on claude, openclaude and codex)
|
|
305
|
+
a reviewer's session across rounds on claude, openclaude and codex) and the opt-in
|
|
306
|
+
`plan --implementer-session` (a retry continues its implementer's session). That keeps one task's
|
|
271
307
|
confused turn from poisoning another and keeps each task's context small, but it also
|
|
272
308
|
leaves each dwarf blind to the wider run.
|
|
273
309
|
|
|
@@ -278,7 +314,7 @@ Complete requirements, approach, retry findings and distinct memory facts are as
|
|
|
278
314
|
per role; implementation and review instructions are separate.
|
|
279
315
|
|
|
280
316
|
It exists to prevent two specific failures that clean slates create, which the opt-in
|
|
281
|
-
`--reviewer-session`
|
|
317
|
+
`--reviewer-session` and `--implementer-session` do not change:
|
|
282
318
|
|
|
283
319
|
- a dwarf reimplementing a helper an earlier task already merged, because nothing told it
|
|
284
320
|
that task was done;
|
|
@@ -313,10 +349,17 @@ renders both — the last moment the plan can be changed for free.
|
|
|
313
349
|
Decompose-mode QA prompts require a final line:
|
|
314
350
|
|
|
315
351
|
```
|
|
316
|
-
FORGE_VERDICT: PASS
|
|
317
|
-
FORGE_VERDICT: FAIL
|
|
352
|
+
FORGE_VERDICT: PASS — no CONFIRMED finding at the blocking threshold (P2 or worse)
|
|
353
|
+
FORGE_VERDICT: FAIL — at least one CONFIRMED finding at the blocking threshold (P2 or worse)
|
|
318
354
|
```
|
|
319
355
|
|
|
356
|
+
forge decides the verdict from the findings, at a blocking threshold: `P2` unless
|
|
357
|
+
`--qa-threshold` sets another. A CONFIRMED finding at the threshold or worse, or one with no
|
|
358
|
+
severity, blocks: a PASS that lists one becomes FAIL. A CONFIRMED finding below the threshold
|
|
359
|
+
never blocks: a FAIL made only of those is accepted, and either way they are recorded in
|
|
360
|
+
`known_issues.md`, which `forge issues` and the sweep pick up. PLAUSIBLE findings never block.
|
|
361
|
+
`--qa-threshold P3` (or `none`) makes every CONFIRMED finding block.
|
|
362
|
+
|
|
320
363
|
The runner accepts only a standalone verdict on the final nonempty line (the shared parser
|
|
321
364
|
also tolerates the dash gloss the prompt prints after each verdict, trailing whitespace and
|
|
322
365
|
CRLF). A missing verdict is `UNKNOWN` and is treated exactly
|
|
@@ -337,8 +380,10 @@ review; the implementer rules appended to every dwarf prompt come from the same
|
|
|
337
380
|
`plan --fail-first` (and `forge-solo.sh --fail-first`) checks that the tests a change adds
|
|
338
381
|
or edits can fail. Before each review, forge exports the reviewed commit and, separately,
|
|
339
382
|
the task's base plus only the change's test-path files (tests, their fixtures and helpers),
|
|
340
|
-
then runs `.forge/verify-subset` (
|
|
341
|
-
|
|
383
|
+
then runs `.forge/verify-subset` (a per-file test command that contains `{files}`, such as
|
|
384
|
+
`pytest -q {files}` or `npm test -- {files}`; it is a separate file from `.forge/verify` because
|
|
385
|
+
there is no general way to restrict an arbitrary command to a file list) once per new or
|
|
386
|
+
edited test file in each. Every file gets one result in
|
|
342
387
|
`tasks/<id>/failfirst.json` (solo: `<run>/failfirst.json`):
|
|
343
388
|
|
|
344
389
|
- `proven`: passes with the change, fails without it;
|
|
@@ -349,13 +394,87 @@ then runs `.forge/verify-subset` (the per-file test command with `{files}`, see
|
|
|
349
394
|
The reviewer's prompt lists the results and asks for a `[P2][CONFIRMED]` finding for each
|
|
350
395
|
test that passes without the change, unless the reviewer explains why it need not fail
|
|
351
396
|
(a refactor kept green). It is advice: forge never changes a status or verdict from it, and
|
|
352
|
-
a P2 only blocks through the reviewer and the usual
|
|
397
|
+
a P2 only blocks through the reviewer and the usual threshold gate (`P2` by default, see [QA verdicts](#qa-verdicts)). The exports are
|
|
353
398
|
throwaway directories outside the review snapshot, so no fingerprint changes. forge-ui
|
|
354
399
|
shows the evidence under the task's review findings, and each check is recorded in the
|
|
355
400
|
run dataset as a `fail_first` event with the JSON attached. Without
|
|
356
401
|
`.forge/verify-subset` the check records `skipped` and the prompt says nothing.
|
|
357
402
|
`plan --no-fail-first` turns it off again.
|
|
358
403
|
|
|
404
|
+
### Pre-review tests (opt-in)
|
|
405
|
+
|
|
406
|
+
`plan --pre-review-tests` runs **only the tests an attempt affects** before paying for its
|
|
407
|
+
review, never the whole suite (that stays the run's end-of-run verification). After an attempt is
|
|
408
|
+
committed, forge exports the reviewed commit and runs `.forge/verify-subset` on a selection:
|
|
409
|
+
|
|
410
|
+
1. the test files the change adds or edits;
|
|
411
|
+
2. for each changed source file, the tests from the first source that answers: `.forge/test-map`,
|
|
412
|
+
then the naming convention (`foo.py` → `test_foo.py`, `foo_test.py`, `foo.test.js`, ...), then
|
|
413
|
+
a reverse lookup (test files that name the changed module);
|
|
414
|
+
3. with `{changed}` in the command instead of `{files}`, the changed paths themselves, for a runner
|
|
415
|
+
that finds the related tests on its own (`npx jest --findRelatedTests {changed}`).
|
|
416
|
+
|
|
417
|
+
`.forge/test-map` is the reliable source; one rule per line, `#` comments, globs where `*` also
|
|
418
|
+
matches `/`, and `-` for "no tests":
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
scripts/forge-issues.py tests/test_issues.py tests/test_sweep.py
|
|
422
|
+
ui/forge_ui/*.py ui/tests/test_*.py
|
|
423
|
+
docs/* -
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
A change to shared test infrastructure (a conftest, a test helper, a lockfile, a build file),
|
|
427
|
+
more than 20 selected files (`FORGE_PRE_REVIEW_MAX_FILES`) or a run past 120 s
|
|
428
|
+
(`FORGE_PRE_REVIEW_TIMEOUT`) makes the check `skipped` as too broad. A failing run is rerun file
|
|
429
|
+
by file (a file that passes alone is `flaky`), and each file that still fails is run on the task
|
|
430
|
+
base: one that fails there too is `pre-existing` and does not count against the attempt.
|
|
431
|
+
|
|
432
|
+
- **Red** (`failed`): the attempt is `FAIL` without a review. Its retry findings are the failing
|
|
433
|
+
tests and the end of their output, labelled as forge's (`tasks/<id>/prereview.md`). It counts
|
|
434
|
+
toward `--retry-failed` and `--escalate-after` like a rejected attempt.
|
|
435
|
+
- **Green**, `flaky` or `pre-existing`: the review runs, and the reviewer's prompt says what forge
|
|
436
|
+
ran and found.
|
|
437
|
+
- **Skipped or broken** (no `.forge/verify-subset`, nothing selected, too broad, a command error):
|
|
438
|
+
the review runs exactly as without the option. The check never blocks on its own failure.
|
|
439
|
+
|
|
440
|
+
The implementer is told forge will run them, so it need not repeat them exhaustively. Checks run
|
|
441
|
+
in throwaway exports, so neither the task worktree nor any fingerprint changes; at most 2 run at
|
|
442
|
+
once across the plan's tasks (`plan --pre-review-parallel N`, 1-64). A QA-only resume reuses the
|
|
443
|
+
check of the commit it re-reviews. `tasks/<id>/prereview.json` records the selection, every run
|
|
444
|
+
and the outcome; forge-ui shows it under the task's review findings, and the dataset records a
|
|
445
|
+
`pre_review` event. `forge control set <plan> pre-review-tests on|off` and `pre-review-parallel N`
|
|
446
|
+
change both while a run works; `plan --no-pre-review-tests` turns it off.
|
|
447
|
+
|
|
448
|
+
### Implementer session (opt-in)
|
|
449
|
+
|
|
450
|
+
`plan --implementer-session` makes a retry **continue the implementer's own session** instead of
|
|
451
|
+
starting one that re-reads the same files: the dwarf keeps what it learned, and the retry's prompt
|
|
452
|
+
(the task, the findings, the rules) arrives as the next turn, after a short note that its work is
|
|
453
|
+
as it left it. It applies to claude and openclaude. codex's `exec resume` takes no sandbox flag, so
|
|
454
|
+
a codex implementer could be resumed only by a config override nobody verifies, and it stays fresh.
|
|
455
|
+
|
|
456
|
+
A retry continues only when all of these hold; anything else is a fresh session, as without the
|
|
457
|
+
option:
|
|
458
|
+
|
|
459
|
+
- it carries findings from a review, or from pre-review tests, of a commit this session made;
|
|
460
|
+
- the worktree is still exactly that commit: no edits since (a timed-out or interrupted attempt
|
|
461
|
+
leaves some), nothing committed on top;
|
|
462
|
+
- the dwarf resolves to the same harness, model and effort, so an escalation (`--escalate-after`,
|
|
463
|
+
a pin, `retry --dwarf`) starts fresh;
|
|
464
|
+
- the plan is not Fractal.
|
|
465
|
+
|
|
466
|
+
A continue the harness refuses or that fails at once (dispatch exit **9**, nothing changed in the
|
|
467
|
+
worktree) is followed by a fresh dispatch of the same prompt, which decides the attempt. One that
|
|
468
|
+
fails after it already changed files is a failed implementer (`ERROR`), as a fresh one would be:
|
|
469
|
+
running another on top would pay for the attempt twice. One row per attempt goes to
|
|
470
|
+
`tasks/<id>/implementer_sessions.tsv`: row, attempt, `continued`, `fresh` or `failed`, the reason
|
|
471
|
+
(`same-spec`, `first-attempt`, `no-findings`, `work-changed`, `no-session`, `invalid-session`,
|
|
472
|
+
`spec-changed`, `harness-unsupported`, `fractal`, `continue-unsupported`, `continue-failed`) and
|
|
473
|
+
the session id it considered. The dataset tags a continued dwarf dispatch `session_continue`, and
|
|
474
|
+
`forge dataset status` counts implementer continues apart from reviewer ones.
|
|
475
|
+
`plan --no-implementer-session` turns it off; `split` and `combine` carry it (combine only when
|
|
476
|
+
every source has it).
|
|
477
|
+
|
|
359
478
|
### Shadow reviews (opt-in)
|
|
360
479
|
|
|
361
480
|
`plan --shadow-qa <spec>[,<spec>...] [--shadow-rate R]` sends a sampled share of
|
|
@@ -392,23 +511,26 @@ P0 data loss, security hole, crash or wrong result on the main path; P1 wrong be
|
|
|
392
511
|
realistic input or a broken existing contract; P2 edge-case bug, unusual-timing race, missing
|
|
393
512
|
hardening; P3 minor. Severity is impact; CONFIRMED/PLAUSIBLE is confidence.
|
|
394
513
|
|
|
395
|
-
|
|
396
|
-
|
|
514
|
+
`--qa-threshold Pn` on `plan`, `run`, `retry` or `review` (remembered in `<plan>/qa_threshold`; `none`
|
|
515
|
+
means P3, `default` removes the setting) changes the default `P2`, the **least severe level that
|
|
516
|
+
still blocks** (see [QA verdicts](#qa-verdicts)). `tasks/<id>/qa_threshold` overrides it per task (a
|
|
517
|
+
per-task `none` means P3, so it exempts the task from a looser plan threshold; `forge control set ... qa-threshold`
|
|
518
|
+
writes both and takes effect at the next attempt) —
|
|
397
519
|
the way to give a dev-tooling or investigation task a looser bar than production code,
|
|
398
520
|
which otherwise gets a new finding in a new corner of a non-default option every round and
|
|
399
521
|
only a human decision ends it. The orchestrator decides *deterministically* (`forge-contract.py gate`),
|
|
400
|
-
|
|
522
|
+
and does not take the reviewer's word in either direction: a `FAIL` becomes `PASS` with known
|
|
401
523
|
issues only when there is at least one CONFIRMED finding, every CONFIRMED finding carries a
|
|
402
|
-
`P0..P3` label, and all of them are strictly milder than the threshold
|
|
403
|
-
any blocking finding, or a `FAIL` with no
|
|
404
|
-
then the literal `PASS`; `known_issues.md`,
|
|
405
|
-
|
|
524
|
+
`P0..P3` label, and all of them are strictly milder than the threshold; a `PASS` that lists a
|
|
525
|
+
blocking finding becomes `FAIL`. Anything unlabelled, any blocking finding, or a `FAIL` with no
|
|
526
|
+
CONFIRMED finding stays a failure. The task's status is then the literal `PASS`; `known_issues.md`,
|
|
527
|
+
`qa.gate` and the summary say what was tolerated.
|
|
406
528
|
|
|
407
529
|
### The finding sweep (opt-in)
|
|
408
530
|
|
|
409
531
|
Tolerated findings are recorded, not fixed. `run --sweep Pn` fixes them inside the run instead: once
|
|
410
532
|
every task has merged, and before the combined verification, the scheduler runs `forge-sweep.py plan`
|
|
411
|
-
once. It collects the open findings at `Pn` or worse (the ones
|
|
533
|
+
once. It collects the open findings at `Pn` or worse (the ones the threshold tolerated, plus
|
|
412
534
|
PLAUSIBLE ones with `--sweep-plausible`), with `forge issues`' own collector, and leaves out:
|
|
413
535
|
|
|
414
536
|
- findings a person accepted with `accept`, and findings of fix tasks (one round: what a sweep review
|
|
@@ -482,10 +604,10 @@ lines, because every labelled line is counted. That is the retry's review, not t
|
|
|
482
604
|
QA-only re-run above.
|
|
483
605
|
|
|
484
606
|
**In-run retries.** `run <plan> --retry-failed N` re-queues a task whose reviewer said
|
|
485
|
-
`FAIL`/`UNKNOWN` as soon as it ends, up to `N` more times in that run, preparing the retry exactly
|
|
607
|
+
`FAIL`/`UNKNOWN`, or whose review was `INVALIDATED` by a change to the review copy, as soon as it ends, up to `N` more times in that run, preparing the retry exactly
|
|
486
608
|
as `retry` does (same findings carry-forward, same pinned base, same cumulative review). Other
|
|
487
609
|
tasks keep running; dependents wait for the task to merge. It applies per invocation (not
|
|
488
|
-
remembered), never to `TIMEOUT`/`ERROR`/`
|
|
610
|
+
remembered), never to `TIMEOUT`/`ERROR`/`CONFLICT` or an `INVALIDATED` merge, and never after a retry that
|
|
489
611
|
changed nothing (`tasks/<id>/noretry`). Every entry is logged in `tasks/<id>/attempts.tsv`.
|
|
490
612
|
|
|
491
613
|
**Escalation after repeated failures.** In forge's history the first three attempts at a task
|
|
@@ -529,7 +651,7 @@ changed spec passed, mostly effort bumps); the attempts this policy makes are wh
|
|
|
529
651
|
|
|
530
652
|
**Live controls.** `forge control show|set|pin|unpin <plan>` changes a run while it works:
|
|
531
653
|
`qa-threshold` (read once per attempt, so an attempt keeps the bar it started with; per task, `none`
|
|
532
|
-
exempts it and `inherit` drops the override), `timeout`, `escalate-after`, `escalate-effort`
|
|
654
|
+
(P3) exempts it from a looser plan threshold and `inherit` drops the override; at plan level, `default` restores P2), `timeout`, `escalate-after`, `escalate-effort`
|
|
533
655
|
(`on|off`), `verify-retries`, `infra-backoff` (a shape as for `--infra-backoff`; `none` drops it,
|
|
534
656
|
read at the next infrastructure wait), and, only while a scheduler is live, `retry-budget` (plan
|
|
535
657
|
or `--task`), `infra-retries` and `max-parallel` (1 to 64, at the next dispatch decision; a lower
|
|
@@ -683,7 +805,7 @@ Four subcommands act on plans after tasks have run. Full usage and refusal condi
|
|
|
683
805
|
over the combined result (`integration.base..tip`, or `parent..candidate`) in a disposable
|
|
684
806
|
checkout with the goal, every task's requirements, known issues, drift, guard notes and the
|
|
685
807
|
verification result in front of the reviewer. Same verdict/severity contract and
|
|
686
|
-
|
|
808
|
+
threshold gate as per-task QA; a mutation during the review is `INVALIDATED`; a `FAIL`
|
|
687
809
|
or missing verdict blocks `integrate` with exit `5`, an infrastructure stop with `8`, and the
|
|
688
810
|
user's branch is never touched. Nothing runs unless one of them is invoked.
|
|
689
811
|
- **`split <plan> <new-plan> --tasks a,b`** copies the selected tasks' saved state to a new plan,
|
|
@@ -704,7 +826,7 @@ removes what it created.
|
|
|
704
826
|
<repo>/../.forge-worktrees/<run-id>/<task-id> task worktree
|
|
705
827
|
<repo>/../.forge-worktrees/<run-id>/_integration integration worktree
|
|
706
828
|
forge/<run-id>/<task-id> task branch
|
|
707
|
-
forge/<run-id
|
|
829
|
+
forge/<run-id>-integration integration branch
|
|
708
830
|
```
|
|
709
831
|
|
|
710
832
|
Fractal also keeps control repositories, isolated product candidates and per-step logs
|
|
@@ -734,6 +856,21 @@ one checkout holding every task's merged work is the one checkout that cannot bu
|
|
|
734
856
|
Failure is reported and non-fatal: the dwarf gets a worktree it can still install into itself,
|
|
735
857
|
which is the status quo this replaces. Output lands in `tasks/<id>/setup.out`.
|
|
736
858
|
|
|
859
|
+
**Submodules.** `git worktree add` leaves every submodule directory empty. Before the setup step,
|
|
860
|
+
forge fills them offline from the source checkout (no fetch, no `git submodule`), so `.forge/setup`
|
|
861
|
+
sees a complete tree. Each submodule gets one state in `tasks/<id>/submodules.txt`:
|
|
862
|
+
|
|
863
|
+
- `exported` — the recorded commit was extracted from the source's submodule repository;
|
|
864
|
+
- `copied` — that commit was not available, so the source checkout's files were copied;
|
|
865
|
+
- `kept` — the directory already held files (a resume), left as they are;
|
|
866
|
+
- `missing` — nothing was available; the directory stays empty and the runner prints a note.
|
|
867
|
+
|
|
868
|
+
The files carry no `.git`, so git ignores them: they never appear in `changes.diff`, a commit, a
|
|
869
|
+
review snapshot or a fingerprint, and the worktree still moves and is removed normally. The capsule
|
|
870
|
+
tells the dwarf which submodules are present. Integration worktrees (`run`, `integrate`, `combine`,
|
|
871
|
+
`split`) get the same treatment. Out of scope: a task that moves a gitlink's recorded commit (its
|
|
872
|
+
worktree keeps the old content) and nested submodules (left empty).
|
|
873
|
+
|
|
737
874
|
Forge does not guess this step, and the obvious guess is worth naming because it looks right and
|
|
738
875
|
is not: symlinking the source repo's `node_modules` into the worktree. In a workspace monorepo the
|
|
739
876
|
workspace links inside it point back at the source checkout, so the worktree builds against the
|
|
@@ -766,7 +903,8 @@ The user's own branch and working tree are untouched for the whole run.
|
|
|
766
903
|
| task status `INFRA`, `run` exits `8` | quota/auth/rate limit/network/empty output stopped a dispatch; no attempt spent. See `tasks/<id>/infra.txt`, fix the cause, run again (or `--infra-retries M`, `--infra-fallback`) |
|
|
767
904
|
| task status `INTERRUPTED`, `run` exits `130` | the run was signalled or stopped with `forge control stop --now`; verification was skipped. The summary prints `forge-parallel.sh retry <plan> <id>` for each one; a plain `run` does not dispatch them |
|
|
768
905
|
| a run that sits idle with tasks `PENDING` | `forge control drain` is in effect (`forge control show` says `drained`; `forge control resume` continues), every scope a task needs is paused on infrastructure (`infra.paused`), or `max-parallel` is lower than you think |
|
|
769
|
-
| a `FAIL` task merged anyway |
|
|
906
|
+
| a `FAIL` task merged anyway | the threshold (`P2` by default) tolerated its findings, or a person ran `accept`; see `known_issues.md` and `qa.gate` |
|
|
907
|
+
| a task `FAIL`ed although its reviewer said `PASS` | forge's gate: a CONFIRMED finding at or above the threshold was listed (`qa.gate` decision `fail`); the retry starts with a note saying so |
|
|
770
908
|
| task status `CONFLICT` | QA passed but the merge onto the integration branch conflicted — `files` was understated somewhere |
|
|
771
909
|
| every wave has one task | `files` sets overlap across most tasks; the decomposition is not actually parallel |
|
|
772
910
|
| dwarves ignore existing work | `goal.txt` or `files` missing, so the capsule carries no useful status |
|
|
@@ -790,8 +928,9 @@ retried after its prerequisites merge. A fresh task then branches from current i
|
|
|
790
928
|
|
|
791
929
|
QA receives complete implementation input, approach, capsule and cumulative binary diff.
|
|
792
930
|
It runs in a disposable repository. Both source and review fingerprints must remain unchanged,
|
|
793
|
-
and the task branch must still point at the reviewed commit when merged
|
|
794
|
-
|
|
931
|
+
and the task branch must still point at the reviewed commit when merged; the review copy is a
|
|
932
|
+
commit, so only its tracked content counts (a test run's untracked `__pycache__/` there changes
|
|
933
|
+
nothing). INVALIDATED results never merge; `retry` re-runs only QA while the work is unchanged. Disposable snapshots detect mutation; they do not confine unrestricted shell access.
|
|
795
934
|
|
|
796
935
|
Configure combined executable checks with `run <plan> --verify '<command>'` (also accepted by
|
|
797
936
|
`retry`), or a shell command file at `<repo>/.forge/verify`. Commands execute under Bash from
|
|
@@ -803,8 +942,7 @@ A failed command whose source fingerprint is unchanged is rerun (`--verify-retri
|
|
|
803
942
|
`1`, `0` = strict single run). A rerun that passes leaves status `PASS` but writes
|
|
804
943
|
`verification.flaky` (both exit codes), keeps the first run in `verification.log` and the second
|
|
805
944
|
in `verification.retry.log`, and prints a loud `FLAKY` line in `run`/`retry`/`integrate` output;
|
|
806
|
-
a command that changes the tree is never retried.
|
|
807
|
-
triage, which then does not.
|
|
945
|
+
a command that changes the tree is never retried.
|
|
808
946
|
|
|
809
947
|
**Verification lanes.** Instead of one command, verification can be several named **lanes**
|
|
810
948
|
that run side by side, each rerun on its own. A lane is a file whose name is the lane's name
|
|
@@ -835,8 +973,7 @@ in the run output (`FLAKY: lane <name> failed once and passed on rerun`), in
|
|
|
835
973
|
checkout's fingerprint is compared after every round, and a change fails the verification
|
|
836
974
|
(`mutated`; with lanes in parallel it cannot be pinned to one of them). A lane's states are
|
|
837
975
|
`waiting`, `running`, `pass`, `fail`, `flaky`, `known`, `skipped` and `interrupted`. Lanes mode
|
|
838
|
-
replaces the whole-command rerun above
|
|
839
|
-
site is on); the single-command mode is unchanged.
|
|
976
|
+
replaces the whole-command rerun above; the single-command mode is unchanged.
|
|
840
977
|
|
|
841
978
|
A lane may print `::forge step name=<step> state=start` and `::forge step name=<step>
|
|
842
979
|
state=end [exit=<n>]`, each on a line of its own, to say which step it is in; forge-ui shows the
|
package/references/harnesses.md
CHANGED
|
@@ -22,7 +22,7 @@ provider test. See [Fractal execution](fractal.md).
|
|
|
22
22
|
- [opencode](#opencode)
|
|
23
23
|
- [antigravity (agy)](#antigravity-agy)
|
|
24
24
|
- [grok](#grok)
|
|
25
|
-
- [Continuing a reviewer session](#continuing-a-reviewer-session)
|
|
25
|
+
- [Continuing a reviewer session](#continuing-a-reviewer-session) (and an implementer's)
|
|
26
26
|
- [Adding a harness](#adding-a-harness)
|
|
27
27
|
|
|
28
28
|
## At a glance
|
|
@@ -329,8 +329,15 @@ A grok reviewer has not been proven live yet.
|
|
|
329
329
|
`forge-dispatch.sh qa <spec> ... --continue-session <id>` continues an earlier reviewer session instead of
|
|
330
330
|
starting a fresh one. `<id>` is the session or thread id a dispatch left in `<run-dir>/<role>.session`
|
|
331
331
|
(8 to 128 characters of `[A-Za-z0-9-]`, not starting with `-`). It is accepted for the `qa` role on claude,
|
|
332
|
-
openclaude and codex in custom-prompt mode only
|
|
333
|
-
|
|
332
|
+
openclaude and codex in custom-prompt mode only, and for the `dwarf` role on claude and openclaude
|
|
333
|
+
(`plan --implementer-session`); any other role or harness, `--native-review` or a malformed id is a usage
|
|
334
|
+
error (exit 2). Nothing in forge asks for it by default.
|
|
335
|
+
|
|
336
|
+
An implementer continues with the fresh dwarf argv plus `--resume <id>`, so it keeps `acceptEdits` and its
|
|
337
|
+
Bash allowance. codex is reviewer-only: `exec resume` has no `-s` and no `--approve-for-me` (checked against
|
|
338
|
+
codex-cli 0.164.0), so its write access would rest on a config override that nothing verifies, and a
|
|
339
|
+
sandbox it silently lacked would end in an empty diff. Its preamble says the work has been reviewed since,
|
|
340
|
+
is in `<repo>` as the implementer left it and need not be re-read, and that this attempt's instructions win.
|
|
334
341
|
|
|
335
342
|
Probed 2026-10-22 (claude 2.1.307, codex 0.162.0):
|
|
336
343
|
|
package/references/planning.md
CHANGED
|
@@ -38,5 +38,13 @@ pass on a first attempt, each ending its prompt with an `## Acceptance criteria`
|
|
|
38
38
|
checks the reviewer can verify; see [task size](decompose.md#task-size-and-acceptance-criteria). Write each task's approach to
|
|
39
39
|
`tasks/<id>/approach.md`, where the runner picks it up for both the dwarf and qa.
|
|
40
40
|
|
|
41
|
+
If `plan` exits 4 (the prompt or coverage gate is `on` and sent work back), read
|
|
42
|
+
`<plan>/plan.sendback.md` and re-dispatch the planner with that file appended to its prompt: it
|
|
43
|
+
rewrites the listed `prompt.md` files and extends or adds tasks for each uncovered requirement.
|
|
44
|
+
Then run `plan` again, once; forge never sends the same task or requirement back twice. Under
|
|
45
|
+
the table, the `decision-model gates:` block lists what drift and forward added to
|
|
46
|
+
`tasks.tsv` (files and deps, `on` only) and what is still flagged; see
|
|
47
|
+
[decomposition](decompose.md#plan-gates-sent-back-and-the-block-under-the-table).
|
|
48
|
+
|
|
41
49
|
Show the approach before dispatching and let the user change it. That gate is the last
|
|
42
50
|
moment the plan is free; after it, changing the plan costs a whole run.
|
package/references/solo.md
CHANGED
|
@@ -46,7 +46,7 @@ Statuses: PASS, FAIL, UNKNOWN, NOCHANGES, INVALIDATED. Exit codes: 0 completed r
|
|
|
46
46
|
review, 7 timeout, 8 infrastructure failure (quota, auth, rate limit, network, empty output:
|
|
47
47
|
nothing was judged — fix the cause and run again; a dwarf that returns nothing *and* changes
|
|
48
48
|
nothing is reported as 8, not 5). The default dispatch timeout is 2700 seconds, scaled up for
|
|
49
|
-
`xhigh`/`max` effort (so the default
|
|
49
|
+
`xhigh`/`max` effort (so the default planner effort gets 3600; QA defaults to `high`), overridable per model in the
|
|
50
50
|
registry; 0 disables that dispatch timeout, but an enabled Fractal task still has its own attempt
|
|
51
51
|
deadline. See [dispatch timeouts](../docs/commands.md#scriptsforge-dispatchsh).
|
|
52
52
|
|
|
@@ -54,8 +54,18 @@ The dwarf prompt carries implementer rules (no commits, no background processes,
|
|
|
54
54
|
measurement before the last message). forge records what it observes: if the dwarf committed
|
|
55
55
|
anyway the run still reviews its changes, says so, and prints `git reset --soft <old HEAD>` —
|
|
56
56
|
it never resets anything itself; leftover processes (stopped) and promises of later work appear
|
|
57
|
-
under "implementer guard notes". The QA prompt asks for `P0..P3`-labelled findings
|
|
58
|
-
|
|
57
|
+
under "implementer guard notes". The QA prompt asks for `P0..P3`-labelled findings.
|
|
58
|
+
|
|
59
|
+
forge decides the verdict from the findings, at a blocking threshold: `P2` unless
|
|
60
|
+
`--qa-threshold` sets another. A CONFIRMED finding at the threshold or worse, or one with no
|
|
61
|
+
severity, blocks: a PASS that lists one becomes FAIL. A CONFIRMED finding below the threshold
|
|
62
|
+
never blocks: a FAIL made only of those is accepted, and either way they are recorded in
|
|
63
|
+
`known_issues.md`, which `forge issues` and the sweep pick up. PLAUSIBLE findings never block.
|
|
64
|
+
`--qa-threshold P3` (or `none`) makes every CONFIRMED finding block.
|
|
65
|
+
|
|
66
|
+
`--qa-threshold P0|P1|P2|P3|none` sets this run's threshold and is written to `<run>/qa_threshold`
|
|
67
|
+
only when given. The gate, the same as in a decomposed run, writes `qa.gate` and `known_issues.md`
|
|
68
|
+
in the run directory. See [the verdict rule](decompose.md#qa-verdicts).
|
|
59
69
|
|
|
60
70
|
`--native-review` is an explicit Codex-only alternative: native review cannot accept the
|
|
61
71
|
custom requirements prompt or verdict instruction. Its result is informational and UNKNOWN;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Shared artifact operations. A private index never stages or unstages user work.
|
|
3
|
+
# forge_tree <dir> [--tracked]: the tree of everything in <dir> that is not ignored. --tracked
|
|
4
|
+
# leaves untracked files out, for a copy whose artifact is a commit: there an untracked file
|
|
5
|
+
# (a test run's __pycache__/ in a repository with no .gitignore) cannot reach what merges.
|
|
3
6
|
forge_tree() (
|
|
4
7
|
cd "$1" || exit 1
|
|
5
|
-
local idx tree actual_index f
|
|
8
|
+
local idx tree actual_index f add=-A
|
|
9
|
+
[ "${2:-}" = --tracked ] && add=-u
|
|
6
10
|
idx="$(mktemp "${TMPDIR:-/tmp}/forge-index.XXXXXX")" || exit 1
|
|
7
11
|
rm -f "$idx"
|
|
8
12
|
trap 'rm -f "$idx"' EXIT
|
|
9
13
|
actual_index="$(git rev-parse --git-path index)" || exit 1
|
|
10
14
|
export GIT_INDEX_FILE="$idx"
|
|
11
|
-
git read-tree HEAD && git add
|
|
15
|
+
git read-tree HEAD && git add "$add" -- . ':(exclude).forge' || exit 1
|
|
12
16
|
# Force-added ignored files are tracked in the real index, but not in HEAD yet.
|
|
13
17
|
GIT_INDEX_FILE="$actual_index" git diff --cached --name-only --diff-filter=A -z HEAD |
|
|
14
18
|
while IFS= read -r -d '' f; do
|
|
@@ -55,14 +59,36 @@ forge_review_snapshot() ( # source, baseline tree, final tree, destination
|
|
|
55
59
|
|
|
56
60
|
)
|
|
57
61
|
|
|
58
|
-
forge_fingerprint() {
|
|
62
|
+
forge_fingerprint() { # forge_fingerprint <dir> [--tracked], as forge_tree
|
|
59
63
|
local tree head index
|
|
60
|
-
tree="$(forge_tree "$1")" || return 1
|
|
64
|
+
tree="$(forge_tree "$1" "${2:-}")" || return 1
|
|
61
65
|
head="$(git -C "$1" rev-parse HEAD)" || return 1
|
|
62
66
|
index="$(git -C "$1" diff --cached --binary HEAD | git -C "$1" hash-object --stdin)" || return 1
|
|
63
67
|
printf '%s %s %s\n' "$head" "$tree" "$index"
|
|
64
68
|
}
|
|
65
69
|
|
|
70
|
+
forge_pre_review() { # review snapshot, task dir, repo, plan dir: 1 when the affected tests fail (#85)
|
|
71
|
+
# Runs only the tests the attempt affects, in throwaway exports of the review snapshot, so no
|
|
72
|
+
# fingerprint changes. Writes <dir>/prereview.json, the reviewer's evidence to prereview.txt
|
|
73
|
+
# and, when they fail, the implementer's findings to prereview.md. Anything but a red check
|
|
74
|
+
# (nothing selected, too broad, a broken check) returns 0: the review runs as usual.
|
|
75
|
+
local cmd="" map="" reviewed rc
|
|
76
|
+
rm -f "$2/prereview.json" "$2/prereview.txt" "$2/prereview.md"
|
|
77
|
+
[ -s "$3/.forge/verify-subset" ] && cmd="$(cat "$3/.forge/verify-subset")"
|
|
78
|
+
[ -s "$3/.forge/test-map" ] && map="$3/.forge/test-map"
|
|
79
|
+
reviewed="$(git -C "$1" rev-parse HEAD)" || return 0
|
|
80
|
+
python3 "$SKILL_DIR/scripts/forge-pre-review.py" run --repo "$1" --base "$(cat "$2/review.base")" \
|
|
81
|
+
--reviewed "$reviewed" --command "$cmd" ${map:+--map "$map"} --out "$2/prereview.json" \
|
|
82
|
+
--report "$2/prereview.md" --deps-from "$3" --slots-dir "$4/.prereview-slots" \
|
|
83
|
+
--slots "$(cat "$4/pre_review_parallel" 2>/dev/null || echo 2)" --log "$2/prereview.log" \
|
|
84
|
+
> "$2/prereview.txt" 2>/dev/null
|
|
85
|
+
rc=$?
|
|
86
|
+
forge_dataset_event pre_review --dir "$2" --file prereview="$2/prereview.json"
|
|
87
|
+
[ "$rc" = 1 ] && [ -s "$2/prereview.md" ] && return 1
|
|
88
|
+
[ "$rc" = 0 ] || : > "$2/prereview.txt"
|
|
89
|
+
return 0
|
|
90
|
+
}
|
|
91
|
+
|
|
66
92
|
forge_fail_first() { # review snapshot, run or task dir, repo: advisory fail-first evidence for QA
|
|
67
93
|
# Writes <dir>/failfirst.json and the reviewer's section to <dir>/failfirst.txt; never fails
|
|
68
94
|
# the run and never touches the snapshot (forge-fail-first.py exports through its own index).
|