@giamme/forge 0.13.1 → 0.14.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 +38 -0
- package/SKILL.md +17 -11
- package/VERSION +1 -1
- package/docs/artifacts.md +2 -0
- package/docs/commands.md +134 -8
- package/docs/development.md +3 -0
- package/docs/reviews.md +2 -0
- package/docs/troubleshooting.md +5 -1
- package/forge +28 -1
- package/package.json +1 -1
- package/references/dataset.md +3 -1
- package/references/decompose.md +201 -61
- package/references/harnesses.md +4 -1
- package/references/runtime.md +29 -0
- package/references/ui.md +10 -0
- package/scripts/forge-compare.py +491 -0
- package/scripts/forge-config.py +3 -3
- package/scripts/forge-contract.py +34 -8
- package/scripts/forge-control.py +105 -13
- package/scripts/forge-dispatch.sh +85 -25
- package/scripts/forge-jev-options.sh +17 -4
- package/scripts/forge-ledger.py +387 -0
- package/scripts/forge-lib-plans.sh +11 -2
- package/scripts/forge-lib-task.sh +390 -28
- package/scripts/forge-parallel-options.sh +20 -4
- package/scripts/forge-parallel.sh +123 -17
- package/scripts/forge-plan-check.py +68 -3
- package/scripts/forge-pr.py +276 -0
- package/scripts/forge-route.py +403 -38
- package/scripts/forge-runs.py +18 -1
- package/scripts/forge-runtime.py +94 -8
- package/scripts/forge-schedule.py +303 -46
- package/scripts/forge-verify-failed.py +111 -0
- package/scripts/forge-watch.py +372 -0
- package/scripts/forge_dataset/harvest.py +3 -1
- package/scripts/forge_fractal/cli.py +23 -6
- package/scripts/forge_infra.py +274 -0
- package/scripts/forge_jev/client.py +13 -9
- package/ui/docs/api.md +51 -8
- package/ui/forge_ui/export.py +6 -2
- package/ui/forge_ui/reader.py +172 -6
- package/ui/forge_ui/static/app.js +2 -2
- package/ui/forge_ui/static/checksview.js +20 -7
- package/ui/forge_ui/static/controls.js +6 -3
- package/ui/forge_ui/static/panel.js +69 -4
- package/ui/forge_ui/static/runmodel.js +30 -4
- package/ui/forge_ui/static/scene3d.js +3 -2
- package/ui/forge_ui/static/style.css +11 -4
package/references/decompose.md
CHANGED
|
@@ -262,11 +262,15 @@ So:
|
|
|
262
262
|
parallel tasks. A task should still be reviewable and correct on its own.
|
|
263
263
|
- End every `prompt.md` with an `## Acceptance criteria` section: observable checks the
|
|
264
264
|
reviewer can verify (a behaviour, a command that passes, a file that exists), not
|
|
265
|
-
restated goals.
|
|
265
|
+
restated goals. A command names the task's own tests, never the whole suite: the run's
|
|
266
|
+
verification runs the suite after each merge, and naming it here makes every attempt run it.
|
|
266
267
|
- `plan` prints an advisory block under the table naming tasks at 7,000 characters or 9
|
|
267
|
-
declared files and over, with the history for their size,
|
|
268
|
-
criteria
|
|
269
|
-
|
|
268
|
+
declared files and over, with the history for their size, tasks with no acceptance
|
|
269
|
+
criteria, and tasks whose acceptance criteria ask for the whole suite (forge's
|
|
270
|
+
`tests/check.sh`, a bare `unittest discover`, `npm test`, `make check`, `cargo test` and the
|
|
271
|
+
like, or a command of the plan's `--verify` or the repository's `.forge/verify`). A heading
|
|
272
|
+
inside a code fence, or with nothing under it, does not count. The block never changes the
|
|
273
|
+
table or the exit code.
|
|
270
274
|
|
|
271
275
|
## Plan gates: sent back, and the block under the table
|
|
272
276
|
|
|
@@ -374,6 +378,10 @@ forge's rule that a dwarf → QA cycle does not loop on its own initiative.
|
|
|
374
378
|
The prompt contract (preamble, findings format, severity definitions and the verdict lines)
|
|
375
379
|
comes from one place, `scripts/forge-contract.py`, shared by solo, decomposed and the final
|
|
376
380
|
review; the implementer rules appended to every dwarf prompt come from the same module.
|
|
381
|
+
When the run verifies the repository (`--verify`, verification lanes or `.forge/verify`), those
|
|
382
|
+
rules tell the implementer never to run the whole suite, even when the task's acceptance
|
|
383
|
+
criteria name it, and to report it as left to forge: the suite runs once, after the merge.
|
|
384
|
+
Without verification, the implementer runs the whole suite only when the task asks for it.
|
|
377
385
|
|
|
378
386
|
### Fail-first evidence (opt-in)
|
|
379
387
|
|
|
@@ -617,14 +625,16 @@ times on one model (`--escalate-after N` on `run` or `retry`, kept in the plan,
|
|
|
617
625
|
turns it off):
|
|
618
626
|
|
|
619
627
|
- **Counting:** the count is the task's failed attempts (FAIL, or an implementer TIMEOUT) on its current model,
|
|
620
|
-
from the fifth column of `attempts.tsv
|
|
621
|
-
forge's own errors judge nothing and are skipped; a pass
|
|
628
|
+
from the fifth column of `attempts.tsv`, after the latest row of `tasks/<id>/decisions.tsv`.
|
|
629
|
+
Infrastructure stops, missing verdicts and forge's own errors judge nothing and are skipped; a pass
|
|
630
|
+
or a change of model resets it. A lateral move does not: the streak carries across `tasks/<id>/lateral.tsv`.
|
|
622
631
|
- **Escalation:** at the threshold, the next attempt goes to a different model in the next tier
|
|
623
632
|
up of the pools given to `plan` (same position in the pool, as with exploration),
|
|
624
633
|
recorded in `escalations.tsv` and `tasks.tsv` like a `retry --dwarf`.
|
|
625
634
|
- **Stop:** when nothing is above (the model is in the top tier, or in no tier pool at
|
|
626
|
-
all), the task stops with `
|
|
627
|
-
name a model. `run --retry-failed` does not retry it,
|
|
635
|
+
all), the task stops as `NEEDS_DECISION` with reason `split` (see [When reviews don't converge](#when-reviews-dont-converge)).
|
|
636
|
+
`tasks/<id>/split.suggested` still says to split it or name a model. `run --retry-failed` does not retry it,
|
|
637
|
+
and a plain `retry` refuses (exit 2).
|
|
628
638
|
- **Effort step** (`--escalate-effort` on `run` or `retry`, kept in the plan as `escalate_effort`;
|
|
629
639
|
`--no-escalate-effort` removes it; off by default): when no higher tier has another model, the
|
|
630
640
|
same alias and harness is tried once more at the next effort its pairing accepts
|
|
@@ -649,11 +659,82 @@ turns it off):
|
|
|
649
659
|
History cannot yet say whether escalating rescues a task (31% of the 29 later attempts on a
|
|
650
660
|
changed spec passed, mostly effort bumps); the attempts this policy makes are what will.
|
|
651
661
|
|
|
662
|
+
## When reviews don't converge
|
|
663
|
+
|
|
664
|
+
A task can fail review after review, each round with new findings. forge keeps a findings ledger
|
|
665
|
+
at `tasks/<id>/ledger.tsv`, one row per review: epoch, attempt, review, verdict, gate, worst,
|
|
666
|
+
confirmed, new, carried, diff_bytes, delta_bytes. A CONFIRMED finding is carried when the previous
|
|
667
|
+
review named the same problem; the rest are new. The diff sizes are `changes.diff` and
|
|
668
|
+
`changes.since.diff` as they stand when the row is written.
|
|
669
|
+
|
|
670
|
+
The signal looks at the last reviews. The count is the plan file `converge_window` when that file
|
|
671
|
+
holds a number (`plan --converge-window N`, or `forge control set converge-window N` later), and
|
|
672
|
+
**4** otherwise. It fires when every review in that window failed (verdict
|
|
673
|
+
FAIL, or the gate turned a PASS into a fail) with at least one CONFIRMED finding, at least half of
|
|
674
|
+
the findings in the later reviews are new, and the worst severity is no better in the last review
|
|
675
|
+
than in the first. A window below 2 never fires. On past runs, a window of 4 stopped no task that
|
|
676
|
+
merged by attempt 4. Rows from before the latest `tasks/<id>/decisions.tsv` entry do not count: a
|
|
677
|
+
decision restarts the window, and the escalation streak with it.
|
|
678
|
+
|
|
679
|
+
Task and solo reviews are asked to list every CONFIRMED finding, and to say so plainly when the
|
|
680
|
+
diff is correct, so a round is the whole list and not only the worst few.
|
|
681
|
+
|
|
682
|
+
The task then stops with status **`NEEDS_DECISION`**. So does a task the retry policy cannot
|
|
683
|
+
escalate further (reason `split`; `split.suggested` still names the suggestion), and a task at its
|
|
684
|
+
attempt cap (reason `cap`). The cap is `plan --max-attempts N`, default **8** when `max_attempts`
|
|
685
|
+
is absent, counted across runs: an infrastructure stop spends nothing, and each `retry=N` a person
|
|
686
|
+
grants adds N to the cap. `0` is no cap, and a grant does not create one. `forge control set max-attempts N --confirm`
|
|
687
|
+
changes it; `--confirm` applies only to that key. A `NEEDS_INPUT` task at the cap keeps its question:
|
|
688
|
+
raise the plan's cap before the answer can start an attempt.
|
|
689
|
+
|
|
690
|
+
`tasks/<id>/decision.md` gives the reasons and the choices. Nothing else resumes the task: not a
|
|
691
|
+
re-run, not `--retry-failed`, not a retry budget and not a pin. A plain `retry` exits 2. The
|
|
692
|
+
choices:
|
|
693
|
+
|
|
694
|
+
- `forge-parallel.sh retry <plan> <id> --decide retry=N --reason "…" --approved` gives N more
|
|
695
|
+
attempts, N from 1 to 20. At the cap this raises the cap by N, and it is the only choice that
|
|
696
|
+
runs the task again while the attempts already spent sit on the cap.
|
|
697
|
+
- `forge-parallel.sh retry <plan> <id> --decide threshold=Pn --reason "…" --approved` sets this
|
|
698
|
+
task's blocking threshold (`P0`, `P1`, `P2` or `P3`) and then retries once.
|
|
699
|
+
- `forge-parallel.sh retry <plan> <id> --dwarf <spec> --reason "…" --approved` names a model. Not
|
|
700
|
+
together with `--decide`.
|
|
701
|
+
- `forge-parallel.sh accept <plan> <id> --reason "…" --approved` merges it; the findings become
|
|
702
|
+
known issues.
|
|
703
|
+
- Split it by hand: `tasks/<id>/decision.md` and the run summary say to replace its row in
|
|
704
|
+
`tasks.tsv` with smaller tasks, then `forge-parallel.sh run <plan>`, which reads that file
|
|
705
|
+
again and recomputes `waves.tsv`. `forge control drain` and `add` do not do it: they need a
|
|
706
|
+
scheduler that is still live (exit 3 once `scheduler.live` is gone, which it is by the time
|
|
707
|
+
the summary is printed), and `add` queues a new row without replacing the stopped one, which
|
|
708
|
+
stays `NEEDS_DECISION` for that invocation (its dependents keep the `deps` loaded at the
|
|
709
|
+
start, and the run exits 5 while the row is unmerged).
|
|
710
|
+
|
|
711
|
+
Take the stopped task's row out of `tasks.tsv`. Leave `tasks/<id>/` where it is; its diff
|
|
712
|
+
is not on the integration branch. A row left in place is not dispatched. Append one row
|
|
713
|
+
per smaller task, seven tab-separated columns: `id`, `deps`, `difficulty` (`low`, `medium`
|
|
714
|
+
or `high`), `files` (non-empty), `dwarf`, `qa`, `title`. Copy the stopped task's `dwarf`
|
|
715
|
+
and `qa` (explicit specs; `forge control add` refuses `-` and `UNASSIGNED`, and `run`
|
|
716
|
+
preflights every spec). `deps` is `-`, a task that is already `MERGED`, or another new
|
|
717
|
+
task. On every remaining row whose `deps` named the stopped task, put those new ids in
|
|
718
|
+
its place: a dependency that is no longer a row makes `run` die with `dependency cycle or
|
|
719
|
+
unsatisfiable deps`, and one that never merges leaves the dependent `BLOCKED`. Write a
|
|
720
|
+
non-empty `tasks/<id>/prompt.md` for each new id. The next `run` skips `MERGED` work and
|
|
721
|
+
dispatches the new rows from the integration branch as it stands, not from the stopped
|
|
722
|
+
task's worktree. While a scheduler is still live, `forge control add` can queue a row
|
|
723
|
+
written this way whose dependencies that run already knows; the row that replaces the
|
|
724
|
+
stopped task takes effect on the `run` after the scheduler has exited.
|
|
725
|
+
`forge-parallel.sh split` moves whole tasks into a new plan
|
|
726
|
+
([below](#accepting-splitting-combining-and-the-whole-run-review)).
|
|
727
|
+
|
|
728
|
+
A live scheduler takes the same decision as `forge control retry <plan> <id> --decide …` (or
|
|
729
|
+
`--dwarf`), with `--reason` and `--approved`; that only queues the request. The answer is appended
|
|
730
|
+
to `tasks/<id>/decisions.tsv` (epoch, attempt, choice, reason). The run summary lists these tasks
|
|
731
|
+
under `waiting for your decision:`. A run that ends with such a task unmerged exits 5.
|
|
732
|
+
|
|
652
733
|
**Live controls.** `forge control show|set|pin|unpin <plan>` changes a run while it works:
|
|
653
734
|
`qa-threshold` (read once per attempt, so an attempt keeps the bar it started with; per task, `none`
|
|
654
735
|
(P3) exempts it from a looser plan threshold and `inherit` drops the override; at plan level, `default` restores P2), `timeout`, `escalate-after`, `escalate-effort`
|
|
655
736
|
(`on|off`), `verify-retries`, `infra-backoff` (a shape as for `--infra-backoff`; `none` drops it,
|
|
656
|
-
read at the next infrastructure wait), and, only while a scheduler is live, `retry-budget` (plan
|
|
737
|
+
read at the next infrastructure wait), `infra-fallback` (`on|off`, at the next infrastructure stop), `max-attempts` (a non-negative integer, `0` = no cap, and only with `--confirm`), `converge-window` (a non-negative integer), and, only while a scheduler is live, `retry-budget` (plan
|
|
657
738
|
or `--task`), `infra-retries` and `max-parallel` (1 to 64, at the next dispatch decision; a lower
|
|
658
739
|
limit lets running tasks finish and never stops one). The budgets
|
|
659
740
|
keep the **per invocation** rule: the flags of `run` are not remembered, and a live scheduler only
|
|
@@ -667,7 +748,8 @@ run. `pin <task> <spec>` sets the model the task's next full retry uses, once (c
|
|
|
667
748
|
the pin stays and nothing is retried. A QA-only resume leaves it for the next full retry;
|
|
668
749
|
Fractal plans never apply pins; a MERGED task refuses one.
|
|
669
750
|
The last column of `escalations.tsv` says who decided: `policy`, `retry` (an explicit
|
|
670
|
-
`--dwarf`)
|
|
751
|
+
`--dwarf`) or `pin`; four-column rows read as `policy`. Older rows may say `fallback`.
|
|
752
|
+
A sideways move is recorded in `lateral.tsv`, not here (see [Infrastructure failures](#infrastructure-failures)).
|
|
671
753
|
Every change goes to `control.log` (JSON lines: `at`, `actor` `cli|ui`, `action`, `task`, `key`,
|
|
672
754
|
`value`, `previous`) and to the dataset as a `control` event. Exit 2 invalid input, 3 refused (not
|
|
673
755
|
live, MERGED, Fractal, failing doctor, lock busy over 5 s). Report them; never set one yourself
|
|
@@ -690,16 +772,16 @@ Five more commands steer a live scheduler (exit 3 when none is live):
|
|
|
690
772
|
an outcome line to `control.log` with the same `request` id (`actor` `scheduler`, `outcome`
|
|
691
773
|
`applied|refused`, `reason`). `retry` takes a `FAIL`, `UNKNOWN`, `TIMEOUT`, `ERROR`,
|
|
692
774
|
`BLOCKED` or `INTERRUPTED` task that is neither running nor waiting, prepares it exactly as
|
|
693
|
-
`forge-parallel.sh retry` does
|
|
694
|
-
spends no automatic retry budget; an
|
|
695
|
-
scheduler's own to resume. `add` takes a row the human appended to `tasks.tsv` (with its
|
|
775
|
+
`forge-parallel.sh retry` does. A `NEEDS_DECISION` task is resumed only by `--decide` or
|
|
776
|
+
`--dwarf`, each with `--reason` and `--approved`. It spends no automatic retry budget; an
|
|
777
|
+
`INFRA` task is the scheduler's own to resume. `add` takes a row the human appended to `tasks.tsv` (with its
|
|
696
778
|
`tasks/<id>/prompt.md`) whose dependencies this run already knows, and refreshes `waves.tsv`.
|
|
697
779
|
A request never outlives the scheduler that was live when it was queued; one left behind is
|
|
698
780
|
refused, and every request is refused once the run is stopping.
|
|
699
781
|
|
|
700
782
|
**Ordinary execution resume:** run `run` again. Tasks already `MERGED` are skipped. A saved PASS is fingerprint-checked and merged without
|
|
701
783
|
redispatch. PENDING, `INFRA` (paused by an infrastructure failure) and newly unblocked tasks run
|
|
702
|
-
when eligible. Failed or interrupted tasks
|
|
784
|
+
when eligible. A `NEEDS_DECISION` task is not among them: only a decision resumes it. Failed or interrupted tasks
|
|
703
785
|
require an explicit `retry` (or `--retry-failed N`); `run` never silently pays for them again. Worktrees and pinned
|
|
704
786
|
baselines are retained. A per-plan advisory lock excludes concurrent run/retry/integrate
|
|
705
787
|
operations.
|
|
@@ -727,60 +809,109 @@ Pause, stop and inspection preserve both the work and diagnostics.
|
|
|
727
809
|
|
|
728
810
|
## Infrastructure failures
|
|
729
811
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
`
|
|
735
|
-
`
|
|
812
|
+
A usage window, a spent budget, an auth problem, a rate limit, a provider outage, a network error,
|
|
813
|
+
an empty answer or a cancelled dispatch says nothing about the work. The status stays **`INFRA`**.
|
|
814
|
+
`forge-dispatch.sh` classifies the stop from the dispatch log (strong phrases and structured
|
|
815
|
+
`is_error`/`turn.failed` results only; a reply that otherwise succeeded is never reclassified) and
|
|
816
|
+
exits **8**, writing `<role>.infra` (`class=`, `retry_after=`, `reset_at=` when the wait is known,
|
|
817
|
+
`detail=`, `rc=`, `role=`, `harness=`, `model=`). `do_task` copies that file to
|
|
818
|
+
`tasks/<id>/infra.txt` and adds `stage=dwarf|qa`. The class is a symptom. What happens next is the
|
|
819
|
+
cause, from `CAUSES` in `scripts/forge_infra.py`. A run recorded before the split may say `quota`;
|
|
820
|
+
that name is recovered as `usage_limit`, and the summary still prints the stored word.
|
|
736
821
|
|
|
737
822
|
- a **dwarf-stage** stop refunds the attempt counter;
|
|
738
|
-
- a **QA-stage** stop keeps the attempt (the dwarf's work is
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
The scheduler pauses only what the stop says something about. Its **scope** comes from the class:
|
|
742
|
-
|
|
743
|
-
| Class | Scope paused | Other tasks |
|
|
744
|
-
|---|---|---|
|
|
745
|
-
| `rate_limit` | that model on that harness (`model:<harness>/<model>`) | keep running, on any other model |
|
|
746
|
-
| `quota`, `auth` | that harness's account (`harness:<harness>`) | keep running on other harnesses |
|
|
747
|
-
| anything else (network, empty output, ...) | everything (`all`): running tasks drain, nothing new starts | wait with it |
|
|
823
|
+
- a **QA-stage** stop keeps the attempt (the dwarf's work is committed) and writes the `resume=qa`
|
|
824
|
+
marker, so the next entry re-reviews without running the dwarf.
|
|
748
825
|
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
`
|
|
754
|
-
|
|
755
|
-
|
|
826
|
+
| Cause | Scope | Move | Without a peer | Hint |
|
|
827
|
+
|---|---|---|---|---|
|
|
828
|
+
| `capacity` | model | lateral | wait | — |
|
|
829
|
+
| `rate_limit` | model | wait | wait | — |
|
|
830
|
+
| `usage_limit` | harness | lateral | wait_if_reset | wait for the reset, or add another harness to this tier's pool |
|
|
831
|
+
| `budget` | harness | lateral | ask | add credits, or check the billing of {harness} |
|
|
832
|
+
| `auth` | harness | lateral | ask | log in to {harness} again |
|
|
833
|
+
| `network` | all | wait | wait | — |
|
|
834
|
+
| `provider_down` | harness | lateral | wait | — |
|
|
835
|
+
| `empty` | model | retry | wait | — |
|
|
836
|
+
| `cancelled` | model | retry | ask | check {harness}'s approval and permission settings |
|
|
837
|
+
|
|
838
|
+
**Scope** is what the pause holds back. `model` pauses that model on that harness
|
|
839
|
+
(`model:<harness>/<model>`); `harness` pauses that harness's account (`harness:<harness>`);
|
|
840
|
+
`all` pauses everything, so running tasks drain and nothing new starts. A model or harness cause
|
|
841
|
+
with no harness, or a model cause with no model, pauses everything. Other tasks keep running. A
|
|
842
|
+
pending task whose next dispatch needs a paused pair waits; unstarted tasks stay `PENDING`, never
|
|
843
|
+
`BLOCKED`.
|
|
844
|
+
|
|
845
|
+
**Move** is what happens first. **lateral** sends the work to another model of the same tier —
|
|
846
|
+
another harness or account when the scope is a harness, another model when the scope is one model —
|
|
847
|
+
and never a stronger tier. **wait** pauses the scope until the cause clears and spends one of that
|
|
848
|
+
scope's waits. **retry** dispatches the same model again at once and spends no wait; the next stop
|
|
849
|
+
of that same cause is treated as lateral.
|
|
850
|
+
|
|
851
|
+
**Without a peer** is the recovery when no model can take the work. **wait** is the pause above.
|
|
852
|
+
**wait_if_reset** waits when the reset is known and inside six hours, and asks otherwise; if this
|
|
853
|
+
task did move sideways, the scope waits rather than asking. **ask** pauses the scope, marks it
|
|
854
|
+
**needs you** with the hint (`{harness}` filled in), and spends no wait. Nothing on that scope is
|
|
855
|
+
retried until a person acts. Raising the infra-retry budget above the value it had when it asked
|
|
856
|
+
starts a wait after all. "Needs you" is that end of the recovery: no peer, and the cause will not
|
|
857
|
+
clear by itself.
|
|
858
|
+
|
|
859
|
+
**Lateral recovery** is on for a new plan. `plan` writes `infra_fallback` as `on`;
|
|
860
|
+
`plan --no-infra-fallback` writes `off`, and a re-plan keeps the file as it is. A plan with no file stays off. `run --infra-fallback` and
|
|
861
|
+
`run --no-infra-fallback` write the file, and `forge control set infra-fallback on|off` applies at
|
|
862
|
+
the next infrastructure stop. It runs at the dwarf stage and at the QA stage, and not on a Fractal
|
|
863
|
+
plan:
|
|
864
|
+
|
|
865
|
+
- a **dwarf-stage** stop takes the next healthy model of the tier the task is running in: the tier
|
|
866
|
+
recorded at its newest assignment (the plan's pick, explored or not, an escalation, a pin, a
|
|
867
|
+
`retry --dwarf`, an earlier move), as long as it still runs that model; otherwise its difficulty.
|
|
868
|
+
A re-plan that keeps a row's model keeps its tier. A pinned implementer is not moved. No attempt
|
|
869
|
+
is spent.
|
|
870
|
+
- a **QA-stage** stop takes a reviewer of the same strength from `qa-routing.json`: the next member
|
|
871
|
+
of the task's difficulty pool, then of `any`, on a pair nobody paused. Never the stopped
|
|
872
|
+
reviewer's model, and never the implementer's. The attempt and the `resume` marker stay, so the
|
|
873
|
+
next entry is QA only. A reviewer no such pool lists, or a plan with no `qa-routing.json`, has
|
|
874
|
+
no peer. A pin waits for the next full retry.
|
|
875
|
+
|
|
876
|
+
Each move is a row of `tasks/<id>/lateral.tsv` (epoch, attempt, role `dwarf` or `qa`, from, to,
|
|
877
|
+
cause) and a `lateral` dataset event. It is not an escalation: it is not written to
|
|
878
|
+
`escalations.tsv`, and the escalation streak carries across the dwarf moves. A pool with no healthy
|
|
879
|
+
member keeps the ordinary pause.
|
|
880
|
+
|
|
881
|
+
Without `--infra-retries`, `run` ends once nothing else can run, prints what to fix and exits `8`;
|
|
882
|
+
verification is skipped, and running the same command again resumes. `run --infra-retries M` waits
|
|
883
|
+
out each scope instead, up to `M` waits **per scope** (a stop in a scope already paused joins its
|
|
884
|
+
wait and is not counted again). A scope whose waits are used up stays paused. An asking scope
|
|
885
|
+
spends none of those waits.
|
|
756
886
|
|
|
757
887
|
Each wait is the provider's retry-after when the log carried one (capped at 6 h), otherwise the
|
|
758
|
-
backoff shape for that wait number. `--infra-backoff <shape>` on `run` (kept
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
and until when
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
888
|
+
backoff shape for that wait number. `--infra-backoff <shape>` on `run` (kept as `infra_backoff`,
|
|
889
|
+
read at every wait, so `forge control set infra-backoff` applies to the next one) takes
|
|
890
|
+
`exp:<base>[,<cap>]` (base doubling, capped at `<cap>`, default the larger of the base and 30 min),
|
|
891
|
+
`linear:<start>,<step>[,<cap>]`, or `list:<a>,<b>,...` (a bare `<a>,<b>,...` is a list; the last
|
|
892
|
+
value repeats), all in positive seconds. The default is `exp:60`; `FORGE_INFRA_BACKOFF` changes
|
|
893
|
+
that base. The wait message names the source, for example `waiting 120s before resuming (backoff
|
|
894
|
+
exp:60, wait 2 of 3)`. While anything is paused, `infra.paused` (JSON `{"scopes": [...]}` with
|
|
895
|
+
`scope`, `class`, `harness`, `model`, `tasks`, `cycle`, `until`, `exhausted`, `needs_you`, `hint`,
|
|
896
|
+
`reset_at`) says what waits and until when. It is removed when nothing is paused, and again when
|
|
897
|
+
the scheduler exits, so a summary printed after the run reads `infra.txt` alone.
|
|
898
|
+
|
|
899
|
+
The run summary and `forge control show` name the cause, the reset when it is known
|
|
900
|
+
(`resets HH:MM`, with the date when it is not today), and **needs you** with the hint. The
|
|
901
|
+
summary's line is ` <task> <cause> on <harness>/<model> (<stage> stage)`, then the reset and
|
|
902
|
+
`— needs you: <hint>`, and a move is `moved sideways: <task> <role> <from> → <to> (<cause>)`.
|
|
903
|
+
`forge control show` prints the cause on the task's status (`INFRA (cause)`) and, while the
|
|
904
|
+
scheduler is live, on each pause line. forge-ui shows the same facts; the words it uses are in
|
|
905
|
+
[forge-ui](ui.md).
|
|
906
|
+
|
|
907
|
+
A dwarf that exits 0 with an empty final message *and* an empty diff is `class=empty`: it never
|
|
908
|
+
really ran. Under Fractal a dwarf-side stop still ends as Fractal's own `failed`; QA-side stops
|
|
909
|
+
behave as above, and `scripts/forge_fractal/pipeline.py` resets `INFRA` to `PENDING` on resume.
|
|
775
910
|
|
|
776
911
|
A planned pause (a provider maintenance window, a quota reset) is `forge control drain`, not a
|
|
777
912
|
signal: running tasks finish, nothing new starts, and `forge control resume` continues the same
|
|
778
913
|
run.
|
|
779
914
|
|
|
780
|
-
A dwarf that exits 0 with an empty final message *and* an empty diff is the same class
|
|
781
|
-
(`class=empty`): it never really ran. Under Fractal a dwarf-side stop still ends as Fractal's own
|
|
782
|
-
`failed`; QA-side stops behave as above, and `pipeline.py` resets `INFRA` to `PENDING` on resume.
|
|
783
|
-
|
|
784
915
|
## Implementer guards
|
|
785
916
|
|
|
786
917
|
forge records what it observed about how each dwarf behaved, never what the dwarf claimed:
|
|
@@ -900,7 +1031,8 @@ The user's own branch and working tree are untouched for the whole run.
|
|
|
900
1031
|
| task status `TIMEOUT` | that role exceeded the dispatch timeout and was killed. It has usually left a partial edit in the worktree; `retry` continues from it |
|
|
901
1032
|
| task status `FAIL` with "produced no changes" | the dwarf ended without editing anything — usually an ambiguous prompt it could not resolve headlessly |
|
|
902
1033
|
| task status `UNKNOWN` | QA never emitted a verdict line; read `tasks/<id>/qa.last`. `retry` re-runs QA only, on the unchanged work |
|
|
903
|
-
| task status `INFRA`, `run` exits `8` |
|
|
1034
|
+
| task status `INFRA`, `run` exits `8` | an infrastructure stop; the cause is in the summary and `tasks/<id>/infra.txt`. No attempt spent. Fix a "needs you" line before re-running; otherwise re-run, or wait with `--infra-retries M`. See [Infrastructure failures](#infrastructure-failures) |
|
|
1035
|
+
| task status `NEEDS_DECISION` | reviews are not converging, the retry policy has no stronger model, or the attempt cap is spent. Read `tasks/<id>/decision.md`. Only a decision resumes it |
|
|
904
1036
|
| 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 |
|
|
905
1037
|
| 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 |
|
|
906
1038
|
| 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` |
|
|
@@ -936,10 +1068,18 @@ Configure combined executable checks with `run <plan> --verify '<command>'` (als
|
|
|
936
1068
|
`retry`), or a shell command file at `<repo>/.forge/verify`. Commands execute under Bash from
|
|
937
1069
|
the integration checkout. Forge records `verification.command`, `.log`, `.exit`, `.fingerprint`
|
|
938
1070
|
and `.status` in the plan directory. Failed checks or source changes fail the run. With no
|
|
939
|
-
command, the result is explicitly UNVERIFIED.
|
|
1071
|
+
command, the result is explicitly UNVERIFIED. A `retry` that leaves tasks still to run
|
|
1072
|
+
(PENDING or BLOCKED) skips its verification and says so: the `run` that dispatches them verifies
|
|
1073
|
+
the integration branch at its end, and `integrate` verifies its candidate.
|
|
940
1074
|
|
|
941
1075
|
A failed command whose source fingerprint is unchanged is rerun (`--verify-retries N`, default
|
|
942
|
-
`1`, `0` = strict single run).
|
|
1076
|
+
`1`, `0` = strict single run). When the repository has `.forge/verify-subset` (a test command
|
|
1077
|
+
with `{files}` or `{changed}`) and the log names failing tracked test files (unittest
|
|
1078
|
+
`FAIL:`/`ERROR:` lines, pytest `FAILED path::`, node's test runner `test at file:L:C` or TAP
|
|
1079
|
+
`location:`), those files run alone first (`verification.failing.log`, run kind `failing`): if
|
|
1080
|
+
they fail again the regression is confirmed and the whole command is not rerun. If they pass,
|
|
1081
|
+
or nothing can be named, the whole command reruns as before, so a pass always comes from the
|
|
1082
|
+
whole command. A rerun that passes leaves status `PASS` but writes
|
|
943
1083
|
`verification.flaky` (both exit codes), keeps the first run in `verification.log` and the second
|
|
944
1084
|
in `verification.retry.log`, and prints a loud `FLAKY` line in `run`/`retry`/`integrate` output;
|
|
945
1085
|
a command that changes the tree is never retried.
|
package/references/harnesses.md
CHANGED
|
@@ -43,7 +43,10 @@ way to distinguish stuck from slow. `forge-dispatch.sh` therefore runs every bac
|
|
|
43
43
|
background and kills it after its timeout: `--timeout`, else `FORGE_TIMEOUT` (an explicit `0`
|
|
44
44
|
disables), else the optional `timeout` column of the model's registry row, else 2700 s — scaled
|
|
45
45
|
×4/3 for `xhigh` and ×2 for `max`/`ultra` effort when not explicit (`<role>.resolved` records
|
|
46
|
-
`timeout=` and `timeout_source=`). A killed dispatch exits `7
|
|
46
|
+
`timeout=` and `timeout_source=`). A killed dispatch exits `7`, unless claude or openclaude had
|
|
47
|
+
already given its final result and only an open background task kept it up: that result stands,
|
|
48
|
+
whether the watchdog or `FORGE_RESULT_GRACE` (default 1800 s of silence after it; `0` = off) ended
|
|
49
|
+
it, and `<role>.settled` records which (see [commands](../docs/commands.md)).
|
|
47
50
|
|
|
48
51
|
**Infrastructure failures exit `8`.** After the backend exits, `forge-runtime.py classify` reads
|
|
49
52
|
the dispatch log (never `<role>.last`, which is only created afterwards): claude/openclaude/grok
|
package/references/runtime.md
CHANGED
|
@@ -31,6 +31,35 @@ Telemetry is independent of project memory. Dispatch and pipeline attempt record
|
|
|
31
31
|
their total durations must not be added together. Unsupported usage remains unknown. See
|
|
32
32
|
[the evaluation](../tests/benchmark-2026-09-07.md) for observed improvements and regressions.
|
|
33
33
|
|
|
34
|
+
## Infrastructure stops
|
|
35
|
+
|
|
36
|
+
A dispatch that fails for a reason other than the work exits 8, and its task stops with
|
|
37
|
+
status `INFRA`. `forge-runtime.py classify` gives the stop a class, and `forge-dispatch.sh`
|
|
38
|
+
writes it to `<role>.infra` as `class=`. `forge_infra.py` holds the one table of what each
|
|
39
|
+
class means for a recovery (scope, first move, what to do without a peer).
|
|
40
|
+
|
|
41
|
+
- `capacity`: the model is at capacity for everyone (overloaded, at capacity, HTTP 529).
|
|
42
|
+
- `rate_limit`: this account is sending too fast (rate limit, too many requests, HTTP 429).
|
|
43
|
+
- `usage_limit`: a spent subscription window, which resets (usage limit, hit your session or weekly limit).
|
|
44
|
+
- `budget`: money that is gone (insufficient credits, credit balance too low, billing, quota exceeded, HTTP 402).
|
|
45
|
+
- `auth`: credentials refused (401, 403, unauthorized, login required).
|
|
46
|
+
- `provider_down`: one provider failing while the connection works (bad gateway, service unavailable, gateway time-out, HTTP 502/503/504).
|
|
47
|
+
- `network`: local connectivity (ECONNRESET and similar codes, getaddrinfo, connection refused or reset, fetch failed, name resolution, certificate).
|
|
48
|
+
- `empty`: exit 0 with no final answer. `cancelled`: the CLI stopped a working model to ask for approval.
|
|
49
|
+
|
|
50
|
+
The order is auth > usage_limit > budget > capacity > rate_limit > provider_down > network, and
|
|
51
|
+
the first class with a matching phrase wins. A usage-limit message that also mentions credits
|
|
52
|
+
is `usage_limit`: the window resets, the money does not.
|
|
53
|
+
|
|
54
|
+
When the message gives a wait, `<role>.infra` also has `retry_after=<seconds>` and
|
|
55
|
+
`reset_at=<epoch>` (now plus the wait). Without a wait there is no `reset_at` line. The
|
|
56
|
+
scheduler copies the file into `infra.txt`, so both lines go with it.
|
|
57
|
+
|
|
58
|
+
Runs recorded before the split say `quota`, which `forge_infra.LEGACY` reads as `usage_limit`.
|
|
59
|
+
The scheduler still acts on the classes it was written for: `infra_info` folds `capacity` into
|
|
60
|
+
`rate_limit`, `usage_limit` and `budget` into `quota`, and `provider_down` into `network`, until
|
|
61
|
+
it reads the table.
|
|
62
|
+
|
|
34
63
|
## Optional Fractal adapter decision
|
|
35
64
|
|
|
36
65
|
Fractal adds a Python adapter around the existing shell pipeline instead of replacing
|
package/references/ui.md
CHANGED
|
@@ -73,6 +73,16 @@ run goes on, with the same exit code.
|
|
|
73
73
|
- It refreshes every two seconds while something runs (five otherwise) while the tab is
|
|
74
74
|
visible, so a run can be watched as it goes. A run can also be replayed from its record.
|
|
75
75
|
|
|
76
|
+
An infrastructure stop shows as `INFRA · <label>`: `at capacity`, `rate limited`, `usage limit`,
|
|
77
|
+
`out of budget`, `login needed`, `network down`, `provider down`, `empty answer` or `cancelled`.
|
|
78
|
+
A cause the page does not know, such as an older run's `quota`, is shown as it was written.
|
|
79
|
+
Opening the task lists that label, the stage, the harness and model, and `resets …` when the
|
|
80
|
+
limit's reset is known. A pause that needs the user says "needs you" with the fix hint, and a
|
|
81
|
+
sideways move is a "moved sideways" line under Models. A task at `NEEDS_DECISION` is waiting, not
|
|
82
|
+
failed: its inspector gives the reasons, the attempts against the cap, the review ledger, and the
|
|
83
|
+
text of `tasks/<id>/decision.md`. forge-ui shows those commands and does not run them, and it does
|
|
84
|
+
not offer Retry now. A run whose unfinished tasks are all waiting is `WAITING`.
|
|
85
|
+
|
|
76
86
|
The 3D view loads three.js from cdn.jsdelivr.net when first used; offline, the page shows the
|
|
77
87
|
same run in 2D. The full page description is in [ui/README.md](../ui/README.md).
|
|
78
88
|
|