@giamme/forge 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +13 -3
  3. package/VERSION +1 -1
  4. package/bin/forge.js +104 -0
  5. package/docs/README.md +1 -0
  6. package/docs/development.md +1 -1
  7. package/docs/install.md +91 -2
  8. package/docs/reviews.md +6 -4
  9. package/docs/troubleshooting.md +1 -1
  10. package/forge +4 -0
  11. package/forge.cmd +56 -0
  12. package/package.json +5 -3
  13. package/scripts/forge-artifact.sh +5 -1
  14. package/scripts/forge-config.py +10 -9
  15. package/scripts/forge-control.py +61 -38
  16. package/scripts/forge-dispatch.sh +108 -31
  17. package/scripts/forge-group.py +2 -1
  18. package/scripts/forge-guard.py +207 -38
  19. package/scripts/forge-handoff.py +14 -17
  20. package/scripts/forge-install.sh +82 -9
  21. package/scripts/forge-issues.py +5 -2
  22. package/scripts/forge-lib-env.sh +158 -0
  23. package/scripts/forge-lib-group.sh +5 -5
  24. package/scripts/forge-lib-plans.sh +8 -3
  25. package/scripts/forge-lib-task.sh +40 -15
  26. package/scripts/forge-memory.sh +2 -0
  27. package/scripts/forge-metrics.sh +6 -1
  28. package/scripts/forge-parallel.sh +174 -53
  29. package/scripts/forge-planner.py +28 -2
  30. package/scripts/forge-pre-review.py +11 -4
  31. package/scripts/forge-ripwire.py +68 -22
  32. package/scripts/forge-route.py +10 -3
  33. package/scripts/forge-runs-compact.py +3 -2
  34. package/scripts/forge-runs-rm.py +14 -14
  35. package/scripts/forge-runtime.py +38 -21
  36. package/scripts/forge-schedule.py +90 -56
  37. package/scripts/forge-shadow.py +16 -9
  38. package/scripts/forge-solo.sh +6 -2
  39. package/scripts/forge-summarize.py +7 -3
  40. package/scripts/forge-sweep.py +8 -3
  41. package/scripts/forge-ui.py +8 -13
  42. package/scripts/forge-update.sh +6 -1
  43. package/scripts/forge-verify.py +30 -23
  44. package/scripts/forge-win.sh +156 -0
  45. package/scripts/forge_brief/__init__.py +7 -2
  46. package/scripts/forge_brief/proposals.py +13 -3
  47. package/scripts/forge_decide/budget.py +18 -8
  48. package/scripts/forge_decide/replay.py +15 -5
  49. package/scripts/forge_findings/apply.py +2 -1
  50. package/scripts/forge_findings/store.py +16 -4
  51. package/scripts/forge_findings/triage.py +6 -15
  52. package/scripts/forge_flock.py +102 -0
  53. package/scripts/forge_fractal/__init__.py +7 -3
  54. package/scripts/forge_fractal/cli.py +7 -2
  55. package/scripts/forge_fractal/execution.py +14 -14
  56. package/scripts/forge_fractal/invocation.py +3 -2
  57. package/scripts/forge_fractal/pipeline.py +2 -1
  58. package/scripts/forge_fractal/selection.py +2 -1
  59. package/scripts/forge_identity.py +2 -1
  60. package/scripts/forge_locations.py +14 -4
  61. package/scripts/forge_posix.py +125 -0
  62. package/scripts/forge_proc.py +507 -0
  63. package/scripts/forge_registry.py +17 -8
  64. package/scripts/forge_retro/__init__.py +8 -2
  65. package/scripts/forge_retro/issues.py +2 -1
  66. package/scripts/forge_side/__init__.py +32 -14
  67. package/scripts/forge_storage.py +11 -1
  68. package/ui/forge_ui/control.py +42 -14
  69. package/ui/forge_ui/reader.py +24 -18
  70. package/ui/forge_ui/server.py +10 -1
  71. package/ui/forge_ui/static/scene3d.js +23 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,42 @@ 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.22] - 2026-11-23
