@giamme/forge 0.19.0 → 0.20.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 CHANGED
@@ -5,6 +5,22 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and versions follow the format `{major}.{minor}[.{patch}]` ([...] parts appear only when non-zero).
7
7
 
8
+ ## [0.20] - 2026-11-17
9
+
10
+ Review findings you can trust and manage: one record per repository with issue states from GitHub, forge findings and forge-ui actions, an optional triage agent, and a sweep per finding.
11
+
12
+ ### Added
13
+
14
+ - You can now manage review findings. `forge findings` shows every finding of a repository and marks them fixed, dismissed, reopened, to file or a duplicate, with tags (ui, tests, infra, backend, docs by default, or your own), notes and edits. forge-ui's Findings tab does the same on selected rows and files the selected ones as issues, and its Memories tab can add and edit learnings (`forge memory add` / `edit`). An optional triage agent, run on a model you name, proposes duplicates, fixes, tags, issues and forge plans for related findings; nothing changes until you approve a proposal.
15
+
16
+ ### Changed
17
+
18
+ - `--sweep` now works per finding instead of once per plan: a later run of the same plan sweeps the findings its new tasks left, in a new round, and never a finding an earlier round already tried. When there is nothing new, the run summary says so. A finding the sweep fixed is recorded as fixed once its fix task merges.
19
+
20
+ ### Fixed
21
+
22
+ - Review findings now show their real state. A finding that was filed as an issue, fixed in the code, dismissed or swept no longer shows as open: forge reads issue states from GitHub (closed issues count as fixed), keeps one record per repository whatever checkout or worktree a run used, and finds every run of the repository, including runs from removed worktrees. forge-ui's open count leaves out shadow and unlabelled reviews.
23
+
8
24
  ## [0.19] - 2026-11-15
9
25
 
10
26
  Group review and wider brief answers; a retry budget per model, scripted tasks, chained plans and forge handoff; early stops for a fix outside the task and for a prompt edited mid-attempt; forge-ui runs its own commands; and forge's website.
package/SKILL.md CHANGED
@@ -123,6 +123,9 @@ For explanation requests, explain the workflow without spending model quota.
123
123
  - CONFIRMED findings the threshold tolerated, from a PASS or a FAIL (`tasks/<id>/known_issues.md`);
124
124
  - PLAUSIBLE findings in a passed task's `qa.last`;
125
125
  - whatever a whole-run review left open.
126
+ - Triage (`forge findings triage REPO --spec S`) needs a model the user names, never one you choose. Offer it, never start it unprompted. Relay its proposals, and run `forge findings apply` only on the user's explicit word for each one.
127
+
128
+ `forge findings` holds what happened to each finding (fixed, dismissed, duplicate, to file), and a finding marked `to-file` is offered with the others.
126
129
 
127
130
  When there are any, act on the user's `--file-issues` choice with one filer:
128
131
  - **gh-proman**, only when it is installed and set up for the repository: `gh-proman -C <repo> config show` exits 0. It also puts the issues on the team's board with a priority. Run `gh-proman findings --from <plan or run dir> --include-plausible --json`, then follow the gh-proman skill's review-findings steps.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.19
