@giamme/forge 0.11.1 → 0.12.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 +56 -0
- package/SKILL.md +7 -3
- package/VERSION +1 -1
- package/docs/artifacts.md +50 -11
- package/docs/commands.md +56 -8
- package/docs/decomposed-runs.md +43 -2
- package/docs/forge-ui.md +55 -8
- package/docs/reviews.md +64 -6
- package/package.json +1 -1
- package/references/dataset.md +4 -2
- package/references/decompose.md +191 -17
- package/references/harnesses.md +13 -1
- package/references/ui.md +25 -4
- package/scripts/forge-contract.py +37 -7
- package/scripts/forge-control.py +268 -25
- package/scripts/forge-dispatch.sh +90 -3
- package/scripts/forge-guard.py +156 -15
- package/scripts/forge-issues.py +47 -3
- package/scripts/forge-lib-plans.sh +9 -3
- package/scripts/forge-lib-review.sh +24 -5
- package/scripts/forge-lib-task.sh +53 -5
- package/scripts/forge-lib-verify.sh +137 -6
- package/scripts/forge-parallel-options.sh +85 -0
- package/scripts/forge-parallel.sh +262 -31
- package/scripts/forge-ripwire.py +1 -1
- package/scripts/forge-route.py +157 -5
- package/scripts/forge-runtime.py +49 -1
- package/scripts/forge-schedule.py +735 -53
- package/scripts/forge-solo.sh +3 -1
- package/scripts/forge-sweep.py +542 -0
- package/scripts/forge-verify.py +878 -0
- package/scripts/forge_dataset/forecast.py +33 -5
- package/scripts/forge_dataset/harvest.py +10 -4
- package/scripts/forge_verify_reports.py +225 -0
- package/ui/README.md +58 -12
- package/ui/docs/api.md +277 -28
- package/ui/forge_ui/checks.py +331 -0
- package/ui/forge_ui/control.py +12 -2
- package/ui/forge_ui/export.py +25 -8
- package/ui/forge_ui/reader.py +657 -24
- package/ui/forge_ui/server.py +29 -0
- package/ui/forge_ui/static/app.js +15 -7
- package/ui/forge_ui/static/checksview.js +449 -0
- package/ui/forge_ui/static/controls.js +217 -33
- package/ui/forge_ui/static/convo.js +11 -2
- package/ui/forge_ui/static/findingsview.js +6 -4
- package/ui/forge_ui/static/gantt.js +14 -9
- package/ui/forge_ui/static/index.html +2 -0
- package/ui/forge_ui/static/panel.js +44 -1
- package/ui/forge_ui/static/runmodel.js +109 -12
- package/ui/forge_ui/static/scene3d.js +9 -5
- package/ui/forge_ui/static/style.css +113 -0
- package/ui/forge_ui/static/verifyview.js +324 -0
- package/ui/forge_ui/transcripts.py +225 -54
package/references/dataset.md
CHANGED
|
@@ -350,8 +350,10 @@ run.
|
|
|
350
350
|
wave), and the expected number of first-try passes.
|
|
351
351
|
- It never creates the store, and prints nothing when the store is missing or has no history.
|
|
352
352
|
|
|
353
|
-
`forge-parallel.sh run` prints the same block before it dispatches
|
|
354
|
-
|
|
353
|
+
`forge-parallel.sh run` prints the same block before it dispatches, shortened: the tasks without
|
|
354
|
+
enough history share one line instead of a row each, and when no task has enough, the whole block
|
|
355
|
+
is one line pointing at `forge dataset forecast <plan>`. It runs with a time budget
|
|
356
|
+
(`FORGE_FORECAST_BUDGET_S`, default 3 seconds; `inf` means no limit), prints one line and moves on if reading the
|
|
355
357
|
history takes longer, never prints errors and never changes the exit code. `--no-forecast` or
|
|
356
358
|
`FORGE_FORECAST=off` turn it off. The block is written to the plan as `forecast.json` and
|
|
357
359
|
recorded once as a `forecast` event, so it can later be compared to what the run did.
|
package/references/decompose.md
CHANGED
|
@@ -404,6 +404,38 @@ any blocking finding, or a `FAIL` with no CONFIRMED finding stays a failure. The
|
|
|
404
404
|
then the literal `PASS`; `known_issues.md`, `qa.gate` and the summary say what was tolerated.
|
|
405
405
|
Without a threshold none of this applies.
|
|
406
406
|
|
|
407
|
+
### The finding sweep (opt-in)
|
|
408
|
+
|
|
409
|
+
Tolerated findings are recorded, not fixed. `run --sweep Pn` fixes them inside the run instead: once
|
|
410
|
+
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 `--qa-threshold` tolerated, plus
|
|
412
|
+
PLAUSIBLE ones with `--sweep-plausible`), with `forge issues`' own collector, and leaves out:
|
|
413
|
+
|
|
414
|
+
- findings a person accepted with `accept`, and findings of fix tasks (one round: what a sweep review
|
|
415
|
+
finds goes to `forge issues`, never into another sweep);
|
|
416
|
+
- dismissed ones (`forge issues --dismiss`), ones with no file, and ones whose file is gone;
|
|
417
|
+
- ones whose line, as the reviewer saw it, a later merge changed (`changed`, naming those merges).
|
|
418
|
+
|
|
419
|
+
Every finding left out is listed in the plan with its reason. The rest become fix tasks, one per file,
|
|
420
|
+
worst first, at most 8 findings each and `--sweep-max N` (default 5) tasks. Each fix task is a row
|
|
421
|
+
`sweep-<n>` in `tasks.tsv` with `prompt.md` and `sweep.json`. Its implementer is the plan's low tier
|
|
422
|
+
(the first spec of `--dwarf-low`, else of `--dwarf`; checked at `run` start), else the implementer of
|
|
423
|
+
the task the worst finding came from. Its reviewer is that task's reviewer. The plan (groups, findings,
|
|
424
|
+
dispatches) is printed and kept in `<plan>/sweep/plan.md` and `plan.json`. A plan is swept at most once.
|
|
425
|
+
|
|
426
|
+
Fix tasks share the run's scheduling, controls and `--retry-failed` budget. Their review is narrow
|
|
427
|
+
(`forge-contract.py qa --kind sweep`): one `S<n>: FIXED` or `S<n>: NOT FIXED` line per finding, plus
|
|
428
|
+
regressions as findings. It passes when at least one finding is fixed and there is no blocking
|
|
429
|
+
regression. When a fix task merges, its review's lines go to `tasks/<id>/sweep.outcome.json`, and
|
|
430
|
+
`forge issues` leaves out what it fixed (`swept` in `--json`). A fix task that fails leaves its
|
|
431
|
+
findings for `forge issues` and does not fail the run. The run's summary says what the sweep fixed,
|
|
432
|
+
and the whole-run review that follows reads the sweep's changes like any other task's.
|
|
433
|
+
|
|
434
|
+
`run --sweep-ahead` (kept in `<plan>/sweep_ahead`; `--no-sweep-ahead` turns it off) is the cheaper
|
|
435
|
+
first step. A task dispatched after others merged is told the open findings in files it owns (at
|
|
436
|
+
most 3, picked once in `tasks/<id>/sweep.ahead.json`), to fix only on its way, and its reviewer is
|
|
437
|
+
told the same. It adds no dispatch. A later sweep counts the ones whose line changed as `changed`.
|
|
438
|
+
|
|
407
439
|
## Retrying, and resuming an interrupted run
|
|
408
440
|
|
|
409
441
|
A failed task keeps its branch and its worktree. `retry` is what acts on them:
|
|
@@ -471,6 +503,15 @@ turns it off):
|
|
|
471
503
|
- **Stop:** when nothing is above (the model is in the top tier, or in no tier pool at
|
|
472
504
|
all), the task stops with `tasks/<id>/split.suggested`: split it into smaller tasks, or
|
|
473
505
|
name a model. `run --retry-failed` does not retry it, and a plain `retry` refuses (exit 2).
|
|
506
|
+
- **Effort step** (`--escalate-effort` on `run` or `retry`, kept in the plan as `escalate_effort`;
|
|
507
|
+
`--no-escalate-effort` removes it; off by default): when no higher tier has another model, the
|
|
508
|
+
same alias and harness is tried once more at the next effort its pairing accepts
|
|
509
|
+
(`forge-dispatch.sh efforts --spec <spec>` lists them, weakest first), counted from the effort
|
|
510
|
+
the last dispatch really ran after any clamp; a spec that names no effort counts as `medium`.
|
|
511
|
+
The streak then counts per effort, so the new effort starts from zero. At the pairing's highest
|
|
512
|
+
effort the task still stops, and `split.suggested` says that effort was tried too. Turning the
|
|
513
|
+
step on (flag or `forge control set escalate-effort on`) clears the stop markers, so tasks the
|
|
514
|
+
policy already stopped are decided again at their next retry.
|
|
474
515
|
- **Overrides:** an explicit `retry --dwarf <spec>` is the human's choice and skips the policy, even
|
|
475
516
|
with the same model. The dwarf column itself cannot tell a pin from a pool pick, so it does
|
|
476
517
|
not; `--escalate-after 0` does.
|
|
@@ -488,8 +529,11 @@ changed spec passed, mostly effort bumps); the attempts this policy makes are wh
|
|
|
488
529
|
|
|
489
530
|
**Live controls.** `forge control show|set|pin|unpin <plan>` changes a run while it works:
|
|
490
531
|
`qa-threshold` (read once per attempt, so an attempt keeps the bar it started with; per task, `none`
|
|
491
|
-
exempts it and `inherit` drops the override), `timeout`, `escalate-after`, `
|
|
492
|
-
|
|
532
|
+
exempts it and `inherit` drops the override), `timeout`, `escalate-after`, `escalate-effort`
|
|
533
|
+
(`on|off`), `verify-retries`, `infra-backoff` (a shape as for `--infra-backoff`; `none` drops it,
|
|
534
|
+
read at the next infrastructure wait), and, only while a scheduler is live, `retry-budget` (plan
|
|
535
|
+
or `--task`), `infra-retries` and `max-parallel` (1 to 64, at the next dispatch decision; a lower
|
|
536
|
+
limit lets running tasks finish and never stops one). The budgets
|
|
493
537
|
keep the **per invocation** rule: the flags of `run` are not remembered, and a live scheduler only
|
|
494
538
|
mirrors them into `retry_budget`, `infra_budget` and `tasks/<id>/retry_budget` (re-read at every
|
|
495
539
|
decision, removed when it stops; `tasks/<id>/retries.used` stays), so a change dies with the
|
|
@@ -501,18 +545,55 @@ run. `pin <task> <spec>` sets the model the task's next full retry uses, once (c
|
|
|
501
545
|
the pin stays and nothing is retried. A QA-only resume leaves it for the next full retry;
|
|
502
546
|
Fractal plans never apply pins; a MERGED task refuses one.
|
|
503
547
|
The last column of `escalations.tsv` says who decided: `policy`, `retry` (an explicit
|
|
504
|
-
`--dwarf`) or `
|
|
505
|
-
`at`, `actor` `cli|ui`, `action`, `task`, `key`,
|
|
506
|
-
`control` event. Exit 2 invalid input, 3 refused (not
|
|
507
|
-
lock busy over 5 s). Report them; never set one yourself
|
|
548
|
+
`--dwarf`), `pin` or `fallback` (`--infra-fallback`, below); four-column rows read as `policy`.
|
|
549
|
+
Every change goes to `control.log` (JSON lines: `at`, `actor` `cli|ui`, `action`, `task`, `key`,
|
|
550
|
+
`value`, `previous`) and to the dataset as a `control` event. Exit 2 invalid input, 3 refused (not
|
|
551
|
+
live, MERGED, Fractal, failing doctor, lock busy over 5 s). Report them; never set one yourself
|
|
552
|
+
unless asked.
|
|
553
|
+
|
|
554
|
+
Five more commands steer a live scheduler (exit 3 when none is live):
|
|
555
|
+
|
|
556
|
+
- `drain <plan>` starts nothing new: running tasks finish, the scheduler waits (it prints
|
|
557
|
+
`drained — N task(s) waiting` once) and infrastructure waits keep counting down. `resume <plan>`
|
|
558
|
+
ends the drain. This is the supported way to pause a run; nothing has to be signalled. A drain
|
|
559
|
+
holds only tasks still to start: when none is left (or waiting on infrastructure), the run
|
|
560
|
+
ends as it would without the drain, verification included.
|
|
561
|
+
- `stop <plan>` starts nothing new and ends the run once the running tasks are done: a waiting
|
|
562
|
+
infrastructure pause ends too, unstarted tasks stay `PENDING`, verification is skipped and `run`
|
|
563
|
+
exits 130. When every task has merged by then, nothing was cut short: the run ends as usual,
|
|
564
|
+
verifies and exits 0. `stop --now` interrupts the running tasks
|
|
565
|
+
as SIGTERM would.
|
|
566
|
+
- `retry <plan> <task> [--dwarf <spec>]` and `add <plan> <task>` only queue a request, one JSON
|
|
567
|
+
file in `control.requests/`. At its next pass the scheduler applies or refuses it and appends
|
|
568
|
+
an outcome line to `control.log` with the same `request` id (`actor` `scheduler`, `outcome`
|
|
569
|
+
`applied|refused`, `reason`). `retry` takes a `FAIL`, `UNKNOWN`, `TIMEOUT`, `ERROR`,
|
|
570
|
+
`BLOCKED` or `INTERRUPTED` task that is neither running nor waiting, prepares it exactly as
|
|
571
|
+
`forge-parallel.sh retry` does (a policy stop refuses it unless `--dwarf` names a model), and
|
|
572
|
+
spends no automatic retry budget; an `INFRA` task is the
|
|
573
|
+
scheduler's own to resume. `add` takes a row the human appended to `tasks.tsv` (with its
|
|
574
|
+
`tasks/<id>/prompt.md`) whose dependencies this run already knows, and refreshes `waves.tsv`.
|
|
575
|
+
A request never outlives the scheduler that was live when it was queued; one left behind is
|
|
576
|
+
refused, and every request is refused once the run is stopping.
|
|
508
577
|
|
|
509
578
|
**Ordinary execution resume:** run `run` again. Tasks already `MERGED` are skipped. A saved PASS is fingerprint-checked and merged without
|
|
510
579
|
redispatch. PENDING, `INFRA` (paused by an infrastructure failure) and newly unblocked tasks run
|
|
511
580
|
when eligible. Failed or interrupted tasks
|
|
512
581
|
require an explicit `retry` (or `--retry-failed N`); `run` never silently pays for them again. Worktrees and pinned
|
|
513
582
|
baselines are retained. A per-plan advisory lock excludes concurrent run/retry/integrate
|
|
514
|
-
operations.
|
|
515
|
-
|
|
583
|
+
operations.
|
|
584
|
+
|
|
585
|
+
**Interrupts.** A SIGINT or SIGTERM to `run` (or to its scheduler), and `forge control stop
|
|
586
|
+
--now`, first reap the tasks that already ended (a PASS still merges), then send TERM to each
|
|
587
|
+
running task's process group, wait up to `FORGE_INTERRUPT_GRACE` seconds (default 10) for the
|
|
588
|
+
group to empty and KILL what is left. Only those live tasks become `INTERRUPTED`; their worktree
|
|
589
|
+
keeps the partial work. Each guarded dispatch records its harness in `tasks/<id>/<role>.harness`
|
|
590
|
+
(pid and start time), and `forge-guard.py stop` ends a harness that outlived its dispatch, at
|
|
591
|
+
the interrupt and again at the next scheduler start (a scheduler killed outright leaves tasks
|
|
592
|
+
`RUNNING`; the next run stops their harnesses and marks them `INTERRUPTED`). An interrupted
|
|
593
|
+
`run` skips verification and its rerun, prints `forge-parallel.sh retry <plan> <id>` for each
|
|
594
|
+
interrupted task, releases the plan lock and exits **130**. A signal that arrives during
|
|
595
|
+
verification stops the verify command's whole process tree (TERM, then KILL after a few
|
|
596
|
+
seconds) and records `verification.status` `INTERRUPTED`; that verification is not rerun.
|
|
516
597
|
|
|
517
598
|
**Fractal resume:** discover the managed ID with `<skill_dir>/forge fractal runs --repo
|
|
518
599
|
"$REPO" --json`, then use `<skill_dir>/forge fractal resume RUN_ID`. Run-level resume
|
|
@@ -527,17 +608,52 @@ Pause, stop and inspection preserve both the work and diagnostics.
|
|
|
527
608
|
Quota or usage limits, auth problems, rate limits, network errors and empty answers say nothing
|
|
528
609
|
about the work. `forge-dispatch.sh` classifies them from the dispatch log (strong phrases and
|
|
529
610
|
structured `is_error`/`turn.failed` results only; a reply that otherwise succeeded is never
|
|
530
|
-
reclassified) and exits **8**, writing `<role>.infra` (`class=`, `retry_after=`, `detail
|
|
531
|
-
`do_task` then ends the task as **`INFRA
|
|
611
|
+
reclassified) and exits **8**, writing `<role>.infra` (`class=`, `retry_after=`, `detail=`,
|
|
612
|
+
`harness=`, `model=`). `do_task` then ends the task as **`INFRA`**, copying that file to
|
|
613
|
+
`tasks/<id>/infra.txt` with `stage=dwarf|qa`:
|
|
532
614
|
|
|
533
615
|
- a **dwarf-stage** stop refunds the attempt counter;
|
|
534
616
|
- a **QA-stage** stop keeps the attempt (the dwarf's work is real and committed) and writes the
|
|
535
|
-
`resume=qa` marker, so the next entry re-reviews without running the dwarf
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
617
|
+
`resume=qa` marker, so the next entry re-reviews without running the dwarf.
|
|
618
|
+
|
|
619
|
+
The scheduler pauses only what the stop says something about. Its **scope** comes from the class:
|
|
620
|
+
|
|
621
|
+
| Class | Scope paused | Other tasks |
|
|
622
|
+
|---|---|---|
|
|
623
|
+
| `rate_limit` | that model on that harness (`model:<harness>/<model>`) | keep running, on any other model |
|
|
624
|
+
| `quota`, `auth` | that harness's account (`harness:<harness>`) | keep running on other harnesses |
|
|
625
|
+
| anything else (network, empty output, ...) | everything (`all`): running tasks drain, nothing new starts | wait with it |
|
|
626
|
+
|
|
627
|
+
A pending task whose next dispatch (its implementer and reviewer, or the reviewer alone before a
|
|
628
|
+
QA-only resume) needs a paused pair waits; the rest of the run continues. Unstarted tasks stay
|
|
629
|
+
`PENDING`, never `BLOCKED`. Without `--infra-retries`, `run` ends once nothing else can run, prints
|
|
630
|
+
what to fix and exits `8`; verification is skipped and running the same command again resumes.
|
|
631
|
+
`run --infra-retries M` waits out each scope instead, up to `M` waits **per scope** (a stop in a
|
|
632
|
+
scope already paused joins its wait and is not counted again), then resumes its tasks in the same
|
|
633
|
+
run with no attempt spent. A scope whose waits are used up stays paused while other tasks finish.
|
|
634
|
+
|
|
635
|
+
Each wait is the provider's retry-after when the log carried one (capped at 6 h), otherwise the
|
|
636
|
+
backoff shape for that wait number. `--infra-backoff <shape>` on `run` (kept in the plan as
|
|
637
|
+
`infra_backoff`, read at every wait, so `forge control set infra-backoff` applies to the next one)
|
|
638
|
+
takes `exp:<base>[,<cap>]` (base doubling, capped at `<cap>`, default the larger of the base and
|
|
639
|
+
30 min), `linear:<start>,<step>[,<cap>]`, or `list:<a>,<b>,...` (a bare `<a>,<b>,...` is a list;
|
|
640
|
+
the last value repeats), all in positive seconds. The default is `exp:60`; `FORGE_INFRA_BACKOFF`
|
|
641
|
+
changes that base. The wait message names the source, for example `waiting 120s before resuming
|
|
642
|
+
(backoff exp:60, wait 2 of 3)`. While anything is paused, `infra.paused` (JSON `{"scopes": [...]}`
|
|
643
|
+
with `scope`, `class`, `harness`, `model`, `tasks`, `cycle`, `until`, `exhausted`) says what waits
|
|
644
|
+
and until when; `forge control show` reports it as `infra_paused`, and it is removed when nothing
|
|
645
|
+
is paused.
|
|
646
|
+
|
|
647
|
+
`--infra-fallback` on `run` (kept as `infra_fallback`; `--no-infra-fallback` turns it off, the
|
|
648
|
+
default) moves a **dwarf-stage `rate_limit`** stop to the next member of the task's own tier pool,
|
|
649
|
+
in pool order, that runs another model on a pair nobody paused. No attempt is spent; the move is
|
|
650
|
+
recorded in `escalations.tsv` with source `fallback` and in `tasks.tsv`, and the task is
|
|
651
|
+
dispatched again at once. A pinned task, a Fractal plan, a QA-stage stop and a pool with no
|
|
652
|
+
healthy member keep the ordinary pause.
|
|
653
|
+
|
|
654
|
+
A planned pause (a provider maintenance window, a quota reset) is `forge control drain`, not a
|
|
655
|
+
signal: running tasks finish, nothing new starts, and `forge control resume` continues the same
|
|
656
|
+
run.
|
|
541
657
|
|
|
542
658
|
A dwarf that exits 0 with an empty final message *and* an empty diff is the same class
|
|
543
659
|
(`class=empty`): it never really ran. Under Fractal a dwarf-side stop still ends as Fractal's own
|
|
@@ -647,7 +763,9 @@ The user's own branch and working tree are untouched for the whole run.
|
|
|
647
763
|
| 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 |
|
|
648
764
|
| task status `FAIL` with "produced no changes" | the dwarf ended without editing anything — usually an ambiguous prompt it could not resolve headlessly |
|
|
649
765
|
| task status `UNKNOWN` | QA never emitted a verdict line; read `tasks/<id>/qa.last`. `retry` re-runs QA only, on the unchanged work |
|
|
650
|
-
| 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`) |
|
|
766
|
+
| 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
|
+
| 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
|
+
| 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 |
|
|
651
769
|
| a `FAIL` task merged anyway | an explicit `--qa-threshold` tolerated its findings; see `known_issues.md` and `qa.gate` |
|
|
652
770
|
| task status `CONFLICT` | QA passed but the merge onto the integration branch conflicted — `files` was understated somewhere |
|
|
653
771
|
| every wave has one task | `files` sets overlap across most tasks; the decomposition is not actually parallel |
|
|
@@ -688,6 +806,62 @@ in `verification.retry.log`, and prints a loud `FLAKY` line in `run`/`retry`/`in
|
|
|
688
806
|
a command that changes the tree is never retried. This runs before Jev's optional model-assisted
|
|
689
807
|
triage, which then does not.
|
|
690
808
|
|
|
809
|
+
**Verification lanes.** Instead of one command, verification can be several named **lanes**
|
|
810
|
+
that run side by side, each rerun on its own. A lane is a file whose name is the lane's name
|
|
811
|
+
(letters, digits, `_` and `-`, at most 64) and whose text is a Bash command, run from the
|
|
812
|
+
integration checkout like the single command; leading `#forge:` lines give it options. Declare
|
|
813
|
+
them in the repository as `.forge/verify.d/<name>` files, or for one plan with
|
|
814
|
+
`run --verify-lane 'name[opt,opt]=command'` (also `retry`; repeatable, written to
|
|
815
|
+
`<plan>/verify.d/`; the first one of an invocation replaces the plan's earlier lanes and its
|
|
816
|
+
`--verify`, as `--verify` replaces the plan's lanes). The first source that exists wins: the
|
|
817
|
+
plan's lanes, the plan's `--verify`, the repository's `.forge/verify.d/`, then
|
|
818
|
+
`.forge/verify` (ignored, with a note, when the repository also has lanes). `run` checks the
|
|
819
|
+
lanes before any model is paid for and exits 2 on an invalid one (an unknown or repeated
|
|
820
|
+
option, an empty command, a path outside the checkout, a missing baseline).
|
|
821
|
+
|
|
822
|
+
| Option | Means |
|
|
823
|
+
|---|---|
|
|
824
|
+
| `group=<name>` | lanes of one group never run at the same time (a shared database, a port) |
|
|
825
|
+
| `first` | runs before every other lane; if a `first` lane fails (after its reruns) or changes the tree, the rest are `skipped` |
|
|
826
|
+
| `retries=<0-9>` | reruns of this lane when it fails; otherwise `--verify-retries` (default `1`) |
|
|
827
|
+
| `reports=<dir>` | JUnit `*.xml` and TAP `*.tap` reports the lane writes under `<dir>` (inside the checkout). Only reports written during that run count; they give the lane's test counts and failing tests, and are re-read every 10 s while it runs |
|
|
828
|
+
| `baseline=<file>` | known failing test names, one per line (`#` comments), inside the checkout. A lane whose every failing test is in it ends `known`, which passes. A report that could not be read, or a failure no report names, is judged by the exit code |
|
|
829
|
+
|
|
830
|
+
Up to `--verify-parallel N` lanes run at once (`run`, `retry` and `integrate`, kept as
|
|
831
|
+
`verify_parallel`, 1 to 32, default 3), started in name order. A lane that fails is rerun alone,
|
|
832
|
+
after the round, up to its budget; a pass on a rerun makes it `flaky`, which passes but is named
|
|
833
|
+
in the run output (`FLAKY: lane <name> failed once and passed on rerun`), in
|
|
834
|
+
`verification.flaky` and in the whole-run review. Nothing reruns once the tree changed: the
|
|
835
|
+
checkout's fingerprint is compared after every round, and a change fails the verification
|
|
836
|
+
(`mutated`; with lanes in parallel it cannot be pinned to one of them). A lane's states are
|
|
837
|
+
`waiting`, `running`, `pass`, `fail`, `flaky`, `known`, `skipped` and `interrupted`. Lanes mode
|
|
838
|
+
replaces the whole-command rerun above and Jev's flake triage (a note says so when Jev's tests
|
|
839
|
+
site is on); the single-command mode is unchanged.
|
|
840
|
+
|
|
841
|
+
A lane may print `::forge step name=<step> state=start` and `::forge step name=<step>
|
|
842
|
+
state=end [exit=<n>]`, each on a line of its own, to say which step it is in; forge-ui shows the
|
|
843
|
+
open step live. A signal stops the running lanes' process groups (TERM, then KILL after 5 s),
|
|
844
|
+
marks them and the verification `INTERRUPTED`, and exits 130 like a single command.
|
|
845
|
+
|
|
846
|
+
The runner is `scripts/forge-verify.py` (`lanes` lists and checks a directory's lanes; `run`
|
|
847
|
+
runs them). In lanes mode `verification.command` holds one `<lane>: <first line>` per lane,
|
|
848
|
+
`verification.log` the runner's summary plus the last 200 lines of each lane that failed, and
|
|
849
|
+
`verification.lanes.json` the live state of every lane; each lane writes
|
|
850
|
+
`verification.lane.<name>.log` and keeps each finished run as `verification.lane.<name>.run-<k>.log`.
|
|
851
|
+
|
|
852
|
+
```
|
|
853
|
+
.forge/verify.d/lint #forge: first
|
|
854
|
+
npm run lint && npm run typecheck
|
|
855
|
+
.forge/verify.d/unit #forge: reports=reports/unit
|
|
856
|
+
npm test -- --reporter=junit --outputFile=reports/unit/junit.xml
|
|
857
|
+
.forge/verify.d/db #forge: group=postgres retries=2 reports=reports/db baseline=.forge/known-db-failures.txt
|
|
858
|
+
docker compose up -d postgres && npm run test:db
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
Here `lint` runs alone first; `unit` and `db` then run together, another lane in the
|
|
862
|
+
`postgres` group would wait for `db`, and a `db` run whose only failures are listed in the
|
|
863
|
+
baseline ends `known`.
|
|
864
|
+
|
|
691
865
|
`scripts/forge-verify-coverage.py` reads the project's own test configuration and **warns**
|
|
692
866
|
(never fails) about suites the command does not run — at `run` start before any model is paid
|
|
693
867
|
for, again in `verify_result`, and at `integrate` — recording the lines in
|
package/references/harnesses.md
CHANGED
|
@@ -53,7 +53,9 @@ looking for strong phrases (usage/session limit, quota, insufficient balance/cre
|
|
|
53
53
|
429/529, unauthorized/401/403, invalid API key, not logged in, ECONNRESET/ENOTFOUND/…). An
|
|
54
54
|
`empty` answer (exit 0, nothing said) is the fifth class. codex's non-fatal reconnect notices
|
|
55
55
|
followed by a normal reply never classify. `<role>.infra` holds `class=`, `retry_after=` (parsed
|
|
56
|
-
from "resets 3pm", "try again in 2h", `|<epoch>`, capped at 24 h), `detail=`, `rc=`, `role
|
|
56
|
+
from "resets 3pm", "try again in 2h", `|<epoch>`, capped at 24 h), `detail=`, `rc=`, `role=`,
|
|
57
|
+
`harness=`, `model=` (the scheduler pauses by them: a rate limit pauses that model on that
|
|
58
|
+
harness, a quota or auth stop that harness).
|
|
57
59
|
A dwarf that exits 0 with nothing said writes the file but still exits 0; callers consult it
|
|
58
60
|
only when the diff is empty.
|
|
59
61
|
|
|
@@ -68,6 +70,16 @@ anything still alive in it (`<role>.orphans`). This is proven offline only; veri
|
|
|
68
70
|
with one live dispatch before relying on it, and use the kill switch if a harness deliberately
|
|
69
71
|
leaves a helper running.
|
|
70
72
|
|
|
73
|
+
On an interrupt the harness leads its own session, so the TERM a decomposed run's scheduler
|
|
74
|
+
sends to a task's process group reaches the dispatch, whose exit trap stops the harness. The
|
|
75
|
+
scheduler waits up to `FORGE_INTERRUPT_GRACE` seconds (default 10) for each task's group to
|
|
76
|
+
empty before KILLing it. As a backstop, a guarded dispatch records its harness right after
|
|
77
|
+
launch in `<role>.harness` (`<pid><TAB><start time>`, from `forge-guard.py identity`; removed when
|
|
78
|
+
the dispatch ends). For a task whose dispatch could not stop its harness, and at the next
|
|
79
|
+
scheduler start for tasks a killed scheduler left `RUNNING`, `forge-guard.py stop <record>`
|
|
80
|
+
signals the recorded group (TERM, about 2 s, KILL) only when the pid still has the recorded
|
|
81
|
+
start time, so a reused pid is left alone.
|
|
82
|
+
|
|
71
83
|
Effort ladders, low to high:
|
|
72
84
|
|
|
73
85
|
- codex — `low medium high xhigh max ultra`
|
package/references/ui.md
CHANGED
|
@@ -24,9 +24,13 @@ run goes on, with the same exit code.
|
|
|
24
24
|
- **Fractal child tasks:** the tree a Fractal task was split into, in the inspector and above
|
|
25
25
|
the opened task in 3D, each node with its decision, cost, output and candidate diff.
|
|
26
26
|
- **Controls:** change a live plan from its inspector: QA threshold, timeout, escalate-after,
|
|
27
|
-
verify retries, and (while a scheduler is live)
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
the effort step, verify retries, the infrastructure backoff, and (while a scheduler is live)
|
|
28
|
+
the retry and infra-retry budgets, max parallel, Drain/Resume, Stop and Stop now; per task, a
|
|
29
|
+
threshold override (`None` exempts it), a retry budget, a one-shot model pin and, on a live run,
|
|
30
|
+
*Retry now* for a stopped or failed task (optionally on a chosen model), which shows its queued
|
|
31
|
+
request until the scheduler applies or refuses it. Each infrastructure pause gets a line: what
|
|
32
|
+
is paused, why, its tasks and the time left. Each is one `forge control` call; the change is
|
|
33
|
+
confirmed first and logged in `control.log`.
|
|
30
34
|
- **Open findings and issues:** the findings a run (or all of its repository's runs) left open,
|
|
31
35
|
filed as GitHub issues or dismissed through `forge issues`.
|
|
32
36
|
- **Delete a run:** a dry run, then `forge runs rm`: the dataset keeps the traces, an archive is
|
|
@@ -44,7 +48,24 @@ run goes on, with the same exit code.
|
|
|
44
48
|
as the run's verdict; changes on the user's own branch after an integrate are not tracked. The
|
|
45
49
|
*Execution* view shows the same run on wall-clock time, one block per attempt in the lane it
|
|
46
50
|
ran in, with projected blocks for what has not started and a strip of busy slots against
|
|
47
|
-
`--max-parallel
|
|
51
|
+
`--max-parallel`; the verification follows on rows of its own, one per verification lane
|
|
52
|
+
with each run and rerun.
|
|
53
|
+
- **Verification** (its finish node): live, the elapsed time, a lane's announced step
|
|
54
|
+
(`::forge step`), its last line, a warning after five minutes without output and the live
|
|
55
|
+
output; after a failure, the failing tests first, by lane, new or known (from JUnit/TAP
|
|
56
|
+
reports), each opening the lane's log at its line, or a reportless lane's log tail; then every
|
|
57
|
+
lane's state, time, runs and tests; a lane's name opens its output.
|
|
58
|
+
- **Where each task is:** the task table's *Now* column and a task's *Now* section: the command a
|
|
59
|
+
running dwarf or reviewer runs and for how long, flagged *quiet* after five minutes with no
|
|
60
|
+
output, or why a task waits (dependencies, shared files, no free slot, a drain or stop, an
|
|
61
|
+
infrastructure pause with its countdown, the retry policy's stop and its split). The run
|
|
62
|
+
inspector says what the scheduler is doing.
|
|
63
|
+
- **Checks:** each attempt's tests, type checks, lints and builds, read from its dwarf's and
|
|
64
|
+
reviewer's logs, with exits, times and counts, a failed one's last lines, and which of the
|
|
65
|
+
commands its `## Acceptance criteria` name never ran. codex and grok logs carry no times, so
|
|
66
|
+
`forge-dispatch.sh` keeps `<role>.clock` (when the log grew, each second) beside each log for
|
|
67
|
+
them; `FORGE_LOG_CLOCK=off` turns it off. An environment problem (Docker, a sandbox's EPERM, a
|
|
68
|
+
port in use, …) that several tasks' failed commands met gets one banner in the run header.
|
|
48
69
|
- **Opening a node** shows its attempts, dwarves and reviews, and an inspector with the prompt
|
|
49
70
|
that launched each one, the model, timings by phase, tokens, verdicts and the P0–P3 findings
|
|
50
71
|
of every review (the final review's included).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
Three subcommands, stdlib only, no network:
|
|
5
5
|
|
|
6
|
-
qa --part head|tail [--kind task|final|solo] [--threshold P0|P1|P2|P3]
|
|
6
|
+
qa --part head|tail [--kind task|final|solo|sweep] [--threshold P0|P1|P2|P3]
|
|
7
7
|
Prints one piece of the QA prompt. The caller prints everything between and
|
|
8
8
|
after the pieces itself (scope notes, the diff fence, the memory note and the
|
|
9
9
|
"Place any learning notes before the final FORGE_VERDICT ..." sentence).
|
|
@@ -73,7 +73,7 @@ import sys
|
|
|
73
73
|
|
|
74
74
|
SEVERITIES = ('P0', 'P1', 'P2', 'P3')
|
|
75
75
|
PLACEHOLDER = 'path/file.py:123'
|
|
76
|
-
KINDS = ('task', 'final', 'solo')
|
|
76
|
+
KINDS = ('task', 'final', 'solo', 'sweep')
|
|
77
77
|
|
|
78
78
|
Finding = collections.namedtuple('Finding', 'status severity located line text')
|
|
79
79
|
Finding.__doc__ = (
|
|
@@ -114,6 +114,14 @@ _HEAD = {
|
|
|
114
114
|
'behaviour versus what was asked. Also say if it solved a different problem than the',
|
|
115
115
|
"one stated, or changed files outside the goal's scope.",
|
|
116
116
|
] + _NO_TRUST,
|
|
117
|
+
'sweep': [
|
|
118
|
+
'This is a finding sweep. The implementer was asked to fix only the review findings listed in',
|
|
119
|
+
'the task above (S1, S2, ...), which reviews of earlier tasks in this run left open. Your review',
|
|
120
|
+
'is narrow: for each listed finding, decide from the diff below whether it is fixed, or no longer',
|
|
121
|
+
'applies to the code; and check that the change breaks nothing it touches. Do not review code the',
|
|
122
|
+
'diff did not change, and do not report other problems you notice there: they are not this',
|
|
123
|
+
"task's work.",
|
|
124
|
+
] + _NO_TRUST,
|
|
117
125
|
'final': [
|
|
118
126
|
'This is the final, whole-run review. The diff below is the COMBINED result of several',
|
|
119
127
|
'tasks that were implemented independently and each reviewed on its own slice only.',
|
|
@@ -148,11 +156,25 @@ _SEVERITY = [
|
|
|
148
156
|
|
|
149
157
|
_NO_THRESHOLD = ['The severity tag does not change the verdict rule below.']
|
|
150
158
|
|
|
159
|
+
_SWEEP_FINDINGS = [
|
|
160
|
+
'Report findings only — do not edit any file. A finding here is a regression the change',
|
|
161
|
+
'introduced: give its file and line, what breaks, and a concrete input that triggers it. Mark it',
|
|
162
|
+
'CONFIRMED if you traced it in the code, or PLAUSIBLE if you could not fully verify it.',
|
|
163
|
+
]
|
|
164
|
+
|
|
165
|
+
_SWEEP_STATUS = [
|
|
166
|
+
'Then give one line for every listed finding, in exactly this form (its own S number):',
|
|
167
|
+
' - S<n>: FIXED',
|
|
168
|
+
' - S<n>: NOT FIXED — what is still wrong',
|
|
169
|
+
'FIXED means the diff removes the problem, or the code it pointed at no longer has it. Do not',
|
|
170
|
+
'repeat a NOT FIXED finding as a finding bullet; its line is enough.',
|
|
171
|
+
]
|
|
172
|
+
|
|
151
173
|
_PASS = ' FORGE_VERDICT: PASS — no confirmed correctness bug (style nits are not failures)'
|
|
152
174
|
_FAIL = ' FORGE_VERDICT: FAIL — at least one CONFIRMED correctness bug'
|
|
153
175
|
|
|
154
176
|
|
|
155
|
-
def _threshold_clause(rank: int) -> list:
|
|
177
|
+
def _threshold_clause(rank: int, kind: str = 'task') -> list:
|
|
156
178
|
name = SEVERITIES[rank]
|
|
157
179
|
blocking = ', '.join(SEVERITIES[:rank + 1])
|
|
158
180
|
if rank == len(SEVERITIES) - 1:
|
|
@@ -164,6 +186,8 @@ def _threshold_clause(rank: int) -> list:
|
|
|
164
186
|
'CONFIRMED finding at a lower severity (%s) is recorded as a known issue and does' % tolerated,
|
|
165
187
|
'not by itself justify FAIL. Give FAIL if and only if at least one CONFIRMED',
|
|
166
188
|
'finding is blocking.']
|
|
189
|
+
if kind == 'sweep': # the verdict lines below say when a sweep fails
|
|
190
|
+
lines[-2:] = ['not by itself justify FAIL.']
|
|
167
191
|
return lines + ['A CONFIRMED finding without a severity tag counts as blocking.']
|
|
168
192
|
|
|
169
193
|
|
|
@@ -176,10 +200,15 @@ def qa_text(part: str, kind: str = 'task', threshold=None) -> str:
|
|
|
176
200
|
return '\n'.join(_HEAD[kind]) + '\n'
|
|
177
201
|
if part != 'tail':
|
|
178
202
|
raise ValueError('part must be head or tail')
|
|
179
|
-
lines = list(_FINDINGS) + (_SOLO_EXTRA if kind == 'solo' else [])
|
|
203
|
+
lines = list(_SWEEP_FINDINGS if kind == 'sweep' else _FINDINGS) + (_SOLO_EXTRA if kind == 'solo' else [])
|
|
180
204
|
lines += [''] + _SEVERITY
|
|
181
|
-
lines += [''] + (_NO_THRESHOLD if rank is None else _threshold_clause(rank))
|
|
182
|
-
if
|
|
205
|
+
lines += [''] + (_NO_THRESHOLD if rank is None else _threshold_clause(rank, kind))
|
|
206
|
+
if kind == 'sweep':
|
|
207
|
+
lines += [''] + _SWEEP_STATUS
|
|
208
|
+
where = '' if rank is None else ' at the blocking threshold (%s or worse)' % SEVERITIES[rank]
|
|
209
|
+
verdicts = [' FORGE_VERDICT: PASS — at least one listed finding is FIXED, and no CONFIRMED regression%s' % where,
|
|
210
|
+
' FORGE_VERDICT: FAIL — no listed finding is FIXED, or a CONFIRMED regression%s' % where]
|
|
211
|
+
elif rank is None:
|
|
183
212
|
verdicts = [_PASS, _FAIL]
|
|
184
213
|
else:
|
|
185
214
|
where = '%s or worse' % SEVERITIES[rank]
|
|
@@ -378,7 +407,8 @@ def _parser() -> argparse.ArgumentParser:
|
|
|
378
407
|
qa.add_argument('--part', required=True, choices=('head', 'tail'),
|
|
379
408
|
help='head = review preamble, tail = findings format + verdict contract')
|
|
380
409
|
qa.add_argument('--kind', choices=KINDS, default='task',
|
|
381
|
-
help='task (default), final (whole-run review)
|
|
410
|
+
help='task (default), final (whole-run review), solo (solo wording) or sweep (a finding '
|
|
411
|
+
'sweep task: per-finding FIXED lines, regressions only)')
|
|
382
412
|
qa.add_argument('--threshold', type=_threshold_arg, default=None, metavar='P0..P3',
|
|
383
413
|
help='least severe level that still blocks (default: none)')
|
|
384
414
|
sub.add_parser('dwarf', help='print the implementer rules block')
|