9
+
10
+ Forge runs on Windows: natively from Git Bash, or inside MSYS2 if you prefer. Plus fixes for plan reviewers, retries after a brief edit, decisions and verification status.
11
+
12
+ ### Highlights
13
+
14
+ - Forge now runs natively on Windows, from Git Bash with the regular Windows Python 3.9 or later. Start it with `forge` after an npm install, or with `forge.cmd` from CMD or PowerShell. `forge install` links skills with directory junctions instead of symlinks, and a run's processes are stopped together through Windows Job Objects. If the Microsoft Store alias hijacks `python3`, forge sets up its own shim. Thanks to Kratoswer-byte for the port.
15
+ - On Windows you can choose MSYS2 mode instead: forge then runs inside MSYS2, where process groups, signals, file locks and symlinks behave as on Linux. Set `FORGE_WIN_MODE=msys2` and start forge from Git Bash as usual, or start it from an MSYS2 shell. Setup and limits are in [Install](docs/install.md#windows-msys2-mode). Thanks to Bardugo624.
16
+
17
+ ### Fixed
18
+
19
+ - Approval, status and results tables stay aligned when task ids are longer than 14 characters: the `id` column now fits the plan's longest id.
20
+ - A `plan` that was refused because tasks were `UNASSIGNED` no longer leaves the fallback `opus` reviewer stuck on them, so a following `plan --qa ...` picks the reviewer you ask for. `plan` also tells you when `--qa` leaves reviewers you set explicitly unchanged.
21
+ - While a new verification is running, forge no longer shows the previous verification's result next to the new commit.
22
+ - In forge-ui's 3D view, tasks with 8 or more attempts now show every attempt's boxes at full height when opened, instead of the later ones stopping short or staying hidden.
23
+ - On Windows, running `forge install` again no longer re-creates links it already made when Git Bash shows the same folder under a different path (such as `/tmp` or a short `PROGRA~1` name).
24
+ - Escalations and group operations no longer print stray `No such file or directory` messages when an optional plan file is missing.
25
+ - After you resume or accept a `NEEDS_DECISION` task, its old decision is cleared, so a task that later ends `FAIL` no longer points you at a `--decide` that doesn't apply. Running `--decide` on a `FAIL` or `UNKNOWN` task now tells you to use `retry` without it.
26
+ - Retrying a task after you clarify its `prompt.md`, `approach.md` or `qa_threshold` now reviews the same code again against the new brief, instead of refusing it as an identical diff. With an unchanged brief, an identical diff is still refused.
27
+
28
+ ## [0.21] - 2026-11-19
29
+
30
+ Groundwork for native Windows support, plus fixes for macOS with Python 3.9 and for parallel tasks that start at the same moment.
31
+
32
+ ### Highlights
33
+
34
+ - 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.
35
+
36
+ ### Fixed
37
+
38
+ - 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.
39
+ - 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.
40
+ - 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.
41
+ - 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.
42
+ - 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.
43
+
8
44
  ## [0.20] - 2026-11-17
9
45
 
10
46
  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.
package/README.md CHANGED
@@ -65,9 +65,12 @@ git clone https://github.com/Giamme/forge.git ~/.claude/skills/forge
65
65
  bash ~/.claude/skills/forge/scripts/forge-install.sh
66
66
  ```
67
67
 
68
- forge runs on macOS and Linux. It needs bash, git, Python 3.9 or later, and the agent CLIs
69
- you route models through; [the doctor](docs/install.md#check-what-forge-can-reach) shows which
70
- ones it can reach. Foundry's `forge` shares the name: see
68
+ forge runs on macOS, Linux, and Windows (Git Bash + native Python 3.9 or later). It needs bash,
69
+ git, Python 3.9 or later, and the agent CLIs you route models through;
70
+ [the doctor](docs/install.md#check-what-forge-can-reach) shows which ones it can reach. On
71
+ Windows, install Git for Windows alongside Python 3.9+; see [Windows notes](docs/install.md#windows)
72
+ for `FORGE_BASH`, junctions, and platform differences, or run it inside MSYS2 instead, an
73
+ opt-in mode ([MSYS2 mode](docs/install.md#windows-msys2-mode)). Foundry's `forge` shares the name: see
71
74
  [the Foundry note](docs/install.md#from-npm).
72
75
 
73
76
  → [Install and update](docs/install.md)
@@ -188,6 +191,13 @@ python3 ui/tools/demo_runs.py /tmp/forge-demo
188
191
  | [Ripwire and Jev](docs/add-ons.md) | optional repository context and advisory judgments |
189
192
  | [Troubleshooting](docs/troubleshooting.md) | symptoms, causes and fixes |
190
193
  | [Development](docs/development.md) | repository layout, offline checks, runtime measurement |
194
+ | [Contributing](CONTRIBUTING.md) | setting up, running the tests, the rules reviewers check, pull requests |
195
+
196
+ ## Contributing
197
+
198
+ Issues and pull requests are welcome. [CONTRIBUTING.md](CONTRIBUTING.md) covers setting up,
199
+ running the tests and what reviewers look for. Please report security issues privately, as
200
+ [SECURITY.md](SECURITY.md) describes.
191
201
 
192
202
  ## License
193
203
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.20
1
+ 0.22
package/bin/forge.js ADDED
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { spawn } = require('child_process');
7
+
8
+ const root = path.resolve(__dirname, '..');
9
+ const forgeScript = path.join(root, 'forge');
10
+
11
+ function isWindowsBashStub(candidate) {
12
+ const low = candidate.replace(/\//g, '\\').toLowerCase();
13
+ return low.includes('\\system32\\bash.exe') || low.includes('\\syswow64\\bash.exe') || low.includes('\\windowsapps\\');
14
+ }
15
+
16
+ function findBash() {
17
+ if (process.platform !== 'win32') {
18
+ return fs.existsSync('/bin/bash') ? '/bin/bash' : 'bash';
19
+ }
20
+ for (const key of ['FORGE_BASH', 'BASH']) {
21
+ const val = (process.env[key] || '').trim();
22
+ if (val && fs.existsSync(val) && !isWindowsBashStub(val)) {
23
+ return val;
24
+ }
25
+ }
26
+ const candidates = [];
27
+ for (const dir of (process.env.PATH || '').split(path.delimiter)) {
28
+ if (!dir) continue;
29
+ const p = path.join(dir, 'bash.exe');
30
+ if (fs.existsSync(p) && !isWindowsBashStub(p)) {
31
+ candidates.push(p);
32
+ }
33
+ }
34
+ for (const envRoot of [process.env.ProgramFiles, process.env['ProgramFiles(x86)'], process.env.LocalAppData]) {
35
+ if (!envRoot) continue;
36
+ candidates.push(path.join(envRoot, 'Git', 'bin', 'bash.exe'));
37
+ candidates.push(path.join(envRoot, 'Git', 'usr', 'bin', 'bash.exe'));
38
+ candidates.push(path.join(envRoot, 'Programs', 'Git', 'bin', 'bash.exe'));
39
+ }
40
+ candidates.push('C:\\Program Files\\Git\\bin\\bash.exe', 'C:\\Program Files (x86)\\Git\\bin\\bash.exe');
41
+ for (const c of candidates) {
42
+ if (fs.existsSync(c)) {
43
+ return c;
44
+ }
45
+ }
46
+ console.error('forge: Git Bash (bash.exe) not found. Install Git for Windows or set FORGE_BASH.');
47
+ process.exit(127);
48
+ }
49
+
50
+ const bash = findBash();
51
+ const child = spawn(bash, [forgeScript, ...process.argv.slice(2)], {
52
+ stdio: 'inherit',
53
+ windowsHide: false,
54
+ });
55
+
56
+ const handlers = new Map();
57
+ function listen(sig, fn) {
58
+ try {
59
+ process.on(sig, fn);
60
+ handlers.set(sig, fn);
61
+ } catch (_err) {
62
+ // Signal not supported on this platform.
63
+ }
64
+ }
65
+ // Ctrl-C already reaches bash: the terminal sends it to the whole foreground process group, and a
66
+ // Windows console to every process attached to it. Passing it on would deliver it twice on macOS
67
+ // and Linux, and on Windows child.kill() always ends the process at once, before forge can clean
68
+ // up. So node only stays alive through it and leaves it to bash.
69
+ listen('SIGINT', () => {});
70
+ // SIGTERM and SIGHUP can reach node alone (a kill of its pid), so they are passed on.
71
+ for (const sig of ['SIGTERM', 'SIGHUP']) {
72
+ listen(sig, () => {
73
+ try {
74
+ child.kill(sig);
75
+ } catch (_err) {
76
+ // Child may already have exited.
77
+ }
78
+ });
79
+ }
80
+
81
+ function cleanupSignals() {
82
+ for (const [sig, fn] of handlers.entries()) {
83
+ process.removeListener(sig, fn);
84
+ }
85
+ }
86
+
87
+ child.on('error', (err) => {
88
+ cleanupSignals();
89
+ console.error(`forge: failed to launch ${bash}: ${err.message}`);
90
+ process.exit(127);
91
+ });
92
+
93
+ child.on('exit', (code, signal) => {
94
+ cleanupSignals();
95
+ if (signal) {
96
+ try {
97
+ process.kill(process.pid, signal);
98
+ return;
99
+ } catch (_err) {
100
+ process.exit(128);
101
+ }
102
+ }
103
+ process.exit(code == null ? 1 : code);
104
+ });
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
@@ -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. Two CI workflows, neither of which runs the tests: one 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).
60
+ invocation scenarios and verification limits. Three CI workflows: `.github/workflows/test.yml` runs `tests/check.sh` on every pull request (Ubuntu with Python 3.9, and Windows with Git Bash; documentation-only changes skip it) and on every push to `dev` (also the latest 3.x on Ubuntu, 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/install.md CHANGED
@@ -6,10 +6,38 @@ Install forge from npm or a git checkout, check which agent CLIs it can reach, a
6
6
 
7
7
  ## Requirements
8
8
 
9
- forge runs on macOS and Linux. It needs bash, git and Python 3.9 or later, plus the agent
10
- CLIs you route models through; the doctor below shows which ones it finds. Installing from
9
+ forge runs on macOS, Linux, and Windows. It needs bash, git and Python 3.9 or later, plus the
10
+ agent CLIs you route models through; the doctor below shows which ones it finds. Installing from
11
11
  npm brings none of these with it.
12
12
 
13
+ ### Windows
14
+
15
+ On Windows, forge runs natively through Git Bash (`bin/forge.js` for npm, `forge.cmd` for CMD or
16
+ PowerShell) and standard Windows Python 3.9+ (no WSL or MSYS2 Python install is required).
17
+ This is native mode, the default. MSYS2 mode, opt-in, runs forge inside MSYS2 instead:
18
+ see [Windows: MSYS2 mode](#windows-msys2-mode).
19
+
20
+ - **Prerequisites:** [Git for Windows](https://gitforwindows.org/) (provides `git` and Git Bash)
21
+ and native Python 3.9 or later on `PATH` (or discoverable via `py -3`).
22
+ - **`FORGE_BASH`:** If Git Bash lives in a non-standard location, set `FORGE_BASH` to the full
23
+ path of your `bash.exe`; forge ignores Windows `System32\bash.exe` / `WindowsApps` WSL stubs.
24
+ - **`python3` shim:** When `python3` resolves to the Microsoft Store alias, forge writes a
25
+ per-user wrapper in `%LOCALAPPDATA%\forge\bin` (`python3` and `python3.cmd`) pointing at your
26
+ installed `python` or `py -3`.
27
+ - **Known platform differences:**
28
+ - Skill links under `.claude`, `.codex`, and `.openclaude` use NTFS directory junctions
29
+ (`mklink /J`), which do not require Administrator privileges or Developer Mode; Antigravity still
30
+ receives a copied directory, so re-run `forge install` / `forge update` after pulling changes.
31
+ - Process-tree termination (timeouts, Ctrl-C, orphan reaping) uses Win32 Job Objects and
32
+ `TerminateProcess` because Windows lacks POSIX `SIGTERM`/`os.killpg`, so background helpers are
33
+ ended forcefully rather than via a graceful shutdown signal. Because `ProcessJob.attach` runs
34
+ right after `Popen`, a grandchild spawned in the first few milliseconds can escape the job
35
+ (cleanup is best-effort), and killing the scheduler abruptly ends running tasks attached to its
36
+ Job Object rather than leaving them in separate sessions as on macOS/Linux.
37
+ - `O_NOFOLLOW` / `O_DIRECTORY` symlink checks fall back to `os.lstat` (reparse-point) checks
38
+ before open, which is best-effort rather than kernel-atomic, and POSIX `chmod` permission bits
39
+ are not enforced natively on Windows.
40
+
13
41
  ## From npm
14
42
 
15
43
  ```bash
@@ -50,6 +78,67 @@ The installer also offers optional Fractal support in an interactive terminal. D
50
78
  or a Fractal installation failure does not prevent ordinary Forge setup. See
51
79
  [Fractal installation](fractal.md#install-the-optional-runtime) for prerequisites and a separate install.
52
80
 
81
+ ## Windows: MSYS2 mode
82
+
83
+ On Windows forge has two modes. Native mode, the default, runs it in Git Bash with Windows' own
84
+ Python. MSYS2 mode runs it inside [MSYS2](https://www.msys2.org/) instead, where bash, git,
85
+ python3 and ps agree on process IDs, process groups, signals, `flock` and symlinks as they do on
86
+ Linux. MSYS2 mode is opt-in:
87
+
88
+ - Set `FORGE_WIN_MODE=msys2` where forge starts, and start forge from Git Bash as usual: each
89
+ entry script re-runs itself inside MSYS2, and the agent CLIs still get the `PATH` they had in
90
+ Git Bash. For Claude Code, put the variable under `"env"` in `~/.claude/settings.json`; for a
91
+ terminal, in your shell profile.
92
+ - Or start forge from an MSYS2 shell. There it always runs in MSYS2 mode.
93
+
94
+ `FORGE_WIN_MODE` is `native` (the default) or `msys2`; any other value stops forge with an error.
95
+
96
+ To set MSYS2 mode up:
97
+
98
+ 1. Install MSYS2 in `C:\msys64`, or set `FORGE_MSYS2_ROOT` to where it is. In an MSYS2 shell:
99
+
100
+ ```bash
101
+ pacman -Syu
102
+ pacman -S python git procps-ng diffutils
103
+ ```
104
+
105
+ 2. Use Git 2.48 or newer, both MSYS2's and the Git for Windows the agent CLIs use. forge's
106
+ worktrees link back to your repository with relative paths, which marks the repository as
107
+ needing Git 2.48 (`extensions.relativeWorktrees` in its config): older Git, and libgit2- or
108
+ JGit-based tools such as some IDEs, then refuse to open it. forge checks both versions and
109
+ stops with a message when one is older.
110
+ 3. Keep a native Windows Python on the Git Bash `PATH` (`python3`, `python` or `py`): the
111
+ hand-over to MSYS2 goes through it, because two MSYS runtimes cannot pass their environment
112
+ to each other directly.
113
+ 4. Turn on Developer Mode in Windows settings, so MSYS2 can create real symlinks.
114
+ 5. Clone forge where Claude Code reads skills:
115
+
116
+ ```bash
117
+ git clone https://github.com/Giamme/forge.git ~/.claude/skills/forge
118
+ ```
119
+
120
+ MSYS2 mode has only been tried from a git checkout: neither the npm package nor
121
+ `scripts/forge-install.sh` (links into the other harnesses, optional Fractal) has been tried
122
+ in it.
123
+
124
+ What differs in MSYS2 mode:
125
+
126
+ - File modes are not enforced: MSYS2 mounts Windows drives with `noacl`, so files forge writes
127
+ as 0600 (provider keys, settings) are as private as your user profile, no more.
128
+ - A script task's `tasks/<id>/run` counts as executable when it starts with `#!`.
129
+ - `forge watch` raises no desktop notification, and Ripwire has no Windows build.
130
+ - `stop` recognises a harness by its start time, which Cygwin gives to the second for the first
131
+ 24 hours and only to the day after that: past a day, a harness is recognised by the day it
132
+ started.
133
+
134
+ If MSYS2 programs fail at random to start (`0xC0000142`, or `fork: Resource temporarily
135
+ unavailable`), look at Windows' Exploit protection. Cygwin's `fork` rebuilds the parent's memory
136
+ layout in the child, and forced ASLR gets in its way. First exempt MSYS2's own programs: in
137
+ Windows Security, App & browser control, Exploit protection, Program settings, add the programs
138
+ in `C:\msys64\usr\bin` and turn off "Force randomization for images (Mandatory ASLR)" and
139
+ "Randomize memory allocations (Bottom-up ASLR)" for them. Change those settings system-wide only
140
+ as a last resort: that weakens every program on the machine.
141
+
53
142
  ## Check what forge can reach
54
143
 
55
144
  `<forge>` is your checkout, or `"$(npm root -g)/@giamme/forge"` for an npm install:
package/docs/reviews.md CHANGED
@@ -78,10 +78,12 @@ Two things it deliberately does:
78
78
  - **Reviews the task's cumulative diff**, against the commit the task was originally branched
79
79
  from — not just the fix. Reviewing the fix alone would let the first attempt's code through
80
80
  unread.
81
- - **Refuses to re-review identical code.** If the retry produces a byte-identical diff, the
82
- task fails again without spending a QA dispatch. A retry that only rejects the findings,
83
- and leaves that diff unchanged, is still this identical retry: it writes
84
- `tasks/<id>/noretry` and QA is not dispatched.
81
+ - **Refuses to re-review identical code.** If the retry produces a byte-identical diff
82
+ against an unchanged brief, the task fails again without spending a QA dispatch. A retry that
83
+ only rejects the findings, and leaves both the diff and the brief unchanged, writes
84
+ `tasks/<id>/noretry` and QA is not dispatched. Clarifying `tasks/<id>/prompt.md` or
85
+ `approach.md` (or changing `qa_threshold`) before retrying lets QA re-review even unchanged code
86
+ against the updated brief.
85
87
 
86
88
  When the diff did change, QA on that retry is handed the previous round as well as the
87
89
  cumulative diff. The report goes under **Findings from the previous review round**. The
@@ -38,7 +38,7 @@ Symptoms, causes and fixes, from a skill a harness cannot see to a task that wil
38
38
  | every wave has exactly one task | `files` sets overlap across most tasks; the decomposition isn't actually parallel |
39
39
  | dwarves reimplement already-merged work | `goal.txt` or `files` missing, so the capsule carries no useful status |
40
40
  | several tasks report "produced no changes" | the decomposition made tasks that weren't independently actionable — use a coarser `--decompose-level`, not more retries |
41
- | `retry` says "produced no new changes" | the dwarf returned a byte-identical diff, so no reviewer was paid to read the same code twice. Escalate with `--dwarf`, or fix the prompt |
41
+ | `retry` says "produced no new changes" | the dwarf returned a byte-identical diff against the same brief, so no reviewer was paid to read the same code twice. Escalate with `--dwarf`, or clarify `prompt.md` / `approach.md` (an updated brief re-reviews even unchanged code) |
42
42
  | a new file's code never reached QA | fixed: untracked files are diffed against `/dev/null`. A hand-built capture using only `git status --porcelain` shows the reviewer a filename and no content |
43
43
  | claude dwarf ends "I need your permission to edit" | a permission mode that prompts for Edit. forge uses `acceptEdits` plus an explicit Bash allowance, because `auto` allows shell but prompts for Edit, and `acceptEdits` alone allows Edit but prompts for real shell commands |
44
44
  | `.forge/` turns up in a review | a diff capture is missing `':(exclude).forge'` |
package/forge CHANGED
@@ -11,6 +11,10 @@ while [ -L "$SELF" ]; do
11
11
  esac
12
12
  done
13
13
  ROOT="$(cd -P "$(dirname "$SELF")" && pwd)"
14
+ # Windows: re-run inside MSYS2 when started from Git Bash (no-op elsewhere).
15
+ . "$ROOT/scripts/forge-win.sh"
16
+ source "$ROOT/scripts/forge-lib-env.sh"
17
+ forge_ensure_python3
14
18
 
15
19
  usage() {
16
20
  printf '%s\n' \
package/forge.cmd ADDED
@@ -0,0 +1,56 @@
1
+ @echo off
2
+ setlocal EnableExtensions
3
+ set "FORGE_SCRIPT=%~dp0forge"
4
+
5
+ if defined FORGE_BASH (
6
+ if exist "%FORGE_BASH%" (
7
+ set "BASH_EXE=%FORGE_BASH%"
8
+ goto :run
9
+ )
10
+ )
11
+
12
+ for %%P in (
13
+ "%ProgramFiles%\Git\bin\bash.exe"
14
+ "%ProgramFiles(x86)%\Git\bin\bash.exe"
15
+ "%LocalAppData%\Programs\Git\bin\bash.exe"
16
+ ) do (
17
+ if exist "%%~P" (
18
+ set "BASH_EXE=%%~P"
19
+ goto :run
20
+ )
21
+ )
22
+
23
+ for %%I in (bash.exe) do (
24
+ if not "%%~$PATH:I"=="" call :check_bash "%%~$PATH:I" && goto :run
25
+ )
26
+
27
+ for %%I in (git.exe) do (
28
+ if not "%%~$PATH:I"=="" (
29
+ if exist "%%~dp$PATH:I..\bin\bash.exe" (
30
+ set "BASH_EXE=%%~dp$PATH:I..\bin\bash.exe"
31
+ goto :run
32
+ )
33
+ if exist "%%~dp$PATH:I..\usr\bin\bash.exe" (
34
+ set "BASH_EXE=%%~dp$PATH:I..\usr\bin\bash.exe"
35
+ goto :run
36
+ )
37
+ )
38
+ )
39
+
40
+ echo forge: Git Bash not found. Install Git for Windows or set FORGE_BASH. 1>&2
41
+ exit /b 127
42
+
43
+ :check_bash
44
+ set "CAND=%~1"
45
+ set "TEST=%CAND:\System32\bash.exe=%"
46
+ if not "%TEST%"=="%CAND%" exit /b 1
47
+ set "TEST=%CAND:\SysWOW64\bash.exe=%"
48
+ if not "%TEST%"=="%CAND%" exit /b 1
49
+ set "TEST=%CAND:\WindowsApps\=%"
50
+ if not "%TEST%"=="%CAND%" exit /b 1
51
+ set "BASH_EXE=%CAND%"
52
+ exit /b 0
53
+
54
+ :run
55
+ "%BASH_EXE%" "%FORGE_SCRIPT%" %*
56
+ exit /b %ERRORLEVEL%
package/package.json CHANGED
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "name": "@giamme/forge",
3
- "version": "0.20.0",
3
+ "version": "0.22.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",
7
7
  "author": "Giamme",
8
8
  "repository": { "type": "git", "url": "git+https://github.com/Giamme/forge.git" },
9
9
  "homepage": "https://giamme.github.io/forge/",
10
- "bin": { "forge": "forge" },
11
- "os": ["darwin", "linux"],
10
+ "bin": { "forge": "bin/forge.js" },
11
+ "os": ["darwin", "linux", "win32"],
12
12
  "files": [
13
13
  "forge",
14
+ "forge.cmd",
15
+ "bin/",
14
16
  "SKILL.md",
15
17
  "VERSION",
16
18
  "CHANGELOG.md",
@@ -102,7 +102,11 @@ forge_review_deps() { # source checkout, review snapshot, note file (#117)
102
102
  if [ -n "$src" ]; then
103
103
  while IFS= read -r rel; do
104
104
  [ -n "$rel" ] && [ -d "$src/$rel" ] && [ ! -e "$2/$rel" ] && [ ! -L "$2/$rel" ] || continue
105
- ln -s "$src/$rel" "$2/$rel" 2>/dev/null || continue
105
+ if declare -F forge_link_dir >/dev/null 2>&1; then
106
+ forge_link_dir "$src/$rel" "$2/$rel" 2>/dev/null || continue
107
+ else
108
+ ln -s "$src/$rel" "$2/$rel" 2>/dev/null || continue
109
+ fi
106
110
  mkdir -p "$2/.git/info" && echo "/$rel" >> "$2/.git/info/exclude"
107
111
  linked="$linked${linked:+, }$rel"
108
112
  done <<< "$(_forge_dep_dirs "$src" | sort)"
@@ -64,6 +64,7 @@ import sys
64
64
  SKILL = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
65
65
  sys.path.insert(0, os.path.join(SKILL, 'scripts'))
66
66
 
67
+ import forge_posix # noqa: E402
67
68
  from forge_decide import GATES, MODES, load_repo, load_user, save_repo, save_user, user_path
68
69
  from forge_decide import profiles
69
70
  from forge_decide.migrate import run as migrate_run
@@ -153,8 +154,8 @@ def read_small(path):
153
154
  if st.st_size >= CONTENT_MAX:
154
155
  return None, 'larger than 64 KiB'
155
156
  try:
156
- flags = os.O_RDONLY | os.O_NOFOLLOW | getattr(os, 'O_NONBLOCK', 0)
157
- with os.fdopen(os.open(path, flags), 'rb') as handle:
157
+ flags = os.O_RDONLY | forge_posix.O_NOFOLLOW | forge_posix.O_NONBLOCK
158
+ with os.fdopen(forge_posix.open_nofollow(path, flags), 'rb') as handle:
158
159
  data = handle.read(CONTENT_MAX + 1)
159
160
  except OSError as err:
160
161
  return None, 'unreadable: %s' % err.strerror
@@ -170,7 +171,7 @@ def open_forge_dir(d):
170
171
  except FileExistsError:
171
172
  pass
172
173
  try:
173
- return os.open(d, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW)
174
+ return forge_posix.open_dir(d, nofollow=True)
174
175
  except OSError as err:
175
176
  raise Invalid('%s must be a real directory, not a symlink or file (%s)' % (d, err.strerror))
176
177
 
@@ -180,21 +181,21 @@ def atomic_write(d, target, text):
180
181
  name = os.path.basename(target)
181
182
  tmp = '.%s.%d.tmp' % (name, os.getpid())
182
183
  try:
183
- fd = os.open(tmp, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644, dir_fd=dfd)
184
+ fd = forge_posix.open_at(dfd, tmp, os.O_WRONLY | os.O_CREAT | os.O_EXCL | forge_posix.O_NOFOLLOW, 0o644)
184
185
  try:
185
186
  with os.fdopen(fd, 'w') as handle:
186
187
  handle.write(text)
187
188
  handle.flush()
188
189
  os.fsync(handle.fileno())
189
- os.replace(tmp, name, src_dir_fd=dfd, dst_dir_fd=dfd)
190
+ forge_posix.replace_at(dfd, tmp, name)
190
191
  except BaseException:
191
192
  try:
192
- os.unlink(tmp, dir_fd=dfd)
193
+ forge_posix.unlink_at(dfd, tmp)
193
194
  except OSError:
194
195
  pass
195
196
  raise
196
197
  finally:
197
- os.close(dfd)
198
+ forge_posix.close_dir(dfd)
198
199
 
199
200
 
200
201
  # ------------------------------------------------------------------------------------------ show
@@ -533,9 +534,9 @@ def cmd_unset(args):
533
534
  if d and os.path.lexists(target):
534
535
  dfd = open_forge_dir(d)
535
536
  try:
536
- os.unlink(os.path.basename(target), dir_fd=dfd)
537
+ forge_posix.unlink_at(dfd, os.path.basename(target))
537
538
  finally:
538
- os.close(dfd)
539
+ forge_posix.close_dir(dfd)
539
540
  emit(args, args.key, previous, None)
540
541
  return 0
541
542