@giamme/forge 0.19.0 → 0.21.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 +32 -0
- package/README.md +7 -0
- package/SKILL.md +3 -0
- package/VERSION +1 -1
- package/docs/README.md +1 -0
- package/docs/commands.md +137 -5
- package/docs/development.md +1 -1
- package/docs/forge-ui.md +70 -19
- package/forge +8 -2
- package/package.json +1 -1
- package/references/decompose.md +20 -8
- package/references/memory.md +30 -5
- package/scripts/forge-config.py +10 -9
- package/scripts/forge-control.py +51 -35
- package/scripts/forge-findings.py +675 -0
- package/scripts/forge-group.py +2 -1
- package/scripts/forge-guard.py +71 -33
- package/scripts/forge-handoff.py +14 -17
- package/scripts/forge-issues.py +233 -99
- package/scripts/forge-memory.sh +471 -19
- package/scripts/forge-parallel.sh +24 -14
- package/scripts/forge-planner.py +28 -2
- package/scripts/forge-pre-review.py +11 -4
- package/scripts/forge-ripwire.py +68 -22
- package/scripts/forge-route.py +10 -3
- package/scripts/forge-runs-compact.py +3 -2
- package/scripts/forge-runs-rm.py +14 -14
- package/scripts/forge-runtime.py +36 -19
- package/scripts/forge-schedule.py +135 -62
- package/scripts/forge-shadow.py +16 -9
- package/scripts/forge-summarize.py +7 -3
- package/scripts/forge-sweep.py +206 -46
- package/scripts/forge-ui.py +8 -13
- package/scripts/forge-verify.py +29 -23
- package/scripts/forge_brief/__init__.py +1 -1
- package/scripts/forge_brief/proposals.py +7 -2
- package/scripts/forge_decide/budget.py +6 -1
- package/scripts/forge_decide/replay.py +6 -1
- package/scripts/forge_findings/__init__.py +17 -0
- package/scripts/forge_findings/apply.py +442 -0
- package/scripts/forge_findings/status.py +43 -0
- package/scripts/forge_findings/store.py +595 -0
- package/scripts/forge_findings/tags.py +53 -0
- package/scripts/forge_findings/triage.py +594 -0
- package/scripts/forge_flock.py +87 -0
- package/scripts/forge_fractal/__init__.py +7 -3
- package/scripts/forge_fractal/cli.py +7 -2
- package/scripts/forge_fractal/execution.py +14 -14
- package/scripts/forge_fractal/invocation.py +3 -2
- package/scripts/forge_fractal/pipeline.py +2 -1
- package/scripts/forge_fractal/selection.py +2 -1
- package/scripts/forge_identity.py +328 -0
- package/scripts/forge_locations.py +14 -4
- package/scripts/forge_memory_list.py +7 -3
- package/scripts/forge_posix.py +108 -0
- package/scripts/forge_proc.py +399 -0
- package/scripts/forge_registry.py +15 -6
- package/scripts/forge_retro/__init__.py +8 -2
- package/scripts/forge_retro/issues.py +2 -1
- package/scripts/forge_side/__init__.py +232 -38
- package/scripts/forge_storage.py +11 -1
- package/ui/docs/api.md +130 -12
- package/ui/forge_ui/control.py +693 -17
- package/ui/forge_ui/export.py +1 -1
- package/ui/forge_ui/projects.py +209 -22
- package/ui/forge_ui/reader.py +18 -17
- package/ui/forge_ui/server.py +10 -1
- package/ui/forge_ui/static/findingsactions.js +201 -0
- package/ui/forge_ui/static/index.html +2 -0
- package/ui/forge_ui/static/projectsview.js +600 -45
- package/ui/forge_ui/static/style.css +59 -0
- package/ui/forge_ui/static/triageview.js +423 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,38 @@ 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.21] - 2026-11-19
|
|
9
|
+
|
|
10
|
+
Groundwork for native Windows support, plus fixes for macOS with Python 3.9 and for parallel tasks that start at the same moment.
|
|
11
|
+
|
|
12
|
+
### Highlights
|
|
13
|
+
|
|
14
|
+
- First step toward native Windows support: file locking, safe file opening and process handling now go through one cross-platform layer that also works on Windows. Nothing changes on macOS or Linux, and Windows isn't usable yet: the Windows launcher, installer and docs come in the next part. Thanks to Kratoswer-byte for the port.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- On macOS with Python 3.9, such as the system `python3`, every phase of a run was recorded as taking about 0 seconds, so `report` and forge-ui showed wrong phase times. Phases are now timed on a clock that all of forge's processes share.
|
|
19
|
+
- In brief mode, a task that waits for the brief writer could start right away on macOS with Python 3.9, as if the writer had already finished. The scheduler now always checks the writer the first time.
|
|
20
|
+
- forge-ui no longer looks up the machine's full host name before it starts listening, which could delay its startup by several seconds on macOS.
|
|
21
|
+
- The planner refuses a reply nested more than 64 levels deep or holding a number over 4,300 digits the same way on every Python version, and forge-ui refuses a profile nested that deep. Before, Python 3.12 and later accepted the deep profile, and older Python 3.9 builds spent a long time parsing the huge number.
|
|
22
|
+
- In a parallel run, a task that started at the same moment as others could end ERROR with "could not create worktree — fatal: could not open '.git/worktrees/<id>/gitdir'". Tasks no longer clean up stale worktree registrations while another task is creating its worktree.
|
|
23
|
+
|
|
24
|
+
## [0.20] - 2026-11-17
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- 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.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- `--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.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- 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.
|
|
39
|
+
|
|
8
40
|
## [0.19] - 2026-11-15
|
|
9
41
|
|
|
10
42
|
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/README.md
CHANGED
|
@@ -188,6 +188,13 @@ python3 ui/tools/demo_runs.py /tmp/forge-demo
|
|
|
188
188
|
| [Ripwire and Jev](docs/add-ons.md) | optional repository context and advisory judgments |
|
|
189
189
|
| [Troubleshooting](docs/troubleshooting.md) | symptoms, causes and fixes |
|
|
190
190
|
| [Development](docs/development.md) | repository layout, offline checks, runtime measurement |
|
|
191
|
+
| [Contributing](CONTRIBUTING.md) | setting up, running the tests, the rules reviewers check, pull requests |
|
|
192
|
+
|
|
193
|
+
## Contributing
|
|
194
|
+
|
|
195
|
+
Issues and pull requests are welcome. [CONTRIBUTING.md](CONTRIBUTING.md) covers setting up,
|
|
196
|
+
running the tests and what reviewers look for. Please report security issues privately, as
|
|
197
|
+
[SECURITY.md](SECURITY.md) describes.
|
|
191
198
|
|
|
192
199
|
## License
|
|
193
200
|
|
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.
|
|
1
|
+
0.21
|
package/docs/README.md
CHANGED
|
@@ -20,6 +20,7 @@ The README is the short overview. These pages hold the rest, one topic each.
|
|
|
20
20
|
| [Ripwire and Jev](add-ons.md) | optional repository context and advisory judgments |
|
|
21
21
|
| [Troubleshooting](troubleshooting.md) | symptoms, causes and fixes |
|
|
22
22
|
| [Development](development.md) | repository layout, offline checks, runtime measurement |
|
|
23
|
+
| [Contributing](../CONTRIBUTING.md) | setting up, running the tests, the rules reviewers check, pull requests |
|
|
23
24
|
|
|
24
25
|
Deeper material that the skill itself reads lives in [`references/`](../references/): the
|
|
25
26
|
per-harness details, the decomposition and Fractal contracts, memory internals, Jev and the
|
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
|
|
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`
|
|
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
|
|
248
|
-
| `--
|
|
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
|
-
|
|
386
|
+
record-store error, 3 busy.
|
|
255
387
|
|
|
256
388
|
### `forge pr`
|
|
257
389
|
|
package/docs/development.md
CHANGED
|
@@ -57,7 +57,7 @@ forge/
|
|
|
57
57
|
## Offline checks
|
|
58
58
|
|
|
59
59
|
Run `bash tests/check.sh` for offline regression checks. See [tests](../tests/README.md) for skill
|
|
60
|
-
invocation scenarios and verification limits.
|
|
60
|
+
invocation scenarios and verification limits. Three CI workflows: `.github/workflows/test.yml` runs `tests/check.sh` on every pull request (Ubuntu, Python 3.9; documentation-only changes skip it) and on every push to `dev` (also the latest 3.x, and macOS with the system Bash 3.2), `.github/workflows/pages.yml` builds and publishes the website ([site/README.md](../site/README.md)), and `.github/workflows/npm-publish.yml` publishes the package to npm when a GitHub Release is published (npm trusted publishing, no token).
|
|
61
61
|
|
|
62
62
|
## Runtime efficiency and measurement
|
|
63
63
|
|
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
|
|
151
|
-
|
|
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.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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.
|
|
3
|
+
"version": "0.21.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",
|
package/references/decompose.md
CHANGED
|
@@ -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
|
|
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 (
|
|
1238
|
-
|
|
1239
|
-
|
|
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
|
|
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`).
|
|
1256
|
-
|
|
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
|
package/references/memory.md
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
214
|
-
|
|
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 |
|