@giamme/forge 0.21.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 (42) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +6 -3
  3. package/VERSION +1 -1
  4. package/bin/forge.js +104 -0
  5. package/docs/development.md +1 -1
  6. package/docs/install.md +91 -2
  7. package/docs/reviews.md +6 -4
  8. package/docs/troubleshooting.md +1 -1
  9. package/forge +4 -0
  10. package/forge.cmd +56 -0
  11. package/package.json +5 -3
  12. package/scripts/forge-artifact.sh +5 -1
  13. package/scripts/forge-control.py +10 -3
  14. package/scripts/forge-dispatch.sh +108 -31
  15. package/scripts/forge-guard.py +137 -6
  16. package/scripts/forge-install.sh +82 -9
  17. package/scripts/forge-lib-env.sh +158 -0
  18. package/scripts/forge-lib-group.sh +5 -5
  19. package/scripts/forge-lib-plans.sh +8 -3
  20. package/scripts/forge-lib-task.sh +40 -15
  21. package/scripts/forge-memory.sh +2 -0
  22. package/scripts/forge-metrics.sh +6 -1
  23. package/scripts/forge-parallel.sh +156 -43
  24. package/scripts/forge-runtime.py +2 -2
  25. package/scripts/forge-schedule.py +18 -1
  26. package/scripts/forge-solo.sh +6 -2
  27. package/scripts/forge-sweep.py +1 -1
  28. package/scripts/forge-update.sh +6 -1
  29. package/scripts/forge-verify.py +1 -0
  30. package/scripts/forge-win.sh +156 -0
  31. package/scripts/forge_brief/__init__.py +6 -1
  32. package/scripts/forge_brief/proposals.py +6 -1
  33. package/scripts/forge_decide/budget.py +12 -7
  34. package/scripts/forge_decide/replay.py +9 -4
  35. package/scripts/forge_flock.py +17 -2
  36. package/scripts/forge_posix.py +17 -0
  37. package/scripts/forge_proc.py +108 -0
  38. package/scripts/forge_registry.py +2 -2
  39. package/scripts/forge_side/__init__.py +13 -4
  40. package/ui/forge_ui/control.py +7 -2
  41. package/ui/forge_ui/reader.py +6 -1
  42. package/ui/forge_ui/static/scene3d.js +23 -2
package/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ 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
+
8
28
  ## [0.21] - 2026-11-19
9
29
 
10
30
  Groundwork for native Windows support, plus fixes for macOS with Python 3.9 and for parallel tasks that start at the same moment.
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)
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.21
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
+ });
@@ -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. 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).
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.21.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)"
@@ -914,7 +914,10 @@ def decision_of(plan, args, dwarf):
914
914
  status = task_status(plan, args.task, strict=True)
915
915
  if status != 'NEEDS_DECISION':
916
916
  if args.decide is not None:
917
- raise Refused(f'task {args.task} is {status}, not waiting for a decision: --decide only decides a NEEDS_DECISION task')
917
+ hint = ' (retry without --decide)' if status in (
918
+ 'FAIL', 'UNKNOWN', 'ERROR', 'TIMEOUT', 'INTERRUPTED', 'INVALIDATED', 'CONFLICT',
919
+ ) else ''
920
+ raise Refused(f'task {args.task} is {status}, not waiting for a decision: --decide only decides a NEEDS_DECISION task{hint}')
918
921
  return None
919
922
  if args.decide is None and dwarf is None:
920
923
  head = ' '.join(line.strip() for line in (read_file(plan, f'tasks/{args.task}/decision.md') or '').splitlines()[:3]
@@ -995,8 +998,12 @@ def retry_prepared(args, plan, answer):
995
998
  try:
996
999
  with os.fdopen(fd, 'w', encoding='utf-8') as handle:
997
1000
  handle.write(answer + '\n')
998
- command = ['bash', os.path.join(SKILL, 'scripts', 'forge-parallel.sh'), 'retry', plan, args.task,
999
- '--answer-file', tmp, '--no-dispatch']
1001
+ script = os.path.join(SKILL, 'scripts', 'forge-parallel.sh')
1002
+ if forge_proc.IS_WINDOWS:
1003
+ base = forge_proc.bash_cmd(script)
1004
+ else:
1005
+ base = ['bash', script]
1006
+ command = base + ['retry', plan, args.task, '--answer-file', tmp, '--no-dispatch']
1000
1007
  if args.json: # stdout is the JSON: the command's own words go to stderr
1001
1008
  done = subprocess.run(command, stdin=subprocess.DEVNULL, capture_output=True, text=True)
1002
1009
  sys.stderr.write(done.stdout + done.stderr)