@giamme/forge 0.14.1 → 0.15.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/SKILL.md +47 -14
  3. package/VERSION +1 -1
  4. package/docs/commands.md +288 -6
  5. package/docs/models.md +53 -0
  6. package/package.json +1 -1
  7. package/references/dataset.md +12 -3
  8. package/references/decompose.md +103 -4
  9. package/references/harnesses.md +17 -0
  10. package/references/planning.md +59 -0
  11. package/references/ui.md +39 -1
  12. package/scripts/forge-compare.py +6 -3
  13. package/scripts/forge-config.py +531 -4
  14. package/scripts/forge-dispatch.sh +56 -2
  15. package/scripts/forge-lib-plans.sh +19 -2
  16. package/scripts/forge-lib-review.sh +5 -3
  17. package/scripts/forge-lib-task.sh +119 -0
  18. package/scripts/forge-parallel-options.sh +12 -6
  19. package/scripts/forge-parallel.sh +565 -21
  20. package/scripts/forge-plan-check.py +591 -8
  21. package/scripts/forge-planner.py +480 -0
  22. package/scripts/forge-runtime.py +86 -0
  23. package/scripts/forge-shadow.py +51 -7
  24. package/scripts/forge-solo.sh +81 -7
  25. package/scripts/forge_dataset/cli.py +10 -0
  26. package/scripts/forge_dataset/efforts.py +215 -0
  27. package/scripts/forge_dataset/harvest.py +44 -0
  28. package/scripts/forge_decide/__init__.py +19 -1
  29. package/scripts/forge_decide/builtin_profiles.json +25 -0
  30. package/scripts/forge_decide/cli.py +12 -0
  31. package/scripts/forge_decide/profiles.py +866 -0
  32. package/scripts/forge_decide/resolve.py +38 -6
  33. package/ui/docs/api.md +87 -8
  34. package/ui/forge_ui/control.py +173 -12
  35. package/ui/forge_ui/executions.py +28 -8
  36. package/ui/forge_ui/models.py +60 -1
  37. package/ui/forge_ui/reader.py +21 -1
  38. package/ui/forge_ui/static/leaderboard.js +5 -1
  39. package/ui/forge_ui/static/modelstats.js +25 -1
  40. package/ui/forge_ui/static/panel.js +19 -2
  41. package/ui/forge_ui/static/settings.js +788 -25
  42. package/ui/forge_ui/static/style.css +23 -0
@@ -30,10 +30,10 @@ 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, `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 (orchestrator or planner), 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). Blobs: both task tables, prompts, approaches, excerpts of the declared files at plan time, the file inventory, `memory.md` |
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
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) |
@@ -64,13 +64,22 @@ continuing was requested, so a failed continue that still printed a verdict is t
64
64
  The `attempt` event's `resumed` flag is a different fact: a QA-only re-run after an
65
65
  infrastructure stop (the `tasks/<id>/resume` marker).
66
66
 
67
+ A dispatch also carries `service_tier`, `speed` and `speed_reason`, read from the attempt's
68
+ `metrics.json`. `service_tier` is the tier that was asked. When metrics has none, it falls
69
+ back to `<role>.resolved`'s `service_tier=`, which is written only when the dispatch asked
70
+ for a tier. `speed` is what the log reported: `fast`, `standard`, `default`, or null when
71
+ the log does not say. `speed_reason` is why it was not fast (claude's
72
+ `fast_mode_disabled_reason`, or codex's error message), or null. Each is null when absent,
73
+ so a dispatch that predates the keys is otherwise unchanged.
74
+
67
75
  `plan --reviewer-session` writes `$PLAN/reviewer_session` (`on`). The plan event records
68
76
  it in `options`. The file joins the plan id only when it is present, so every plan already
69
77
  in a store keeps its id, and turning the experiment on stores a new plan event.
70
78
  `plan --implementer-session` (`$PLAN/implementer_session`, `on`) is recorded the same way, and
71
79
  `plan --pre-review-tests` joins the plan id the same way and is listed in `flags`. `plan-gates.json`
72
80
  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.
81
+ its id, and a re-plan that changes the file's content gets a new plan event. `plan-shape.json`,
82
+ `collapsed.json` and `plan-gate.json` join the same way, each only when it is present.
74
83
  `forge dataset status` counts continued and failed continues for reviewers and implementers
75
84
  apart.
76
85
 
@@ -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. The counts are guidance, not quotas; a goal with three natural seams
44
- produces three tasks at `high` too.
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 `FORGE_ROUTE_EXPLORE`, then 0.2.
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
 
@@ -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
 
@@ -327,6 +328,22 @@ the answer extracted from the `result` line, tokens recorded, nothing left runni
327
328
  day, grok-4.7 dwarfs implemented and passed review on real tasks (the forge-ui integration run).
328
329
  A grok reviewer has not been proven live yet.
329
330
 
331
+ ## Fast service tier
332
+
333
+ `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.
334
+
335
+ | Harness | Added to the command | Notes |
336
+ |---|---|---|
337
+ | codex | `-c service_tier=fast`, beside `-c model_reasoning_effort=…` | Fresh, resume and native-review commands alike. The CLI records the tier as `priority`. |
338
+ | 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. |
339
+ | 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. |
340
+
341
+ 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)`.
342
+
343
+ 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.
344
+
345
+ 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.
346
+
330
347
  ## Continuing a reviewer session
331
348
 
332
349
  `forge-dispatch.sh qa <spec> ... --continue-session <id>` continues an earlier reviewer session instead of
@@ -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/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, with edits for the per-repo files and Jev.
38
+ - **Settings:** `forge config show` in one view: the registry, decision-model gates, 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
@@ -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]