Repository navigation
Conversation
garrytan
force-pushed
the
capy/fixwave-2
branch
from
October 15, 2026 22:01
5e19e47 to
68ffd59
Compare
garrytan
force-pushed
the
capy/fixwave-2
branch
from
October 16, 2026 00:26
bd9c02e to
7e82084
Compare
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>
…on (#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>
…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>
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>
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>
…duct 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>
…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>
…anes (#3176) Once 8b2f297 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>
…red 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>
garrytan
force-pushed
the
capy/fixwave-2
branch
from
October 16, 2026 00:31
7e82084 to
7c81e26
Compare
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behavior changes
lib/script-invocation.ts. Bun on Windows can't execute an extensionless shebang script, so before this PRgstack-restamprefused withcannot fingerprint the working tree (),gstack-gate-diffandgstack-evidencesilently dropped the content fingerprint, and the pregatesecretscheck couldn't startgstack-redact(On Windows with Bun 1.4.2, gstack-pregate refuses and gstack-restamp fails: spawnSync cannot execute bin/gstack-wtree, and pregate reports a misleading POLICY_SOURCE_UNAVAILABLE #3197, reported by @exGeni). Bash scripts now run through Git Bash and Bun scripts through Bun. The migrated call sites arehosts/claude/hooks/spawn-bin.ts,lib/gbrain-exec.ts,lib/regen.ts, gate-diff (bin/gstack-gate-diff,lib/gate-diff/git.ts),lib/restamp.ts,bin/gstack-evidence,lib/pregate/checks/secrets.tsandlib/pregate/lane-selection.ts.GSTACK_GIT_BASH; thenGSTACK_BASHas a deprecated alias (when both are set and differ, the canonical one wins with a one-line warning, and a value that points nowhere is refused instead of skipped); then thebash.exenext togit --exec-path; then the standard install paths; then a PATHbashonly when itsunamereports MSYS or MINGW. WSL launchers (System32, WindowsApps) and Cygwin are rejected, and hooks no longer fall back to a bare PATHbash.BASH_UNAVAILABLE. Its troubleshooting entry isdocs/troubleshooting.md#bash-unavailable.<state root>/cache/windows-bash.json, keyed by the git.exe path and mtime.wtreeFingerprintreturns{tree}or{error, kind: 'launch' | 'exit'}and always setsGIT_OPTIONAL_LOCKS=0. Each consumer now says why a fingerprint is missing:regen checkreports the check as incomplete and names the cause;+nowtreewith the cause;RESTAMP_CONFLICTand the detail (gstack-wtree exited 1: …,gstack-wtree could not start: …);wtreeand warns once instead of staying silent.lib/regen.tskeeps a string-returningwtreeFingerprint(repoRoot)wrapper for the pregate callers until they move to the shared fingerprint in a follow-up release.gstack-evidenceused to accept only 40-hex trees.(group),[id],[...slug],@slot,$id,+page). A test in a platform-only lane now keeps its remote receipt obligation instead of quietly running locally. This is the manifest-parser half of @vocodestudios's fix(pregate): map Next.js route paths and tsconfig path aliases to their tests #3176; the tsconfig-alias half ships separately..github/workflows/windows-pregate-e2e.ymldrives restamp, regen, evidence, gate-diff, a timed hook and the refusal onwindows-latest, once under the runner's Git and once under a pinned, checksum-verified PortableGit 2.56.0.2 (sha256075e158e…). It has no cache step: the secret scanner flagged the cache key'senv.kvas a false positive, so the step was dropped instead of allowlisted.test/script-invocation-tripwire.test.tsfails when a file underlib/, underhosts/, or a Bun bin spawns a gstack bin by path or a barebash. Five known sites outside this change are listed with their owners and may only shrink. The same test keeps the compiled binaries from importing the module.test/gbrain-spawn-windows-shell.test.tsnow expects forward-slashed bash paths;test/timeline-stop-hook-slug.test.tsandtest/plan-tune-cathedral.test.tsnow listlib/script-invocation.tsandlib/result-codes.ts, which the copied scripts import.No other assertion was weakened.
setup.ps1(from layer 1b) now resolves Git Bash by the same table.test/setup-ps1.test.tsdrives it through every row oftest/fixtures/windows-bash-resolution.jsoninstead of a hand-mirrored copy. Two rows failed and are fixed insetup.ps1: an override and alias that differ only in slash direction no longer print the differ warning, and the root thatgit --exec-pathnames is also searched forusr\bin\bash.exe(Git for Windows on arm64).~/.capy/work/changelog-C.md.Coordinator exception
The coordinator accepted these edits outside Lane C's file list:
bin/gstack-doctor-components.sh, which is generated and regenerated by this change;scripts/test-pr-profile.tsandscripts/harness-version.json, which register the new tests with the PR profile and record the harness-version decision (non-behavioral);test/helpers/free-fixtures-data.ts, which registers the new free fixtures;setup.ps1andtest/setup-ps1.test.ts(layer 1b's files), edited at the coordinator's request to wire them to the shared resolver table.This PR doesn't touch
lib/pregate/context.ts,lib/pregate/index.ts(#3190's files) orbin/gstack-upgrade.Paid checks
This layer targets
capy/fixwave-1b, not main, so no paid CI runs on it. The paid PR gate runs once, on the wave PR from the top of the stack to main. Nothing paid was run locally.Measured against main before the stack rebase, Lane C's changes alone select:
profile=pr selected 108 of 245 tests -> running 81 of 81 shardstier=gate: 47/108 files, 81 shards, jobs=8, ordinary default wall=1800sThe selection is broad because this layer changes shared derived references.
bin/gstack-doctor-components.sh,lib/pregate/checks/secrets.ts,lib/pregate/lane-selection.ts,lib/regen.ts,lib/restamp.ts,lib/result-codes.tsandlib/script-invocation.tseach select all 244 dependent gate cases, andhosts/claude/hooks/spawn-bin.tsselects 35.test/helpers/free-fixtures-data.tsis a paid-runner input, so it selects every case. 137 of the selected behaviors remain scheduled or release coverage, not PR passes.Validation
Failing-first, on base 47d639a:
test/script-invocation.test.tsCannot find module '../lib/script-invocation'test/script-invocation-tripwire.test.tstest/pregate-manifest-paths.test.ts(CLI case)requires_remoteexpected the windows-shard obligation forapp/(shop)/[id]/page.test.js, received[]test/wtree-consumers.test.ts(gstack-wtree failed)with no cause, restamp passes raw stderr, the SHA-256 evidence record has nowtree, and the unavailable case prints 0 warningsAfter the fix:
capy/fixwave-1b(head 5e19e47): 748 pass, 0 fail across 40 files, with pwsh 7.4.6 so thesetup.ps1cases run. The first run of the same set, which ran alongside typecheck, failed 3test/autoplan-residuals.test.tscases withRUNTIME_BELOW_MINIMUM (bun 1.3.14). They passed alone, in either half of the set, and in a full rerun of the same order.bun run typecheckreports 0 errors, and thetypecheck:testratchet reports "none new".bun run teston Ubicloud (ubirun-fixwave2c-1792091137-c0056a9f, head 617d3fa51) passed: 17/17 shards, 28,227 tests, 0 failed. The earlier runubirun-fixwave2c-1792089187-d4dbd99afailed onlytest/harness-version.test.ts, which thescripts/harness-version.jsondecision fixed. That run predates the stack rebase; the integrator reruns the suite at freeze.PREGATE: fail. Its local-lane failures fail the same way on base: 9 come from the unattended-session launch variables, andgstack-retro-metricsandtranscript-scope-brain-syncfail because fixture authors resolve to this machine's git identity. The secrets check warned on 5 MEDIUM PII findings, which don't block.Coordination
capy/fixwave-1b(layer 1b), which sits on 1a, which sits on main 47d639a.lib/result-codes.tsanddocs/troubleshooting.mdwere append-only, and both sides were kept. 1b'ssetup.ps1refusal links to this layer's#bash-unavailableentry.bin/gstack-doctor-components.shwas regenerated from the merged codes.