1
+ 0.20
package/docs/commands.md CHANGED
@@ -27,8 +27,9 @@ harness (`/forge`); this command installs forge and drives its optional tools.
27
27
  | `forge worktrees rm PATH… [--branches] [--dry-run] [--json] [--actor {cli,ui}]` | remove `failed` and `finished` worktrees, and leftover folders, by forge-ui's rules (never `--force`; `--branches` is `git branch -d` on a finished worktree's merged branch). Exit 0 when no row failed, 4 when one did, 2 usage. See [below](#forge-worktrees-rm) |
28
28
  | `forge runs rerun RUN_DIR --dwarf SPEC [--qa SPEC] [--to DIR] [--max-parallel N] [--dry-run] [--run --yes]` | set up the same plan again with another implementer, from the same starting commit; spends nothing unless `--run --yes`; never merges. See [below](#forge-runs-rerun-and-compare) |
29
29
  | `forge runs compare RUN_A RUN_B [--json] [--no-record]` | two runs of one plan, side by side, per task; records the pair in the dataset |
30
- | `forge memory show\|learnings\|prune\|spend\|forget REPO …` | a repository's project memory; `learnings REPO --json` lists every learning in its ledger with what forge does with it (`in_memory`, `waiting` for a second run, `stale`, `capped`, `muted`), from forge-memory.sh's own rebuild, without changing the repository. `forget REPO KEY…` (`KEY` is `category:key`; `--dry-run`, `--json`, `--actor ui\|cli`) drops those ledger rows and rebuilds `memory.md`. A missing key is not an error. `--json` prints `{ok, dry_run, keys: [{key, rows, found}], memory_lines_removed}`. Exit 0 ok, 2 usage. See [below](#forge-memory-forget) and [project memory](memory.md) |
30
+ | `forge memory show\|learnings\|prune\|spend\|forget\|add\|edit REPO …` | a repository's project memory. `learnings REPO --json` lists every learning with what forge does with it (`in_memory`, `waiting`, `stale`, `capped`, `muted`); a learning a person wrote has `manual: true` (the field is absent otherwise). `forget REPO KEY…` (`KEY` is `category:key`; `--dry-run`, `--json`, `--actor ui\|cli`) drops those ledger rows and rebuilds `memory.md`; a missing key is not an error. `add REPO --category verify\|trap\|finding --text T [--path P]…` appends one person row (kept at once). `edit REPO KEY --text T` replaces that learning and keeps its paths; a missing key is an error. `--json` on forget prints `{ok, dry_run, keys: [{key, rows, found}], memory_lines_removed}`; on add and edit `{ok, key, memory_lines_added, memory_lines_removed}`. Exit 0 ok, 2 usage. See [below](#forge-memory-forget) and [project memory](memory.md) |
31
31
  | `forge issues RUN [--apply] …` | file the review findings a run left open as GitHub issues; see [below](#forge-issues) |
32
+ | `forge findings show\|fix\|dismiss\|reopen\|to-file\|dup\|tag\|note\|edit\|triage\|triage-status\|proposals\|apply\|reject REPO …` | every review finding of a repository and what happened to it. `REPO` is a checkout, a linked worktree, or a plan or solo run dir. `triage` is read-only and needs `--spec`. `--actor` is `cli` (default), `ui` or `triage`; `--json` is machine-readable. Exit 0 ok, 2 usage, 3 refused, 1 error. See [below](#forge-findings) |
32
33
  | `forge pr [RUN_DIR \| --repo DIR] [--texts] [--paths] [--out FILE] [--create [--base B] [--head B]]` | a draft pull-request description for a finished run, on stdout; `--create` opens it as a draft PR with `gh`; see [below](#forge-pr) |
33
34
  | `forge retro note\|report\|issues PLAN …` | retro notes on what got in a run's way (`plan --retro`): `note` records one by hand (`--type`, `--fixable-by`, `--summary`, and `--command`, `--exit`, `--error`, `--blocking`, `--tried` as needed), `report` writes `retro.md`, and `issues` drafts GitHub issues for forge's own repository and posts only with `--apply --approve HASH`. `record` is forge's own call after a dispatch. Exit 2 usage, 3 refused. See [retro notes](../references/decompose.md#retro-notes-opt-in) |
34
35
  | `forge brief write\|show\|answer\|stale\|propose\|proposals\|apply\|reject PLAN …` | each task's open questions, asked before it starts (`plan --brief`), and the diff a wider answer waits on. `write` asks the missing ones (`--task ID`, `--jobs N`; `--force` redoes a task that already has `brief.json`). `show` lists them (`--task`, `--json`), parked questions by group and tasks marked `affected by <pid>`. `answer PLAN TASK QID TEXT` records an answer (`--file F`, `--actor`). A task answer goes into the prompt before the task starts and is late after. A parked `wave` or `plan` question is answerable only when `--brief-scope` is at least that wide; the answer is stored and the command prints `forge brief propose`. `stale PLAN TASK` flags dependents' open questions after a merge. `propose PLAN TASK QID` (`--actor`) turns that parked answer into `proposals/<pid>/`, one read-only dispatch. `proposals PLAN` (`--json`) lists every proposal with its state, scope, group, summary, diff and, while `proposed`, the apply line. `apply PLAN PID --approve HASH` (`--actor`, `--no-regenerate`) writes that diff. `--no-regenerate` marks affected tasks and does not regenerate their questions. `reject PLAN PID` (`--reason TEXT`, `--actor`) marks it `rejected` and touches no plan file. Exit 2 usage or an unknown task, question or proposal; 3 when PLAN is not a plan dir, when brief is off (`write`, `show`, `propose`), or when a proposal is refused (`propose`, `apply`, `reject`). See [brief mode](../references/decompose.md#brief-mode-opt-in) |
@@ -197,6 +198,127 @@ A real forget that drops at least one row records a `memory_forget` dataset even
197
198
 
198
199
  Exit 0 ok, 2 usage (a bad key, an unknown option, a missing repo, or no key). See [project memory](memory.md#scriptsforge-memorysh).
199
200
 
201
+ `add` and `edit` write a row a person asked for, so they run when `FORGE_MEMORY=off` too.
202
+
203
+ ```
204
+ forge memory add REPO --category verify|trap|finding --text TEXT [--path P]… [--actor {ui,cli}] [--json]
205
+ forge memory edit REPO KEY --text TEXT [--path P]… [--actor {ui,cli}] [--json]
206
+ ```
207
+
208
+ `add` appends one ledger row and rebuilds `.forge/memory.md`. The row's role is `person` and its run id is `manual-<epoch>` (seconds). `--category` is `verify`, `trap` or `finding`. `--text` is one line, 1 to 300 characters, with no tab; the rebuild then clamps it like any other fact (180 characters, anchor kept). `--path` is repeatable, at most 20: each path is relative, at most 300 characters, and must not contain `..`, a comma, a tab, a newline, or `[` or `]`. The paths are stored on the row, and the first is appended as `[anchor]` when the text has none. A `finding` written this way is injected on that first row, not after a second run. The row is still dropped when its anchor path is gone, and under the cap it is trimmed only after every run fact.
209
+
210
+ `edit` is a forget of that one learning plus an add, in one rewrite of the ledger and one rebuild. `KEY` is `category:key`, normalised the same way as `forget`. The new row keeps that category, and its key is computed from the new text, so the key you pass and the key it prints can differ. Paths are the old row's paths and anchors, plus any new `--path`, still at most 20; an old path that could not be an anchor is dropped rather than refusing the edit. A key that is not in the ledger is an error and nothing is written.
211
+
212
+ `--json` prints one object, `{"ok": true, "key": "trap:alpha thing", "memory_lines_added": ["- alpha thing [a.py]"], "memory_lines_removed": []}`. Without it the line is `added <key>` or `edited <key>`. Each command records one dataset event, `memory_add` or `memory_edit` (`key`, `actor`). `learnings --json` sets `manual` to true on a learning that has any `person` row, and omits the field otherwise.
213
+
214
+ Exit 0 ok, 2 usage (a bad category, text or path, a missing `--text`, a repo that is not a directory, or, for `edit`, a key that is not in the ledger).
215
+
216
+ ### `forge findings`
217
+
218
+ Every review finding of a repository, and what happened to it. The record belongs to the repository, not to the checkout a run started in. `REPO` is a checkout, a linked worktree, or a plan or solo run dir. `FP` is the 12-hex fingerprint `show` prints. Every subcommand takes `--actor {cli,ui,triage}` (default `cli`) and `--json`.
219
+
220
+ ```
221
+ forge findings show REPO [--status S]… [--online]
222
+ forge findings fix REPO FP… [--commit SHA] [--reason TEXT]
223
+ forge findings dismiss REPO FP… --reason TEXT
224
+ forge findings reopen REPO FP…
225
+ forge findings to-file REPO FP… [--title T] [--body-file F]
226
+ forge findings dup REPO FP --of FP
227
+ forge findings tag REPO FP… (--add | --remove) TAG… [--]
228
+ forge findings note REPO FP TEXT
229
+ forge findings edit REPO FP [--severity P0|P1|P2|P3] [--text-file F]
230
+ forge findings triage REPO --spec S [--timeout N] [--max-findings N] [--detach]
231
+ forge findings triage-status REPO [N]
232
+ forge findings proposals REPO [N]
233
+ forge findings apply REPO N PID --approve HASH [--plan-dir DIR]
234
+ forge findings reject REPO N PID [--reason TEXT]
235
+ ```
236
+
237
+ `show` lists every run of the repository (the same collection as `forge issues --all-runs --include-plausible --include-dismissed`). It is offline unless `--online`, which asks GitHub which findings are already filed. `--status S` is repeatable; `open` keeps both `open` and `to-file`. Any other name keeps that status, and an unknown name keeps nothing. Rows are worst severity first, then the newest plan. A line is `fp status severity tags file:line summary`. Tags are the record's tags when it has any, otherwise the default for the file.
238
+
239
+ `fix` marks findings `fixed`. It needs `--commit` (7 to 40 lowercase hex characters), `--reason` (at most 500 characters), or both. `dismiss` marks them `dismissed` and requires `--reason` (at most 500). `reopen` marks them `open`. `to-file` keeps a draft issue: `--title` is at most 200 characters, `--body-file` is a file (not `-`) of at most 20000 characters. `dup` marks one finding a duplicate of `--of`; a finding cannot duplicate itself. A status change clears that entry's reason, commit, issue url and `duplicate_of`, and keeps its tags, note, edit and draft.
240
+
241
+ `tag` adds or removes tags. Exactly one of `--add` or `--remove`. `--` separates fingerprints from tags; without it, tags follow the flag and fingerprints precede it. A tag matches `^[a-z][a-z0-9-]{0,23}$`. A finding holds at most 8. `note` sets the note (at most 2000 characters); empty text clears it. `edit` needs `--severity`, `--text-file` (at most 4000 characters, not `-`), or both. The replacement is stored on the record as `edit` and does not rewrite the review. A repeated fingerprint counts once. One fingerprint that is not 12 hex characters refuses the whole command.
242
+
243
+ A change that leaves an entry as it was is reported unchanged and is not written. `--json` on these commands prints `{ok, op, changed: [{fp, before, after}], unchanged}`. Without it the line is `<op>: N changed, M unchanged`.
244
+
245
+ The record is `${XDG_STATE_HOME:-~/.local/state}/forge/findings/<identity key>.record.json` (`{"version": 1, "findings": {fp: entry}}`). An empty or relative `XDG_STATE_HOME` counts as unset. The identity key is 16 hex characters of the repository root, shared by every checkout. Beside it: `<key>.record.log.jsonl` (one JSON line per change) and a `finding_record` dataset event per change (fail-open). `<key>.lock` is the same lock `forge issues --apply` takes; a busy lock is retried for 10 seconds, then refused. Old per-checkout dismissals (`<checkout key>.json`) are merged in on read as `dismissed` and never written again.
246
+
247
+ Stored statuses are `open`, `to-file`, `filed`, `fixed`, `dismissed` and `duplicate`. `open` in the record means reopened. An entry may also hold `tags`, `note`, `edit` (`severity`, `text`) and `draft` (`title`, `body`). A tag, note or edit on a finding the record has not seen stores it as `open`, and that hides a swept mark or an old dismissal the same way `reopen` does. `filed` is what `forge issues --apply` records, with the issue url; there is no findings subcommand that files.
248
+
249
+ The status `show` prints is the first of these that answers:
250
+
251
+ 1. The record, when it is `duplicate`, `dismissed`, `fixed`, `filed` or `to-file`. A record of `open` does not stop here: a filed issue in step 2 still shows, and a swept or old dismissal does not.
252
+ 2. The issues listing: filed and `CLOSED` is `fixed`, filed is `filed`; unless the record reopened it, swept is `swept` and an old dismissal is `dismissed`.
253
+ 3. A review row, which `show` does not pass. forge-ui does: a shadow review is `shadow`, an unlabelled one (`UNSTATED`) is `unlabelled`, a superseded one is `superseded`.
254
+ 4. `open`.
255
+
256
+ Only `open` and `to-file` count as open. Default tags, when the record has none, come from the path, first match: `tests` (a `tests/` or `test/` directory, or `test_*`, `*_test.*`, `*.test.*`), `docs` (`docs/`, `site/`, `*.md`), `infra` (`.github/`, `ci/`, `scripts/forge-install`, `Dockerfile`, a root `*.yml` or `*.yaml`, a name starting with `install`), `ui` (`ui/`, `web/`, `frontend/`, `static/`, or `*.js`, `*.ts`, `*.tsx`, `*.css`, `*.html`), otherwise `backend`. No path gives no tag.
257
+
258
+ `triage` asks one read-only model to propose what to do. `--spec` is required, named as `forge --dwarf` names a model. `--timeout` is seconds, default 3600, and must not be negative. `--max-findings` is 1 to 2000, default 400: the open and `to-file` findings, worst then newest. The dispatch is `forge-dispatch.sh side` (kind `triage`), after `doctor --spec S --role side`. It is refused when `FORGE_TRIAGE` is off, when the repository's privacy floor says never send, when the repository has no checkout to read, when a triage is already `running`, or when 200 triage dirs already exist. Nothing in a triage edits a finding, a file, a memory or an issue.
259
+
260
+ Each triage is `${XDG_STATE_HOME:-~/.local/state}/forge/triage/<identity key>/<N>/` with `state.json`, `findings.json`, `prompt.txt`, `proposals.json` and `done`, plus the dispatch's `side.last` and `side.resolved`. `state` is `running`, then `done` or `failed` (with `reason`). A `running` triage whose process is gone, or whose `done` exists, reads as `failed` with reason `lost`. The model replies once and, if the `forge-triage` block is unusable, once more; an empty proposal list is a successful `done`. `--detach` returns at once (`{"triage": N, "state": "running"}`, exit 0) and the job continues in its own session. That job is the internal `_triage-job` command, which `--help` does not list; it writes its exit code to `done`. Without `--detach` the command waits and exits 1 when the state is `failed`.
261
+
262
+ `triage-status` and `proposals` read triage `N`, or the newest when `N` is omitted. `proposals` prints `proposals.json`. Each proposal has `id` (`p1`, `p2`, …), `hash` (12 hex characters), `state` (`pending`, then `applied` or `rejected`) and one kind:
263
+
264
+ | Kind | Carries | Approving it |
265
+ |---|---|---|
266
+ | `duplicate` | `fp`, `of`, `why` | marks `fp` `duplicate` of `of`, reason `why` cut to 500 characters |
267
+ | `fixed` | `fp`, `evidence`, `commit` | marks `fp` `fixed`, reason `evidence` cut to 500 characters; `commit` is kept when it is 7 to 40 lowercase hex characters |
268
+ | `tag` | `fps`, `tags` | adds those tags |
269
+ | `issue` | `fps`, `title`, `body` | marks them `to-file` with that draft. GitHub is never contacted |
270
+ | `plan` | `fps`, `title`, `request`, `plan` | writes a plan dir and prints the command that would run it. Nothing is dispatched |
271
+
272
+ `apply REPO N PID --approve HASH` applies one `pending` proposal. `HASH` is the hash `proposals` shows; it is checked against the proposal as it is now, and a mismatch is refused with nothing written. The record is written with actor `triage`. The person who asked is `decided.actor` on the proposal (`decided` is `{at, actor}` and, for a rejection, `reason`). A `plan` approval writes `request.md` and a plan `forge-planner.py parse` has accepted. `--plan-dir` chooses the directory; the default is `${XDG_STATE_HOME:-~/.local/state}/forge/plans/<identity key>/triage-<N>-<pid>`. The directory must not already exist. Findings that have no note get the note `in plan <dir>`. The command prints the plan dir and `bash scripts/forge-parallel.sh plan <dir> --repo <checkout>`. `reject` marks one `pending` proposal `rejected`. `--reason` is at most 500 characters. A proposal that is not `pending`, an unknown triage or id, or a fingerprint that is not a finding of the repository now, is refused and left as it was.
273
+
274
+ `show --json`:
275
+
276
+ ```json
277
+ {
278
+ "repo": "owner/repo",
279
+ "root": "/path/to/repo",
280
+ "key": "0123456789abcdef",
281
+ "findings": [
282
+ {
283
+ "fp": "a1b2c3d4e5f6",
284
+ "status": "open",
285
+ "severity": "P2",
286
+ "tags": ["backend"],
287
+ "file": "src/app.py",
288
+ "summary": "widget drops events on retry",
289
+ "record": null
290
+ }
291
+ ],
292
+ "notes": [],
293
+ "warnings": []
294
+ }
295
+ ```
296
+
297
+ Each finding is that object plus the `forge issues --json` fields (`confidence`, `origin`, `plan`, `plan_dir`, `task`, `text`, `reviewer`, `commit`, `review`, `filed`, `swept`, `dismissed`). `record` is the record entry, or null.
298
+
299
+ `proposals --json` prints `proposals.json`:
300
+
301
+ ```json
302
+ {
303
+ "triage": 1,
304
+ "spec": "alias:high",
305
+ "at": "2026-11-16T12:00:00Z",
306
+ "proposals": [
307
+ {
308
+ "id": "p1",
309
+ "hash": "0123456789ab",
310
+ "state": "pending",
311
+ "kind": "duplicate",
312
+ "fp": "aaaaaaaaaaaa",
313
+ "of": "bbbbbbbbbbbb",
314
+ "why": "same cache defect"
315
+ }
316
+ ]
317
+ }
318
+ ```
319
+
320
+ Exit 0 ok, 2 usage (the command line is not usable; nothing was written), 3 refused (the record or the triage refuses the change; nothing was written), 1 error. A triage that finishes `failed` exits 1 after printing its state. A usage error, a refusal or an error the command reports itself prints `forge findings: …` on stderr, and with `--json` also `{"ok": false, "error": "…"}`.
321
+
200
322
  ### `forge runs rerun` and `forge runs compare`
201
323
 
202
324
  `forge runs rerun <run-dir> --dwarf SPEC` answers "would this plan have gone better on another
@@ -241,17 +363,27 @@ the size of a `--only` selection).
241
363
 
242
364
  | Flag | Does |
243
365
  |---|---|
244
- | `--json` | machine-readable output; `findings` lists each one with its fingerprint, severity, origin (`tolerated`, `accepted`, `review` or `plausible`), task, `review`, `swept` (`{task, finding}` when the run's finding sweep fixed it; such a finding is never drafted), `filed` state and `dismissed` mark. A whole-run finding's `review` is `{name, outdated, merged_since}` (`outdated` is null when the review has no verdict or the plan has no accepted integration commit; `merged_since` is empty unless the review is outdated). Every other finding has `review` null |
366
+ | `--json` | machine-readable output; `findings` lists each one with its fingerprint, severity, origin (`tolerated`, `accepted`, `review` or `plausible`), task, `review`, `swept` (`{task, finding}` when the run's finding sweep fixed it; such a finding is never drafted), `filed` state, `dismissed` mark, `record` (the finding-record entry, or null) and `status` (`open`, `to-file`, `filed`, `fixed`, `dismissed`, `duplicate` or `swept`). A whole-run finding's `review` is `{name, outdated, merged_since}` (`outdated` is null when the review has no verdict or the plan has no accepted integration commit; `merged_since` is empty unless the review is outdated). Every other finding has `review` null |
245
367
  | `--offline` | never run `gh`: no filed state, commit publication judged from local refs |
246
368
  | `--only FP` | keep only these 12-hex fingerprints (repeatable or comma-separated) |
247
- | `--all-runs` | read `RUN` as a repository (or a plan dir naming one) and collect every run in its registry; the newest plan wins for a finding in several |
248
- | `--dismiss FP`, `--undismiss FP`, `--reason TEXT` | mark findings as needing no work (or take it back), then exit; no network. The marks live outside the repo, in `${XDG_STATE_HOME:-~/.local/state}/forge/findings/<repo key>.json` |
369
+ | `--all-runs` | read `RUN` as a repository (or a plan dir naming one) and collect every run of that repository: the main checkout, linked worktrees, and checkouts that are gone. The newest plan wins for a finding present in several |
370
+ | `--to-file` | keep only findings whose record status is `to-file`. A draft title replaces the generated one and the draft body follows under Notes. May be combined with `--only`: both must match |
371
+ | `--dismiss FP`, `--undismiss FP`, `--reason TEXT` | mark findings as needing no work (or take it back), then exit; no network. `--dismiss` writes status `dismissed` on the finding record and `--undismiss` writes `open`. A fingerprint that matches no current finding is accepted |
249
372
  | `--include-dismissed` | draft dismissed findings too |
250
373
 
374
+ Findings, dismissals and the `filed` mark belong to the repository, not to the checkout the run
375
+ started in. The record is `${XDG_STATE_HOME:-~/.local/state}/forge/findings/<identity key>.record.json`
376
+ (see [forge findings](#forge-findings)). Old `<checkout key>.json` dismissal stores are read and never
377
+ written. A finding that is `filed`, `fixed` or `duplicate` is never drafted, and `--apply` records
378
+ `filed` with the issue url. When the run's checkout is gone, the command uses the repository root, and
379
+ the GitHub slug is `origin` of the first checkout of that repository that still exists. That checkout
380
+ is the only one asked: no `origin`, or an `origin` that is not a GitHub `owner/repo`, ends the search.
381
+ `--repo` still overrides it; `--apply` needs a slug.
382
+
251
383
  Two filers for one repository at once would both see a finding as unfiled, so `--apply` takes a
252
384
  repository lock from the issue lookup to the last `gh issue create`, and each dismissal takes it
253
385
  around its write. A busy lock is retried for 10 s, then exit 3. Exit 0 ok, 2 usage or a `gh` or
254
- dismissal-store error, 3 busy.
386
+ record-store error, 3 busy.
255
387
 
256
388
  ### `forge pr`
257
389
 
package/docs/forge-ui.md CHANGED
@@ -147,8 +147,11 @@ locks, the audit log) whichever way you change something, and a change from the
147
147
  indistinguishable from the same command typed in a terminal, except that the page passes
148
148
  `--actor ui` (`control.log` says `ui` instead of `cli` for a control change). A destructive change
149
149
  shows a dry run and then asks: removing worktrees, forgetting memories, compacting disk and deleting
150
- a run. A brief answer, a proposal, approving or rejecting one, and *Send answer* on a task that is
151
- waiting go out when you press the button, with no dry run. The HTTP shapes are in
150
+ a run. A finding action (mark fixed, dismiss, reopen, mark to file, duplicate, tag, note or edit),
151
+ adding or editing a learning, starting a triage, and approving a triage proposal each ask you to
152
+ confirm first, with no dry run. A brief answer, a brief proposal, approving or rejecting a brief
153
+ proposal, rejecting a triage proposal, and *Send answer* on a task that is waiting go out when you
154
+ press the button, with no dry run. The HTTP shapes are in
152
155
  [the API](../ui/docs/api.md); this page describes what you do.
153
156
 
154
157
  - **Run controls** (a plan's inspector): the QA threshold (shown with its source, `P2 (default)`
@@ -170,19 +173,66 @@ waiting go out when you press the button, with no dry run. The HTTP shapes are i
170
173
  and runs `forge control retry --answer`.
171
174
  - **Projects (`#/projects`):** one page per repository with its runs, every finding forge's reviews
172
175
  wrote about it (each attempt, final reviews, shadow reviews behind a toggle), and every memory forge
173
- keeps for it, whichever run or checkout they came from. A finding a later review got past is
174
- `superseded`, never `fixed`; repeats across rounds are one row with a count. The Memories tab shows
175
- what `memory.md` gives each role and each learning's state, as `forge memory learnings` reports it.
176
- Runs and checkouts that are gone are read from the dataset, and those rows say so. When the server
177
- can write, each learning on the checkout you are looking at has a checkbox, the filtered list has
178
- *Select all*, and *Forget selected* runs
179
- [`forge memory forget`](commands.md#forge-memory-forget) on that checkout with `--actor ui`. It
180
- dry-runs first. The confirm lists the learnings (`category:key` and the text) and the `memory.md`
181
- lines that go, or says that no `memory.md` line goes. Cancelling sends nothing more. The result
182
- then says how many ledger rows each key lost, or that the key was not found. A learning with no
183
- category or key cannot be selected. Under `--read-only` the tab still shows the learnings and
184
- hides the checkboxes and the button. Reachable from the header, a run's repository name and each
185
- map district.
176
+ keeps for it, whichever run or checkout they came from. Repeats across rounds are one row with a count.
177
+ The status column is the one [`forge findings`](commands.md#forge-findings) prints. The record wins
178
+ when it says `duplicate`, `dismissed`, `fixed`, `filed` or `to-file`. Otherwise a filed issue GitHub
179
+ has closed is `fixed` and one still open is `filed`; unless the record reopened the finding, a swept
180
+ one is `swept` and an old dismissal is `dismissed`. A shadow review is `shadow`, an unlabelled one
181
+ (`UNSTATED`) is `unlabelled`, and a finding a later review of the same task got past is `superseded`
182
+ (that does not say it was fixed). Anything else is `open`. The open count, on the project list and
183
+ in the Findings filter named `open`, counts only `open` and `to-file`, so `shadow`, `unlabelled`,
184
+ `superseded`, `swept`, `dismissed`, `duplicate`, `filed` and `fixed` are left out. The project list
185
+ does not ask GitHub, so a filed or swept finding can still be in that number; the Findings tab asks
186
+ and can count fewer. A `to-file` row keeps its draft. Each row shows its tags: the ones stored on
187
+ the record, or, when none are stored, the default for its path (`tests`, `docs`, `infra`, `ui` or
188
+ `backend`), marked as derived from the path. The tab asks `forge issues` online, so a closed issue
189
+ can show `fixed`, and says when those states were read. When GitHub cannot be asked it says so, and
190
+ that a filed finding may show as open. When the server can write, select findings (a row with no
191
+ record key cannot) and confirm one action. There is no dry run. Each runs
192
+ [`forge findings`](commands.md#forge-findings) on the repository root with `--actor ui`: *Mark fixed*
193
+ is `forge findings fix REPO FP…` with `--commit` (7 to 40 hex characters), `--reason`, or both;
194
+ *Dismiss* is `forge findings dismiss REPO FP… --reason TEXT` (the reason is required); *Reopen* is
195
+ `forge findings reopen REPO FP…`; *Mark to file* is `forge findings to-file REPO FP…` with an
196
+ optional `--title` and keeps a draft, it does not open a GitHub issue; *Duplicate of…* is
197
+ `forge findings dup REPO FP --of FP` (one finding); *Tags…* is `forge findings tag REPO FP… -- TAG…`
198
+ with `--add` or `--remove`. A row's *Note* is `forge findings note REPO FP TEXT` (empty text clears
199
+ it) and *Edit* is `forge findings edit REPO FP` with `--severity` (`P0`–`P3`), `--text-file`, or
200
+ both: the replacement stays on the record and does not rewrite the review. Note and edit take one
201
+ finding. *File selected* is separate and still runs `forge issues`: it shows the drafts and creates
202
+ the GitHub issues only after that confirm. *Triage with an agent* is on the same tab. You name a
203
+ spec; the page checks it with `bash scripts/forge-dispatch.sh doctor --spec S --role side` and does
204
+ not call a model for that check. *Start triage* stays disabled until that check passes, while a
205
+ triage is already running, or when *Most findings* is filled in with anything other than a whole
206
+ number from 1 to 2000. Starting
207
+ asks you to confirm, because it spends that model's quota, then runs
208
+ `forge findings triage REPO --spec S [--max-findings N] --detach --actor ui`. Left empty, *Most
209
+ findings* omits `--max-findings` and the command's default of 400 applies. While it runs, the page reads
210
+ `forge findings triage-status` and `forge findings proposals` every 5 seconds. The agent only
211
+ proposes. Each proposal is `duplicate`, `fixed`, `tag`, `issue` or `plan`. *Approve* asks first and
212
+ runs `forge findings apply REPO N PID --approve HASH [--plan-dir DIR] --actor ui` with the hash on
213
+ that card, so a proposal that changed since you read it is refused and nothing is written. An
214
+ `issue` approval only marks those findings `to-file` with the draft; GitHub is not contacted. A
215
+ `plan` approval writes a plan directory and shows
216
+ `bash scripts/forge-parallel.sh plan DIR --repo CHECKOUT`. Nothing runs by itself. *Reject* runs
217
+ `forge findings reject REPO N PID [--reason TEXT] --actor ui` when you press it, with no confirm.
218
+ Under `--read-only` the tab still lists the findings and shows those `forge findings` commands to
219
+ copy, including the triage ones, and hides the buttons. The Memories tab shows what `memory.md`
220
+ gives each role and each learning's state, as `forge memory learnings` reports it. Runs and
221
+ checkouts that are gone are read from the dataset, and those rows say so. When the server can write,
222
+ each learning on the checkout you are looking at has a checkbox, the filtered list has *Select all*,
223
+ and *Forget selected* runs [`forge memory forget`](commands.md#forge-memory-forget) on that checkout
224
+ with `--actor ui`. It dry-runs first. The confirm lists the learnings (`category:key` and the text)
225
+ and the `memory.md` lines that go, or says that no `memory.md` line goes. Cancelling sends nothing
226
+ more. The result then says how many ledger rows each key lost, or that the key was not found. A
227
+ learning with no category or key cannot be selected. *Add learning* runs `forge memory add` on the
228
+ checkout you picked, or on every checkout of the project that exists when none is picked:
229
+ `--category verify|trap|finding --text TEXT [--path P]… --actor ui`. *Edit* on a row runs
230
+ `forge memory edit` there with that learning's `category:key` and `--text`, the same `--actor ui`.
231
+ Each asks you to confirm first, with no dry run; the confirm names the checkouts and, for an edit,
232
+ the old text and the new. Add and edit are documented with
233
+ [`forge memory forget`](commands.md#forge-memory-forget). Under `--read-only` the tab still shows
234
+ the learnings, hides the checkboxes, Forget, Add and Edit, and shows the `forge memory` commands
235
+ to copy. Reachable from the header, a run's repository name and each map district.
186
236
  - **Disk (`#/disk`):** what forge takes on disk in every repository it has runs for (each run dir's
187
237
  review snapshots, logs and anything forge does not create, each run's worktree folder, the data home),
188
238
  what can go without losing a run, and the command that takes it back (`forge runs compact --logs`),
@@ -247,10 +297,11 @@ the page sends it with every change, and the server also checks the `Host` and `
247
297
  headers, so another website open in your browser cannot make your browser change a run. Reading
248
298
  needs no token. `--read-only` (or `FORGE_UI_READONLY=1`) turns writing off altogether: no
249
299
  token is issued and every change is refused. No action button is shown: not the run controls,
250
- not Remove or Forget selected or Compact, and not *Send answer*. The summaries and the questions
251
- still show, without their switches, answer boxes, or Propose, Approve and Reject buttons, and
252
- every copy button stays (worktree commands, compact commands, and the `retry --answer` command
253
- on a waiting task). `FORGE_UI_READONLY=1 forge ui open` starts such a
300
+ not Remove or Forget selected or Compact, not the finding actions, Add learning, Edit or triage
301
+ Start, Approve and Reject, and not *Send answer*. The summaries and the questions still show,
302
+ without their switches, answer boxes, or Propose, Approve and Reject buttons, and every copy
303
+ button stays (worktree commands, compact commands, the `forge findings` and `forge memory`
304
+ commands, the triage commands, and the `retry --answer` command on a waiting task). `FORGE_UI_READONLY=1 forge ui open` starts such a
254
305
  server, and the launcher never reuses a server running in the other mode; it replaces it.
255
306
 
256
307
  Also: replay, critical path, Fractal child-task trees, quick jump (Ctrl K, ⌘K on a Mac, or
package/forge CHANGED
@@ -23,6 +23,7 @@ usage() {
23
23
  ' jev the old decision-model commands, replaced by decide (kept for one release)' \
24
24
  ' dataset every run'"'"'s inputs and outcomes: status, dump, import, export, outcomes, ...' \
25
25
  ' issues file the review findings a run left open as GitHub issues (plain gh)' \
26
+ ' findings every review finding of a repository: show, mark, tag, triage' \
26
27
  ' memory a repository'"'"'s project memory: show, learnings --json (each learning and its state), prune, forget' \
27
28
  ' pr a draft pull-request description for a finished run (--create opens it with gh)' \
28
29
  ' ui forge-ui, the run viewer: open [DIR], status, stop' \
@@ -106,13 +107,18 @@ case "${1:-}" in
106
107
  shift
107
108
  exec python3 "$ROOT/scripts/forge-issues.py" "$@"
108
109
  ;;
110
+ findings)
111
+ shift
112
+ help_if_bare $# python3 "$ROOT/scripts/forge-findings.py"
113
+ exec python3 "$ROOT/scripts/forge-findings.py" "$@"
114
+ ;;
109
115
  memory)
110
116
  shift
111
117
  # only the commands its help lists: note and record are what a run writes into the ledger, not a person
112
118
  case "${1:-}" in
113
- show|learnings|prune|spend|inject|forget|-h|--help|help) ;;
119
+ show|learnings|prune|spend|inject|forget|add|edit|-h|--help|help) ;;
114
120
  '') /bin/bash "$ROOT/scripts/forge-memory.sh" --help >&2; exit 2 ;;
115
- *) printf 'forge memory: unknown command: %s (show, learnings, prune, spend, inject or forget)\n' "$1" >&2; exit 2 ;;
121
+ *) printf 'forge memory: unknown command: %s (show, learnings, prune, spend, inject or forget, add or edit)\n' "$1" >&2; exit 2 ;;
116
122
  esac
117
123
  exec /bin/bash "$ROOT/scripts/forge-memory.sh" "$@"
118
124
  ;;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giamme/forge",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Multi-model coding with a reviewer that reads the code: plan, build in parallel worktrees, review every real diff, merge only what passes.",
5
5
  "keywords": ["claude-code", "codex", "opencode", "agent-skill", "code-review", "multi-model"],
6
6
  "license": "MIT",
@@ -1229,14 +1229,23 @@ CONFIRMED finding stays a failure. The task's status is then the literal `PASS`;
1229
1229
  ### The finding sweep (opt-in)
1230
1230
 
1231
1231
  Tolerated findings are recorded, not fixed. `run --sweep Pn` fixes them inside the run instead: once
1232
- every task has merged, and before the combined verification, the scheduler runs `forge-sweep.py plan`
1233
- once. It collects the open findings at `Pn` or worse (the ones the threshold tolerated, plus
1232
+ every task has merged, and before the combined verification, the scheduler runs `forge-sweep.py plan`.
1233
+ The sweep is once per finding, not once per plan. Round 1 is `<plan>/sweep/plan.json`; round N (N ≥ 2)
1234
+ is `<plan>/sweep/rounds/<N>/plan.json`. A finding an earlier round attempted is not swept again, whatever
1235
+ that attempt's outcome. The first round is planned once every task that is not a fix task has merged.
1236
+ A later round starts when those tasks have merged, every fix task of the previous round is `MERGED`,
1237
+ `FAIL`, `NEEDS_DECISION` or `INFRA`, and new eligible findings exist. At most one round starts per
1238
+ scheduler pass. A later `plan` with nothing new writes and prints nothing. The scheduler records that
1239
+ check in `<plan>/sweep/nothing.json`, and the run's summary prints
1240
+ `sweep: nothing new to sweep (N finding(s) already swept or attempted, M left for forge issues)`.
1241
+ It collects the open findings at `Pn` or worse (the ones the threshold tolerated, plus
1234
1242
  PLAUSIBLE ones with `--sweep-plausible`), with `forge issues`' own collector, and leaves out:
1235
1243
 
1236
1244
  - findings a person accepted with `accept` or kept with `adopt --approved` (listed as `accepted`), and
1237
- findings of fix tasks (one round: what a sweep review finds goes to `forge issues`, never into another
1238
- sweep);
1239
- - dismissed ones (`forge issues --dismiss`), ones with no file, and ones whose file is gone;
1245
+ findings of fix tasks (what a sweep review finds goes to `forge issues`, never into another sweep);
1246
+ - dismissed ones (`forge issues --dismiss`), ones the finding record marks `fixed`, `filed` or
1247
+ `duplicate`, and ones an earlier round already attempted;
1248
+ - ones with no file, and ones whose file is gone;
1240
1249
  - ones whose line, as the reviewer saw it, a later merge changed (`changed`, naming those merges).
1241
1250
 
1242
1251
  Every finding left out is listed in the plan with its reason. The rest become fix tasks, one per file,
@@ -1246,14 +1255,17 @@ worst first, at most 8 findings each and `--sweep-max N` (default 5) tasks. Each
1246
1255
  the task the worst finding came from. Its reviewer is that task's reviewer. What an adopted range's review
1247
1256
  tolerated is swept too: its fix task's reviewer is the adoption's, and below the low tier its implementer
1248
1257
  is the run's first task's. The plan (groups, findings,
1249
- dispatches) is printed and kept in `<plan>/sweep/plan.md` and `plan.json`. A plan is swept at most once.
1258
+ dispatches) is printed and kept next to that round's `plan.json`, as `plan.md`. Round 1 lives in
1259
+ `<plan>/sweep/`; each later round lives in `<plan>/sweep/rounds/<N>/`.
1250
1260
 
1251
1261
  Fix tasks share the run's scheduling, controls and `--retry-failed` budget. Their review is narrow
1252
1262
  (`forge-contract.py qa --kind sweep`): one `S<n>: FIXED` or `S<n>: NOT FIXED` line per finding, plus
1253
1263
  regressions as findings. It passes when at least one finding is fixed and there is no blocking
1254
1264
  regression. When a fix task merges, its review's lines go to `tasks/<id>/sweep.outcome.json`, and
1255
- `forge issues` leaves out what it fixed (`swept` in `--json`). A fix task that fails leaves its
1256
- findings for `forge issues` and does not fail the run. The run's summary says what the sweep fixed,
1265
+ `forge issues` leaves out what it fixed (`swept` in `--json`). Each finding that review marked fixed
1266
+ also gets a `fixed` record, actor `sweep`, reason `sweep <task>`, and the merge commit when
1267
+ `<plan>/accepted.integration` is 7 to 40 lowercase hex characters. A fix task that fails leaves its
1268
+ findings for `forge issues` and does not fail the run. The run's summary says what each round fixed,
1257
1269
  and the whole-run review that follows reads the sweep's changes like any other task's.
1258
1270
 
1259
1271
  `run --sweep-ahead` (kept in `<plan>/sweep_ahead`; `--no-sweep-ahead` turns it off) is the cheaper
@@ -107,10 +107,14 @@ on a task with a real trap, they emit it.
107
107
  | `verify`, `trap` | on first sighting — these are facts, true the first time |
108
108
  | `finding` | only after **two distinct runs** |
109
109
 
110
+ A row a person wrote (`forge memory add` or `edit`: role `person`, run id `manual-<epoch>`) is
111
+ kept on its first row, in every category, including `finding`. It is injected at once.
112
+
110
113
  Everything reaches the ledger immediately regardless; promotion governs only what gets
111
114
  injected. The threshold is the main guard against a junk drawer: one QA noticing one bug is
112
115
  an incident, and putting it in every future prompt would be noise. Two separate runs finding
113
- the same thing is a pattern worth telling the next dwarf about.
116
+ the same thing is a pattern worth telling the next dwarf about. A person's row does not wait
117
+ for that second run.
114
118
 
115
119
  Recurrence counts **distinct runs**, not lines — one run emitting the same learning twice is
116
120
  still one occurrence. Promoted findings display their count (`3x:`), which is also how a
@@ -140,7 +144,9 @@ misleading. This is what keeps memory true as the codebase moves, and it is why
140
144
  for an anchor wherever one makes sense.
141
145
 
142
146
  Caps are 40 lines and 4 KB (`FORGE_MEMORY_MAX_LINES`, `FORGE_MEMORY_MAX_BYTES`). Over cap,
143
- entries are trimmed from the bottom — lowest recurrence count first, then least recent.
147
+ run facts are trimmed from the bottom — lowest recurrence count first, then least recent.
148
+ A person's fact is trimmed only once no run fact is left. A person row is still dropped when
149
+ its anchor path is gone, on the same rule as any other anchored entry.
144
150
  A single entry is clamped to 180 characters (`FORGE_MEMORY_MAX_FACT_CHARS`), truncated at a
145
151
  word boundary with its anchor preserved, so one discursive model cannot spend the whole
146
152
  budget on one line.
@@ -208,10 +214,28 @@ forge-memory.sh record <repo> --last <file> --role <r> [--run-id X] [--task T]
208
214
  forge-memory.sh show <repo>
209
215
  forge-memory.sh prune <repo> # re-apply staleness and cap now
210
216
  forge-memory.sh spend <repo> [--run <run-id>] # time and dispatch counts
217
+ forge-memory.sh add <repo> --category <verify|trap|finding> --text TEXT [--path P]...
218
+ [--actor ui|cli] [--json]
219
+ forge-memory.sh edit <repo> <category:key> --text TEXT [--path P]...
220
+ [--actor ui|cli] [--json]
211
221
  ```
212
222
 
213
- `--no-memory`, or `FORGE_MEMORY=off` in the environment, disables all of it: nothing is
214
- injected, nothing is recorded, and no `.forge/` is created.
223
+ `add` appends one ledger row (role `person`, run id `manual-<epoch>`) and rebuilds `memory.md`.
224
+ `--category` is `verify`, `trap` or `finding`. `--text` is one line of 1 to 300 characters with
225
+ no tab, then clamped like any other fact. `--path` is repeatable, at most 20, each a relative
226
+ path of at most 300 characters with no `..`, comma or brackets; the first is appended as
227
+ `[anchor]` when the text has none. The row is kept at once, including a `finding`, trimmed last
228
+ by the cap, and still dropped when that path is gone. `edit` forgets that one `category:key` and
229
+ adds the new text in its place, keeping the category and the old paths plus any new `--path`. The
230
+ new row's key comes from the new text. A key that is not in the ledger is refused and nothing is
231
+ written. Both record a dataset event, `memory_add` or
232
+ `memory_edit`. `learnings --json` sets `manual` to true when any row of the learning has role
233
+ `person`, and omits the field otherwise. `add` and `edit` run when memory is off: they are an
234
+ edit you asked for.
235
+
236
+ `--no-memory`, or `FORGE_MEMORY=off` in the environment, disables injection and automatic
237
+ recording: nothing is injected, a run records nothing, and that run creates no `.forge/`.
238
+ `show`, `learnings`, `prune`, `spend`, `forget`, `add` and `edit` still do what you asked.
215
239
 
216
240
  ## Failure modes
217
241
 
@@ -220,7 +244,8 @@ injected, nothing is recorded, and no `.forge/` is created.
220
244
  | memory stays empty | nothing durable was learned — the common and correct case. Check the ledger: rows with `-` categories mean dispatches ran and emitted nothing |
221
245
  | a fact you wanted is missing | it was a `finding` seen once; it is in the ledger and will promote on its second run |
222
246
  | the same fact appears twice, worded differently | dedup is exact-after-normalization; delete the weaker line from `memory.md`, or let the cap evict it |
223
- | a fact is wrong and keeps coming back | it is in the ledger. Editing `memory.md` alone will not hold — the next rebuild regenerates from the ledger; remove the ledger rows |
247
+ | a fact is wrong and keeps coming back | it is in the ledger. Editing `memory.md` alone will not hold — the next rebuild regenerates from the ledger; remove the ledger rows, or `forge memory edit` that key |
248
+ | `edit` says there is no ledger row | that `category:key` is not in the ledger. `edit` refuses it and writes nothing. `forget` treats a missing key as a no-op |
224
249
  | memory vanished after a refactor | its entries were anchored to paths that no longer exist and were dropped as stale. Working as intended |
225
250
  | `.forge/` shows up in a review | a diff capture is missing the exclude pathspec |
226
251
  | memory in a worktree is stale | inject reads the **main repo**, not the worktree; on a repo's first run `.forge/` is not committed, so a worktree branched from the base commit does not have it |