@giamme/forge 0.14.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/SKILL.md +47 -14
- package/VERSION +1 -1
- package/docs/artifacts.md +1 -1
- package/docs/commands.md +302 -9
- package/docs/forge-ui.md +14 -0
- package/docs/memory.md +22 -0
- package/docs/models.md +53 -0
- package/docs/reviews.md +7 -0
- package/forge +11 -0
- package/package.json +1 -1
- package/references/dataset.md +16 -4
- package/references/decompose.md +154 -9
- package/references/harnesses.md +21 -1
- package/references/planning.md +59 -0
- package/references/solo.md +5 -1
- package/references/ui.md +48 -1
- package/scripts/forge-artifact.sh +53 -0
- package/scripts/forge-compare.py +6 -3
- package/scripts/forge-config.py +531 -4
- package/scripts/forge-contract.py +55 -8
- package/scripts/forge-control.py +0 -2
- package/scripts/forge-dispatch.sh +84 -14
- package/scripts/forge-fail-first.py +3 -1
- package/scripts/forge-guard.py +247 -8
- package/scripts/forge-issues.py +12 -0
- package/scripts/forge-lib-adopt.sh +260 -0
- package/scripts/forge-lib-attribute.sh +10 -2
- package/scripts/forge-lib-plans.sh +35 -6
- package/scripts/forge-lib-review.sh +13 -5
- package/scripts/forge-lib-task.sh +138 -5
- package/scripts/forge-memory.sh +41 -4
- package/scripts/forge-metrics.sh +7 -0
- package/scripts/forge-parallel-options.sh +12 -6
- package/scripts/forge-parallel.sh +659 -32
- package/scripts/forge-plan-check.py +591 -8
- package/scripts/forge-planner.py +480 -0
- package/scripts/forge-route.py +16 -2
- package/scripts/forge-runs-rm.py +23 -7
- package/scripts/forge-runtime.py +111 -2
- package/scripts/forge-schedule.py +5 -2
- package/scripts/forge-shadow.py +53 -7
- package/scripts/forge-solo.sh +87 -7
- package/scripts/forge_dataset/cli.py +26 -0
- package/scripts/forge_dataset/efforts.py +215 -0
- package/scripts/forge_dataset/export.py +1 -0
- package/scripts/forge_dataset/harvest.py +55 -0
- package/scripts/forge_dataset/history.py +126 -0
- package/scripts/forge_dataset/worktrees.py +95 -0
- package/scripts/forge_decide/__init__.py +19 -1
- package/scripts/forge_decide/builtin_profiles.json +25 -0
- package/scripts/forge_decide/cli.py +12 -0
- package/scripts/forge_decide/profiles.py +866 -0
- package/scripts/forge_decide/resolve.py +38 -6
- package/scripts/forge_memory_list.py +153 -0
- package/scripts/forge_worktrees.py +88 -0
- package/ui/README.md +31 -0
- package/ui/docs/api.md +168 -12
- package/ui/forge_ui/__init__.py +14 -1
- package/ui/forge_ui/__main__.py +1 -1
- package/ui/forge_ui/control.py +250 -12
- package/ui/forge_ui/executions.py +28 -8
- package/ui/forge_ui/findings.py +7 -0
- package/ui/forge_ui/models.py +60 -1
- package/ui/forge_ui/projects.py +571 -0
- package/ui/forge_ui/reader.py +48 -8
- package/ui/forge_ui/static/app.js +99 -21
- package/ui/forge_ui/static/cloudui.js +6 -2
- package/ui/forge_ui/static/convo.js +1 -1
- package/ui/forge_ui/static/diffview.js +2 -2
- package/ui/forge_ui/static/files.js +1 -1
- package/ui/forge_ui/static/index.html +5 -1
- package/ui/forge_ui/static/leaderboard.js +5 -1
- package/ui/forge_ui/static/modelstats.js +25 -1
- package/ui/forge_ui/static/panel.js +47 -4
- package/ui/forge_ui/static/projectsview.js +372 -0
- package/ui/forge_ui/static/settings.js +924 -29
- package/ui/forge_ui/static/style.css +116 -3
- package/ui/forge_ui/static/uikit.js +94 -1
- package/ui/forge_ui/static/worktreesview.js +250 -0
- package/ui/forge_ui/worktrees.py +570 -0
package/references/dataset.md
CHANGED
|
@@ -30,16 +30,17 @@ time order: an attempt that PASSed, then a merge that CONFLICTed, then a human `
|
|
|
30
30
|
| kind | one per | what it holds |
|
|
31
31
|
|---|---|---|
|
|
32
32
|
| `start` | execution | a receipt written by `begin()`. A start with no matching end is an execution that was killed or is still running |
|
|
33
|
-
| `dispatch` | model call | role, alias, harness, **resolved** model, effort after clamping, timeout and its source, delivery (custom or native review), phase timings, exit, timeout, infra class, tokens, parsed verdict and findings, `FORGE_LEARNING` lines, `session_id`, `session_continue`. Blobs: the delivered prompt and the final message |
|
|
33
|
+
| `dispatch` | model call | role, alias, harness, **resolved** model, effort after clamping, timeout and its source, delivery (custom or native review), phase timings, exit, timeout, infra class, tokens, parsed verdict and findings, `tests` (a reviewer's `FORGE_TESTS` line: `status`, `reason`; null when it has none), `FORGE_LEARNING` lines, `session_id`, `session_continue`, `service_tier`, `speed`, `speed_reason`. Blobs: the delivered prompt and the final message |
|
|
34
34
|
| `attempt` | task attempt or solo run | status, attempt number (with refund and resume flags), trigger (`initial`, `auto`, `human`), dwarf and qa spec, declared vs changed files, numstat, drift, guard notes, gate line (`thr<TAB>decision<TAB>worst<TAB>n_confirmed<TAB>n_unlabelled<TAB>n_below`; a solo attempt has it too, with the `known_issues` blob; null when the run wrote none), patch key, the files this execution wrote and the ones it only carried, `sent_back` (`prereview`, `bounce` or `message`: the send-back this attempt ended with, which leaves its status `FAIL`; null otherwise) and `retry_source` (where the retry findings it was given came from: `review`, `prereview`, `bounce`, `message` or `answer`; null on a first attempt). Blobs: the diff, retry findings, memory slices, capsule, Jev task files |
|
|
35
35
|
| `verification` / `verify_run` | verify, and each command execution | command and its source (flag, `.forge/verify`, Jev), status, flaky. One `verify_run` per execution, each with its own log |
|
|
36
|
-
| `plan` | `plan` | goal, original request, decompose level, exploratory routing decisions (`tasks[id].route`, with their odds), author (
|
|
36
|
+
| `plan` | `plan` | goal, original request, decompose level, exploratory routing decisions (`tasks[id].route`, with their odds), author (`planner` when a planner was dispatched into the plan dir, else `orchestrator`), `orchestrator` (the first line of the plan's `orchestrator` file: `auto` for a plan started by `forge-parallel.sh auto`; absent for a plan built by hand), per-task declared vs executed difficulty and who set it, pools, waves, Jev's plan-time judgments (stores from before 2026-10-27 also hold routing and coupling), options (`qa_threshold`, the effective blocking threshold, and `qa_threshold_source`, `set` when the plan's file held a valid value and `default` otherwise; plus `reviewer_session` when that file is present), `plan_gates` (the parsed `plan-gates.json`: what the plan-time gates did, with the `sent_back` history and `pending`; absent when the plan has no such file), `shape`, `widest` and `wave_count` from `plan-shape.json` (`shape` is `one`, `chain` or `branches`; `wave_count` is how many waves; `widest` is the largest wave). `waves` stays the task-to-wave map from `waves.tsv` on every plan. `collapsed` (true when `collapsed.json` exists) and `collapsed_from` (the task ids it merged), `plan_gate` (the parsed `plan-gate.json`: the planner's one-task-or-plan decision). `shape`, `widest`, `wave_count`, `collapsed`, `collapsed_from` and `plan_gate` are absent when their file is missing. Blobs: both task tables, prompts, approaches, excerpts of the declared files at plan time, the file inventory, `memory.md` |
|
|
37
37
|
| `run_end` | `run` | results per task, the accepted integration commit, `memory.md` |
|
|
38
38
|
| `invocation` | user-facing `forge-parallel.sh` subcommand | argv, exit, duration, plus final review, accept, integrate and split/combine payloads |
|
|
39
|
-
| `event` | point event | `merge` (MERGED, CONFLICT with the files, INVALIDATED and why), `integrate_advanced`, `integrate_conflict`, `combine_conflict`, `sched_terminal`, `memory_record`, `memory_prune`, `attribution` (below) |
|
|
39
|
+
| `event` | point event | `merge` (MERGED, CONFLICT with the files, INVALIDATED and why), `adopt` (a range made outside forge: base, tip, verdict, approved, adopted, spec, reason, authors; adopted 0 when the review refused it), `integrate_advanced`, `integrate_conflict`, `combine_conflict`, `sched_terminal`, `memory_record`, `memory_prune`, `attribution` (below) |
|
|
40
40
|
| `event` `escalation` | retry that changes the model | the model a retry escalated from and to, `after_attempt`, and `source` (`policy`, `retry` for an explicit `--dwarf`, or `pin`), recorded at the rewrite, before the retried attempt begins. Runs from before lateral moves had their own record may also hold `source` `fallback`: those rows are lateral moves |
|
|
41
41
|
| `event` `lateral` | dwarf-stage infrastructure stop moved the task to another model of its tier | `role` (`dwarf`), the model it moved `from` and `to`, `cause` (the stop's class, `-` when none was given) and `attempt` (the attempts spent when it moved). Recorded in `tasks/<id>/lateral.tsv`, not as an `escalation`; a streak of failures carries across it |
|
|
42
42
|
| `event` `control` | `forge control` change | a human's live change: `at`, `actor` (`cli`/`ui`), `action` (`set`, `pin`, `unpin`), `key`, `value`, `previous`; task events carry the task id. Also read back from `control.log` by `import` |
|
|
43
|
+
| `event` `worktree_created` / `worktree_removed` | forge adds or removes a worktree | `path`, `branch` (`-` when detached), `kind` (`task`, `integration`, `candidate` for integrate's scratch worktree, `attribute` for the culprit search's), `repo_path`, and the task for a task worktree; `forge runs rm` adds `by`. Written at task and `_integration` creation, the merged-task cleanup at the end of `run`, integrate's candidate, every prefix of `attribute`, `combine` and `split` (a moved worktree is removed from the old run and created in the new one), and `forge runs rm --worktrees`. A worktree removed outside forge has no `worktree_removed`. forge-ui's Worktrees screen reads them through `forge dataset worktrees` |
|
|
43
44
|
| `event` `run_delete_started` / `run_deleted` | `forge runs rm` | written strictly around a run's deletion: `path`, `run_id`, `archive`, and for `run_deleted` the bytes freed |
|
|
44
45
|
| `event` `shadow_review` | shadow review | how an opt-in second review ended (`done`, `invalid`, `overtime`, `orphaned`, ...), with the reviewed commit and both specs. Its dispatch is recorded with role `qa_shadow` |
|
|
45
46
|
| `jev` | Jev request | site, answers, usage, latency, mode. Blob: the **full request** (state and questions). Its original sha is `jev.jsonl`'s `key`. A per-attempt gate's request state carries `run`, `task` and `attempt` (`dwarf-message`, `retry-addressed`), so its key differs per attempt and per run; `attribution` carries `run` only |
|
|
@@ -64,13 +65,22 @@ continuing was requested, so a failed continue that still printed a verdict is t
|
|
|
64
65
|
The `attempt` event's `resumed` flag is a different fact: a QA-only re-run after an
|
|
65
66
|
infrastructure stop (the `tasks/<id>/resume` marker).
|
|
66
67
|
|
|
68
|
+
A dispatch also carries `service_tier`, `speed` and `speed_reason`, read from the attempt's
|
|
69
|
+
`metrics.json`. `service_tier` is the tier that was asked. When metrics has none, it falls
|
|
70
|
+
back to `<role>.resolved`'s `service_tier=`, which is written only when the dispatch asked
|
|
71
|
+
for a tier. `speed` is what the log reported: `fast`, `standard`, `default`, or null when
|
|
72
|
+
the log does not say. `speed_reason` is why it was not fast (claude's
|
|
73
|
+
`fast_mode_disabled_reason`, or codex's error message), or null. Each is null when absent,
|
|
74
|
+
so a dispatch that predates the keys is otherwise unchanged.
|
|
75
|
+
|
|
67
76
|
`plan --reviewer-session` writes `$PLAN/reviewer_session` (`on`). The plan event records
|
|
68
77
|
it in `options`. The file joins the plan id only when it is present, so every plan already
|
|
69
78
|
in a store keeps its id, and turning the experiment on stores a new plan event.
|
|
70
79
|
`plan --implementer-session` (`$PLAN/implementer_session`, `on`) is recorded the same way, and
|
|
71
80
|
`plan --pre-review-tests` joins the plan id the same way and is listed in `flags`. `plan-gates.json`
|
|
72
81
|
joins it too, but with its parsed content rather than a first line: a plan without the file keeps
|
|
73
|
-
its id, and a re-plan that changes the file's content gets a new plan event.
|
|
82
|
+
its id, and a re-plan that changes the file's content gets a new plan event. `plan-shape.json`,
|
|
83
|
+
`collapsed.json` and `plan-gate.json` join the same way, each only when it is present.
|
|
74
84
|
`forge dataset status` counts continued and failed continues for reviewers and implementers
|
|
75
85
|
apart.
|
|
76
86
|
|
|
@@ -154,6 +164,8 @@ forge still running keeps writing.
|
|
|
154
164
|
./forge dataset routing [--repo PATH] [--since DAYS] [--json] # pass rate and runtime per tier and model
|
|
155
165
|
./forge dataset reviewers [--horizon-days 14] [--repo PATH] [--json] # how each reviewer's PASSed work held up
|
|
156
166
|
./forge dataset forecast <plan> [--repo PATH] [--json] # likely cost and first-try PASS rate per task
|
|
167
|
+
./forge dataset worktrees [--json] # the worktrees forge created and removed (forge-ui's Worktrees screen)
|
|
168
|
+
./forge dataset history [--json] # every review's findings and every learning, by run (forge-ui's Projects screen)
|
|
157
169
|
```
|
|
158
170
|
|
|
159
171
|
`status` runs a different completeness check for each mode, because each mode
|
package/references/decompose.md
CHANGED
|
@@ -11,12 +11,14 @@ run leaves branches behind.
|
|
|
11
11
|
- [The two axes: decompose-level and difficulty](#the-two-axes-decompose-level-and-difficulty)
|
|
12
12
|
- [tasks.tsv](#taskstsv)
|
|
13
13
|
- [Routing](#routing)
|
|
14
|
+
- [Profiles](#profiles)
|
|
14
15
|
- [Fractal within decomposed tasks](#fractal-within-decomposed-tasks)
|
|
15
16
|
- [Waves and disjointness](#waves-and-disjointness)
|
|
16
17
|
- [Task size and acceptance criteria](#task-size-and-acceptance-criteria)
|
|
17
18
|
- [Plan gates: sent back, and the block under the table](#plan-gates-sent-back-and-the-block-under-the-table)
|
|
18
19
|
- [The capsule](#the-capsule)
|
|
19
20
|
- [Planning](#planning)
|
|
21
|
+
- [Plan shape](#plan-shape)
|
|
20
22
|
- [QA verdicts](#qa-verdicts)
|
|
21
23
|
- [Severity, thresholds and known issues](#severity-thresholds-and-known-issues)
|
|
22
24
|
- [Retrying, and resuming an interrupted run](#retrying-and-resuming-an-interrupted-run)
|
|
@@ -40,8 +42,14 @@ These are independent and easy to conflate.
|
|
|
40
42
|
|
|
41
43
|
At every level, two rules override the target count: never split so fine that a task cannot
|
|
42
44
|
be verified on its own, and never emit two tasks that must edit the same file — make it one
|
|
43
|
-
task, or add a dep.
|
|
44
|
-
|
|
45
|
+
task, or add a dep. A single-file deliverable (one HTML page, one script, one notebook)
|
|
46
|
+
still splits by module when it splits at all: each task owns its own source file (for
|
|
47
|
+
example `src/physics.js`), and one final low-difficulty task assembles them into the
|
|
48
|
+
required file. A pure chain is worse than one task: no two tasks run at once, and each
|
|
49
|
+
pays its own implementation and review. Prefer parallel branches; when the request allows
|
|
50
|
+
none, return one task. `plan` still accepts a chain; the approval table says when one
|
|
51
|
+
task would have run once. The counts are guidance, not quotas; a goal with three natural
|
|
52
|
+
seams produces three tasks at `high` too.
|
|
45
53
|
|
|
46
54
|
**`difficulty`** is rated per task, by what the task demands of the model — **not** by how
|
|
47
55
|
much code it produces:
|
|
@@ -158,7 +166,9 @@ needs some randomized picks, so `plan` makes a few: `--explore E`, with E betwee
|
|
|
158
166
|
`(1 - E)·[choice = pool's pick] + E / 2`.
|
|
159
167
|
- **Turning it off:** `--explore 0`. The choice is kept in the plan dir (`explore`), so a
|
|
160
168
|
later re-plan neither turns it back on nor changes rows already resolved. Precedence:
|
|
161
|
-
the flag, then the plan's earlier choice, then
|
|
169
|
+
the flag, then a profile frozen on this call, then the plan's earlier choice, then
|
|
170
|
+
`FORGE_ROUTE_EXPLORE`, then 0.2. A kept frozen profile is not applied again, so it does
|
|
171
|
+
not replace the rate the plan already stored.
|
|
162
172
|
- **Later changes:** a re-plan draws nothing for rows that are already resolved. An
|
|
163
173
|
approval-gate edit or a `retry --dwarf` simply runs a different model; the analysis
|
|
164
174
|
keeps such a task in the arm it was assigned and reports it as not followed.
|
|
@@ -170,6 +180,25 @@ neighbour assignments it reaches. See [Dataset](dataset.md#routing). At the defa
|
|
|
170
180
|
that is weeks of normal use per pair; a pair that matters can be given more with
|
|
171
181
|
`--explore 0.5` on its plans.
|
|
172
182
|
|
|
183
|
+
### Profiles
|
|
184
|
+
|
|
185
|
+
A profile is a named bundle of routing, policy, gates and budget, so the pools and the
|
|
186
|
+
policies travel together instead of being retyped. One name resolves user, then repo, then
|
|
187
|
+
built-in: a user profile hides a repo profile of the same name, which hides a built-in.
|
|
188
|
+
The built-ins are `balanced` and `lite`, the [recommended routing](../docs/models.md#recommended-routing).
|
|
189
|
+
`forge config profile` keeps them; `plan` and `forge-solo.sh` take one with `--profile NAME`.
|
|
190
|
+
|
|
191
|
+
The chosen profile is frozen into `<dir>/profile.json`. A flag of that call replaces only
|
|
192
|
+
the key it names; the other keys are applied as those flags would have been: dwarf and qa
|
|
193
|
+
pools, the planner, shadow review, exploration and fast roles, plus the plan files for the
|
|
194
|
+
final reviewer, escalation, the QA threshold, the timeout and verify retries. A QA tier the
|
|
195
|
+
profile does not name uses `routing.qa.any` when that pool is set; only with no such pool
|
|
196
|
+
does QA fall back to `opus`, which dispatch runs at `high`. Gates and budget stay
|
|
197
|
+
in the frozen body. With neither `--profile` nor `--no-profile`, a plan keeps the copy it already
|
|
198
|
+
froze and does not apply it again; a plan with no copy gets the default profile, if one is
|
|
199
|
+
set. The runner does not select `balanced` on its own. `--no-profile` removes the frozen
|
|
200
|
+
copy. See [commands](../docs/commands.md#forge-config-profile).
|
|
201
|
+
|
|
173
202
|
## Fractal within decomposed tasks
|
|
174
203
|
|
|
175
204
|
Select optional Fractal execution on `run`; planning the task table does not activate it.
|
|
@@ -346,7 +375,77 @@ they were meant to solve.
|
|
|
346
375
|
|
|
347
376
|
The planner runs with qa's permission profile: it reads the repo and writes nothing to it.
|
|
348
377
|
Its output becomes `tasks.tsv` plus each `tasks/<id>/approach.md`, and the approval gate
|
|
349
|
-
renders both — the last moment the plan can be changed for free.
|
|
378
|
+
renders both — the last moment the plan can be changed for free. The contract for that
|
|
379
|
+
reply is [Planning](planning.md).
|
|
380
|
+
|
|
381
|
+
`forge-parallel.sh auto` does this whole path in one blocking command. The orchestrator's
|
|
382
|
+
job is mechanical, so a small model can drive it. `auto` copies the goal verbatim to
|
|
383
|
+
`request.md` and writes `auto` to `orchestrator`, then:
|
|
384
|
+
|
|
385
|
+
1. **The gate** (`--plan`, default `auto`). `forge-planner.py gate` prints `one-task` when
|
|
386
|
+
the request is at most 1500 characters and at most 6 requirements, otherwise `plan`, and
|
|
387
|
+
records `plan-gate.json` (`decision`, `signals`, `thresholds`, `rule` `size`). `always`
|
|
388
|
+
plans; `never` is one task. The gate is conservative: on the 16 plans of benchmark #86,
|
|
389
|
+
size did not predict shape.
|
|
390
|
+
2. **One task** writes a single row, id `task`, files `.`, difficulty from
|
|
391
|
+
`--one-task-difficulty` (default `medium`), and does not dispatch a planner. Its
|
|
392
|
+
criterion is that every requirement of the request is met and the tests for the files
|
|
393
|
+
changed pass.
|
|
394
|
+
3. **Planning** uses `--planner`, or else `routing.planner` of the profile the plan flags
|
|
395
|
+
select. With neither, exit 2. A doctor preflight runs before any model call. The planner
|
|
396
|
+
is dispatched into the plan dir, with the fast tier when `planner` is a fast role, and
|
|
397
|
+
the reply is parsed strictly.
|
|
398
|
+
4. **`plan`** gets the flags before `--` that are not `auto`'s own, plus `--collapse-chains`
|
|
399
|
+
unless `--no-collapse`. When the gates send work back (`plan` exits 4 with
|
|
400
|
+
`plan.sendback.md`), `auto` re-dispatches the planner once with that file appended and
|
|
401
|
+
plans again. A second send-back stops.
|
|
402
|
+
5. **Without `--approved`** it stops at the table, exits 0, and prints the `run` command.
|
|
403
|
+
Nothing is dispatched after the planner. `--approved` is the user's explicit
|
|
404
|
+
pre-approval: `auto` then runs, with the flags after `--`, and exits with `run`'s code.
|
|
405
|
+
|
|
406
|
+
A `--` splits the command: flags after it go to `run`. Flags before it go to `plan`, except
|
|
407
|
+
`--goal-file`, `--plan`, `--one-task-difficulty`, `--no-collapse` and `--approved`, which
|
|
408
|
+
`auto` consumes. `auto` starts a new plan dir. One that already has `tasks.tsv` is refused.
|
|
409
|
+
|
|
410
|
+
## Plan shape
|
|
411
|
+
|
|
412
|
+
After the last wave computation, `plan` records `plan-shape.json`: `shape`, `tasks`,
|
|
413
|
+
`waves` and `widest`. `one` is a single task. `chain` is two or more tasks whose every
|
|
414
|
+
wave has one. `branches` is a plan with a wave of two or more. Recording it is advisory:
|
|
415
|
+
a failure is a note, and the table is still printed. `one` and `branches` add nothing to
|
|
416
|
+
the table. A chain prints:
|
|
417
|
+
|
|
418
|
+
```
|
|
419
|
+
this plan runs sequentially: N tasks, at most 1 in parallel; each pays its own implementation and review. One task would run once: re-plan with --collapse-chains
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
`--collapse-chains` is this `plan` call only, and it is not kept. It runs after the gates
|
|
423
|
+
(drift may have added files) and after the table is validated, and before routing. A chain
|
|
424
|
+
becomes one task, id `combined`:
|
|
425
|
+
|
|
426
|
+
- deps `-`; difficulty the highest of the parts (`low` < `medium` < `high`); files the
|
|
427
|
+
union; dwarf and qa the value they share, or `-` when they differ. Routing then fills a
|
|
428
|
+
`-`. A spec every part already named is kept.
|
|
429
|
+
- title `N parts: FIRST TITLE`, cut at 100 characters.
|
|
430
|
+
- the prompt starts "This task combines the N parts of a plan that could only run one
|
|
431
|
+
after another. Do them in order, in this one task; each part's requirements and
|
|
432
|
+
acceptance criteria still hold." Then `## Part i: TITLE (id)`, with that part's headings
|
|
433
|
+
demoted one level, then one `## Acceptance criteria` whose `### Part i: TITLE` holds
|
|
434
|
+
that part's criteria, or `- (no criteria were written for this part)`.
|
|
435
|
+
- approaches that exist become `tasks/combined/approach.md`, each under `### Part i`.
|
|
436
|
+
|
|
437
|
+
The original `tasks.tsv` bytes are kept as `tasks.precollapse.tsv`. Each `tasks/<id>/`
|
|
438
|
+
moves to `tasks.precollapse/<id>/`. `collapsed.json` is `from` (the ids in wave order),
|
|
439
|
+
`into` `combined`, and `shape`. A one-task or branching plan is left as it is. A plan that
|
|
440
|
+
already has `tasks.precollapse.tsv` or `collapsed.json` is not an error. The table
|
|
441
|
+
announces a collapse only when this call did it:
|
|
442
|
+
|
|
443
|
+
```
|
|
444
|
+
collapsed a sequential plan of N tasks into one (tasks.precollapse.tsv keeps the original)
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
`auto` adds `--collapse-chains` unless `--no-collapse`, so the sequential line shows when
|
|
448
|
+
you planned by hand, or when `auto` was told not to collapse.
|
|
350
449
|
|
|
351
450
|
## QA verdicts
|
|
352
451
|
|
|
@@ -688,16 +787,27 @@ changes it; `--confirm` applies only to that key. A `NEEDS_INPUT` task at the ca
|
|
|
688
787
|
raise the plan's cap before the answer can start an attempt.
|
|
689
788
|
|
|
690
789
|
`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.
|
|
692
|
-
|
|
790
|
+
re-run, not `--retry-failed`, not a retry budget and not a pin. A plain `retry` exits 2.
|
|
791
|
+
|
|
792
|
+
`retry` holds the plan lock until its attempts end, so to resume several tasks side by side add
|
|
793
|
+
`--no-dispatch` to each. It records the decision, carries the findings forward and starts nothing;
|
|
794
|
+
the task is then `PENDING`, and one `forge-parallel.sh run <plan>` dispatches them all under
|
|
795
|
+
`--max-parallel`, with dependents starting as their dependencies merge. It works on any `retry`,
|
|
796
|
+
not only a decision, but takes no `--retry-failed` or `--infra-retries`: give those to the `run`. A
|
|
797
|
+
second `--decide` on a prepared task is refused; a `--dwarf` changes its model and keeps its count.
|
|
798
|
+
|
|
799
|
+
The choices:
|
|
693
800
|
|
|
694
801
|
- `forge-parallel.sh retry <plan> <id> --decide retry=N --reason "…" --approved` gives N more
|
|
695
802
|
attempts, N from 1 to 20. At the cap this raises the cap by N, and it is the only choice that
|
|
696
803
|
runs the task again while the attempts already spent sit on the cap.
|
|
697
804
|
- `forge-parallel.sh retry <plan> <id> --decide threshold=Pn --reason "…" --approved` sets this
|
|
698
805
|
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
|
|
700
|
-
|
|
806
|
+
- `forge-parallel.sh retry <plan> <id> --dwarf <spec> --reason "…" --approved` names a model for
|
|
807
|
+
one attempt. Add `--decide retry=N` for up to N attempts: the retry policy keeps the task on that
|
|
808
|
+
model until they are used, and they end early the way any retry does, on a pass or when the reviews
|
|
809
|
+
stop converging. Or add `--decide threshold=Pn` to set the threshold too. `decisions.tsv` records it
|
|
810
|
+
as one row, such as `retry=2 dwarf=sol:high`.
|
|
701
811
|
- `forge-parallel.sh accept <plan> <id> --reason "…" --approved` merges it; the findings become
|
|
702
812
|
known issues.
|
|
703
813
|
- Split it by hand: `tasks/<id>/decision.md` and the run summary say to replace its row in
|
|
@@ -916,7 +1026,7 @@ run.
|
|
|
916
1026
|
|
|
917
1027
|
forge records what it observed about how each dwarf behaved, never what the dwarf claimed:
|
|
918
1028
|
HEAD or the checked-out ref moved (**self-commit / branch switch**), processes left alive in the
|
|
919
|
-
harness's session after it exited (**orphans**, listed in `dwarf.orphans` and stopped; disabled by
|
|
1029
|
+
harness's session after it exited, or started by it in a session of their own (**orphans**, listed in `dwarf.orphans` and stopped; disabled by
|
|
920
1030
|
`FORGE_ORPHAN_GUARD=off` or under Fractal), and a final message that **promises later work**.
|
|
921
1031
|
They are written to `tasks/<id>/guard.txt`, added to the QA prompt as "Implementer guard notes" and
|
|
922
1032
|
shown in the run summary. They never change a status. The dwarf prompt itself tells the
|
|
@@ -928,6 +1038,24 @@ its last message, and to say plainly what it could not run.
|
|
|
928
1038
|
Four subcommands act on plans after tasks have run. Full usage and refusal conditions are in the
|
|
929
1039
|
[README](../docs/reviews.md#accepting-a-task-despite-its-reviewer); the mechanics:
|
|
930
1040
|
|
|
1041
|
+
- **`adopt <plan> <commit|a..b> --reason …`**, or **`adopt <plan> --head --reason …`** (each with
|
|
1042
|
+
`--qa <spec>`, `--yolo-qa`, `--approved`), brings a commit
|
|
1043
|
+
made outside forge into the run instead of leaving `review` refusing. The first cherry-picks onto the
|
|
1044
|
+
integration branch. `--head` takes what is already on it past `accepted.integration`, and it is what
|
|
1045
|
+
`review`'s refusal names. The run's QA (`--qa`, then `final_qa`, then the first task's) reviews that
|
|
1046
|
+
range alone against the reason, and no implementer runs. PASS, or a verdict the threshold accepts, moves
|
|
1047
|
+
`accepted.integration`, adds a row to `adoptions.tsv` (epoch, base, tip, verdict, approved, spec, review,
|
|
1048
|
+
reason) and to `control.log`, writes an `adopt` dataset event, and verifies as a retry does. A FAIL or
|
|
1049
|
+
UNKNOWN puts the branch back and exits 5, unless `--approved` keeps it, which writes the findings to the
|
|
1050
|
+
adoption's `known_issues.md` as `accept` does; `forge issues` and the run's report read that file (as
|
|
1051
|
+
accepted findings, the reason with them), and the sweep does not. A review that concluded nothing always puts it back: a crash or timeout exits 5, an
|
|
1052
|
+
infrastructure stop exits 8, a signal exits 130 or 143. If the worktree changed during the review it is
|
|
1053
|
+
left as it is, with the commands to go on. A range that lived only on the branch stays at
|
|
1054
|
+
`refs/forge/adopt-refused/<dir>`. A merge commit is refused, and a range that does not apply exits 6. A
|
|
1055
|
+
diff over 400 KB is read in the snapshot rather than inlined, as in a final review.
|
|
1056
|
+
There is no task row, because no model implemented it; the final review reads the whole range and is told
|
|
1057
|
+
about it, `attribute` treats it as a step of its own, and forge-ui lists it above the final review.
|
|
1058
|
+
`adopt-<epoch>-<pid>/` keeps the review.
|
|
931
1059
|
- **`accept <plan> <task> --reason … --approved`** overrides a `FAIL`/`UNKNOWN` reviewer only
|
|
932
1060
|
when the reviewed commit is still the branch tip and the worktree still matches
|
|
933
1061
|
`source.fingerprint`. It records `known_issues.md` and `accepted.by`, merges through `merge_task`,
|
|
@@ -1002,6 +1130,23 @@ tells the dwarf which submodules are present. Integration worktrees (`run`, `int
|
|
|
1002
1130
|
`split`) get the same treatment. Out of scope: a task that moves a gitlink's recorded commit (its
|
|
1003
1131
|
worktree keeps the old content) and nested submodules (left empty).
|
|
1004
1132
|
|
|
1133
|
+
**Reviewers get the same dependencies.** A review snapshot holds committed files only, so forge
|
|
1134
|
+
links the directories package managers install into (`node_modules`, `bower_components`, `.venv`,
|
|
1135
|
+
`venv`, `vendor`, `.bundle`, `Pods`, Mix's `deps` and `_build`, `.dart_tool`, `elm-stuff` and
|
|
1136
|
+
SwiftPM's `.build`) from the checkout under review (the task's
|
|
1137
|
+
worktree, or the integration worktree for a final review) into the snapshot, at the root and in
|
|
1138
|
+
workspace packages down to five levels, unless the snapshot already holds that path or lacks its
|
|
1139
|
+
parent. These are the directories this step filled, so they match the attempt. The links count for
|
|
1140
|
+
no fingerprint and stay out of the reviewer's `git status`. The prompt names what was linked and what
|
|
1141
|
+
is committed, or says there is none, says when forge ran no tests of its own, and tells the reviewer
|
|
1142
|
+
to report rather than search or install. A directory that is only partly committed (`vendor/.gitkeep`)
|
|
1143
|
+
keeps its committed files and gets no link. Nothing guards a write
|
|
1144
|
+
through a link: forge commits whatever git does not ignore, so a linked directory is an ignored one
|
|
1145
|
+
(a directory the attempt committed is already in the snapshot and gets no link), and a write there
|
|
1146
|
+
changes nothing that merges. A link dangles once its worktree is removed, which harms nothing. Each
|
|
1147
|
+
reviewer ends with `FORGE_TESTS: RAN`, `NOT NEEDED — why` or `COULD NOT RUN — why`; the last prints a note, and
|
|
1148
|
+
forge-ui and the dataset show it.
|
|
1149
|
+
|
|
1005
1150
|
Forge does not guess this step, and the obvious guess is worth naming because it looks right and
|
|
1006
1151
|
is not: symlinking the source repo's `node_modules` into the worktree. In a workspace monorepo the
|
|
1007
1152
|
workspace links inside it point back at the source checkout, so the worktree builds against the
|
package/references/harnesses.md
CHANGED
|
@@ -22,6 +22,7 @@ provider test. See [Fractal execution](fractal.md).
|
|
|
22
22
|
- [opencode](#opencode)
|
|
23
23
|
- [antigravity (agy)](#antigravity-agy)
|
|
24
24
|
- [grok](#grok)
|
|
25
|
+
- [Fast service tier](#fast-service-tier)
|
|
25
26
|
- [Continuing a reviewer session](#continuing-a-reviewer-session) (and an implementer's)
|
|
26
27
|
- [Adding a harness](#adding-a-harness)
|
|
27
28
|
|
|
@@ -69,7 +70,10 @@ through `forge-guard.py session` (python's `os.setsid()` then `exec`, same pid,
|
|
|
69
70
|
unless `FORGE_ORPHAN_GUARD=off` or the run is Fractal. That gives a process group to signal as a
|
|
70
71
|
unit: the watchdog (TERM, then KILL for a CLI that traps TERM) and the exit trap signal the whole
|
|
71
72
|
group in addition to `pkill -P`, and after a normal exit `forge-guard.py reap` lists and stops
|
|
72
|
-
anything still alive in it (`<role>.orphans`).
|
|
73
|
+
anything still alive in it (`<role>.orphans`). Tools can leave the group (codex runs commands in
|
|
74
|
+
groups of their own, and a test runner's web server starts a session of its own), so
|
|
75
|
+
`forge-guard.py track` samples the harness's descendants every 2 s into `<role>.tracked` (pid and
|
|
76
|
+
start time), and `reap --tracked` stops those still alive and their children as well (#129). This is proven offline only; verify a new harness
|
|
73
77
|
with one live dispatch before relying on it, and use the kill switch if a harness deliberately
|
|
74
78
|
leaves a helper running.
|
|
75
79
|
|
|
@@ -327,6 +331,22 @@ the answer extracted from the `result` line, tokens recorded, nothing left runni
|
|
|
327
331
|
day, grok-4.7 dwarfs implemented and passed review on real tasks (the forge-ui integration run).
|
|
328
332
|
A grok reviewer has not been proven live yet.
|
|
329
333
|
|
|
334
|
+
## Fast service tier
|
|
335
|
+
|
|
336
|
+
`forge-dispatch.sh <role> <spec> … --service-tier fast` asks for a faster service tier of the same model on this invocation, and `doctor --spec <spec> [--role <role>] --service-tier fast` resolves and preflights exactly as that dispatch would, so a refusal comes before any model call. `fast` is the only value; anything else is a usage error (exit 2). Specs never grow a `+fast` suffix, and forge never writes the user's global harness config. `<role>.resolved` gains `service_tier=fast` only when the option was given. Without the option the command line, the resolved block and the exit are unchanged.
|
|
337
|
+
|
|
338
|
+
| Harness | Added to the command | Notes |
|
|
339
|
+
|---|---|---|
|
|
340
|
+
| codex | `-c service_tier=fast`, beside `-c model_reasoning_effort=…` | Fresh, resume and native-review commands alike. The CLI records the tier as `priority`. |
|
|
341
|
+
| claude | `--fast-mode on` | A hidden flag: `claude --help` does not list it. Preflight exempts it the same way it exempts grok's hidden `--background-wait-timeout`, and no other way. |
|
|
342
|
+
| openclaude, opencode, antigravity, grok | — | Refused, exit 3, before anything runs: `forge: <harness> has no per-invocation fast tier (#68); drop the fast tier for the <role> role or pick a codex or claude spec`. opencode's fast mode is per-model config only, and the others have none. |
|
|
343
|
+
|
|
344
|
+
Claude's fast mode is billed as extra usage. Without that extra usage the CLI does not refuse: the run stays at standard speed and exits 0. The `result` event's `usage.speed` is `fast` or `standard`, and `fast_mode_disabled_reason` (for example `extra_usage_disabled` or `sdk_opt_in_required`) says why it was not fast. Forge reports the miss with one line, `forge: claude ran at standard speed: fast mode is unavailable (extra_usage_disabled)`.
|
|
345
|
+
|
|
346
|
+
Codex's fast tier is not available with EU data residency for GPT-6 models, and it uses plan usage or credits faster. An unsupported tier is an `item.completed` error whose message contains `is not advertised as supported for model`; the CLI then continues at the default tier and exits 0. Forge records that speed as `default` and prints one note. When the stream says nothing about the tier, the speed is unknown and no note is printed. The note never changes the exit code.
|
|
347
|
+
|
|
348
|
+
The attempt's `metrics.json` always carries `service_tier` (what `<role>.resolved` asked, else null), `speed` (what the log showed) and `speed_reason`, null when the log does not say.
|
|
349
|
+
|
|
330
350
|
## Continuing a reviewer session
|
|
331
351
|
|
|
332
352
|
`forge-dispatch.sh qa <spec> ... --continue-session <id>` continues an earlier reviewer session instead of
|
package/references/planning.md
CHANGED
|
@@ -48,3 +48,62 @@ the table, the `decision-model gates:` block lists what drift and forward added
|
|
|
48
48
|
|
|
49
49
|
Show the approach before dispatching and let the user change it. That gate is the last
|
|
50
50
|
moment the plan is free; after it, changing the plan costs a whole run.
|
|
51
|
+
|
|
52
|
+
## The planner contract (`forge-planner.py`)
|
|
53
|
+
|
|
54
|
+
`scripts/forge-planner.py` is the contract between a planner and forge, so no session has to
|
|
55
|
+
turn a free-form reply into `tasks.tsv` by hand. A later `forge-parallel.sh auto` calls
|
|
56
|
+
`prompt` and `parse`; you can call them yourself. Standard library only, and every
|
|
57
|
+
subcommand refuses (exit 2) a plan dir that already has `tasks.tsv`.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
python3 <skill_dir>/scripts/forge-planner.py prompt --plan "$PLAN" --goal-file goal.md [--level low|medium|high]
|
|
61
|
+
python3 <skill_dir>/scripts/forge-planner.py parse --plan "$PLAN" --reply reply.txt
|
|
62
|
+
python3 <skill_dir>/scripts/forge-planner.py gate --plan "$PLAN" --goal-file goal.md
|
|
63
|
+
python3 <skill_dir>/scripts/forge-planner.py one-task --plan "$PLAN" --goal-file goal.md [--difficulty medium]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**`prompt`** writes `$PLAN/planner.prompt` and prints its path: the planner's role (read-only),
|
|
67
|
+
the request verbatim, the decomposition rules and the reply format. The rules are those of
|
|
68
|
+
[decompose.md](decompose.md) plus: one task is a valid answer; a pure chain is worse than one
|
|
69
|
+
task (prefer parallel branches); never two tasks on one file unless a dep orders them; a
|
|
70
|
+
single-file deliverable is split by module, each task owning its own source file, with one final
|
|
71
|
+
low-difficulty task assembling the required file; each task prompt ends with `## Acceptance
|
|
72
|
+
criteria` and never asks for the whole suite. A planner you dispatch by hand (above) can be
|
|
73
|
+
given this same prompt file as `--prompt-file`.
|
|
74
|
+
|
|
75
|
+
**The reply** holds exactly one fenced block opened by ```` ```forge-plan ```` whose body is JSON:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
{"tasks": [{"id": "parse-config", "deps": [], "difficulty": "medium",
|
|
79
|
+
"files": ["src/config.py", "tests/test_config.py"],
|
|
80
|
+
"title": "Parse the new config section", "approach": "…",
|
|
81
|
+
"prompt": "… ## Acceptance criteria …"}]}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**`parse`** is strict and never guesses or repairs. It refuses a reply unless: there is exactly
|
|
85
|
+
one `forge-plan` block whose body is an object with exactly the key `tasks`; `tasks` is 1 to 20
|
|
86
|
+
objects with exactly the keys `id, deps, difficulty, files, title, approach, prompt`; each `id`
|
|
87
|
+
matches `^[a-z0-9][a-z0-9-]{0,39}$` and is unique; `deps` are known ids with no cycle;
|
|
88
|
+
`difficulty` is `low`, `medium` or `high`; `files` is a non-empty list of repo-relative paths (no
|
|
89
|
+
absolute path, no `..`, no tab, comma or newline); `title` is one non-empty line without a tab;
|
|
90
|
+
`approach` is a string (it may be empty); `prompt` is non-empty and has a `## Acceptance
|
|
91
|
+
criteria` heading.
|
|
92
|
+
|
|
93
|
+
On success it writes `tasks.tsv` (dwarf and qa `-`), `tasks/<id>/prompt.md` (the task's prompt,
|
|
94
|
+
then `## The whole request` and `$PLAN/request.md` verbatim, so no requirement is lost) and, for
|
|
95
|
+
a non-empty approach, `tasks/<id>/approach.md`. `$PLAN/request.md` must hold the user's request
|
|
96
|
+
(exit 2 when missing). On a refusal it writes only `$PLAN/planner.refused` (the first reason and
|
|
97
|
+
the reply's path), prints both and exits 4; fix the reply (or re-dispatch the planner with the
|
|
98
|
+
reason appended) and run `parse` again.
|
|
99
|
+
|
|
100
|
+
**`gate`** decides before any planner is paid for: `one-task` when the request has at most 1500
|
|
101
|
+
characters and at most 6 requirements (counted by `split_requirements` of
|
|
102
|
+
`forge_jev/coverage.py`), else `plan`. It prints the decision and records the signals, the
|
|
103
|
+
thresholds and the rule in `$PLAN/plan-gate.json`. It is this conservative because size did not
|
|
104
|
+
predict the plan's shape on the 16 plans of benchmark #86 (element-web, 3262 characters and 15
|
|
105
|
+
requirements, planned one task; flipt, 3276 and 22, planned two parallel tasks): it only skips
|
|
106
|
+
the planner for small goals.
|
|
107
|
+
|
|
108
|
+
**`one-task`** writes a one-row plan with no planner: id `task`, files `.`, the request as the
|
|
109
|
+
prompt followed by one acceptance criterion, and the request's first line as the title.
|
package/references/solo.md
CHANGED
|
@@ -82,7 +82,11 @@ Solo defaults to `--output summary`; `--output full` includes raw CLI output. Re
|
|
|
82
82
|
`.last` files once, then inspect logs only as needed. `forge-dispatch.sh report <run-dir>`
|
|
83
83
|
reports immutable attempt metrics and native usage independently of project memory. Shared
|
|
84
84
|
context is assembled from original requirements and approach; QA does not embed dwarf
|
|
85
|
-
execution instructions. Review snapshots use self-contained object packs and one checkout
|
|
85
|
+
execution instructions. Review snapshots use self-contained object packs and one checkout, with
|
|
86
|
+
the repo's dependency directories (`node_modules`, `.venv`, `vendor`, Mix's `deps` and the others
|
|
87
|
+
listed under [worktree setup](decompose.md#worktree-setup)) linked in, at the root and in workspace
|
|
88
|
+
packages, when it has them; the prompt says what is there, and the reviewer reports `FORGE_TESTS` as in
|
|
89
|
+
[worktree setup](decompose.md#worktree-setup).
|
|
86
90
|
|
|
87
91
|
Optional [Ripwire context](ripwire.md) is enabled by default. Use `--no-ripwire`
|
|
88
92
|
or `FORGE_RIPWIRE=off` to disable preparation and installation offers.
|
package/references/ui.md
CHANGED
|
@@ -35,7 +35,8 @@ run goes on, with the same exit code.
|
|
|
35
35
|
filed as GitHub issues or dismissed through `forge issues`.
|
|
36
36
|
- **Delete a run:** a dry run, then `forge runs rm`: the dataset keeps the traces, an archive is
|
|
37
37
|
written unless declined, and clean worktrees and unchecked-out branches can go with it.
|
|
38
|
-
- **Settings:** `forge config show` in one view,
|
|
38
|
+
- **Settings:** `forge config show` in one view: the registry, decision-model gates (each says what it does, when, what it sends and what `on` changes, and **How to set this up** opens a setup guide), profiles,
|
|
39
|
+
the per-repo files, the dataset and `FORGE_*` variables, with edits where the server can write.
|
|
39
40
|
- **Export a run:** one HTML file to share that opens without forge-ui; prompts, diffs, reports
|
|
40
41
|
and local paths stay out unless chosen.
|
|
41
42
|
- **Quick jump and notifications:** Ctrl K (⌘K) or `/` searches every run, task, project and
|
|
@@ -86,6 +87,43 @@ not offer Retry now. A run whose unfinished tasks are all waiting is `WAITING`.
|
|
|
86
87
|
The 3D view loads three.js from cdn.jsdelivr.net when first used; offline, the page shows the
|
|
87
88
|
same run in 2D. The full page description is in [ui/README.md](../ui/README.md).
|
|
88
89
|
|
|
90
|
+
## Profiles
|
|
91
|
+
|
|
92
|
+
The Settings page has a **Profiles** section. Its lede: a named bundle of routing, policy,
|
|
93
|
+
gates and budget. A user profile hides a repo profile of the same name, which hides a
|
|
94
|
+
built-in. Editing writes `decide.json` at the profile's level.
|
|
95
|
+
|
|
96
|
+
The list is one button per winning profile: the name, a level tag, a `default` tag when it
|
|
97
|
+
is the effective default, and `shadows LEVEL, LEVEL` when that copy hides another. Opening
|
|
98
|
+
one shows dwarf and QA pools by tier, then Routing, Policy, Gates, Budget and Source when
|
|
99
|
+
the body sets them. An empty body says "This profile sets nothing." A built-in, or any
|
|
100
|
+
level that is not `user` or `repo`, says "This built-in profile is read-only. Duplicate it
|
|
101
|
+
to change a copy."
|
|
102
|
+
|
|
103
|
+
Duplicate is offered for every profile. Edit, set as default and remove are offered only
|
|
104
|
+
for a user or repo profile. A read-only server (no write token, or controls off) still
|
|
105
|
+
lists profiles and shows the summary. It hides the editor, duplicate, default, delete and
|
|
106
|
+
the new-profile form, and the page says "This page is read-only: this server has no write
|
|
107
|
+
token, or has controls off."
|
|
108
|
+
|
|
109
|
+
Saving the JSON body replaces that profile, after a confirm. If the profile changed while
|
|
110
|
+
it was being edited, saving replaces it with that text. A new profile is a blank body or a
|
|
111
|
+
copy, confirmed as "Create profile NAME at the LEVEL level with a copy of X?" or "… with a
|
|
112
|
+
blank body?". Duplicate defaults to the user level, or to repo when the source is a repo
|
|
113
|
+
profile. Set default writes `default_profile` at the profile's own level. Clear default
|
|
114
|
+
removes it from the file that stores the effective default. Writes go through
|
|
115
|
+
`POST /api/config/profiles`, which runs `forge config profile`. Unsaved profile JSON counts
|
|
116
|
+
as unsaved when the repository changes. The endpoints are in [the API](../ui/docs/api.md).
|
|
117
|
+
|
|
118
|
+
The run page's Settings section, for a plan and for a solo run, has a **Profile** row when
|
|
119
|
+
the run record carries a profile. The label is `Profile`. The text is `NAME (level)`. When
|
|
120
|
+
`overridden` is a non-empty list of keys it continues ` · flags override: KEY, KEY`. There
|
|
121
|
+
is no row when the record has no profile.
|
|
122
|
+
|
|
123
|
+
The reader puts `settings.profile` on the run record when `profile.json` has a non-empty
|
|
124
|
+
`name` and `level` and an `overridden` list of keys, as `plan` and solo write it. Any other
|
|
125
|
+
file leaves the profile out of the record, with a warning, and the row is absent.
|
|
126
|
+
|
|
89
127
|
## Commands
|
|
90
128
|
|
|
91
129
|
```bash
|
|
@@ -166,3 +204,12 @@ server that is already running, do not unregister runs, and do not block `forge
|
|
|
166
204
|
close the exposure, run `forge ui stop`. Do not forward the server's port.
|
|
167
205
|
|
|
168
206
|
The API contract is [ui/docs/api.md](../ui/docs/api.md).
|
|
207
|
+
|
|
208
|
+
## Live refresh
|
|
209
|
+
|
|
210
|
+
A live refresh never cancels what the user is doing. Every view that redraws on new data goes through
|
|
211
|
+
`ForgeUI.guard(region, draw)` (`preserve` in `app.js` does): while a pointer is down in the region, a
|
|
212
|
+
selection touches it or a `<select>` in it has focus, the latest draw waits and runs when that ends. What the
|
|
213
|
+
user just did draws at once, and a hold that lasts five seconds shows **Newer data is waiting**, with a
|
|
214
|
+
button that runs it. Anything collapsible in such a view gets a `data-keep` key, which `preserve` and
|
|
215
|
+
`ForgeUI.keepOpen` restore. A new view that rebuilds on a poll goes through the same two.
|
|
@@ -59,6 +59,59 @@ forge_review_snapshot() ( # source, baseline tree, final tree, destination
|
|
|
59
59
|
|
|
60
60
|
)
|
|
61
61
|
|
|
62
|
+
# Where package managers install into a checkout: npm and bower, Python virtualenvs, Go, PHP and Ruby
|
|
63
|
+
# vendor dirs, Bundler's config, CocoaPods, Mix (deps, _build), Dart, Elm and SwiftPM (#127). The same
|
|
64
|
+
# names as forge-fail-first.py's DEP_DIRS. Only a directory the snapshot does not hold is linked, so a
|
|
65
|
+
# committed one of these names is never replaced.
|
|
66
|
+
FORGE_DEP_DIRS='node_modules bower_components .venv venv vendor .bundle Pods deps _build .dart_tool elm-stuff .build'
|
|
67
|
+
|
|
68
|
+
_forge_dep_dirs() { # checkout: its dependency directories, relative, never one inside another
|
|
69
|
+
# Five levels reach apps/group/name/node_modules.
|
|
70
|
+
local name names=()
|
|
71
|
+
for name in $FORGE_DEP_DIRS; do names+=(${names[0]+-o} -name "$name"); done
|
|
72
|
+
(cd "$1" && find . -maxdepth 5 \( -name .git -o -name .forge \) -prune -o \
|
|
73
|
+
\( "${names[@]}" \) \( -type d -o -type l \) -print -prune 2>/dev/null) |
|
|
74
|
+
sed 's#^\./##'
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
forge_review_deps() { # source checkout, review snapshot, note file (#117)
|
|
78
|
+
# Links the dependency directories of the checkout under review (what .forge/setup filled, so
|
|
79
|
+
# they match the attempt, unlike the source repo's) into its snapshot, at the root and in
|
|
80
|
+
# workspace packages, and writes what the reviewer has to the note. An untracked link counts for
|
|
81
|
+
# no fingerprint, and the exclude keeps it out of the reviewer's `git status`: a `node_modules/`
|
|
82
|
+
# ignore pattern does not match a link. A directory the snapshot already holds is committed: it
|
|
83
|
+
# stays as it is. `ln` fails where the snapshot lacks the parent (an old run's dir in a solo
|
|
84
|
+
# repo): that is no part of the change, so nothing is linked there.
|
|
85
|
+
local src rel linked="" committed
|
|
86
|
+
src="$(cd "$1" && pwd)" || src=""
|
|
87
|
+
committed="$(_forge_dep_dirs "$2" | sort | awk 'NR > 1 { printf ", " } { printf "%s", $0 }')"
|
|
88
|
+
if [ -n "$src" ]; then
|
|
89
|
+
while IFS= read -r rel; do
|
|
90
|
+
[ -n "$rel" ] && [ -d "$src/$rel" ] && [ ! -e "$2/$rel" ] && [ ! -L "$2/$rel" ] || continue
|
|
91
|
+
ln -s "$src/$rel" "$2/$rel" 2>/dev/null || continue
|
|
92
|
+
mkdir -p "$2/.git/info" && echo "/$rel" >> "$2/.git/info/exclude"
|
|
93
|
+
linked="$linked${linked:+, }$rel"
|
|
94
|
+
done <<< "$(_forge_dep_dirs "$src" | sort)"
|
|
95
|
+
fi
|
|
96
|
+
{
|
|
97
|
+
if [ -n "$linked" ]; then
|
|
98
|
+
echo "Dependencies linked into your checkout from the attempt's own copy: $linked. Use them to run tests, and do not write to them. forge does not check that they are complete, or look more than five levels down."
|
|
99
|
+
fi
|
|
100
|
+
if [ -n "$committed" ]; then
|
|
101
|
+
echo "Dependency directories committed in your checkout, holding only what was committed: $committed."
|
|
102
|
+
fi
|
|
103
|
+
if [ -z "$linked$committed" ]; then
|
|
104
|
+
echo "Dependencies in your checkout: none. It holds committed files only, with no installed packages."
|
|
105
|
+
fi
|
|
106
|
+
} > "$3"
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
forge_tests_note() { # QA reply: the reason, when the reviewer says its tests could not run (#117)
|
|
110
|
+
grep -qs 'FORGE_TESTS:' "$1" || return 0
|
|
111
|
+
python3 "$SKILL_DIR/scripts/forge-contract.py" tests --qa-last "$1" 2>/dev/null |
|
|
112
|
+
awk -F'\t' '$1 == "could_not_run" { print ($2 == "" ? "no reason given" : $2) }'
|
|
113
|
+
}
|
|
114
|
+
|
|
62
115
|
forge_fingerprint() { # forge_fingerprint <dir> [--tracked], as forge_tree
|
|
63
116
|
local tree head index
|
|
64
117
|
tree="$(forge_tree "$1" "${2:-}")" || return 1
|
package/scripts/forge-compare.py
CHANGED
|
@@ -37,9 +37,9 @@ sys.path.insert(0, str(SKILL / 'ui'))
|
|
|
37
37
|
|
|
38
38
|
# Plan options that travel with a rerun, so it is judged the way the original was. Not the ones
|
|
39
39
|
# `plan` writes itself (routing, Jev's frozen selection) or that a fresh plan decides (exploration).
|
|
40
|
-
OPTION_FILES = ('no_ripwire', 'no_memory', 'yolo_dwarf', 'yolo_qa', 'reviewer_session', 'implementer_session',
|
|
40
|
+
OPTION_FILES = ('no_ripwire', 'no_memory', 'yolo_dwarf', 'yolo_qa', 'reviewer_session', 'implementer_session', 'fast',
|
|
41
41
|
'pre_review_tests', 'pre_review_parallel', 'qa_threshold', 'timeout', 'verify_retries', 'verify_cmd',
|
|
42
|
-
'verify_parallel', 'setup_cmd', 'final_qa', 'shadow_qa', 'shadow_rate', 'escalate_after', 'fail_first')
|
|
42
|
+
'verify_parallel', 'setup_cmd', 'final_qa', 'shadow_qa', 'shadow_rate', 'escalate_after', 'fail_first', 'profile.json')
|
|
43
43
|
PLAN_FILES = ('repo.identity', 'goal.txt', 'request.md')
|
|
44
44
|
TASK_FILES = ('prompt.md', 'approach.md')
|
|
45
45
|
NAME = re.compile(r'[^A-Za-z0-9._-]+')
|
|
@@ -287,8 +287,11 @@ def rerun_plan(args) -> int:
|
|
|
287
287
|
if git(src['repo'], 'branch', new['branch'], src['base'])[0] != 0:
|
|
288
288
|
raise Refusal('could not create %s' % new['branch'])
|
|
289
289
|
created.append('branch')
|
|
290
|
+
# The source's frozen profile was copied and plan keeps it. A source that froze none must not
|
|
291
|
+
# take the user's default now: it would replace the options just copied.
|
|
292
|
+
profile = [] if (new['plan'] / 'profile.json').is_file() else ['--no-profile']
|
|
290
293
|
planned = subprocess.run(['bash', str(SKILL / 'scripts' / 'forge-parallel.sh'), 'plan', str(new['plan']),
|
|
291
|
-
'--explore', '0'], capture_output=True, text=True, stdin=subprocess.DEVNULL)
|
|
294
|
+
'--explore', '0', *profile], capture_output=True, text=True, stdin=subprocess.DEVNULL)
|
|
292
295
|
if planned.returncode != 0:
|
|
293
296
|
raise Refusal('forge-parallel.sh plan failed (%d):\n%s' % (planned.returncode, (planned.stdout + planned.stderr).strip()))
|
|
294
297
|
changed = [r['id'] for r in table(new['plan'] / 'tasks.tsv') if r['dwarf'] != args.dwarf]
|