v1.91.106.0 fix: the 2026-10-15 issue wave (#3209)

* docs(designs): add fix wave 2026-10-15 plan (revision 3, approved)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(cso): invoke docker as argv0 docker so OrbStack's multicall binary dispatches

executable() returns the canonical path, and OrbStack installs docker as a
symlink to docker-tools, which dispatches on argv[0] and exits 127 with
'unsupported argv0 "docker-tools"'. Every Docker call failed, so doctor
reported local-docker-isolation and every scanner missing and setup could
not preload the qualified images.

runProcess takes an argv0 option; docker.ts routes every Docker call
through runDocker, which passes 'docker'. The native watchdog's execve
calls pass "docker" as argv[0] too, so its container cleanup works on the
same installs. The executed file is still the verified canonical path.

Fixes #3187

* test(cso): cover Docker and watchdog invocation through a multicall binary

A compiled fake that refuses any argv[0] but docker stands in for
OrbStack's docker-tools. Both behavior tests fail on the previous code.

Refs #3187

* fix(cso): bound the argv0 test's socket helper and probe images through OrbStack's multicall docker (#3187)

Follow-up to #3188 by Bryan Stone (@aegixx):
- the python3 spawnSync that binds the fake daemon socket gets a 30 s
  timeout; without it test/spawnsync-timeout-tripwire.test.ts fails.
- reviewer test: dockerExactImagePresent, a production probe, admits an
  image when the endpoint's canonical executable is a multicall binary
  that refuses any argv0 other than "docker". It fails on 47d639a
  (returns false) and passes with #3188.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(autoplan): own the conversation after a Claude Code 2.1.300 compaction

Claude Code 2.1.300 keeps a compaction's last records in place and lists
them in compactMetadata.preservedMessages. The segment's tail, which is
also the boundary's logicalParentUuid, is written after the boundary
under the compact summary, so the parent links form a cycle that the
owned causal order never reaches. Every record after the compaction was
dropped, and the publication guard denied each later phase entry with
close_incomplete.

Such a boundary now continues from the last preserved record that is a
node of the file and not its own descendant. Boundaries without that
metadata, with a foreign preserved uuid, or with nothing kept in place
still supply no ownership.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(autoplan): report a compaction-explained unreachable component as unrecognized_shape (#3194)

Follow-up to #3196 by vilano93. After the ownership walk, an owned node
the walk never reached was silently dropped, and the phase guard answered
the next phase entry with close_incomplete, which the user cannot satisfy.
When the unreachable node's ancestry ends in a cycle through a compact
boundary's logical parent, ownedCausalOrder now returns
unrecognized_shape:compaction_unreachable, the guard's existing
unverified disposition (allow with a visible warning and a guard-log
row). Orphans whose ancestor is missing (not flushed yet) and other roots
keep today's behaviour, so the fail-open surface does not widen beyond
compaction. Each node is walked once.

Gate-integrity edit: a close_incomplete denial becomes an unverified
allow for that shape only. Negative controls kept: the existing guard,
hook, guard-reasons and captured-fixture tests still deny (356 pass), and
a new case with the boundary not yet flushed still denies close_incomplete.

Intentional pin changes in #3196's own test file: the three "fails
closed" cases (tail-only segment, missing preserved metadata, foreign
preserved uuid) and the "without compactMetadata" case now expect
unrecognized_shape:compaction_unreachable instead of close_incomplete or
a silently cut transcript.

Reviewer tests: three compactions in one session stay owned and pass the
next phase entry; a 50k-record history with three compactions is decided
in ~300 ms (budget 1000 ms), so descends needs no memo.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* feat(lib): one echo sanitizer for external strings, with a Bash twin

lib/sanitize-echo.ts and bin/gstack-sanitize-echo.sh flatten CR/LF/TAB to
spaces, remove every other ASCII control byte (ESC included) and DEL,
collapse runs of spaces, and cap the result at 200 bytes of valid UTF-8
with no leading or trailing space. Every external string gstack echoes
into a message, a log line or a key=value state file goes through it
(fix wave 2026-10-15, plan rev 3 DX F8). test/sanitize-echo.test.ts runs
both twins on one table under bash, bash --posix and zsh, including a
"\nstages=" injection, ESC sequences and UTF-8 characters cut by the cap.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(bun-version): judge the Bun floor under zsh and hold on an unreadable version (#3195)

Reported by mochafreddo. _gstack_bun_below word-split $_gb_core, which
zsh does not do: `[ -ne ]` errored and every error path read as "not
below", so /gstack-upgrade Step 4 accepted Bun 1.3.2 in a zsh tool shell.

- _gstack_bun_below copies the release's parsed fields into quoted
  positional parameters and compares with $((10#...)); no new _gb_*
  globals. It returns 2 when either side cannot be parsed.
- gstack_bun_status prints malformed for an unparseable version or floor
  (never ok); gstack_bun_incoming_hold holds on it with
  bun-version-unreadable: ... (BUN_VERSION_UNREADABLE), the bun path and
  its output passed through gstack_sanitize_echo. setup's own malformed
  warning is unchanged.
- /gstack-upgrade Step 4 runs the check through `bash -c` and stops on
  BUN_VERSION_UNREADABLE with a reinstall fix (never "bun upgrade").
- New result code BUN_VERSION_UNREADABLE with its troubleshooting entry;
  bin/gstack-doctor-components.sh regenerated from the table.

test/bun-version-shells.test.ts: one version table (1.3.2,
1.3.3-canary.1, 1.3.3, 1.3.14, 1.4.2, 1.10.0, 01.04.02, 2.0.0, garbage)
drives bash, bash --posix, zsh and the TypeScript twin's below();
`zsh -c '. bin/gstack-bun-version.sh; gstack_bun_status 1.3.2'` printed
ok on 47d639a and prints too-old now.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* style(cso): format #3188's runDocker call so format:cso:check passes (#3187)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(cso): keep scanner JSON reports parseable after redaction (#3185)

Reported in #3185. The scanner path splices redactions into raw JSON, and
redactFindingSpans replaced a bare 10+ digit number
("max_memory_bytes":1145427776, an epoch) with an unquoted marker, so
JSON.parse failed and every non-trivial Semgrep run was INVALID_OUTPUT.

- lib/redact-engine.ts: redactJsonFindingSpans, a string- and
  escape-aware lexical tokenizer over one or more top-level values
  (NDJSON included). A span inside a number replaces that whole token
  (-, fraction, exponent) with the quoted marker, number by number; a
  span inside a string keeps the in-string marker, widened to whole
  escapes; a span touching several tokens, whitespace, a literal or a
  structural character returns null (withhold). Non-JSON text gets the
  plain splice. redactFindingSpans is unchanged for every other caller.
- The scan operation's declared format rides the real capture path:
  scanner-executor (scan stdout, or the report file read for outputPath
  plans) -> DockerGroup.execCapture -> runProcess -> spliceRedaction,
  which redacts the concatenated stdout once and maps each interleaved
  run onto it. Version probes and stderr stay plain; marker-only
  withholding and the cross-stream views check are kept, and the output
  is a fixpoint of that check.

Behavior change: a redacted number in a scanner report is now the string
"<REDACTED-...>" instead of an unquoted marker; non-JSON streams keep the
unquoted form (test/cso-eval.test.ts unchanged).

Intentional pin change: test/cso-scanner-release.test.ts pinned the
report read as capture(['/bin/cat', plan.outputPath]); it now pins
capture(['/bin/cat', plan.outputPath], plan.format), so the read also
carries the declared JSON format (stricter, not weaker).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(browse): recover when the last tab is closed outside the CLI

Closing the last tab outside browse (for example, closing the headed
Chromium window) left the daemon wedged: the page 'close' handler removed
the tab and set activeTabId to 0, and executeCommand called
getActiveSession() first, so every later command (goto, status, even stop)
failed with "No active page" until the daemon PID was killed by hand.

closeTab() already opens a blank tab when the last tab closes; the external
close path never did. Add BrowserManager.ensureActiveTab(), which reselects
a remaining tab or opens one blank tab (concurrent callers share one
recovery), and call it before resolving the active session in
executeCommand.

Fixes #3167

* fix(browse): status and stop answer after an external close; recovery says what it did (#3167)

Follow-up to #3179 by aftabkh4n, which reopens a tab on demand.
- BrowserManager.ensureCommandTab runs before every command: status,
  stop and restart never open a tab, so a daemon whose browser or context
  is gone can still report and be stopped; any other command gets an
  active tab. A failed recovery is BROWSE_TAB_UNRECOVERABLE carrying the
  restart command (cause passed through sanitizeEcho), and a command that
  ran on a newly opened tab prints a one-line warning first.
- server.ts reads the session inside the read and write branches instead
  of before dispatch (2223 lines, cap 2224) and exposes browserManager
  and handleCommandInternal on __testInternals__ for the dispatch test.
- meta-commands.ts: handleMetaCommand no longer reads the active session
  before its switch (only snapshot and resume used it), and status prints
  getCurrentUrl() so it works with zero tabs. This file is outside the
  lane's listed ownership; no other lane or #3190 touches browse/.
- New result code BROWSE_TAB_UNRECOVERABLE and troubleshooting entries
  for it and for the old "No active page" wedge.

Reviewer test browse/test/tab-external-close-dispatch.test.ts drives the
real dispatch in a child process: status, text, goto and stop after an
external close, and the closed-context case. On 47d639a (with only the
test seam added) all five fail with "No active page".

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(troubleshooting): /cso INVALID_OUTPUT on Semgrep reports and OrbStack's argv0 refusal (#3185, #3187)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(session-update): name the reinstall fix when an unreadable Bun holds the auto-update (#3195)

Item 11 makes every caller of gstack_bun_incoming_hold treat a Bun
version it cannot read as a hold (bun-version-unreadable,
BUN_VERSION_UNREADABLE). The session-start banner only knew
bun-too-old, so the new reason fell through to "git pull did not
finish ... gstack is not updating" with a pull-and-setup fix that does
not help.

- bin/gstack-session-update: a bun-version-unreadable banner case with
  the reinstall fix and the troubleshooting anchor; the comment that
  said a malformed version passes is corrected.

Intentional pin change: test/session-update-stages.test.ts "supported
or unparseable Bun (bun-dev (local build)) proceeds: setup decides" is
split. 1.3.14 still proceeds; bun-dev (local build) now holds with
BUN_VERSION_UNREADABLE, leaves the checkout and setup untouched, and
the banner names the reinstall fix. The fixture installs
bin/gstack-sanitize-echo.sh beside the floor helper, as a real install
of this release does. The new case fails on 47d639a.

Ownership exception granted by the coordinator for Lane A
(bin/gstack-session-update is Lane B's file; PR 1b stacks on 1a).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(session-update): recover a conflicting autostash by its unmerged files

The auto-updater fast-forwards with `merge --ff-only --autostash`. When
the carried-over local edits conflict with the incoming revision, git
2.56 still exits 0 from that merge, pops the edits with conflict markers
into the live checkout, and keeps the stash entry. The recovery only ran
on a non-zero exit with "autostash" in stderr, so on git 2.56 it never
ran: the updater logged UPDATED and ran setup over a half-merged tree,
in the directory Claude Code runs hooks from. When it did run, it had two
more problems:
- `git checkout -- .` refuses unmerged paths ("error: path 'f' is
  unmerged", exit 1), so it left the markers in place anyway.
- `git stash drop` dropped stash@{0}, whatever that was. refs/stash is
  shared with every worktree of the repository, and when
  refs/stash.lock is held git cannot store the autostash at all, so the
  top entry can be someone else's.

Now the merge is judged by `git ls-files -u`, whatever its exit code.
On unmerged files after the fast-forward, autostash_recover finds the
autostash commit by the id git prints ("cannot store <id>" first, then
"Created autostash: <id>", with the merge run under LC_ALL=C and
core.abbrev=40). A moved refs/stash is only the fallback. When that id
is not a stash entry, it is anchored under refs/gstack-autostash/<UTC>.
The tree is reset to the fast-forwarded revision, which the hook check
already passed, and the stash is kept. The log line is
AUTOSTASH_CONFLICT_RECOVERED tree_reset=1 kept_stash=<id> kept_ref=<ref>.
The update then continues, so the regenerable patches are re-rendered
and setup runs as for any other move. If the commit cannot be found,
nothing is reset: the markers stay for a person, the run logs
PULL_FAILED, and setup does not run.

Files that are already unmerged before the update, from someone's own
merge, rebase or stash pop, now hold the update with PULL_FAILED
"unmerged files ...". Without that check, the recovery would take them
for its own and reset them away.

core.abbrev=40, not "no": "no" is accepted from git 2.31.0 (its release
notes), and `merge --autostash` exists from 2.27.0, so "no" would fail
every update on git 2.27-2.30.

Files:
- bin/gstack-session-update: autostash_recover, the unmerged-files check
  before the merge, the C-locale merge with its stdout kept for the id,
  and removal of the old grep-and-drop block.
- test/session-update-autostash.test.ts: 7 cases in a new describe block.
  A conflicting pop leaves no markers, keeps the edits and still runs
  setup. A user's own stash entry survives. A held refs/stash.lock gets
  the edits anchored. With a git whose merge prints nothing, a moved
  refs/stash still finds the edits; with the lock held as well, nothing
  is reset. Pre-existing unmerged files hold the checkout. A
  non-conflicting edit rides over the update (control).

Tests, on upstream 15ebd85cd:
- 5 of the 7 new cases fail against the previous session-update; the
  unmerged-files guard and the control pass on both.
- Two mutants are each caught by one new case: dropping the refs/stash
  fallback, and resetting when the edits cannot be found.
- session-update-autostash, session-update-stages,
  session-update-hook-hold and team-mode pass 63/0 with
  `--timeout 60000`. At bun's 5 s default under heavy load (one
  reading: load average 169), the three shared files timed out 8 tests
  on this branch and 17 with the previous script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(session-update): trust only git's autostash id; owe setup on a stop

An independent review of the autostash recovery (Codex gpt-6-astra,
high effort, verdict BLOCK high=1 med=2) found three defects on its rare
paths. All three are fixed here, each with a case that failed first.

- [high] The refs/stash fallback could erase local edits. When git's
  messages were unavailable, recovery took any change to refs/stash as
  its own autostash. refs/stash is shared with every worktree: if a
  sibling pushed a stash while refs/stash.lock kept git from storing
  this one, recovery took the sibling's entry and reset the checkout,
  erasing edits nothing held. Now only git's own printed id counts. A
  missing id resets nothing: the markers stay, the run logs
  PULL_FAILED. Recovery needs git's messages, so when the temp file for
  them cannot be created the update is held before the merge
  (HELD temp-file-unavailable), not merged blind.
- [med] A stop after the checkout moved lost the setup it owed. The
  failure recorded only the pull reason. Once the person resolved the
  conflict, the next check saw an unchanged HEAD and no pending stage,
  logged UP_TO_DATE, and never set up the new revision. Now a failure
  after HEAD moved records `setup` as a pending stage, retried at once.
  The unmerged-files check holds it until the conflict is resolved, and
  the pull reason is the stage's reason, so the session-start line says
  what to resolve.
- [med] An unreadable index read as "no conflicts". Both `git ls-files
  -u` checks discarded the exit status, so a failed read after a
  conflicting pop (which git exits 0 for) let setup run over the markers.
  Now a failed read stops the update with PULL_FAILED "cannot read the
  index", before the merge or after it.

Files:
- bin/gstack-session-update: autostash_recover drops the refs/stash
  fallback (and STASH_BEFORE). The temp-file hold. The ls-files exit
  status checked at both points. The pending setup stage on a failure
  after HEAD moved.
- test/session-update-autostash.test.ts: a shim(fx, name, tool, body)
  helper; the fallback case now expects a refusal; the refusal case runs
  on through resolution to setup; three new cases (unreadable index
  before and after the merge, no temp file for git's messages).

Tests, on upstream 15ebd85cd:
- The 5 changed or new cases failed on the previous commit, each on its
  defect: refs/stash trusted and recovered; UP_TO_DATE with no setup
  after resolution; UPDATED over an unreadable index, before and after
  the merge; a blind merge with no temp file.
- Against upstream's own session-update, 8 of the block's 10 cases fail.
- session-update-autostash, session-update-stages,
  session-update-hook-hold and team-mode pass 66/0 with
  `--timeout 90000`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(session-update): reap heartbeat and its sleeper on exit

The lock heartbeat subshell left its sleep 300 child orphaned when the
updater exited, so heartbeats accumulated across sessions. Track and
reap the heartbeat job (with a job-table fallback for signals between
fork and $!), give the subshell its own exit trap that kills and waits
its sleeper, and map HUP/INT/TERM to exits so the EXIT trap always runs.
Adds a fixture-driven regression test.

* test(session-update): repin the lock trap and heartbeat to #3191's cleanup shape

Intentional pin change: test/session-update-autostash.test.ts 'reclaim is
TOCTOU-safe' and 'EXIT trap is ownership-checked' pinned the one-line
EXIT trap and the 'while :; do sleep 300; ...' loop that #3191 (Jess
Sullivan) replaces with cleanup_session_update and a 'sleep 300 & wait'
heartbeat. The pins still assert the ownership-checked rm -rf, the EXIT
trap, MYPID, and that the heartbeat is killed.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(session-update): move installs only through gstack-ff-update; extract hooks without tar (#3184)

Item 2 (#3189, #3191 adopted in the previous commits) and item 3 of the
fix-wave plan.

bin/gstack-ff-update <dir> <rev> is now the only code that moves an
install's tree. Inside an install-scoped lock (absolute git common dir,
the updater's TTL and mv-aside reap, a heartbeat reaped on exit) it
captures the working tree and the staged state through private indexes,
carries edits that merge cleanly (as an autostash pop would), lets the
regenerable SKILL.md/sections footprint take the target when it
conflicts, and shelves any other conflicting edit, staged change or
unmerged file into refs/gstack/rescue/<oid> (first parent the pre-update
HEAD, second the staged state; compare-and-create; gstack rescue
identity). The move is a two-way read-tree on the private index, so a
late edit or an untracked file in the way refuses with
autostash-unrecoverable and changes nothing. It sources nothing so the
held-install recovery can fetch it from the new revision.

gstack-session-update calls it instead of merge --autostash, holds a
checkout with unmerged files (unmerged-files:), and names shelved edits
at session start at most once a day with inspect, export-the-delta and
delete commands. The incoming revision is extracted for the hook check
through a private index and checkout-index with core.symlinks=false,
never tar (MSYS tar cannot create connect-chrome before its target), and
the held reason carries the failing command's flattened, control-free
stderr. Held lines print before the stage line, one case per reason
with its anchor, every path shell-quoted, no setup fix while unmerged
files exist. docs/troubleshooting.md gains the held-install recovery
forms (Git Bash, PowerShell 5.1, trial and go-back) and entries for each
new line.

design: kept_ref is refs/gstack/rescue/<oid>, refs/stash is never
touched, the quiet-merge cases become a pre-existing-ref refusal and its
recovery, pre-existing unmerged files are a HELD unmerged-files, and the
git shim pins the real binary through git --exec-path.

Intentional pin changes in existing tests:
- test/session-update-stages.test.ts: printed paths are shell-quoted;
  the bun-too-old fix runs gstack-ff-update instead of git pull.
- test/session-update-hook-hold.test.ts: the order pin looks for
  'bash "$FF_UPDATE"' instead of 'merge --ff-only'; the
  hook-check-unavailable fix no longer recommends git pull --autostash;
  installedUpdater copies gstack-ff-update beside the updater.

Reported by wengweiling (#3184).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(gstack-upgrade): Step 4 fast-forwards through gstack-ff-update (#3189)

Item 2 of the fix-wave plan, kept in its own commit so PR 1b can be
rebased onto PR 1a (which edits only Step 4's Bun floor-check line).

Step 4's `git pull --ff-only --autostash` had the same hole the
auto-updater had: a conflicting autostash exits 0 and leaves conflict
markers in the install, and the skill printed FF_OK. It now runs
bin/gstack-ff-update . origin/main after the fetch and the floor check:
exit 0 runs setup (a rescued line is relayed with its inspect, export
and delete commands), exit 4 (not a fast-forward) is the only way into
the gated reset fallback, and any other refusal stops with nothing
changed. The footprint discard moves to the reset fallback, ahead of
its stash, where the warning text already promised it.

Intentional pin changes:
- test/upgrade-template-pins.test.ts: the ff-before-reset pin looks for
  'bash bin/gstack-ff-update . origin/main'.
- test/gstack-upgrade-fresh-shell.test.ts: the C9 fence marker is
  'bash bin/gstack-ff-update'; the gstack-like fixture ships the bin.
- test/upgrade-setup-recovery.test.ts: the git-path fixtures ship
  gstack-ff-update (a stub where git itself is a stub).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(setup.ps1): run under Windows PowerShell 5.1's legacy argument passing (#3130)

Item 4 of the fix-wave plan. Windows PowerShell 5.1 strips the double
quotes inside native arguments, so the bash -c script setup.ps1 handed
Git Bash arrived broken ("unexpected EOF while looking for matching").
The script now holds no double quote: `set -f; IFS=; mapfile -d '' -t
argv < $1; rm -f -- $1; exec ./setup ${argv[@]}` (empty IFS and no
globbing keep $1 and each argv entry whole). That form drops an empty
argument, so setup.ps1 refuses one before anything runs
(SETUP_PS1_EMPTY_ARGUMENT, with its troubleshooting entry).

test/setup-ps1.test.ts runs the adversarial arguments under legacy
passing (pwsh with $PSNativeCommandArgumentPassing = 'Legacy', and
powershell.exe itself on Windows) with a space in TMPDIR, plus the
empty-argument refusal. Intentional pin change: the pinned bash -c
line in "passes arguments NUL-separated through a private file to a
constant bash script" now names the quote-free script and asserts it
holds no double quote.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(setup): register hooks at the $HOME path when CLAUDE_CONFIG_DIR links back to it

A per-session CLAUDE_CONFIG_DIR whose skills symlink to ~/.claude/skills
passed the split-brain guard, so its temporary path was written into the
global settings.json and the hooks broke once the session directory was
removed. Fall back to $HOME/.claude/skills/gstack whenever both spellings
resolve to the same tree.

Fixes #3180

* fix(setup): one sourced helper picks the hook root for setup and gstack-memorable (#3180)

bin/gstack-memorable carried a verbatim copy of setup's old canonical-root
block, so `gstack-memorable enable` under a per-session CLAUDE_CONFIG_DIR
still baked the session path into settings.json after #3181 fixed setup.
The choice now lives in bin/gstack-claude-root.sh
(gstack_canonical_claude_root), sourced by both.

Intentional test changes:
- test/setup-hook-canonical-paths.test.ts: #3181's source-slicing block
  test is rewritten to source the helper (with a spawnSync timeout, which
  the sliced version lacked and the tripwire flags); the
  "honors CLAUDE_CONFIG_DIR" pin moves from setup to the helper, and a new
  pin requires both callers to source it. Adds a no-$HOME-install case.
- test/setup-hook-syntax-gate.test.ts: the hook-section slice starts at the
  new assignment and the harness sources the helper.
- test/setup-claude-code-migration.test.ts, test/team-mode.test.ts: the
  partial-checkout fixtures copy the new helper setup sources.

Reviewer test: gstack-memorable enable under a per-session config dir that
links back to ~/.claude registers the $HOME path (fails on main).

Builds on #3181 by NetrioGit.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(setup): remove 1.31-era unprefixed Cursor skill folders (#3133)

A 1.31 setup run from a checkout under ~/.cursor/skills linked unprefixed
<skill>/ folders there, each holding a SKILL.md symlink into the checkout.
Current setup links gstack-<skill>/ folders, and the retired-skill prune
only looks at gstack-* names, so the old folders stayed: Cursor loaded
autoplan, review and the rest twice, or kept dangling links once the
checkout moved.

Run the Claude flat-name cleanup on ~/.cursor/skills as well. Cursor
installs only gstack-* names, so no prefix gate is needed, and the helper
removes only entries proven to link into gstack (#2119), so user-owned
folders stay. It runs after linking, so a run that fails before the new
links exist keeps the old folders. Reported by @andrewkjankowski in #3084.

Fixes #3133

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(setup): name the skills dir in the flat-name cleanup line (#3133)

`./setup --host cursor` now runs the flat-name cleanup on
~/.cursor/skills as well as ~/.claude/skills, so the "cleaned up old
entries" line says which directory the folders were removed from.

Reviewer test for #3152 (szsunyuan): a real dir whose SKILL.md links into
gstack loses only that link and keeps the user's file; SKILL.md links into
a sibling repo named gstack-fork, a relative link, and a dangling link
outside any gstack checkout are all kept; the printed line names the
removed folders and the Cursor skills dir.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(setup): install Chromium with `bun x`, and name exit 127 for what it is (#3131)

A Bun installed with winget ships no `bunx`, so setup's
`bunx playwright install chromium` exited 127 and was reported as
"offline, proxy, or blocked download?". setup now runs
`bun_cmd x playwright install chromium` through its existing bun resolver
($BUN_CMD), and bin/gstack-browser-ensure runs the bun it found on PATH
with `x`. Exit 127 gets its own text naming the resolved bun, Bun from
bun.sh, and the skip commands for Git Bash and PowerShell; other codes
keep the network hint. New troubleshooting entry:
#chromium-install-exit-127.

Intentional test changes:
- test/setup-playwright-best-effort.test.ts: the installer stub is now a
  `bun_cmd()` stub (was `bunx()`), its mark renamed bun-x-called and now
  records the args; the block under test calls bun_cmd. New winget-shaped
  cases (bun on PATH, no bunx anywhere) run setup's real bun_cmd.
- test/gstack-browser-ensure.test.ts: the fixture is winget-shaped (the
  `bun` stub handles `x`, no `bunx` on PATH); the exit-7 pin now reads
  `<stub>/bun x playwright install chromium exited 7 (...)`.

--help in gstack-browser-ensure prints the comment header only (3,24p).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(windows): prove setup.ps1 on PowerShell 5.1 and the held-install recovery natively (#3130, #3184)

windows-setup job:
- setup.ps1 joins the path filter (with bin/gstack-ff-update,
  bin/gstack-claude-root.sh, bin/gstack-browser-ensure,
  docs/troubleshooting.md and test/setup-ps1.test.ts).
- powershell.exe must be Windows PowerShell 5; test/setup-ps1.test.ts runs
  with a space in TEMP and must report exactly 4 pass, 0 fail, 1 skip
  (the Linux-only missing-prerequisite case).
- A copy of the built checkout under a path with a space installs through
  `powershell.exe -File setup.ps1 --host codex`.

held-install-journey job (new, parallel):
- origin's main is this PR's tree on top of the v1.91.101.0 tree
  (47d639abf); fix-branch adds one file.
- A prefix-mode v1.91.101.0 install at the runner's ~/.claude path in
  three states (clean, dirty-conflicting, already-unmerged), with
  auto_upgrade=true and the throttle cleared: the old updater must log
  `HELD hook-check-unavailable`; the PowerShell recovery form, read
  verbatim from docs/troubleshooting.md and run under powershell.exe,
  must reach main with every local edit (only those) in one rescue ref.
  The dirty state runs it with its .\setup.ps1; the others replace that
  step with a marker.
- The trial and go-back forms move the install to fix-branch (detached)
  and back to main.
- Only then a later release whose symlink sorts before its target is
  pushed, and the new updater must log UPDATED and reach it.
- Both jobs assert the exact list of cases that ran.

The journey steps ran locally on Linux with pwsh in Legacy argument
mode as powershell.exe, a git exec-path whose ../../../bin/bash.exe is
bash, and a failing tar standing in for MSYS tar (all 9 cases passed);
the windows-latest run itself happens on the PR.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(ff-update): a killed step-4 run fails the status check instead of the type check

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(windows): the held-install job runs without the bun cache step

The cache key line is a secret-scanner false positive on added lines
(env.kv); the fixture's own setup installs its packages either way.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(fixtures): register #3191's heartbeat fixture as free

test/free-fixtures.test.ts failed on the frozen-branch Ubicloud run:
test/fixtures/session-update-heartbeat.sh (adopted with #3191) was in no
paid touchfile and not in FREE_FIXTURES. Its only consumer is
test/session-update-heartbeat.test.ts.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(session-update): leave the bun-version-unreadable banner case to item 11 (PR 1a)

PR 1a owns the bun-version-unreadable hold (BUN_VERSION_UNREADABLE), its
banner case and its troubleshooting entry; this branch is rebased onto 1a.
Drops the case, the docs entry and the banner test this branch had added.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(setup.ps1): resolve Git Bash in the shared order, with GSTACK_BASH as an alias and a BASH_UNAVAILABLE refusal

Follows lib/script-invocation.ts (Lane C, PR 2): GSTACK_GIT_BASH is the
override and GSTACK_BASH its deprecated alias at the same precedence;
when both are set and differ GSTACK_GIT_BASH wins and one warning prints.
An override that does not exist is refused, never skipped. Without one:
the install git --exec-path belongs to (behind a scoop shim, or a
portable Git), the folders around git.exe, %LOCALAPPDATA%\Programs\Git,
%ProgramFiles%\Git, and last a bash on PATH whose uname -s reports MSYS;
WSL's bash (System32, WindowsApps) is rejected. A miss lists every
candidate with its rejection, then the PowerShell user-variable and
~/.claude/settings.json env recipes (BASH_UNAVAILABLE, #bash-unavailable).

test/setup-ps1.test.ts gains a 14-row pwsh-on-Linux table with every
location injected (override, alias, both set, missing override and alias,
scoop shim, per-user, portable and machine-wide Git, MSYS PATH bash, WSL
and non-MSYS rejections, missing); 11 rows fail on main. The rows mirror
Lane C's table in test/script-invocation.test.ts; they are not wired to
it, since that branch is not available here. The Windows job's expected
skip count for this file moves from 1 to 15 (the table is Linux-only).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(setup.ps1): give the empty-argument refusal its result code (SETUP_PS1_EMPTY_ARGUMENT)

Adds the row to lib/result-codes.ts (anchor #setup-ps1-empty-argument,
which setup.ps1 already prints). bin/gstack-doctor-components.sh is
regenerated from the table (generated; resolved by regeneration at merge).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(windows): silence SC2016 on the PowerShell version probe (the $ is PowerShell's, not bash's)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(windows-setup): give tar a POSIX path for the spaced checkout

MSYS tar reads `D:\a\_temp/...` as host:path (rsh syntax) and fails with
'Cannot open: No such file or directory' before setup.ps1 runs. The copy
target now goes through cygpath -u; setup.ps1 still gets the Windows form.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(windows-setup): dereference symlinks when copying the spaced checkout

MSYS tar cannot extract connect-chrome, a symlink that precedes its target
(the #3184 failure mode), so the copy died before setup.ps1 ran. tar -h
stores the target instead.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(windows): one Git Bash resolver for gstack's shebang bins (#3197)

Windows has no shebangs, and gstack had three conflicting bash lookups:
the hooks fell back to a bare PATH `bash` (often WSL's launcher), the
gbrain sync checked three fixed paths, and setup.ps1 walked up from
git.exe. lib/script-invocation.ts is now the only TypeScript resolver:
GSTACK_GIT_BASH (GSTACK_BASH as a deprecated alias, same precedence,
warning when they differ, a missing value refused), bash next to
`git --exec-path` (scoop, per-user, portable Git), the known install
paths, then a PATH bash only when `uname -s` reports MSYS/MINGW. WSL
launchers are rejected unprobed. A miss is BASH_UNAVAILABLE, listing
every candidate with its rejection reason.

Bun-shebang bins run under Bun (process.execPath, or the PATH bun inside
a compiled binary). Hooks' runBin resolves through a state-root cache
keyed by git.exe path and mtime, written by temp file plus rename, so
the hot path spawns nothing extra; the override is never cached.
wtreeFingerprint({cwd, timeoutMs}) returns {tree} | {error, kind} with
GIT_OPTIONAL_LOCKS=0 and 40-64 hex ids; the consumers move next.

Intentional pin change: test/gbrain-spawn-windows-shell.test.ts expects
forward-slashed bash paths (WIN_BASH and the GSTACK_BASH override), the
form the shared resolver returns because Bun's spawnSync on Windows
returns ENOENT for a backslash exe path containing spaces.
The copied-tree adapters in test/timeline-stop-hook-slug.test.ts and
test/plan-tune-cathedral.test.ts list the two modules spawn-bin.ts now
imports; the new fixture is registered in test/helpers/free-fixtures-data.ts. bin/gstack-doctor-components.sh is
regenerated for the new result-code row.

Reported by @exGeni.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(windows): fingerprint and gstack bins through the shared invocation (#3197)

bin/gstack-wtree was spawned by path in lib/regen.ts, lib/gate-diff/git.ts,
lib/restamp.ts and bin/gstack-evidence; gstack-slug in restamp, gate-diff
and evidence; gstack-redact in the pregate secrets check; and a bare
`bash -c` in regen, the lane selection manifest and gstack-evidence run.
On Windows each one failed to launch. All now go through
lib/script-invocation.ts, and each fingerprint consumer keeps its fail
direction while saying why:

- gstack-regen check: incomplete, `cannot fingerprint the working tree
  (gstack-wtree exited 1: <helper's own repair>)` instead of
  `(gstack-wtree failed)`; write keeps the registry label as its run id.
- gstack-gate-diff: `+nowtree` candidate, with the cause.
- gstack-restamp: RESTAMP_CONFLICT carrying the launch or exit detail
  (Windows printed `()` before).
- gstack-evidence: records without wtree (grades STALE) and warns once;
  SHA-256 repositories now get a 64-hex fingerprint.

lib/regen.ts keeps a string-returning wtreeFingerprint(repoRoot) wrapper
for lib/pregate/context.ts and lib/pregate/index.ts (files #3190 changes);
item 10b migrates them. test/script-invocation-tripwire.test.ts fails on a
new by-path or bare-bash spawn under lib/, hosts/ or a Bun bin; five sites
outside this change are listed with their owners and may only shrink.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(pregate): keep framework route paths from a selection manifest (#3176)

laneFileSet parsed manifest output with `[\w.-]+` path segments, so
`app/(shop)/[id]/page.test.ts` came back as `page.test.ts`. The selected
test then matched no platform lane, its remote receipt obligation
vanished and it fell back to a local run. manifestTestPaths keeps route
segments whole (`(group)`, `[id]`, `[...slug]`, `[[lang]]`, `@slot`,
`$param`, `+page`), reads every path-shaped token on a line (JSON
arrays, quoted, `path:line`, parenthesized), and decides what is a test
file with the import graph's own isTestFile, so a test-file rule change
there (bats, #3177) reaches manifests without a second regex. A manifest
that cannot start is "unknown" (widens), like a non-zero exit.

This is the manifest-parser half of #3176 by @vocodestudios; the
import-graph half (tsconfig aliases, Next.js route mapping) ships in a
separate PR. test/pregate-manifest-paths.test.ts drives the CLI with a
bracketed route test in the fixture's Windows-only lane and asserts its
requires-remote obligation; it failed on main (requires_remote was []).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(windows): windows-pregate-e2e drives the #3197 paths natively

A windows-latest job (Bun 1.4.2) builds a fixture repository and runs
gstack-restamp --dry-run, gstack-regen check and write, gstack-evidence
run and gstack-gate-diff from their TypeScript entry points, asserting a
real tree fingerprint each time; times a question-log hook cold and warm
and checks it cached its Git Bash resolution; and checks that a missing
GSTACK_GIT_BASH refuses with BASH_UNAVAILABLE and lists the candidate.
The journey runs twice: under the runner's Git for Windows and under a
pinned PortableGit 2.56.0.2 (SHA-256 verified), found only through
`git --exec-path`. gstack-pregate run joins it with item 10b. The workflow is registered in
scripts/test-pr-profile.ts FREE_ONLY_PR_FILES (no paid case reads it), recorded
as a non-behavioral HARNESS_VERSION decision in scripts/harness-version.json.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(setup.ps1): resolve Git Bash by the shared fixture table (#3197)

test/setup-ps1.test.ts now drives setup.ps1 through every row of
test/fixtures/windows-bash-resolution.json, the table that pins
lib/script-invocation.ts, instead of a hand-mirrored copy. Two rows
failed and are fixed here:
- an override and alias that differ only in slash direction no longer
  print the differ warning;
- the root git --exec-path names is also searched for usr\bin\bash.exe
  (Git for Windows on arm64).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(windows): isolate the no-bash case and launch pregate as the product does (#3197, #3176)

windows-free-tests run 38813751242 failed two tests this layer added. Both
were fixture defects on a real Windows host, not product defects:
- gbrain-spawn-windows-shell "returns null when Windows has no bash" stubbed
  only `exists`. The resolver's PATH step asks the real Bun.which and found
  the runner's MSYS bash, which is correct. The case now also stubs
  `which` and `gitExecPath`, so it really means "no bash anywhere".
- pregate-manifest-paths spawned the extensionless bin/gstack-pregate
  directly. CreateProcess cannot exec a shebang, so nothing ran and stdout
  was "". It now launches through lib/script-invocation's runScriptSync,
  gstack's own Windows invocation, so the case runs the manifest lane end
  to end on Windows instead of being excluded.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(windows): the missing-bash step survives the refusal it expects (#3197)

GitHub runs `shell: bash` as `bash -eo pipefail`, and the step's own
`set -uo pipefail` does not turn -e off. So when gstack-restamp refused, as
the step expects, `OUT=$(...)` aborted the script before `CODE=$?` and before
any output was printed: exit 1 after 0.5 s with nothing in the log (PR #3209,
job 116729693492). The capture is now `OUT=$(...) && CODE=0 || CODE=$?`.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(pregate): the manifest-lane case expects the host's own remote lanes (#3176)

Once 8b2f297cc made the case run on Windows, windows-free-tests run
38824886195 (shard 4) showed the expectation itself was Linux-only. pregate
owes a lane remotely when its runner platform is not the host's
(lib/pregate/workflows.ts). On a Windows host the fixture's Windows lane
runs locally, and the Ubuntu `free-tests.yml/unit` lane is the remote
obligation; that is the record Windows produced.

The case now derives the owed lanes from the host the same way. On Windows
it also requires `ran: node --test 'app/(shop)/[id]/page.test.js'`: there the
route reaches the local run only through the manifest's whole path. With a
cut manifest path (page.test.js) the local set is empty, checked through
buildContext({ platform: 'win32' }) + selectLanes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(windows-setup): expect 31 skipped setup.ps1 cases now that the shared table drives it

Layer 2 drives setup.ps1 through the 16 shared rows of
test/fixtures/windows-bash-resolution.json; like the 14 existing resolution
rows they run under pwsh on Linux and skip on Windows. The case list is still
asserted exactly (4 pass, 0 fail, 31 skip).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(ship-measure): give the CLI tests a private HOME (#3162)

Every bun run test left ~/.gstack/projects/ship-measure-cli-*/evals and
sweep-cli-fake-*/evals in the developer's real home, and the free-suite
runner flagged them ("real home changed ... Give the writer a private
HOME/GSTACK_HOME"). ship-measure's diagnostic-dir check calls
getProjectEvalDir(), which builds the eval dir from os.homedir(), and
these two CLI tests passed the real HOME while overriding only the
state root.

Both now set HOME and USERPROFILE to the test's own state dir. The
sweep test also runs on the Windows lane, where os.homedir() reads
USERPROFILE. test/ship-measure.test.ts:79 already gives its config test
a private HOME the same way. getProjectEvalDir() itself is unchanged:
whether eval history should follow GSTACK_HOME is left open in #3162.

Fixes #3162

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(ship-measure): prove the sweep CLI never writes under the parent HOME (#3162)

Reviewer test for #3163 (adopted from y$un_, forrest.sun527): points the
parent HOME at a sentinel with a stub global gstack-slug and asserts no
.gstack dir appears there. Fails on 47d639a (the sentinel gets
.gstack/projects/leaked-slug/evals); passes with #3163.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(redact): isolate fixture git from inherited hooks

Fixture git was spawned with the parent environment, so a developer's
core.hooksPath ran on the local push and rejected it (#2967). The
helper blanks the global and system files and drops GIT_CONFIG_COUNT
and GIT_CONFIG_PARAMETERS. A hooksPath set in the fixture repo still runs.

* test(redact): blank GIT_CONFIG_GLOBAL with /dev/null on every platform (#2967)

Follow-up to #3156 (adopted from Lockyer228): Git for Windows rejects
GIT_CONFIG_GLOBAL=NUL (the repo convention is EMPTY_GLOBAL_GIT_CONFIG =
'/dev/null' in lib/cso/process.ts), so both fixture helpers use /dev/null
everywhere. Reviewer test: a hooksPath in the default global files under
HOME/.gitconfig and XDG_CONFIG_HOME/git/config cannot reject the fixture
push; it fails with the inherited environment (the 47d639a behavior) and
passes with the isolated env.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: gstack-config compares whole root paths and prints a runnable recovery command

- report_root_disagreement compared word-split values, so two variables naming
  the same directory with a space were reported as disagreeing. Compare each
  complete value instead.
- The privacy-key recovery hint single-quoted the root and left the script
  path bare; an apostrophe or space made it unrunnable. Quote with printf %q.
- On Bash 3.2 (macOS /bin/bash) a failed `.` under set -e exits before the
  `||` fallback, so a missing gstack-state-root.sh exited 1 silently and
  test/state-root-resolver-failure.test.ts failed there. Check readability first.
- The merge fixture now lives under a path with a space and an apostrophe,
  executes the printed command, and asserts same-directory variables agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(config): pin the %q-quoted recovery command and run it from a spaced install path

Follow-up to #3186 (adopted from davidfragnoli-lang). Intentional pin
change: the fix line's GSTACK_STATE_ROOT='<legacy>' pin becomes the exact
bash printf %q form of the legacy root (the PR loosened it to a prefix
check; this restores an exact pin) and the original test name is kept.
Reviewer test: copy bin/ to a path containing a space and an apostrophe;
the printed fix: command runs cleanly and flips the merged value. Fails on
47d639a (unquoted $_SELF), passes with #3186.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(gstack-gbrain-sync): fail when a star gitignore already ignores the pin

ensureGbrainSourceGitignored appends .gbrain-source even when git
check-ignore already excludes that path. The extra line dirties a
tracked ignore-everything gitignore.

* fix(gstack-gbrain-sync): skip the pin line when git already ignores it

ensureGbrainSourceGitignored asked only for a literal .gbrain-source
line. An ignore-everything star already excludes the pin, and the extra
line left the tracked gitignore dirty.

* fix(gbrain-sync): only a tracked .gitignore can stand in for the pin line

Follow-up to #3178 (adopted from KuroChen). The skip now requires
`git -c core.excludesFile= check-ignore -v` to name a tracked .gitignore
(not global excludes, not .git/info/exclude, not a negation), so a pin
ignored only on this machine still gets the shared line teammates need
(#1384). Tests: the two git init spawns get timeouts (they failed the
spawnSync tripwire), fixtures isolate HOME/XDG_CONFIG_HOME, and the PR's
star-gitignore fixture stages its .gitignore (intentional fixture change:
the contract is a tracked file). Reviewer tests: global excludes only,
info/exclude only, an untracked star .gitignore, and a re-include each
still append; all three fail on the PR head.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(skill-end): log the completion event before the final drain (#3198)

gstack-skill-end drained and pushed before it appended its own completed
timeline event, and gstack-timeline-log backgrounded its enqueue, so a
full-tier end boundary returned with its latest event unpushed. The
completion log now runs before the drain and the logger waits for its
enqueue (one config read and a spool write; it exits early when sync is
off or the session is unattended). Every consent, secret-scan and
queue-lock gate is unchanged; the stale "local-only, never sent anywhere"
comment is replaced.

Patch and regression test from Kkkkkuro (#3198): 2 pass / 5 fail on
47d639a, 8/8 with the fix. Reviewer test: with artifacts_sync_mode off the
completion is written locally with no queue entry and no push.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(pregate): map Next.js route paths and tsconfig path aliases to their tests

QUOTED excluded ( ) [ ] +, so a test naming app/(app)/page.tsx in a string
never matched. resolveRef never read tsconfig compilerOptions.paths, so an
import through @/ resolved to nothing. Both were PREGATE_NO_LANE false
negatives in a Next.js App Router repo whose tests did name the files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(pregate): TypeScript alias precedence, relative extends and a no-lane explanation

Follow-up to #3176 (adopted from vocodestudios). Path aliases now follow
TypeScript's choice: an exact pattern, else the wildcard with the longest
prefix, targets tried in order. When the chosen pattern resolves nothing,
every plausible reading (other matching patterns, baseUrl, the repo root)
gains the edge, so uncertainty selects more tests, never fewer. Relative
extends chains are followed up to MAX_TSCONFIG_EXTENDS (4) hops, with
baseUrl and paths resolved against the config that declares them.
Trailing commas are dropped by the JSONC tokenizer (never inside a string)
instead of a whole-text regex.

A touched file with no lane now gets explain lines naming the import
specifiers in test files that resolved to no repo file, any extends hop
that was not followed (with the limit), and the hint to declare the file
under dependencies or report the resolver gap. The lines ride testsFor's
provenance, which lanes already pushes to --explain.

Reviewer tests: overlapping aliases in both key orders, exact vs
wildcard, target fallback, the union case, a two-hop extends chain, a
string containing ',]', and the depth-limit explanation. Five fail on the
PR head; all 12 pass. The manifest-parser half of #3176's follow-up
(lane-selection.ts) ships in PR 2.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(browse): reap PTY children on agent shutdown

* fix(browse): reap a terminal-agent PTY's whole process group at shutdown (#3147)

Follow-up to #3148 (adopted from Y4NN777). The PTY child leads its own
session and process group; its identity (pgid, sid, leader start time) is
recorded at spawn and stays checkable after the leader exits. Disposal
schedules a group reap after PTY_SHUTDOWN_GRACE_MS that, unlike the
direct-child SIGKILL fallback, is not cancelled when the leader exits, and
shutdown reaps every pending group before exiting, so descendants that
ignore SIGHUP no longer outlive the agent. Only proven members are
signalled: same pgid and sid, started no earlier than the leader, and
nothing at all when the leader's PID is held by a process with another
start time. Linux only (/proc); other platforms keep the direct-child
behavior. During the shutdown grace the server answers 503 and no new PTY
is spawned.

Test changes to the PR's own test (intentional): the agent is spawned
with process.execPath and the PTY child traps INT TERM HUP, so the case
proves the SIGKILL fallback instead of passing on the kernel hangup.
Reviewer tests: a HUP-immune grandchild is dead within the grace plus 1 s;
an early-exiting leader's surviving descendant is reaped; a session that
completed before shutdown still has its group reaped; unit cases for a
foreign group and a reused leader PID. All four integration cases fail on
47d639a; three fail on the PR head.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* build(deps): bump the github-actions group with 5 updates

Bumps the github-actions group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.1` | `7.0.2` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.1` | `8.0.2` |
| [actions/setup-node](https://github.com/actions/setup-node) | `7.0.0` | `7.1.0` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.4.4` | `2.5.0` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.38.2` | `4.38.3` |

Updates `actions/upload-artifact` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9)

Updates `actions/download-artifact` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333)

Updates `actions/setup-node` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/820762786026740c76f36085b0efc47a31fe5020...949feb2413d6458794dcd2491c4babbbce0c15c1)

Updates `ossf/scorecard-action` from 2.4.4 to 2.5.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/2d1146689b8cda280b9bc96326124645441f03bc...fa7117db83c52d787ae5a89f350999701505d78e)

Updates `github/codeql-action/upload-sarif` from 4.38.2 to 4.38.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...24c54180a607b1449ed407dd24f251e4e9147c8d)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.38.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(model-policy): track the upload-artifact v7.0.2 pin from #3175

Intentional pin change: test/model-policy-workflow.test.ts asserted
actions/upload-artifact@043fb46d…; dependabot #3175 moves the workflow to
cf430e03… (v7.0.2, verified against the upstream tag). The pin tracks the
workflow. #3175's free-tests.yml hunk is left out of this PR (free-tests.yml
is a #3190 file; it is re-bumped in PR 5).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(model-policy): its upload-artifact pin matches the eval workflows' pin

Reviewer test for dependabot #3175: the model-policy workflow's single
upload-artifact pin equals the pin evals.yml, evals-periodic.yml and
windows-free-tests.yml use, so a group bump that misses one workflow (or
the hard-coded pin above) is caught here.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* build(deps): hold Playwright minor/major bumps behind the windowsHide patch (#2923)

Dependabot #2923 bumped playwright to ^1.64.0 and dropped the
patchedDependencies entry keyed to playwright-core@1.62.1, which keeps
windowsHide on Windows (#2160, #1989). The bun ecosystem now ignores only
semver-minor and semver-major updates for playwright and playwright-core;
patch updates still flow. The 1.64 migration (re-key the patch, the
Dia/cookie qualification pins, the arm64 artifact name) is filed with
owner Garry, revisit 2026-11-15. Test fails on 47d639a (no ignore rule).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(readme): drop the stale skill lists users pasted into CLAUDE.md (#3169)

README's install prompt and troubleshooting block each carried a skill
list for CLAUDE.md; both were stale (18 shipped skills missing) and they
disagreed. Claude Code lists installed skills itself, so both now keep
only the /browse rule, and the troubleshooting entry says to delete an
old pasted list. New free test: any comma-separated skill list in
README.md or CLAUDE.md must name exactly the shipped skills (with a
negative control for the detector). Fails on 47d639a; passes now.
Reported by the #3169 issue author. The matching doctor warning for
pasted lists ships in PR 5.

Intentional pin change: test/test-value-bar.test.ts no longer expects the
README skill list to name /test-audit twice; it now expects that list to
be gone (0 occurrences), the registration this commit removes on purpose.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* chore(osv): image-size has a fix; html-to-docx's ^1.0.0 pin blocks it (#2753)

The image-size ledger said no fixed release exists. OSV lists 2.0.3 as
fixed for GHSA-5p2g-fcmc-qvqq and GHSA-w3rx-r6r6-pgpr (checked against
api.osv.dev), but html-to-docx@1.8.0 pins image-size ^1.0.0 and there is
no fixed 1.x, so the fix is a cross-major override. Both entries now say
so and name the upgrade trigger; the 2026-11-30 expiry is kept. New test
checks the wording and that bun.lock still shows the stated pin (it fails
on 47d639a). Correction first raised on #2753 by sonukapoor.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* feat(ios-qa): forward GSTACK_IOS_LAUNCH_ENV to devicectl launches (#1796)

Reimplements only the launch-environment half of #1796 (credit
Bmathews721; the session-cache half is superseded by #3132's design and
had state-root and symlink-write problems). devicectl.ts parses
GSTACK_IOS_LAUNCH_ENV as a JSON object of string to string;
launchEnvArgs() returns the --environment-variables argv (empty when
unset or {}) and launchApp passes it before the bundle id. Invalid JSON, a
non-object, a non-string value, a bad name or a key in the debug bridge's
reserved GSTACK_ namespace refuses before any launch with the new result
code IOS_LAUNCH_ENV_INVALID (the detail names keys and types, never
values). launchEnvArgs is exported for the forced-relaunch path in
tunnel-bootstrap.ts.

Adds the result-code row (bin/gstack-doctor-components.sh regenerated by
gen:skill-docs), a troubleshooting entry under its exact text, the
pregate-no-lane entry's explain note, and the how-to section with an
example. New test fails on 47d639a (module load: no parseLaunchEnv).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(deps): declare sharp and clear two transitive advisories

sharp is imported in four files, including browse/src/screenshot-size-guard.ts,
and test/dependency-security.test.ts asserts a >=0.35.4 floor on it and loads
it. It was declared in no dependency field, reaching the tree only through
@huggingface/transformers with the overrides pin forcing the version. Declare it
at ^0.35.4, matching the floor that test already asserts.

Upgrade @huggingface/transformers to ^4.3.0, which clears sprintf-js@1.1.3 and
aligns the sharp override with what the parent declares: 4.2.0 declared
sharp ^0.34.5 while the override pins 0.35.5, which is outside that range, and
4.3.0 declares ^0.35.4.

Upgrade @anthropic-ai/claude-agent-sdk to 0.2.141, which clears
@anthropic-ai/sdk@0.81.0.

The existing overrides entry for sharp is left in place.

* test(deps): sharp is declared and its override satisfies every asking range

Reviewer test for #3145 (adopted from sonukapoor): sharp must be a
declared dependency, and the pinned overrides.sharp must satisfy both
that declaration and every lockfile package that depends on sharp
(@huggingface/transformers included). Fails on 47d639a (sharp not
declared; transformers 4.2.0 asked for ^0.34.5 against a 0.35.5 pin).

Classifier smoke on the changed tree (transformers 4.3.0,
onnxruntime-node 1.30.0, sharp 0.35.5, claude-agent-sdk 0.2.141): the real
sidecar entry bundled for Node with a private state root, and the
classifier in-process under Bun, each downloaded the TestSavantAI model
fresh, reported testsavant: ok, and returned scores identical to
47d639a's tree on five inputs, including a >512-token input that
exercises the truncation override. dependency-security, deps-smoke,
overlay-sdk-cancel-eof, security-classifier and screenshot-size-guard
pass; typecheck:test reports no new diagnostics.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(gbrain-sync): the no-bash skip names GSTACK_GIT_BASH and how to set it (#3197)

The brain-sync stage's Windows skip line told users to set GSTACK_BASH.
After the fix wave the canonical override is GSTACK_GIT_BASH, with
GSTACK_BASH as a deprecated alias (plan correction 9). The summary is now
the exported NO_BASH_SUMMARY: it names GSTACK_GIT_BASH first and GSTACK_BASH
as the old name, and gives the two recipes that reach Claude Code (a
PowerShell user environment variable plus a Claude Code restart, or the
"env" block of ~/.claude/settings.json).

Minimal on purpose: once PR 2 lands, this switches to
lib/script-invocation.ts noBashMessage(). Until then lib/gbrain-exec.ts
still reads only GSTACK_BASH, so this line is accurate only with PR 2
merged first.

New test test/gbrain-sync-no-bash-message.test.ts fails on the previous
commit (NO_BASH_SUMMARY not exported) and passes now.
Handoff from Lane C (PR 2).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(ios-qa): the forced relaunch carries GSTACK_IOS_LAUNCH_ENV too (#1796)

bootstrapTunnel's relaunchApp (an app whose boot token an earlier daemon
consumed is relaunched once with --terminate-existing) built its own
devicectl argv and dropped GSTACK_IOS_LAUNCH_ENV, so an env-gated debug
bridge vanished after the one relaunch the howto says carries it. It now
uses launchEnvArgs(); an invalid value refuses the relaunch with
launch_failed and the IOS_LAUNCH_ENV_INVALID detail before anything is
terminated.

Two new tests in ios-qa/daemon/test/devicectl-launch-env.test.ts drive
bootstrapTunnel through a consumed-token device: both fail on the previous
commit (relaunch argv lacks --environment-variables; the invalid value
still terminates and relaunches) and pass now. ios-qa daemon: 167 pass.
tunnel-bootstrap.ts was assigned to Lane D by the coordinator for this fix.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(version-gate): check the version queue only on PRs into main

Stacked layer PRs carry no VERSION stamp by design (the release layer stamps
once), so the queue check failed on any layer touching package.json. The
queue and its collision rule only describe main; a PR into main is still
checked exactly as before.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(browse): scope the SIGTERM PTY-reap case to POSIX signals (#3147)

windows-free-tests run 38813751242 (shard 6) failed "SIGTERM reaps every
active PTY child before terminal-agent exits" with "timed out waiting for
pty-child.pid", serially and on retry.

Diagnosis: invalid test expectation on Windows, not an agent defect the
test can observe. The contract under test is the agent's graceful
shutdown, its process.on('SIGTERM'/'SIGINT') cleanup in terminal-agent.ts.
On Windows, Bun's subprocess.kill('SIGTERM') is libuv's TerminateProcess,
so that handler never runs there; and the PTY fixture is an extension-less
`#!/bin/bash` script, which CreateProcess cannot launch, so the child never
starts (the timeout is at the pid file, after the port, token, grant and
WebSocket all succeeded). The file's other integration cases were already
Linux-scoped; this one now skips only on win32 and still runs on Linux and
macOS. The pure ownership unit tests in the file keep running on Windows.

Open, not covered by any test: whether a ConPTY child outlives a
hard-terminated agent on Windows. Testing it needs a Windows-launchable
terminal fixture, which BROWSE_TERMINAL_BINARY (one executable, fixed argv)
cannot express without a product change.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(plan-review): bound the native outside voice without TaskOutput (#3182)

Claude Code 2.1.277 removed TaskOutput, so the plan-review native fallback's
preflight always failed and users without the Codex CLI never got a second
voice. The fallback now uses primitives the host still enforces: a background
`sleep 300` Bash timer (its exit re-invokes the parent; the 2.1.300 sleep block
applies only to foreground commands), a background Plan dispatch whose
completion arrives as a <task-notification>, and TaskStop for whichever task
loses. Only a matching completed notification that beats the timer counts;
interim ("is waiting on its own background work"), turn-limit, foreground and
late results get no credit. The "[Subagent hand-back]" header (2.1.277) is
treated as framing.

The unavailable line now names its cause and fix, ends with
OUTSIDE_VOICE_UNAVAILABLE (new result code + troubleshooting entry), and the
review-log row carries unavailable_reason. The bounded-wait prose was
tightened so plan-ceo-review and plan-eng-review stay under their existing
size ceilings (no ratchet raise for this item).

Intentional pin change: test/run-in-background-guidance.test.ts
hasBoundedOutsideVoiceWait and the dispatch-contract cases now pin the
timer/notification/TaskStop contract instead of TaskOutput's envelope.
bin/gstack-doctor-components.sh is regenerated from lib/result-codes.ts.

Reported by HuellintonMota in #3182.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* feat(bin): gstack-ceo-plan-find locates the CEO plan for a branch (#280)

/plan-ceo-review saves its scope decisions under the state root's
ceo-plans/, but no plan review can find them: only /design-html reads
that directory, newest file first. This helper is the CEO-plan sibling of
gstack-design-doc-find, so /plan-eng-review can call one command instead
of a glob in prose.

It prints the newest top-level plan whose "Branch:" header names the
branch, compared the way gstack-slug writes BRANCH (feat/x matches
feat-x), else the newest plan, else nothing. Subdirectories are not
read. A usage error exits 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(plan-eng-review): read the CEO plan in the Design Doc Check (#280)

/plan-eng-review never looked in ceo-plans/, so an eng review after
/plan-ceo-review ran without the scope that review accepted, deferred or
skipped. capy-ai closed #414 asking for this focused fix, and TODOS.md
scopes it as a gstack-ceo-plan-find sibling of gstack-design-doc-find.

The Design Doc Check now prints "CEO plan found: <path>" or "No CEO plan
found" after the design doc line, and the prose says what to read the
plan for. The data-not-instructions rule names the CEO plan too, since
another agent may have written it. Only plan-eng-review changes: the
shared {{DESIGN_DOC_DISCOVERY}} block and the branch-scoped review log
are untouched. Reported by @chancheuklap in #280.

main left plan-eng-review 4 bytes under its parity cap, so the +325
bytes raise maxSizeRatio to the measured 1.2196, noted the way earlier
growth was.

Fixes #280

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(plan-eng-review): disclose a CEO plan borrowed from another branch (#280)

Review changes on top of #3159 (szsunyuan / y$un_):
- gstack-ceo-plan-find keeps stdout a bare path or empty; when it falls back
  to another branch's plan it prints one stderr line,
  "CEO plan found (from branch <b>, not <current>): <path>", with control
  characters stripped from the plan header ("unknown" when it has none).
- The Design Doc Check tells an interactive reviewer to ask before using such
  a plan, and a spawned session to use it and quote the disclosure.
- The Design Doc Check prose is tightened so plan-eng-review fits the
  owner-approved 1.2196 ceiling (measured 151,950 / 124,597 = 1.2195).

Reviewer tests: test/ceo-plan-find-cross-branch.test.ts (5 of 7 fail on the

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
#3159 head). The design-doc finder's matching disclosure stays deferred.

* fix(test): credit abutting section chunks whose edge bytes repeat (#3182)

detectSectionReads trims the longest suffix/prefix overlap between
consecutive Bash outputs. Two chunks that abut exactly (tail -c +N after a
chunk ending at N-1) can share an edge byte by chance; the trim then drops a
real byte and a fully printed section reads as incomplete. #3182's
review-sections edit moved plan-ceo-review's 66,999-byte boundary onto
"cur|rent", which turned the existing byte-range test red. The detector now
also checks the plain concatenation; a gap still refuses.

Detector/fixture defect, not a product change. New regression case in
test/section-capture-native-tools.test.ts fails without the fix.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(changelog): fix wave 2026-10-15 release notes

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* v1.91.104.0 fix: the 2026-10-15 issue wave

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(qa): probe each documented input rule, not only its boundary values

The paid gate's qa-functional-cli-report run (38829994639) probed zero and an
unsafe integer but never a non-digit amount, so it missed the planted
parseInt defect ("Amounts contain only ASCII digits") and reported no
defect. The functional contract map's invalid-input row now asks for one
probe per documented input rule (allowed characters, format, sign, range,
arity).

test/qa-functional-prompt.test.ts replays a captured CI Read of
system-functional.md; its completed-method variant now feeds the current
section bytes, so the validator check keeps its omitted/pending negative
controls without pinning the old wording.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* v1.91.106.0: restamp the fix wave above v1.91.105.0

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(release): keep the wave's dependency bumps through the main merge

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: Bryan Stone <aegixx@gmail.com>
Co-authored-by: vilano93 <244097767+vilano93@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: aftabkh4n <akobkz@gmail.com>
Co-authored-by: Benjamin D. Smith <benjamin.smith@binarysword.com>
Co-authored-by: Jess Sullivan <jess@sulliwood.org>
Co-authored-by: NetrioGit <5wngh@naver.com>
Co-authored-by: y$un_ <forrest.sun527@gmail.com>
Co-authored-by: Lockyer <135391289+Lockyer228@users.noreply.github.com>
Co-authored-by: davidfragnoli-lang <249433777+davidfragnoli-lang@users.noreply.github.com>
Co-authored-by: KuroChen <kurochen_macmini@KuroChendeMac-mini.local>
Co-authored-by: AV <vo.quanganh@gmail.com>
Co-authored-by: Y4NN777 <171065166+Y4NN777@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sonu Kapoor <sonukapoor@gmail.com>
This commit is contained in:
145 files changed
+8254 -714

No files matched your search

+5
View File
@@ -67,6 +67,11 @@ The journal root has a shape the guard does not know, usually because Claude
Code changed its journal format. The guard reads the journal twice and allows
only when both reads agree. `unrecognized_shape:cwd_spelling` means the
journal's directory is the same folder as the project, spelled differently.
`unrecognized_shape:compaction_unreachable` means records after a Claude Code
compaction hang from a compact boundary whose logical parent loops back
instead of reaching the session root, in a layout gstack does not read yet
(Claude Code 2.1.300's preserved segment is read). Earlier gstack versions
dropped those records and denied the next phase with `close_incomplete`.
Please report the detail and version.
<a id="journal-lag"></a>
+207
View File
@@ -0,0 +1,207 @@
<!-- gstack-autoplan-scope: --no-ui --developer-tool -->
# gstack fix wave (October 15, 2026): open PRs and issues, ordered by severity
## URGENT, outside this plan
- `bin/gstack-upgrade:50` compares a `C:/…` path with a `/c/…` path and refuses on every Git Bash install; `bin/gstack-doctor-check.sh:372-374,401` recommends that command, so it is part of the Windows recovery path (PR 1, item 3). The file belongs to draft #3190 (`capy/next-wave`, thread jam_01M4YA0TAXXGQ01VVWMW71091K). Owner: the #3190 thread. This wave reports it there with the fix (compare `gstack_path_shell` of both sides, `bin/gstack-path-spelling.sh`) and does not edit the file.
## Implementation plan
### Context
Base: origin/main `47d639a` (v1.91.101.0). Input: every open PR (25) and open issue (≈70) on garrytan/gstack as of 2026-10-15, triaged in six read-only lanes on a Capy cloud machine. Each lane reviewed external PR diffs line by line as untrusted input (scope, egress, credentials, dependencies, CI permissions, weakened tests), checked each issue's claim against main's code, and reproduced with focused tests where cheap. Evidence: `~/.capy/work/fixwave/triage-{A..F}.md`. This is plan revision 3. Revision 1 was reviewed by six voices (CEO, DX, Eng; Claude Opus 5.5 and GPT-6.1 Sol each): 60 findings, no Critical. Revision 2 folded them in and was reviewed again by the same six voices: 37 findings, no Critical, no user challenge, every revision-1 finding confirmed addressed. This revision folds in the revision-2 findings. The Review record lists what each phase raised and how it was handled.
Owner request (Garry, 2026-10-15): "do a fix wave on gstack — plan, autoplan, eli5 for approval — go through all PRs and issues, figure out what to fix here in a wave, be circumspect on all code written by others, order by severity and priority." Garry merges gstack; this wave opens PRs and never merges them.
**In-flight work this wave must not collide with.** Garry's draft #3190 (`capy/next-wave`, claims v1.91.102.0) changes 110 files. None of this wave's items are fixed by it (each lane diffed its files against `origin/capy/next-wave`). Files both touch: `setup` (items 12, 13, 16: disjoint hunks), `bin/gstack-bun-version.sh` (item 11: disjoint function; #3190 adds new `gstack_bun_status` callers in the `_gb_*` namespace), `lib/result-codes.ts` and `docs/troubleshooting.md` (append-only), `lib/pregate/checks/lanes.ts` (item 9: one-line conflict), and generated SKILL.md/goldens (items 24, 25). `lib/pregate/lane-selection.ts`, `lib/pregate/import-graph.ts`, `bin/gstack-session-update`, `setup.ps1`, `lib/redact-engine.ts`, `lib/cso/**`, `browse/**`, `lib/regen.ts`, `lib/restamp.ts`, `lib/gate-diff/**`, `bin/gstack-evidence`, `gstack-upgrade/SKILL.md.tmpl` are untouched by #3190 (`git diff --name-only origin/main...origin/capy/next-wave`).
**Security review result.** No external PR in the wave has a red flag: no new egress, telemetry, credential handling, postinstall scripts, or CI permission changes; #3145's lockfile adds no new packages; dependabot #3175's five action SHAs match upstream tags. Two PRs are rejected on safety grounds: #2923 drops the Playwright `patchedDependencies` entry that keeps Windows `windowsHide` (reintroduces console-flash #2160/#1989), and #1796 writes a bearer token through `writeFileSync`+`chmod` (follows a planted symlink), hard-codes `~/.gstack` against the state-root chain, and sends the cached bearer to a device address without checking which app listens.
**How external code is adopted.** Commits are cherry-picked onto the wave branch with original authorship; our changes land as separate commits on top; release churn (VERSION, CHANGELOG, package.json version, e.g. #3189's `1.91.102.0` commit `3d1caac`) is dropped. Fork CI is **not** approved (it would run untrusted code with this repo's runner); the cherry-picked commits run on the wave branch's own CI. Every adopted PR gets at least one reviewer-written behavioral test in addition to the author's own; where that is impossible the PR body says "author test, reviewed". After Garry's review pass (never before: reporters would be running unreviewed code), each source issue gets a comment with exact commands to try the branch, labelled by shell: `cd "<install>" && git checkout -- 'SKILL.md' '*/SKILL.md' '*/sections/*.md' && git fetch origin <branch> && git checkout --detach FETCH_HEAD && ./setup`, and to go back: `cd "<install>" && git checkout main && ./setup`; it says auto-update pauses while a detached revision is checked out. Confirmations within 48 hours are recorded in the PR body (the reporters have the PS 5.1, MSYS tar, OrbStack, zsh, Cursor-1.31 and Claude Code 2.1.300 environments CI lacks); they are evidence, not a merge gate. The source PR is closed after merge with a comment naming what changed and why; issue reporters and PR authors are credited in the CHANGELOG.
Repo constraints: SKILL.md is generated from `.tmpl`; new logic in `lib/*.ts` behind thin `bin/` entrypoints; `test/module-size-ratchet.test.ts`; state paths through `lib/state-root.ts`; result codes in `lib/result-codes.ts` with `docs/troubleshooting.md` anchors (`test/troubleshooting-anchors.test.ts`); every test subprocess has a timeout (`test/spawnsync-timeout-tripwire.test.ts`, which three adopted PRs fail today: #3188, #3178, #3181); parity and context-budget ratchets for template edits; ship is stamp-at-merge PATCH.
Thesis: **people stuck this week get unstuck, including the installs that are already stuck; community fixes land with their authors credited; nothing a stranger wrote reaches main without an independent test.**
### Release promises (the finish line)
- **P1. No user is stuck, including already-stuck installs.** An /autoplan run survives a Claude Code 2.1.300 compaction; a conflicting autostash never leaves conflict markers in a live install and never silently hides a user's edit; a Windows install held by the tar bug and a macOS zsh user get a verified recovery path; `setup.ps1` runs under Windows PowerShell 5.1; `/cso` Semgrep returns findings; `/cso` works with OrbStack; the browse daemon recovers when its last tab is closed outside the CLI.
- **P2. Windows bugs are proven on Windows,** in CI on `windows-latest` (PowerShell 5.1, real MSYS tar, Git for Windows), not only by Linux emulation.
- **P3. Pregate selects the right tests** for bats repos and Next.js/tsconfig-alias repos without dropping a required platform receipt, and runs on Windows instead of refusing with a misleading message.
- **P4. Every new failure state says what happened and the one command that fixes it,** with a troubleshooting entry under its exact error text and a CHANGELOG "If you…" line for each affected cohort.
- **P5. The tracker is honest:** fixed issues are closed with file:line evidence on a dated follow-up; each deferred item has a reason, an owner and a revisit date.
### Delivery shape
Seven PRs with stated dependencies, each a PATCH release with its own slot from `bin/gstack-next-version` at ship time, each running `bun run test` once on its frozen tree (on Ubicloud; this machine has 4 cores). PR 1a ships first and depends on nothing that has never run before.
| PR | Contents | Base | Depends on | Blockers it can have |
|---|---|---|---|---|
| 1a. Recovery, cross-platform | items 1, 5, 6, 7, 11 | main | — | its own tests |
| 1b. Recovery, install and Windows | items 2, 3, 4, 12, 13, 16, W | PR 1a's branch (`gh stack`) | 1a (Step 4 of `/gstack-upgrade` is edited by items 11 and 2) | the first run of the Windows job |
| 2. Windows script invocation | item 10a, item 8's manifest-parser half | main | — | its own Windows job file |
| 3. Maintenance | item 8's import-graph half, items 15, 19–23 | main | — | #3145 classifier smoke (split out if unavailable) |
| 4. Prompt changes | items 17, 14 | main | — | the free spike; paid gate cases and judges priced and approved first |
| 5. After #3190 | items 9, 10b, 24, 25, the doctor rows (D), the Windows curation move | `capy/next-wave` | #3190 | #3190 |
| 6. Census repair | item 18 | main, or folded into PR 5 if the repair edits `ship/` | — | evidence read first |
Sibling PRs share no file except the integrator-owned append-only set (`lib/result-codes.ts`, `docs/troubleshooting.md`, `test/fixtures/module-size-ratchet.json`, `CHANGELOG.md`, `package.json` version line). Coordinator exception, recorded in each PR body: lane-check reports those files as intersections; the exception covers exactly that named set, and after any sibling or #3190 merges, the next PR merges main, resolves the appends, and restamps. Every other intersection is a blocker. For #3190 the exception also covers `setup` (PR 1b's hunks) and `bin/gstack-bun-version.sh` (PR 1a), backed by a receipt bound to both SHAs: the merged tree is computed once per pair (both orders recorded, the tree hash is the same), and on that tree `gen:skill-docs` freshness and the focused tests for both PRs' touched files run once. Files #3190 also changes that this wave needs (`lib/pregate/context.ts`, `lib/pregate/index.ts`, `bin/gstack-doctor-check.sh`, `bin/gstack-doctor-components.sh`, `lib/doctor-components.ts`, `scripts/lib/windows-curation.ts`, `.github/workflows/free-tests.yml`) are edited only in PR 5.
This thread registers dated follow-ups: 2026-10-22 (post the closes below) and 2026-10-29 (if #3190 has not landed, this thread rebuilds PR 5 on main, resolving the `lanes.ts`, `bin/gstack-pregate`, `context.ts`/`index.ts` and doctor hunks itself, and tells the #3190 thread).
Lanes and file ownership (each lane on a fresh machine, its own branch, bisected commits, no VERSION/CHANGELOG/package.json-version edits):
- Lane A (PR 1a): `lib/claude-journal-records.ts`, `lib/redact-engine.ts` and the scanner capture path in `lib/cso/**` (`process.ts`, `docker.ts`, `watchdog.c`, the executor), `browse/src/browser-manager.ts`, `browse/src/server.ts`, `bin/gstack-bun-version.sh` (`_gstack_bun_below` only, no new `_gb_*` globals), new `lib/sanitize-echo.ts` + its bash twin, `gstack-upgrade/SKILL.md.tmpl` (Step 4's floor check only).
- Lane B (PR 1b, on top of A): `bin/gstack-session-update`, new `bin/gstack-ff-update`, `bin/gstack-config`, `bin/gstack-memorable`, new `bin/gstack-claude-root.sh`, `setup` (hook-root, Cursor and Playwright hunks; the only PR that edits `setup`), `setup.ps1`, `bin/gstack-browser-ensure`, `gstack-upgrade/SKILL.md.tmpl` (Step 4's pull), `.github/workflows/windows-setup-e2e.yml`, `test/setup-ps1.test.ts`.
- Lane C (PR 2): new `lib/script-invocation.ts`, `hosts/claude/hooks/spawn-bin.ts`, `lib/gbrain-exec.ts`, `lib/regen.ts`, `lib/gate-diff/git.ts`, `bin/gstack-gate-diff`, `lib/restamp.ts`, `bin/gstack-evidence`, `lib/pregate/checks/secrets.ts`, `lib/pregate/lane-selection.ts` (manifest parser and `bash -c`; the only PR that edits it), new `.github/workflows/windows-pregate-e2e.yml`.
- Lane D (PR 3): `lib/pregate/import-graph.ts`, `browse/src/terminal-agent.ts`, `bin/gstack-skill-end`, `bin/gstack-timeline-log`, `bin/gstack-gbrain-sync.ts`, test-only files for #3163/#3156, `.github/workflows/*` action SHAs (not the two Windows job files), `.github/dependabot.yml`, `bun.lock` and dependency lines of `package.json` (#3145), README/CLAUDE.md skill lists, the OSV ledger comment, `ios-qa/daemon/src/devicectl.ts` and the ios-qa how-to.
- Lane E (PR 4): `scripts/resolvers/outside-voice-steps.ts`, the three plan-skill templates' outside-voice sections, `bin/gstack-ceo-plan-find`, `plan-eng-review/SKILL.md.tmpl`.
- Lane F (PR 5): `lib/pregate/checks/lanes.ts`, `bin/gstack-pregate`, `lib/pregate/context.ts`, `lib/pregate/index.ts`, the doctor files, `scripts/lib/windows-curation.ts`, `scripts/gen-skill-docs.ts` resolvers, the size-guard test.
- Lane G (PR 6): the census case and whatever its evidence names.
Every item lands with a test that fails on `47d639a` first (named per item). No existing assertion is weakened; existing pins that change are named per item as intentional contract changes.
### PR 1a and PR 1b — Recovery (High severity; ship first)
PR 1a holds items 1, 5, 6, 7 and 11; PR 1b holds items 2, 3, 4, 12, 13, 16 and W (items 13 and 16 move here so that `setup` has one owner).
**1. /autoplan locks after a Claude Code 2.1.300 auto-compaction — adopt #3196 (fixes #3194).** After compaction the `preservedSegment` boundary makes a parent cycle, the phase guard denies every phase entry with `close_incomplete`, and the run cannot continue. #3196 (vilano93) teaches `lib/claude-journal-records.ts` the boundary. Verified: `test/autoplan-compaction-preserved-segment.test.ts` fails 2/7 on main, passes on the PR; CI green; two compactions hold. Added: when owned nodes are unreachable from the root after the walk **and** a `compact_boundary` record (its logical parent or preserved list) explains the unreachable component, map it to the guard's existing `unrecognized_shape` disposition (allow with a visible warning and a decision-log row) rather than a false `close_incomplete`; orphaned or not-yet-flushed components keep today's behaviour, so the fail-open surface does not widen beyond compaction. Listed under the PR's gate-integrity edits. Negative controls: the existing denial tests and captured fixtures (`autoplan-publication-guard`, `-hook`, `guard-reasons`, `autoplan-publication-boundary-361c.json`) still deny. Reviewer test: a journal with a ~50k-record history and three compactions finishes inside the hook's time budget (memoize `descends` per walk if it does not).
**2. A conflicting autostash leaves conflict markers in the live install — adopt #3189 and #3191 through one shared bin.** On git 2.55, `merge --ff-only --autostash` with a conflicting stash exits 0, leaves markers in tracked files of the install, and setup runs over them. #3189 (BenjaminDSmithy) detects unmerged files, restores the checked revision, and keeps the stash. Verified: 8/10 of its tests fail on main. Take commits `069b80b` and `8dc0078`; drop `3d1caac`.
- The fast-forward-plus-recovery moves into a new bash bin `bin/gstack-ff-update <dir> <rev>`, the only code that moves an install's tree, called by `bin/gstack-session-update`, by `/gstack-upgrade` Step 4 and by the held-install recovery command (item 3). Step 4 never reimplements recovery in prose.
- Transaction ownership: the bin takes an install-scoped lock at `$(git -C <dir> rev-parse --git-common-dir)/gstack-ff.lock` (the updater's TTL and reap-by-mv logic) before any merge, `update-ref` or reset; callers keep their own locks. Inside the lock it captures the whole working tree as-is (tracked edits, unmerged and marker-laden files, and anything written after an earlier stash) into a rescue commit through a private index, then resets to the target only if the working-tree hash still equals the captured one; otherwise it refuses with `autostash-unrecoverable:` and changes nothing. The regenerable footprint (`SKILL.md`, `*/SKILL.md`, `*/sections/*.md`, rewritten by `gstack-patch-names` in prefix mode) is discarded first, as Step 4 does today.
- Rescue refs are named by the rescue commit id (`refs/gstack/rescue/<oid>`), created compare-and-create, never overwriting an unrelated ref. Tests: Step 4 racing a background updater on one install with two state roots; a barrier-controlled edit written between capture and reset (refused, edit kept); same-second recoveries; a pre-existing ref.
- A recovery that shelved edits is never silent: the session-start banner names the files and the rescue ref, says the edits conflicted with the update, and makes inspection the default (`git -C '<dir>' show --stat <ref>`); restoring is guided out of the live tree (`git -C '<dir>' diff <target> <ref> > ~/gstack-local-edits.patch`), never a bare `stash apply` into the install. The line repeats at most daily until the ref is deleted; the doctor lists rescue refs with the delete command (PR 5, item D). Ordinary success stays quiet. Test the background-to-foreground handoff.
- #3191 (Jesssullivan) reaps the lock heartbeat and its `sleep` child on exit (5/5 of its tests fail on main); update the two static pins in `test/session-update-autostash.test.ts` it breaks (intentional pin change).
- The #3189 test shim pins the real git binary once (resolving through any PATH wrapper) and fails fast with a named reason when it cannot, so no environment note is needed.
**3. Windows auto-update is held on every release — fix #3184, plus the recovery path for held installs.** `hook_incoming_hold` (`bin/gstack-session-update:100`) extracts the incoming revision with `git archive | tar`; MSYS tar cannot create the `connect-chrome` symlink (it precedes its target), the failure is fail-closed since 1.91.89.0, and the banner shows a stale "bun not found" instead of the hold.
- Fix: extraction without tar and without symlinks, both commands in one subshell with a private index: `( export GIT_INDEX_FILE=<tmp>/index; git read-tree <incoming>; git -c core.symlinks=false checkout-index -a --prefix=<tmp>/tree/ )` (symlinks become plain files containing the target path, which the hook check never reads). Tests: a valid installed hook against an invalid incoming hook causes the hold (proving the incoming bytes were checked); the real index is byte-identical afterwards. A tripwire test asserts that no hooked path or hook-imported module in the tree is a symlink, so a future symlinked hook fails loudly instead of reading as missing.
- The held reason carries the first 200 bytes of the failing command's stderr with newlines flattened and control characters stripped (as `:322` does for `PULL_REASON`). Test: stderr containing `\nstages=x` and an ESC sequence.
- Banner: the hold line prints before the stage line; each new hold reason (`unmerged-files:`, `autostash-unrecoverable:`, `bun-version-unreadable:`, `hook-check-unavailable:` with stderr) has its own banner case naming the exact command and a troubleshooting anchor, and no `stages=setup` fix prints while unmerged entries exist. Every path in a printed command is shell-quoted; tests execute the emitted commands against isolated installs whose paths contain a space and an apostrophe.
- Already-held installs: their old updater cannot deliver the fix, and the old `/gstack-upgrade` Step 4 still has the autostash hole, so recovery runs the **new** `gstack-ff-update` fetched from the new revision. Published forms, each labelled with where it runs: in Git Bash, `cd "<install>" && git fetch origin main && git show FETCH_HEAD:bin/gstack-ff-update > "${TMPDIR:-/tmp}/gstack-ff-update" && bash "${TMPDIR:-/tmp}/gstack-ff-update" . FETCH_HEAD && ./setup`; in Windows PowerShell 5.1, the same script run through Git's `bash.exe` followed by `.\setup.ps1`; in Claude Code, ask it to run the Git Bash form. Each form handles clean, dirty-conflicting, already-unmerged and prefix-mode installs (the bin discards the footprint and rescues everything else). `bin/gstack-upgrade`'s Git Bash refusal is reported to #3190 (URGENT block). The forms go into the CHANGELOG "If you…" block, the troubleshooting entry and the #3184 closing comment.
- Test that fails first: `test/session-update-hook-hold.test.ts` with an incoming revision containing a symlink sorted before its target and a PATH `tar` shim emulating MSYS; main logs `HELD hook-check-unavailable`, fixed code fast-forwards.
**4. `setup.ps1` fails under Windows PowerShell 5.1 — fix #3130.** PS 5.1's legacy native-argument passing strips the double quotes inside the `bash -c` string at `setup.ps1:59`. Reproduced with pwsh `$PSNativeCommandArgumentPassing='Legacy'`. Fix: a `-c` string with no double quotes, `set -f; IFS=; mapfile -d '''' -t argv < $1; rm -f -- $1; exec ./setup ${argv[@]}`; validated in Legacy and Standard modes with a space in TMPDIR and adversarial args (`$(touch PWNED)`, `it's`, `"quoted"`, `;echo injected`, backticks, `*`, `a\"b\`), none executed, all forwarded exactly. An empty-string argument is refused in PowerShell before dispatch (`setup.ps1: argument N is empty; setup takes no empty arguments`). Test that fails first: a behavioral case in `test/setup-ps1.test.ts` under Legacy mode (exit 2 on main); on win32 the same test runs `powershell.exe`; the pinned-source assertion changes (intentional).
**W. Windows CI proves items 3 and 4 natively.** The existing `windows-setup-e2e` job gains `setup.ps1` under `powershell.exe` (5.1) from a checkout path containing a space, `setup.ps1` in its path filter, and the held-install journey: a local bare origin whose `main` is this PR's HEAD plus a synthetic later commit containing `connect-chrome`; a prefix-mode v1.91.101.0 install in three states (clean, dirty-conflicting, already-unmerged); `auto_upgrade=true` with the throttle cleared, polling the updater log. Assertions: (1) the v1.91.101.0 updater logs `HELD hook-check-unavailable` (so the test is not vacuous); (2) the PowerShell recovery form reaches HEAD with every local edit present in a rescue ref; (3) the new updater then logs `UPDATED` for the synthetic commit. The job asserts executed counts, not skips. PR 2 adds its own job file for pregate and restamp.
**5. `/cso` Semgrep always reports `INVALID_OUTPUT` — fix #3185.** The scanner path splices redactions into raw JSON; `redactFindingSpans` (`lib/redact-engine.ts:577-583`) replaces a bare 10+ digit number (`"max_memory_bytes":1145427776`, drizzle `"when"` epochs) with an unquoted placeholder, `JSON.parse` fails, and the report is discarded. A delimiter-only rule is not enough (it misses `-4155551234` and can misfire inside strings). Fix: the scan operation's declared output format is carried through the real capture path (executor, Docker capture, process boundary) for scan stdout only; version probes and diagnostic stderr stay plain. For JSON-declared plans, the tokenizer runs over the concatenated stdout (not per interleaved run), tolerates multiple top-level values and NDJSON, is string- and escape-aware, and replaces each number token a merged span touches (`-?digits`, fraction, exponent) with the quoted placeholder, number by number; a span that crosses a token boundary or a structural character withholds the stream. Spans inside JSON strings keep today's in-string replacement; non-JSON streams are unchanged. Marker-only withholding and cross-stream release checks are kept. Tests that fail first: `JSON.parse(redact('{"a":4155551234}'))` succeeds with the value redacted; a spliced Semgrep report with `"time":{"max_memory_bytes":…}` returns `status: 'complete'`. Also: negative, exponent, `[4155551234,4155551235]`, multi-line NDJSON, whitespace, punctuation-inside-string and escaped-quote cases; the real version-then-scan capture sequence with stderr interleaved; the output is a fixpoint of the views check at `lib/cso/process.ts:120`; a non-JSON stream keeps the unquoted form (`test/cso-eval.test.ts:1029,1071`). Behavior change listed.
**6. `/cso` cannot use OrbStack's Docker — adopt #3188 (fixes #3187).** `executable()` returns the realpath and OrbStack's multicall binary dispatches on argv0. #3188 (aegixx) spawns the trusted canonical path with `argv0: 'docker'`, including in `watchdog.c`. Verified with a fake multicall binary; its test fails on main. Change: the python3 `spawnSync` at `test/cso-docker-argv0.test.ts:109` gets a timeout. The trust check still runs on the realpath.
**7. The browse daemon wedges when its last tab is closed outside the CLI — adopt #3179 with changes (fixes #3167).** Reproduced on main: after an external close every command, `status` and `stop` included, throws "No active page". #3179 (aftabkh4n) reopens a page on demand. Changes: `status` and `stop` bypass recovery (so a closed headed context can still be stopped); a failed recovery maps to a named error carrying the restart command; a command that ran on a recreated tab prints a one-line warning. Reviewer tests: `status`, `goto` and `stop` after an external close; the closed-context case; a text read after recovery shows the warning.
**11. The Bun floor check fails open under zsh — fix #3195 (promoted: zsh is macOS's default shell, so `/gstack-upgrade` Step 4 accepts Bun 1.3.2 there).** `_gstack_bun_below` relies on word-splitting `$_gb_core`; zsh does not split, `[ -ne ]` errors, and every error path reads as "not below". Fix: compare the already-parsed `_gb_maj`/`_gb_min`/`_gb_pat` (copied between the two parses, no new `_gb_*` globals) with `$((10#…))`; a parse failure returns a distinct status that every caller treats as a hold and prints `BUN_VERSION_UNREADABLE` (the version output and the bun path, both passed through the one flatten-and-strip sanitizer every echoed external string uses, its own fix and anchor, never "bun upgrade"); Step 4 runs the check through `bash -c`. One version table (1.3.2, 1.3.3-canary.1, 1.3.3, 1.3.14, 1.4.2, 1.10.0, 01.04.02, 2.0.0, garbage) drives bash, zsh, `bash --posix` and the TypeScript twin's `below()`. Test that fails first: `zsh -c '. bin/gstack-bun-version.sh; gstack_bun_status 1.3.2'` expects `too-old` (skipped without zsh); a source assertion that Step 4 invokes bash.
**12. Setup bakes an ephemeral `CLAUDE_CONFIG_DIR` into global hooks — adopt #3181 with changes (fixes #3180).** #3181 (Brit-juho) registers hooks at `$HOME` when the config dir links back to it. Changes: `bin/gstack-memorable` has a verbatim copy of the old block, so `gstack_canonical_claude_root` moves into one sourced helper `bin/gstack-claude-root.sh` used by both; `resolve()`'s `spawnSync` gets a timeout (it fails the tripwire today); the PR's source-slicing test is rewritten to source the helper (intentional test change). Tests that fail first: `test/setup-hook-canonical-paths.test.ts` "per-session config dir linking back", plus a memorable case.
**13. Cursor loads duplicate skills from 1.31-era unprefixed folders — adopt #3152 (fixes #3133; ships in PR 1b).** #3152 (szsunyuan) removes unprefixed Cursor folders proven generated and keeps user-owned ones. Its test fails on main, passes on the branch; CI green. Reviewer test: a user folder whose SKILL.md is a symlink to somewhere outside any gstack checkout is kept. Setup prints which folders it removed.
**16. Missing `bunx` is reported as a network failure — fix #3131 (ships in PR 1b).** A winget Bun ships no `bunx`. Fix: `bun x` through setup's existing bun resolver and in `bin/gstack-browser-ensure`; rc 127 prints `<resolved bun> x playwright install chromium exited 127 (command not found); install Bun from bun.sh (winget Bun ships no bunx), or skip with ./setup --no-browser (Git Bash) or .\setup.ps1 --no-browser (PowerShell)`. Test that fails first: `test/setup-playwright-best-effort.test.ts` with a winget-shaped Bun (bun present, no bunx); the existing `bunx()` stub is renamed (intentional: the block under test changes).
### PR 2 — Windows script invocation (High)
**10a. Windows pregate and restamp refuse because Bun cannot spawn bash scripts — fix #3197 on main's call sites.** `bin/gstack-wtree` is spawned directly at `lib/regen.ts:133`, `lib/gate-diff/git.ts:84`, `lib/restamp.ts:512`, `bin/gstack-evidence:200`; `gstack-slug` at `restamp.ts:591`; `gstack-redact` at `lib/pregate/checks/secrets.ts:38`. gstack already has three conflicting Windows bash resolvers (`hosts/claude/hooks/spawn-bin.ts:27` falls back to a bare PATH `bash`, the WSL trap `lib/gbrain-exec.ts:211` warns about; `lib/gbrain-exec.ts:180`; `setup.ps1:31`).
- `lib/script-invocation.ts` becomes the only TypeScript resolver, used by hooks' `runBin`, `gbrain-exec`, regen, restamp, evidence, secrets and lane-selection's `bash -c`. Order: `GSTACK_GIT_BASH` (canonical, the name `setup.ps1` already reads), `GSTACK_BASH` as a deprecated alias at the same precedence in both `setup.ps1` and TypeScript; then bash under `git --exec-path` (resolves through scoop-style shims, per-user and portable Git); then the known install paths; then a PATH `bash` only when it reports MSYS/MINGW (System32 and WindowsApps `bash.exe`, i.e. WSL, rejected); else an actionable refusal that lists each candidate tried with its rejection reason and names `GSTACK_GIT_BASH`. The same text is used by the gbrain "no bash found" line and `setup.ps1`. Hooks' hot path stays spawn-free (`Bun.which` plus path arithmetic) with the resolved bash cached in the state root keyed by `git.exe` path and mtime; the Windows job times a hook invocation. Bun-shebang bins run as `process.execPath <script>`, falling back to `Bun.which('bun')` when the executable is not Bun (compiled binaries); the tripwire stops compiled entries importing the module unguarded. One fixture table (override, alias, scoop shim, per-user Git, portable Git, WSL rejection, missing) drives both the TypeScript resolver and `setup.ps1` (pwsh on Linux CI with injected paths). Behavior change listed: a non-MSYS PATH bash is no longer used.
- One `wtreeFingerprint({cwd, timeoutMs})` that always sets `GIT_OPTIONAL_LOCKS=0`, accepts 40–64 hex (so SHA-256 repos get a fingerprint in `gstack-evidence`), and returns `{tree}|{error}`, distinguishing a launch/discovery failure from a helper exit. Consumers migrated in this PR, each keeping its fail direction with an error-path test: `bin/gstack-gate-diff:157`, `lib/regen.ts:147`, `lib/restamp.ts:512`, `bin/gstack-evidence:200`, plus artifact tree-string fields and the before-check, after-check, publication and no-scratch regen paths (sync and async). The pregate consumers (`lib/pregate/context.ts:66,97`, `lib/pregate/index.ts:120`) are files #3190 changes, so they move in PR 5 (item 10b) through a compatibility wrapper this PR keeps.
- Tests that fail first: an invocation unit test with injected `platform:'win32'` and `exists` (per-user Git, portable Git, override, WSL rejection, missing bash refusal); a source tripwire that no `lib/`, `bin/*.ts` or `hosts/**` file spawns a shebang bin by path or calls `spawnSync('bash'`; a new `windows-pregate-e2e.yml` job runs `gstack-restamp --dry-run` and the regen/evidence paths under pinned Bun and Git for Windows (`gstack-pregate run` joins it in PR 5). Moving pregate tests back into the Windows curation is a PR 5 edit (`scripts/lib/windows-curation.ts` is a #3190 file).
### PR 3 — Maintenance (Medium and Low)
**8. Pregate misses tests in Next.js route groups and tsconfig path aliases — adopt #3176 with changes (import-graph half in PR 3; manifest-parser half in PR 2, which owns `lane-selection.ts`).** #3176 (vocodestudios): `test/pregate-import-graph-paths.test.ts` 2 fail on main → 4 pass. Changes: aliases resolve exact match first, then the most specific wildcard, then target fallback; when no single target is established, union the plausible dependencies (the graph's "uncertainty selects more tests, never fewer" contract); relative `extends` followed to a bounded depth (the limit named in no-lane explain output); trailing commas dropped inside the tokenizer, not by a global regex. `lib/pregate/lane-selection.ts:42`'s manifest parser keeps framework paths intact (today `app/(shop)/[id]/page.test.ts` becomes `page.test.ts`, which can erase a platform lane's receipt obligation at `:91-94` and fall back to a local run at `:100`). Reviewer tests: overlapping aliases with both targets present in both key orders; exact vs wildcard; a callback-level fixture where a bracketed route test in a platform-only lane keeps its remote receipt obligation. `PREGATE_NO_LANE` explain output prints the unresolvable specifiers seen in test files, with the hint to declare dependencies or report the resolver gap.
**15. Terminal-agent shutdown can orphan HUP-immune PTY descendants — adopt #3148 with changes (fixes #3147).** On main the PTY hangup already kills children that honour SIGHUP; the PR's test fails on main only because it checks the instant the agent exits. Changes: record a spawn-time ownership identity for the PTY session/process group that stays valid after the leader exits; group escalation is not cancelled when the direct child exits; after the grace period the proven-owned group is terminated, so long-lived HUP-immune descendants are reaped, not just the direct child; spawn with `process.execPath`; refuse new connections during the shutdown grace. Reviewer tests: a HUP-immune grandchild through an actual terminal-agent shutdown is dead after the grace period plus one second; an early-exiting leader with a surviving descendant; a foreign group and a reused PID are never signalled.
**19. skill-end pushes before writing its own completion event — fix #3198 (Kkkkkuro's patch).** Move the completion `gstack-timeline-log` call above the final drain; `gstack-timeline-log` waits for its enqueue (one config read and a spool write; exits early when sync is off or unattended). Every consent, secret-scan and queue-lock gate is kept. Fix the stale "local-only, never sent anywhere" comment. Test from the issue (2/7 → 7/7).
**20. `gstack-config` root-path prefix compare and unquoted recovery commands — adopt #3186.** Its test fails 2 on main. Reviewer test executes the printed recovery command against a root path containing a space. The bash 3.2 case is [unverified] on Linux.
**21. gbrain-sync appends a pin line git already ignores — adopt #3178 with changes.** Changes: test `spawnSync` timeouts (lines 89, 100); the check is `git -c core.excludesFile= check-ignore -v` and accepts only a tracked `.gitignore` as the matching source (not global excludes, not `.git/info/exclude`); fixtures isolate `HOME` and `XDG_CONFIG_HOME`.
**22. Test hygiene — adopt #3163 (fixes #3162) and #3156 (fixes #2967).** #3163: ship-measure CLI tests get a private HOME (reproduced: `bun run test` leaves `ship-measure-cli-*` dirs in the real `~/.gstack/projects`). #3156: fixture git ignores inherited hooks, using `core.hooksPath=/dev/null` instead of `NUL` (Git for Windows rejects `NUL`); its load-only explanation is unproven, the isolation is right regardless.
**23. Dependencies and small docs.** Adopt dependabot #3175 and update the upload-artifact SHA pin at `test/model-policy-workflow.test.ts:542` (intentional: the pin tracks the workflow). #3145 (sonukapoor, declares `sharp`, clears two transitive advisories): adopted only with a non-skipping, isolated classifier model-load and inference smoke on the changed tree that asserts non-degraded output; if that smoke cannot run, only the `sharp` declaration lands and the inference-runtime bump is deferred. Close #2923; `.github/dependabot.yml` ignores only `semver-minor` and `semver-major` updates for `playwright`/`playwright-core` (patch and security updates still flow), and the 1.64 migration (re-key the windowsHide patch, the Dia/cookie qualification pins, the arm64 artifact name) is filed with owner Garry and revisit date 2026-11-15. Defer #3174 (agent-sdk 0.3: 12 new test type errors, breaks `overlay-sdk-cancel-eof` cancellation 2/2) with the same owner and date. #3169: drop the stale skill lists in README and CLAUDE.md, keep the `/browse` rule; a free test fails if any skill list present differs from the `*/SKILL.md` names; the matching doctor warning for pasted skill lists ships in PR 5 (item D). #2753: reword the OSV image-size ledger (2.0.3 fixes it; html-to-docx pins `^1.0.0`), keep its 2026-11-30 expiry. #1796: reimplement only `GSTACK_IOS_LAUNCH_ENV` in both launch paths: a JSON object of string to string; invalid JSON, non-string values, or keys colliding with the debug bridge's own variables refuse with a result code instead of launching without it; documented with an example in the ios-qa how-to; credit Bmathews721, close the PR.
### PR 4 — Prompt changes (Medium; eval-gated)
**17. The Claude outside-voice fallback depends on the removed TaskOutput tool — fix #3182.** Claude Code 2.1.277 removed TaskOutput; the native fallback in plan reviews (`codexPlanBoundedWait`, `scripts/resolvers/outside-voice-steps.ts:466`) preflights it, so users without the Codex CLI never get a second voice. Reading the background output file is not an option (it is the raw transcript, which the skill rejects).
- Step 1, a free spike on Claude Code ≥2.1.277: record which completion and cancellation primitives exist (background completion notification and its subagent-result header, foreground Agent result, TaskStop) and measure native reviewer durations from captured runs.
- Step 2: if the host can enforce a deadline (background dispatch, completion notification, stop on deadline), implement that, keeping "only an identifiable complete final report counts" (accounting for the 2.1.277 subagent-result header) and "no late-result credit". If it cannot, the item stops and returns to Garry as a decision: an honestly unbounded foreground reviewer, or "outside voice unavailable" with its cause. No unenforced prompt-only bound ships.
- The unavailable line names the missing capability (Codex CLI missing or unauthenticated; Plan agent type not offered) and the action, in the output and the persisted result.
- Pins that change (intentional): `test/run-in-background-guidance.test.ts:189-193,272-286`, `test/outside-voice-preflight.test.ts`, `test/plan-review-cases.test.ts`, `test/skill-ceo-section-ordering.test.ts`. Free check first: rendered review sections do not require TaskOutput. Then its selected judge and the affected paid outside-voice case, priced through `/eval-plan` and approved before spend.
**14. plan-eng-review ignores the CEO plan — adopt #3159 with changes (fixes #280).** #3159 (szsunyuan) adds `bin/gstack-ceo-plan-find` and reads the CEO plan in the Design Doc Check; CI green. It edits a plan-skill template, which selects paid gate cases and a judge, so it lives in this eval-gated PR. Changes: the finder's stdout stays a bare path or empty (the API `$DESIGN`-style callers rely on); provenance prints as one separate human line, `CEO plan found (from branch <b>, not <current>): <path>`, only for the cross-branch fallback; the skill lets an interactive user skip a plan from another branch, and an unattended run uses it with the printed disclosure (tested). The design-doc finder's matching disclosure is deferred (it changes the shared discovery block in four skills plus spec-review). The PR raises the plan-eng-review prompt-size ceiling from 1.2170 to 1.2196 [measured: triage-B, #3159 diff]; that is an owner decision (gate item); if declined, the template is trimmed to fit. Pins that change are named in the PR; its selected gate cases and judge are priced with item 17's.
### PR 5 — After #3190
**9. Pregate never recognises `.bats` tests — adopt #3177 (fixes #3161).** In bats repos `lanes` always fails. #3177 (harjothkhara): CI green, its bats tests pass; one-line conflict with #3190 in `lanes.ts`, rebased. Reviewer test: a bats file in a nested directory selected end to end.
**10b. The rest of #3197.** #3190's new `gstack-config` spawn routes through `lib/script-invocation.ts`; `bin/gstack-pregate:120` stops reporting a wtree failure as "origin/<base> is not a resolvable commit": the pregate consumers (`lib/pregate/context.ts:66,97`, `lib/pregate/index.ts:120`) migrate to item 10a's `wtreeFingerprint`; a launch/discovery failure is the new result code `WTREE_UNAVAILABLE`, whose detail lists each bash candidate tried with its rejection reason and whose fix names `GSTACK_GIT_BASH` (quoted example); a helper exit keeps a cause-specific message (for example a TMPDIR repair). Under `--json`, every context refusal (unavailable base, `WTREE_UNAVAILABLE`) is one envelope on stdout (`ok:false`, `status:'refused'`, `code`, `detail`, `fix`, `docs`) with exit 3; `GSTACK_RESULT` goes to stderr under `--json`, documented in `--help` and the troubleshooting entry. `gstack-pregate run` joins the `windows-pregate-e2e` job, and the pregate tests excluded from the Windows curation for the "shebang via CreateProcess" reason move back where they now pass. Tests: a wtree failure does not print "is not a resolvable commit" and ends with `(WTREE_UNAVAILABLE)`; a helper-exit failure keeps its own fix; both refusals through the CLI with `--json` parse as JSON with one discriminator shared with the success object.
**D. Doctor rows.** `gstack-doctor` lists `refs/gstack/rescue/*` with dates and the inspect and delete commands (item 2); warns when a gstack block in `~/.claude/CLAUDE.md` or a project CLAUDE.md enumerates skills and prints the short replacement (#3169); prints the resolved Windows bash and the variable that chose it (item 10a); and its Windows fix line names the held-install recovery forms of item 3 instead of `bin/gstack-upgrade` until #3190's thread fixes the path-spelling refusal.
**24. Generated SKILL.md size guard — #3199.** A free test fails when any generated SKILL.md for any host exceeds 100,000 chars, printing host, skill, actual and limit, and the fix. Current offenders (Claude `design-review` 136.8k [measured: triage-D], eight Hermes skills) are allowlisted at their current size, so growth fails and shrinkage requires lowering the pin. The preamble hoist is deferred (owner Garry, revisit 2026-11-15).
**25. Plan-mode section on hosts that have no plan mode — #3168.** The resolver honours the existing, unread `capabilities.planMode` host setting so planMode:false hosts (Hermes) omit the plan-mode section; goldens regenerate after #3190's.
### PR 6 — Census repair
**18. The weekly census has one red case and one headroom breach — #3153.** Its own PR so that a decision on item 17 cannot hold it; folded into PR 5 instead if the repair edits `ship/` (a #3190 area). The periodic tiers were green on Oct 12; the red is the gate-census case `ship-exploratory-late-input` probing before reading its sections (the same failure as the Oct 7 capture) and `review-army-simplification` over its headroom cap. Read the Oct 12 evidence and the free Oct 19 census first; a repair to `ship/` prose runs `gstack-lane-check` against #3190's `ship/` templates and sections before editing. Paid reruns only for the affected cases, priced and approved first, never retried to change a verdict.
### Not in this wave (reason, owner, revisit)
- **#3193** Dart/Flutter pregate lanes (High for Flutter users): ≈830 lines, conflicts with #3190 in 5 files, mixes in a trust-model change (user-owned pregate policy plus a `local` key that loosens the unrun-Windows-lane guard). Ask the author to rebase onto #3190 and split into recognition + import graph, run groups, and the policy change. Owner: Garry (policy decision); revisit when the split lands.
- **#3192** HydraDB (feature): depends on unmerged gbrain#6695 by the same author; changes every gbrain user's search path. Owner: Garry; revisit when gbrain#6695 merges.
- **#3129** drop "When to invoke": owner decision, rebuild after #3190. Owner: Garry; 2026-10-29.
- **#3132** ios-qa session resume (Garry's draft): real-iPhone verification. Owner: Garry.
- **#2595/#2124** Windows code signing: needs a signing account. Owner: Garry; 2026-11-15. #2124 closes as a duplicate of #2595.
- **Host drift canary:** extend the daily canary with a tool-inventory assertion (tools and subagent types gstack prompts require) and a compaction journal-shape capture, since TaskOutput's removal (2.1.277) and the compaction shape (2.1.300) are one recurring class. Owner: Garry; 2026-10-29.
- **Design-doc finder cross-branch disclosure** (the second half of item 14): changes the shared discovery block in four skills plus spec-review. Owner: Garry; 2026-11-15.
- **#340** wireframe persistence: needs a downstream consumer in plan review (an eval-gated prompt change). Owner: Garry; 2026-11-15.
- **#2993, #3183, #3091, #2120, #542, #1319, #2623, #3157, #3158, #3150, #356, #1060, #1048, #2118, #1791, #1651, #2378, #1022, #954, #661, #2920, #2754:** product calls, eval-gated prompt changes, deprecated install modes, external owners, or needs-info. Each gets a comment with its reason; owner Garry unless the triage report names an external owner (#2920 → gbrain); revisit 2026-11-15.
- **Closes, posted by a dated follow-up this thread registers for 2026-10-22, each with its file:line evidence:** #2709, #931, #407, #886, #1957, #2756 (also drops TODOS.md:47/:985), #2365 (refresh the past "sunsets Sept 4" wording), and, once their confirmation windows end that day, #2637, #2295, #2151, #1775, #1674, #1731, #1967, #494, #528, #2847, #1076.
### Upgrade notes and docs (every PR)
Every printed or published command says where it runs (Claude Code, Git Bash, or Windows PowerShell 5.1) and quotes its paths; PowerShell users get a form that works in PowerShell (no `&&`, `.\setup.ps1` rather than the extensionless script), exercised under `powershell.exe` in item W. Each user-visible item adds or extends a `docs/troubleshooting.md` entry headed by its exact error text (#3184 hold, #3130 EOF, #3131 exit 127, #3185 `INVALID_OUTPUT`, #3187 argv0, #3167 "No active page", `BUN_VERSION_UNREADABLE`, the rescue-ref banner, `WTREE_UNAVAILABLE`): meaning, one copy-paste fix, "fixed in vX" (`test/troubleshooting-anchors.test.ts`). The CHANGELOG has an "If you…" block, one line per cohort (Windows-held: the recovery command; local edits in the install: the rescue ref; Cursor: which folders are removed; hooks: the new registration root; /cso: the quoted placeholder), mirrored in each PR's `## Behavior changes`.
### Verification
Per lane: the failing-first tests above; `bun run typecheck`; `typecheck:test` ratchet; `test/spawnsync-timeout-tripwire.test.ts`; `test/module-size-ratchet.test.ts`; template edits run `gen:skill-docs`, `test/parity-suite.test.ts` and the context-budget ratchet; `gstack-pregate run --allow-repo-commands`. Integrator per PR: the SHA-bound merge receipt with #3190 (one merged tree per pair, freshness and focused tests run once), `bun run test` once on the frozen tree on Ubicloud, secret scan, CHANGELOG with contributor credit, the native Windows jobs green for PRs 1b and 2. Paid spend only for PR 4 (items 14 and 17) and PR 6 (item 18's affected cases), each priced through `/eval-plan` and approved before it starts.
## Review record
Revision 1 (snapshot `eed7849f`) was reviewed by CEO, DX and Eng, each with Claude Opus 5.5 (native) and GPT-6.1 Sol (outside); 60 findings (CEO 16+6, DX 15+5, Eng 13+5), no Critical. Every finding was accepted into revision 2 except where noted:
- CEO: delivery split into five independently acceptable PRs with recovery first (native F1, F4; outside F6); recovery path for already-stuck installs and the `bin/gstack-upgrade` URGENT handoff (native F2, outside F1, confirmed); item 1 maps to the existing `unrecognized_shape` (native F3); native Windows CI coverage, item W (native F5, the one user challenge; outside F3); host-drift canary recorded as a dated deferral (native F6); item 17 needs an enforced bound or an owner decision (native F7, outside F5, confirmed); dependabot ignore scoped to minor/major (native F8); #3197's main sites move to PR 2 on main (native F9); item 18 premise corrected and owned (native F10); owners and dates for deferrals and a dated close follow-up (native F11); tar-free extraction plus symlink tripwire (native F12); reviewer-written tests for adopted PRs (native F13); item 11 promoted (native F14); quoting limited to JSON streams (native F15); no fork CI approval (native F16); manifest-parser receipt preservation (outside F2); classifier smoke or split for #3145 (outside F4).
- DX: banner cases and anchors per new hold reason (native F1); visible rescue-ref notice (native F2, outside F2); troubleshooting entries and the CHANGELOG "If you…" block (native F3, F4); one finder output format (native F5); `BUN_VERSION_UNREADABLE` (native F6); actionable exit-127 text (native F7); git shim pinned instead of an environment note (native F8); reporter confirmation before merge (native F9); size-guard output and ratchet (native F10); empty-argument refusal in setup.ps1 (native F11); doctor warning for pasted skill lists (native F12); unavailable line names cause and action (native F13); `WTREE_UNAVAILABLE` fix clause (native F14); unresolved specifiers in no-lane output (native F15); git.exe-relative bash discovery (outside F1); JSON refusal envelope (outside F3); quoted recovery commands executed in tests (outside F4); #340 deferred until it has a consumer (outside F5, resolved by deferral instead of adding a prompt change).
- Eng: one bash resolver (native F1); shared `gstack-ff-update` bin (native F2); fingerprint consumer inventory (native F3, outside F5); #3181 tripwire and helper test (native F4); complete-token JSON quoting (native F5, outside F2); literal-safe extraction, superseded by tar-free extraction (native F6); flattened stderr (native F7); status/stop bypass recovery (native F8); merged-tree checks in the receipt (native F9); `.git/info/exclude` excluded (native F10); `extends` and tokenizer comma handling (native F11); long-journal performance test (native F12); one version table (native F13); stash-oid rescue refs (outside F1); alias precedence (outside F3); process-group reaping (outside F4).
Revision 2 (snapshot `d0628720`) was reviewed by the same six voices; 37 findings (CEO 10+3, DX 9+4, Eng 8+3), no Critical, no user challenge. All accepted into revision 3:
- CEO: PRs 1a/1b split, real dependencies stated, `setup` and `lane-selection.ts` each given one PR, PR 2 gets its own Windows job file, the coordinator exception covers exactly the append-only set with merge-and-restamp after each sibling merge (native F1, F4; outside F3); #3190-shared files the revision added (doctor, curation, `free-tests.yml`, pregate `context.ts`/`index.ts`) moved to PR 5 (native F2; outside F3); held-install recovery runs the new `gstack-ff-update` fetched from the new revision and covers clean, dirty, unmerged and prefix-mode installs (native F3; outside F1); scoop-safe bash discovery via `git --exec-path` and MSYS-verified PATH bash (native F5); reporter trial after review, exact detached commands, 48-hour evidence not a gate (native F6); item 18 its own PR (native F7); `spawn-bin.ts` path (native F8); Oct 29 follow-up registered (native F9); whole-stdout JSON tokenizing (native F10); private index bound to both extraction commands (outside F2).
- DX: commands labelled by shell with a PowerShell form (native F1); `WTREE_UNAVAILABLE` lists candidates and names `GSTACK_GIT_BASH`, separate from helper-exit failures (native F2; outside F2); one canonical override name (native F3); finder stdout stays a bare path, design-doc half deferred (native F4; outside F3); rescue refs repeat daily and are listed by the doctor (native F5); `ok:false` envelope and `GSTACK_RESULT` location (native F6); `GSTACK_IOS_LAUNCH_ENV` format and refusal (native F7); one echo sanitizer (native F8); unattended default for a cross-branch CEO plan (native F9); safe inspect-first rescue guidance (outside F1); item 14 moved to the eval-gated PR (outside F4).
- Eng: install-scoped lock in `gstack-ff-update` (native F1; outside F1); working-tree capture and compare before reset protects late writes (outside F1); `unrecognized_shape` only for compaction-explained components with negative controls (native F2); spawn-free cached hook resolution (native F3); a non-vacuous item W harness (native F4); token-level, NDJSON-tolerant JSON quoting that withholds on cross-token spans (native F5); `Bun.which` fallback for compiled binaries (native F6); one merged tree per pair (native F7); one bash-discovery fixture table for TypeScript and `setup.ps1` (native F8); PTY group ownership survives leader exit (outside F2); scan-stdout format propagated through the real capture path (outside F3).
## Build corrections from the revision-3 review (binding on every lane)
Revision 3 (snapshot `5d243037`) was reviewed by the same six voices: 23 findings (CEO 6+3, DX 6+1, Eng 5+2), one High, no Critical, no user challenge; every revision-2 finding was confirmed resolved. None changes scope or direction, so they are applied as lane tasks rather than another review round:
1. **Rescue export must not reverse upstream fixes (DX native F1, High; DX outside F1).** The rescue commit's parent is the pre-update HEAD (its real baseline); the banner prints `git -C '<dir>' diff <ref>^ <ref> > ~/gstack-local-edits.patch` (the user's delta only) and suggests `git apply -3` in a scratch checkout. Already-unmerged captures are labelled "needs manual resolution". Test: the patch touches only user-edited paths, and an unrelated upstream fix survives restoring the user's edit.
2. **The original index is preserved too (Eng outside F2).** The rescue keeps the staged state as a second parent or ref, separate from the working tree, without touching the real index while building it. Tests: staged-only changes; differing staged and unstaged versions of one file.
3. **The lock path is absolute, with a heartbeat (Eng native F1, outside F1).** `git -C <dir> rev-parse --path-format=absolute --git-common-dir`; the 300 s heartbeat with #3191's reaping, or reclaim only when the holder's PID is dead. Tests: two actors in different working directories and state roots, including a linked worktree; no lock dir appears in the user's project; a holder that outlasts the TTL.
4. **Move with a two-way read-tree, not reset (Eng native F3).** `git read-tree -m -u <captured> <target>` on the private index, so git refuses to overwrite modified or untracked files; the refusal maps to `autostash-unrecoverable:`.
5. **Explicit rescue identity (Eng native F4).** Rescue commits use scoped `GIT_AUTHOR_*`/`GIT_COMMITTER_*` (`gstack rescue <gstack@localhost>`); tested with `HOME`/`XDG_CONFIG_HOME` isolated and `GIT_CONFIG_NOSYSTEM=1`.
6. **`gstack-ff-update` is self-contained (CEO native F3; CEO outside F2).** No sourcing; lock and sanitize logic inlined and pinned to the shared twins by a test. The recovery forms fetch and run it inside a uniquely created private temp directory (`mktemp -d`, checked, cleaned up), never a fixed `$TMPDIR` path. Free Linux test: copy the bin outside any checkout and recover a v1.91.101.0 install; a pre-existing symlink and concurrent invocations never clobber or share a script.
7. **Literal PowerShell 5.1 forms (DX native F2; CEO native F4).** Recovery, trial and go-back each get a literal PowerShell form: locate `bash.exe` from `git --exec-path`, a `-c` string with no double quotes (item 4's pattern), all redirection inside bash, finishing with `.\setup.ps1`. The go-back command (both shells) discards the regenerable footprint first. Item W runs each form under `powershell.exe` on a prefix-mode fixture.
8. **Item W ordering (Eng native F2).** The bare origin's `main` is PR HEAD for assertions 1 and 2 (`connect-chrome` already reproduces the hold); the synthetic commit (a symlink sorted before its target) is pushed only after recovery, then `UPDATED` is asserted for it.
9. **How to set the bash override (DX native F3, F5).** Shell-labelled persistent recipes: a PowerShell user environment variable plus a Claude Code restart, or the `env` block of `~/.claude/settings.json` (a Git Bash export reaches only that shell). The override bypasses the cache and is never cached. `GSTACK_GIT_BASH` wins when both names are set; a warning prints once when they differ (row added to the shared fixture table).
10. **Hook bash cache hygiene (Eng native F5).** Written by temp file plus rename; the cached path is stat-checked before use and re-resolved if missing.
11. **Banner carries the delete command (DX native F6).** `git -C '<dir>' update-ref -d <ref>`, shell-quoted and executed in the banner tests.
12. **Result codes and cohorts (DX native F4).** Each new refusal gets a result code and a troubleshooting entry under its exact text: the shared "no bash found" refusal, the `GSTACK_IOS_LAUNCH_ENV` refusal (`IOS_LAUNCH_ENV_INVALID`), `setup.ps1`'s empty-argument refusal, item 7's browse recovery error, item 17's unavailable line. CHANGELOG "If you…" adds zsh users now held on an old Bun, users of a non-MSYS PATH bash, and `GSTACK_BASH` users.
13. **Ownership holes (CEO native F1; CEO outside F3).** `bin/gstack-config` moves from Lane B to Lane D (item 20). #3175 lands in PR 3 without its `free-tests.yml` hunk, re-bumped in PR 5. `test/helpers/carve-guards.ts`, `test/fixtures/context-budget.json` and `test/setup-playwright-best-effort.test.ts` join the integrator-owned set resolved at restamp, and are listed among the #3190 overlaps; tests and ratchet adapters are part of each lane's ownership inventory.
14. **PR 5's real dependencies (CEO native F2).** PR 5 depends on PR 1b and PR 2 as well as #3190; it is built on `capy/next-wave` after main (with 1b and 2) is merged into it, or on main after #3190 merges. The Oct 29 rebuild has the same precondition.
15. **Paid gates for every PR (CEO outside F1).** Each PR runs the no-spend gate and judge selection; any selected paid check, including in PRs 1a and 1b, is priced through `/eval-plan` and approved before dispatch; reused evidence is bound to unchanged consumed inputs.
16. **Item 25's hosts (CEO native F6).** Every planMode:false host (hermes, codex, agy, openclaw, and define-host's default) is listed in item 25 and in PR 5's Behavior changes.
17. **The split is an owner decision (CEO native F5).** `.gstack/ship-policy.json` sets `default_pr_count=1` and `split_requires_owner=true`. Seven PRs means seven PATCH slots, seven frozen-tree `bun run test` runs on Ubicloud, and a restamp after each merge. Recommended for recovery speed; presented to Garry with the gate.
+11
View File
@@ -128,8 +128,18 @@ Set these env vars to target a specific device or bundle:
GSTACK_IOS_TARGET_UDID=248C3A58-B843-5BDB-8F5D-89ADB7D7BF6A
GSTACK_IOS_TARGET_BUNDLE_ID=com.yourorg.yourapp
GSTACK_IOS_DAEMON_PORT=9099 # loopback listener port; default 9099
GSTACK_IOS_LAUNCH_ENV='{"DEBUG_BRIDGE":"1"}' # optional: env for the app when the daemon launches it
```
`GSTACK_IOS_LAUNCH_ENV` is for apps whose debug bridge (or anything else) is
gated on an environment variable. It is a JSON object of string to string, and
the daemon passes it to `xcrun devicectl device process launch
--environment-variables` on every launch it performs, including the one forced
relaunch below. It only takes effect when the daemon launches the app; an app
that is already running keeps the environment it started with. Invalid JSON, a
non-string value, or a `GSTACK_` key (reserved for the debug bridge) refuses the
launch with `IOS_LAUNCH_ENV_INVALID` instead of starting the app without it.
If `GSTACK_IOS_TARGET_UDID` is unset, the daemon picks the best paired,
available iPhone or iPad, preferring a wired device. When two devices tie (an
iPhone and an iPad both on USB), it refuses to guess: the bootstrap error lists
@@ -230,6 +240,7 @@ Before you ship to TestFlight or the App Store, run `/ios-clean`. It removes the
| `Developer Mode` toggle missing from Settings → Privacy | Connect the device to Xcode → Window → Devices and Simulators once, or try any `devicectl device install` against it. iOS will surface the toggle after the first attempt. |
| `xcrun devicectl device copy from` returns ERROR 7000 | The source path is wrong — boot token lives at `tmp/gstack-ios-qa.token` inside the app's data container (NSTemporaryDirectory), not at the path's root. |
| Bootstrap fails with `multiple_devices` | More than one iPhone/iPad is connected. Run the printed `export GSTACK_IOS_TARGET_UDID=<udid>` and restart the daemon. |
| Launch refused with `(IOS_LAUNCH_ENV_INVALID)` | `GSTACK_IOS_LAUNCH_ENV` is not a JSON object of string to string, or sets a `GSTACK_` key. Fix or unset it and restart the daemon; see [troubleshooting](troubleshooting.md#ios-launch-env-invalid). |
| `boot_token_unavailable ... could not write tmp/gstack-ios-qa.token` | The app could not write its boot-token file. Fix the app's `tmp/` directory and relaunch the app. |
| A SwiftUI `DragGesture` or `Canvas` ignores taps and swipes on iOS 26 | Synthesized in-process touches do not reach SwiftUI gesture recognizers on iOS 26, and `/swipe` only scrolls a `UIScrollView`. See "Known limits" in the `/ios-qa` skill for the input-routing workaround. |
| `/healthz` returns 200 but `/tap` returns ok:true with no UI change | The phone is paired but the StateServer port may have changed across launches. Re-resolve the CoreDevice IPv6 (`dscacheutil -q host -a name '<DeviceName>.coredevice.local'`). |
+401 -9
View File
@@ -795,6 +795,30 @@ auto-updater running its first update cannot make this check.)
**Fix.** `bun upgrade`; the next session start resumes the update. To update
now: `bun upgrade && cd <gstack checkout> && git pull --ff-only && ./setup`.
<a id="bun-version-unreadable"></a>
### `bun-version-unreadable: could not read the version of Bun at <path> (bun --version printed '<output>'); gstack <version> needs <floor> or newer (BUN_VERSION_UNREADABLE)`
**Meaning.** Before moving the checkout, the auto-updater and `/gstack-upgrade`
compare the Bun that setup would run with the incoming release's security
floor. `bun --version` printed something that is not a version (shown, with
control characters removed), so the comparison could not run and the update was
held: nothing was installed or changed. `/gstack-upgrade` prints the same text
after `BUN_VERSION_UNREADABLE:`. Earlier releases read an unreadable version,
and every version under zsh, as "not below the floor" and went ahead (#3195).
**Fix.** Reinstall Bun; `bun upgrade` may not run on a broken install. In Git
Bash or a macOS/Linux terminal:
```bash
curl -fsSL https://bun.sh/install | bash
bun --version
```
**Expected result.** `bun --version` prints a version such as `1.4.2`, and the
next session start (or `/gstack-upgrade`) updates.
**Fixed in.** The first release after v1.91.101.0 (#3195).
<a id="auto-update-incomplete"></a>
### `gstack auto-update: setup did not finish (<reason>); installed skills may be out of date. gstack retries automatically. Fix now: cd <dir> && ./setup`
@@ -895,17 +919,160 @@ cannot be checked before the pull; setup then refuses the broken hook (see the
entry above).
<a id="auto-update-hook-check-unavailable"></a>
### `gstack auto-update: update held (hook-check-unavailable: <reason>); nothing was installed or changed, and your current hooks keep running. ... Fix now: cd <dir> && git pull --ff-only --autostash && ./setup ...`
### `gstack auto-update: update held (hook-check-unavailable: <reason>); nothing was installed or changed, and your current hooks keep running. ... Fix now (in a terminal; Git Bash on Windows): cd '<dir>' && git fetch origin && bash bin/gstack-ff-update . '@{upstream}' && ./setup ...`
**Meaning.** Neither the incoming release's hook checker nor your installed
one gave a verified report on the incoming hooks (a crash, no output, an
unreadable report, or no Bun to bundle the TypeScript hooks), so the
auto-updater cannot tell whether moving your checkout would break Claude Code
tool calls. It left your checkout, skills and hooks at the current revision.
The `<reason>` names what each checker did.
unreadable report, or no Bun to bundle the TypeScript hooks), or the incoming
revision could not be extracted for the check (`cannot extract the incoming
revision: <git's error>`), so the auto-updater cannot tell whether moving your
checkout would break Claude Code tool calls. It left your checkout, skills and
hooks at the current revision. The `<reason>` names what each checker did.
**Fix.** Run the printed command. Setup checks every hook it registers and
says what is wrong (for example that Bun is missing).
**Fix.** Run the printed command. `bin/gstack-ff-update` moves the checkout
without losing a local edit (see
[shelved edits](#auto-update-rescued-edits)), and setup checks every hook it
registers and says what is wrong (for example that Bun is missing).
On Windows, if the reason is `git archive of the incoming revision failed`,
your updater predates the fix for #3184: see
[the held-install recovery](#auto-update-held-install-recovery).
<a id="auto-update-held-install-recovery"></a>
### `HELD hook-check-unavailable: git archive of the incoming revision failed` / `gstack auto-update: update held (hook-check-unavailable: git archive of the incoming revision failed) ...` / `gstack auto-update: setup did not finish (bun not found on PATH) ...` on Windows
**Meaning.** From 1.91.89.0 to the release that fixed #3184, the auto-updater
extracted each incoming release with `git archive | tar` before checking its
hooks. Git for Windows' MSYS `tar` cannot create the `connect-chrome` symlink
because it comes before its target in the archive, so every release was held
(`~/.gstack/analytics/session-update.log` shows the `HELD` line), and a stale
`setup did not finish (bun not found on PATH)` line could hide the hold. Your
installed updater cannot deliver its own fix, and the old `/gstack-upgrade`
can leave conflict markers when a local edit conflicts. The recovery fetches
the new `bin/gstack-ff-update` from the new revision into a private temp
directory and runs it. It works on a clean install, an install with local
edits that conflict, an install that already has unmerged files, and a
prefix-mode install: regenerable `SKILL.md` and `sections/*.md` edits are
re-rendered by setup, and every other edit is kept in a rescue ref (the
command prints it; see [shelved edits](#auto-update-rescued-edits)).
**Fix, in Git Bash** (use your install directory if it is not
`~/.claude/skills/gstack`):
<!-- form:recovery-gitbash -->
```bash
cd ~/.claude/skills/gstack && git fetch origin main && d=$(mktemp -d) && git show FETCH_HEAD:bin/gstack-ff-update > "$d/gstack-ff-update" && bash "$d/gstack-ff-update" . FETCH_HEAD; s=$?; rm -rf "$d"; [ "$s" = 0 ] && ./setup
```
**Fix, in Windows PowerShell 5.1** (it runs the same script through Git's
`bash.exe`, then `.\setup.ps1`):
<!-- form:recovery-powershell -->
```powershell
Set-Location -LiteralPath "$HOME\.claude\skills\gstack" -ErrorAction Stop; $gb = Join-Path (git --exec-path) '..\..\..\bin\bash.exe'; & $gb -c 'set -f; IFS=; git fetch origin main && d=$(mktemp -d) && git show FETCH_HEAD:bin/gstack-ff-update > $d/gstack-ff-update && bash $d/gstack-ff-update . FETCH_HEAD; s=$?; rm -rf -- $d; exit $s'; if ($LASTEXITCODE -eq 0) { .\setup.ps1 }
```
**In Claude Code**, ask it to run the Git Bash form above.
**Expected result.** The script prints `ok <old> <new>` or
`rescued <old> <new> refs/gstack/rescue/<oid> unmerged=<0|1>`, setup
finishes with exit 0, the next session start prints no held line, and later
updates install on their own.
**Trying an unreleased fix, and going back.** A fix branch can be tried
before it ships; auto-update pauses while a detached revision is checked out.
Replace `<branch>` with the branch named in the issue.
<!-- form:trial-gitbash -->
```bash
cd ~/.claude/skills/gstack && git checkout -- 'SKILL.md' '*/SKILL.md' '*/sections/*.md' && git fetch origin <branch> && git checkout --detach FETCH_HEAD && ./setup
```
<!-- form:trial-powershell -->
```powershell
Set-Location -LiteralPath "$HOME\.claude\skills\gstack" -ErrorAction Stop; $gb = Join-Path (git --exec-path) '..\..\..\bin\bash.exe'; & $gb -c 'set -f; git checkout -- SKILL.md */SKILL.md */sections/*.md && git fetch origin <branch> && git checkout --detach FETCH_HEAD'; if ($LASTEXITCODE -eq 0) { .\setup.ps1 }
```
To go back to the released version (this also resumes auto-update):
<!-- form:goback-gitbash -->
```bash
cd ~/.claude/skills/gstack && git checkout -- 'SKILL.md' '*/SKILL.md' '*/sections/*.md' && git checkout main && ./setup
```
<!-- form:goback-powershell -->
```powershell
Set-Location -LiteralPath "$HOME\.claude\skills\gstack" -ErrorAction Stop; $gb = Join-Path (git --exec-path) '..\..\..\bin\bash.exe'; & $gb -c 'set -f; git checkout -- SKILL.md */SKILL.md */sections/*.md && git checkout main'; if ($LASTEXITCODE -eq 0) { .\setup.ps1 }
```
<a id="auto-update-unmerged-files"></a>
### `gstack auto-update: update held (unmerged-files: <n> unmerged file(s) in the install (first: <path>)); an earlier merge, rebase or stash pop left conflicts in the install, and an update would bury them. Fix now (...): cd '<dir>' && git fetch origin && bash bin/gstack-ff-update . '@{upstream}' && ./setup ...`
**Meaning.** Your gstack checkout has unmerged files: conflict markers from a
merge, rebase or `git stash pop` of your own, or from an auto-updater older
than the fix for this (its `merge --autostash` left markers in place when a
local edit conflicted). The background updater never moves a checkout with
unmerged files, and it prints no "setup did not finish" fix while they exist,
because setup would run over the markers.
**Fix.** Run the printed command. It saves everything first, the unmerged
files included, in a rescue ref labelled "needs manual resolution", then
moves the checkout to the release and runs setup. Read the rescue with the
commands under [shelved edits](#auto-update-rescued-edits). To resolve the
conflict yourself instead, finish or abort your merge (`git -C '<dir>' merge
--abort`, `git -C '<dir>' checkout -- <file>`); gstack retries at the next
check.
<a id="auto-update-autostash-unrecoverable"></a>
### `gstack auto-update: update held (autostash-unrecoverable: <reason>); your local edits are where they were and nothing was installed. Look first: git -C '<dir>' status --short. Fix now (...)` / `autostash-unrecoverable: <reason>`
**Meaning.** `bin/gstack-ff-update` refused to move the checkout and changed
nothing. The `<reason>` says why: an untracked file is where the release
puts a tracked one (`git refused to update ...: would be overwritten`), a
file changed while the update ran, another git command held the index lock
(`index.lock exists`), or a rescue ref of that name already names another
commit.
**Fix.** Run the `status` command the line prints, move the listed untracked
file out of the way (or wait for the other git command to finish), then run
the printed `Fix now` command. Nothing needs restoring: your edits are still
in the working tree.
<a id="auto-update-rescued-edits"></a>
### `gstack auto-update: your local edits in the install (<files>) conflicted with an update, so they were saved in refs/gstack/rescue/<oid> and the install runs the update. ...` / `rescued <old> <new> refs/gstack/rescue/<oid> unmerged=<0|1>`
**Meaning.** You had edited tracked files in your gstack checkout, and the
release changed the same lines (or you had staged changes or unmerged files).
Instead of leaving conflict markers in the checkout Claude Code runs hooks
from, `bin/gstack-ff-update` saved your edits as one commit,
`refs/gstack/rescue/<oid>`, and moved the checkout to the release. The
rescue's first parent is the revision you had, so it holds only your changes;
its second parent holds what you had staged. Edits that did not conflict stay
in place, and regenerable `SKILL.md` and `sections/*.md` edits (skill prefix,
gbrain blocks) are re-rendered by setup instead of being rescued. The
session-start line repeats once a day until you delete the ref.
**Fix.** Inspect first:
```bash
git -C ~/.claude/skills/gstack show --stat 'refs/gstack/rescue/<oid>'
```
To keep your edits, export only your changes and apply them in a scratch
checkout (never with `stash apply` in the install):
```bash
git -C ~/.claude/skills/gstack diff 'refs/gstack/rescue/<oid>^' 'refs/gstack/rescue/<oid>' > ~/gstack-local-edits.patch
git clone https://github.com/garrytan/gstack.git ~/gstack-scratch && cd ~/gstack-scratch && git apply -3 ~/gstack-local-edits.patch
```
A rescue labelled "needs manual resolution" holds files that were already
unmerged: their content can contain conflict markers to resolve. Delete the
ref when you are done (this also stops the daily line):
```bash
git -C ~/.claude/skills/gstack update-ref -d 'refs/gstack/rescue/<oid>'
```
<a id="setup-runtime-root-contains-checkout"></a>
### `gstack setup: refusing to replace <root> for <host>: this runtime directory contains the source checkout setup runs from (<checkout>), so replacing it would delete the checkout. Nothing was changed.`
@@ -1041,6 +1208,39 @@ or too large. Each message names the cap that applied:
holds the code you want audited and no symlinks. Add your file count or size to
[#2993](https://github.com/garrytan/gstack/issues/2993).
<a id="cso-scanner-invalid-output"></a>
### `INVALID_OUTPUT: Scanner report is malformed, unsupported, or exceeds structural limits.` (Semgrep on a real repository)
**Meaning.** Before the first release after v1.91.101.0, /cso redacted a
scanner's JSON report by splicing an unquoted `<REDACTED-...>` marker over any
bare number that looked like a phone number or card number, such as Semgrep's
`"max_memory_bytes":1145427776` or an epoch timestamp. The report then failed to
parse and the scanner was recorded as not assessed (#3185). Now a redacted
number becomes the quoted string `"<REDACTED-...>"` and the report parses. A
redaction that would cross JSON tokens still withholds the payload
(`REDACTION_FAILED`).
**Fix.** Update gstack (`/gstack-upgrade`), then run /cso again. If this code
still appears, the scanner itself emitted malformed JSON; report the scanner
and version at https://github.com/garrytan/gstack/issues.
**Fixed in.** The first release after v1.91.101.0 (#3185).
<a id="cso-orbstack-argv0"></a>
### `unsupported argv0 "docker-tools"` (OrbStack's `docker` under /cso)
**Meaning.** /cso runs the canonical path of `docker` (symlinks resolved), and
OrbStack's `docker` is a symlink to one multicall binary, `docker-tools`, that
decides what to be from the name it was started as. Started under its real name
it refused, so Docker isolation and every scanner were reported missing
(#3187). /cso now starts the same verified binary with the name `docker`,
including in its cleanup watchdog.
**Fix.** Update gstack (`/gstack-upgrade`), then run `gstack-doctor`; its `cso`
row should pass with OrbStack running.
**Fixed in.** The first release after v1.91.101.0 (#3187).
<a id="conductor-auq-hook-removed"></a>
### `removed the AskUserQuestion preference hook: it breaks Conductor's native AskUserQuestion (#2207). ...`
@@ -1156,7 +1356,7 @@ the project whose pins apply.
**Meaning.** The first browser skill run on a machine installed without
Chromium (`SKIP browser (lazy; gstack-browser-ensure installs on first use)`)
tried to install it through `bunx playwright install chromium` under setup's
tried to install it through `bun x playwright install chromium` under setup's
lock, or Chromium is installed but does not launch.
**Fix.** Read the installer output above: offline or proxied machines need
@@ -1383,6 +1583,32 @@ killed.
**Fix.** After `browse stop`, check for a leftover browser with
`ps aux | grep -i chrom` and end it with `kill <pid>`.
<a id="browse-no-active-page"></a>
### `No active page. Use "browse goto <url>" first.` (after the last tab was closed outside browse)
**Meaning.** When every tab was closed outside browse (the headed window's tabs
closed by hand, or a page that closed itself), earlier releases failed every
later command this way, `status` and `stop` included, until the daemon was
killed (#3167). Now `status` and `stop` answer without opening a tab, and any
other command opens one new blank tab first and prints
`[browse] warning: every tab was closed outside browse, so this command ran on a new blank tab; open your page again with: browse goto <url>`.
**Fix.** `browse goto <url>` to open your page again.
**Fixed in.** The first release after v1.91.101.0 (#3167).
<a id="browse-tab-unrecoverable"></a>
### ``browse: every tab was closed outside browse and a new one could not be opened, because the browser or its context is gone (<cause>); fix: run `browse restart` ... (BROWSE_TAB_UNRECOVERABLE)``
**Meaning.** Every tab was closed outside browse and the browser, or its
context, is gone too, so browse could not open a tab to run the command.
`browse status` and `browse stop` still answer.
**Fix.** `browse restart` (`$B restart` inside a gstack skill), then run the
command again.
**Fixed in.** The first release after v1.91.101.0 (#3167).
---
## Windows
@@ -1422,6 +1648,112 @@ Windows allows the binaries, re-run `./setup`; the message goes away.
**Expected result.** setup prints no "Windows blocked" line, and
`gstack-doctor` shows `ok` for `browse bundle` and `binaries`.
<a id="setup-ps1-unexpected-eof"></a>
### `setup: -c: line 1: unexpected EOF while looking for matching '"'` / `setup: -c: line 2: syntax error: unexpected end of file` from `.\setup.ps1`
**Meaning.** Windows PowerShell 5.1 (`powershell.exe`, the default PowerShell
on Windows) passes arguments to native programs the legacy way and strips
the double quotes inside them. Until the release that fixed #3130,
`setup.ps1` handed Git Bash a `bash -c` script with double quotes in it, so
bash read a broken script and nothing was installed. PowerShell 7.3 and newer
were not affected.
**Fix.** Update gstack (in Git Bash: `cd ~/.claude/skills/gstack && git pull
--ff-only`), then run `.\setup.ps1` again: its script no longer holds a
double quote. Until then, run `./setup` from Git Bash, or `.\setup.ps1` from
PowerShell 7 (`pwsh`).
<a id="setup-ps1-empty-argument"></a>
### `setup.ps1: argument N is empty; setup takes no empty arguments. Nothing was installed or changed. (SETUP_PS1_EMPTY_ARGUMENT; ...)`
**Meaning.** One of the arguments you gave `.\setup.ps1` is an empty string
(for example `''` or an unset variable such as `$hostName`). setup takes no
empty arguments, and the way `setup.ps1` hands arguments to Git Bash under
Windows PowerShell 5.1 cannot carry one, so it refuses before running
anything.
**Fix.** Drop the empty argument, or give it a value:
```powershell
.\setup.ps1 --host codex
```
---
<a id="chromium-install-exit-127"></a>
### `Chromium bootstrap: chromium-install — <bun> x playwright install chromium exited 127 (command not found); install Bun from bun.sh (winget Bun ships no bunx), or skip with ./setup --no-browser (Git Bash) or .\setup.ps1 --no-browser (PowerShell)`
**Meaning.** setup (or `bin/gstack-browser-ensure`, as `BROWSER_UNAVAILABLE
<bun> x playwright install chromium exited 127 (command not found)`) could
not run the Playwright installer: the shell found no command to run. Until
the release that fixed #3131, setup called `bunx`, which a Bun installed with
winget does not ship, and reported the failure as `exited 127 (offline,
proxy, or blocked download?)`. It now runs `bun x` through the Bun it
resolved, so exit 127 means that Bun itself, or a command it starts, is
missing. Skills that do not need a browser are installed either way.
**Fix.** Install Bun from https://bun.sh (it ships `bun` and `bunx`), then
run setup again. To install without the browser for now, in Git Bash:
```bash
./setup --no-browser
```
or in Windows PowerShell:
```powershell
.\setup.ps1 --no-browser
```
---
<a id="bash-unavailable"></a>
### `gstack: no Git Bash found to run gstack's bash scripts on Windows (tried ...); fix: ... (BASH_UNAVAILABLE)`
**Meaning.** Windows cannot run a shebang script, so gstack hands its bash
scripts (`gstack-wtree`, `gstack-slug`, the hooks' bins, `bash -c` commands in
regen and pregate selection manifests) to Git Bash. It looks in this order and
the message lists every candidate it tried with the reason it was rejected:
1. `GSTACK_GIT_BASH` (or the older name `GSTACK_BASH`; when both are set and
differ, `GSTACK_GIT_BASH` wins and a one-line warning says so). A value
that does not exist is refused, not skipped.
2. bash next to `git --exec-path` (finds scoop, per-user and portable Git).
3. `C:\Program Files\Git`, `C:\Program Files (x86)\Git`,
`%LOCALAPPDATA%\Programs\Git` and scoop's `git\current`.
4. A `bash` on PATH, only when `uname -s` reports MSYS or MINGW. WSL's
`bash.exe` in `System32` or `WindowsApps` is never used: it reads
`C:\...` paths as Linux paths. A PATH bash that is neither (Cygwin, for
example) is no longer used either.
Before #3197 these commands spawned the scripts directly, so `gstack-restamp`
refused with `cannot fingerprint the working tree ()` and `gstack-gate-diff`
and `gstack-evidence` silently dropped the fingerprint.
**Fix.** Install Git for Windows (`winget install --id Git.Git -e` in
PowerShell), or point gstack at your bash.exe for good. An `export` in Git Bash
reaches only that shell, so set it where Claude Code reads it:
- Windows PowerShell 5.1 or PowerShell 7, then restart Claude Code:
```powershell
[Environment]::SetEnvironmentVariable('GSTACK_GIT_BASH', 'C:\Program Files\Git\bin\bash.exe', 'User')
```
- Or the `env` block of `~/.claude/settings.json`:
```json
{ "env": { "GSTACK_GIT_BASH": "C:/Program Files/Git/bin/bash.exe" } }
```
The hooks cache the bash they found in `<state root>/cache/windows-bash.json`
(keyed by `git.exe`'s path and modification time, rechecked before use); the
override is never cached.
**Expected result.** `gstack-restamp --dry-run` prints its diff and
`gstack-gate-diff` records a candidate ending in a tree id instead of
`+nowtree`.
---
## Memory and gbrain
@@ -1991,6 +2323,12 @@ legitimate generated output, or stop the tool from writing it.
the journal recorded (someone edited it after the stage ran). Overwriting it
would lose that edit, so the restamp stopped.
`cannot fingerprint the working tree (<detail>); nothing written` is the same
code before anything was staged: `gstack-wtree exited <n>: <reason>` carries
the helper's own repair (for example a writable `TMPDIR`), and
`gstack-wtree could not start: ...` is the Windows bash lookup failing (see
[`BASH_UNAVAILABLE`](#bash-unavailable)).
**Fix.** Read `.gstack/tmp/restamp-journal.json`, reconcile the named file by
hand, then rerun `gstack-restamp` (idempotent: a complete stamp is a no-op).
@@ -2360,7 +2698,12 @@ string literals, the `bin/<name>` → `test/<name>*.test.ts` convention or a
**Fix.** Add a test that names the file, or declare its lane (an explicit `[]`
for files with no behaviour, such as docs) in `.gstack/pregate.json`. `--explain`
prints every mapping and why.
prints every mapping and why. For a file with no lane it also prints the import
specifiers in test files that resolved to no repo file (for example a
`tsconfig.json` `paths` alias such as `@/lib/x` whose target is missing) and any
`extends` hop that was not followed (only relative `extends`, at most 4 hops). If
a test does cover the file, declare it under `dependencies`; if the resolver
should have found it, report the specifier as a resolver gap.
<a id="pregate-lane-failed"></a>
### `PREGATE_LANE_FAILED`
@@ -2739,3 +3082,52 @@ writes that state; it comes from a hand edit or an older runner.
**Fix.** Answer the gate with `gstack-autoplan answer` until no approval is
pending, and `revise --incorporates` or `--withdraw` each pending amendment.
<a id="ios-launch-env-invalid"></a>
### `ios-qa launch: GSTACK_IOS_LAUNCH_ENV ... so the app was not launched (<detail>); fix: ... (IOS_LAUNCH_ENV_INVALID)`
**Meaning.** `gstack-ios-qa-daemon` forwards `GSTACK_IOS_LAUNCH_ENV` to
`xcrun devicectl device process launch --environment-variables` whenever it
launches the app under test. The value must be a JSON object whose keys are
environment variable names and whose values are strings, and it may not set a
`GSTACK_` variable (that namespace belongs to the debug bridge). Anything else
(invalid JSON, an array, a number value, a `GSTACK_` key) refuses the launch,
because launching without the variables an env-gated debug bridge needs would
look like a working app with no bridge. The detail names the key and its type,
never a value. Added in the release after v1.91.101.0.
**Fix.** In the shell that starts the daemon (macOS Terminal or Claude Code on
the Mac with the device):
```bash
export GSTACK_IOS_LAUNCH_ENV='{"DEBUG_BRIDGE":"1"}'
```
or `unset GSTACK_IOS_LAUNCH_ENV`, then restart `gstack-ios-qa-daemon`.
<a id="outside-voice-unavailable"></a>
### `Outside voice unavailable: <cause>. Fix: <fix>. Continuing to ... (OUTSIDE_VOICE_UNAVAILABLE)`
**Meaning.** `/plan-ceo-review`, `/plan-eng-review` or `/plan-devex-review` ran
without a second opinion. The outside provider (Codex, or Claude Code under the
Codex host) did not run or failed, and the native fallback could not supply a
bounded review either. That fallback dispatches the built-in Plan subagent in
the background next to a five-minute background timer, and stops whichever is
still running when the other ends. The cause names which part was missing:
`Plan agent type not offered`, `TaskStop not offered`, `background tasks
unavailable`, `no complete report within five minutes`, or a failed status.
The review-log row carries the same cause as `unavailable_reason`. Claude Code
2.1.277 removed the TaskOutput tool the fallback used before, so on older
gstack every native fallback on current Claude Code ended here.
**What is kept.** The native plan review itself is complete. The row is
recorded with `status: unavailable`, never as a clean review; a late or partial
reviewer result is not counted.
**Fix.** Repair the provider the line names: install it, or run `codex login`
(in your terminal or Git Bash). For the native fallback, run Claude Code 2.1.277
or later with background tasks enabled (`CLAUDE_CODE_DISABLE_BACKGROUND_TASKS`
unset, not in bare mode). Then re-run the review.
**Expected result.** An `OUTSIDE VOICE (...)` report, or `CODEX SAYS (plan
review — outside voice)` when the provider runs.