diff --git a/bin/gstack-capy-install b/bin/gstack-capy-install index be3938804..2afa07a47 100755 --- a/bin/gstack-capy-install +++ b/bin/gstack-capy-install @@ -458,7 +458,7 @@ exec "$chose" "$@" EOF_SHIM } > "$tmp" fi - chmod 0755 "$tmp" && if cmp -s "$tmp" "$dir/$name"; then rm -f "$tmp"; else mv -f "$tmp" "$dir/$name"; fi + chmod 0755 "$tmp" && if cmp -s "$tmp" "$dir/$name"; then rm -f "$tmp"; else mv -f "$tmp" "$dir/$name" && say "wrote $dir/$name (gstack's per-directory $name shim; GSTACK_BUN_SHIM_EXPLAIN=1 shows its choice, GSTACK_BUN_SHIM=0 opts out)"; fi done exec 8>&- } diff --git a/test/helpers/free-fixtures-data.ts b/test/helpers/free-fixtures-data.ts index 45484e8a9..825693e10 100644 --- a/test/helpers/free-fixtures-data.ts +++ b/test/helpers/free-fixtures-data.ts @@ -18,6 +18,7 @@ export const FREE_FIXTURES: Readonly> = { 'test/fixtures/autoplan-edit-digests-al.json': ['test/autoplan-edit-digests-al.test.ts'], 'test/fixtures/autoplan-home-phase-entry-fb10.json': ['test/autoplan-method-read-audit.test.ts'], 'test/fixtures/autoplan-owned-state-edit.json': ['test/autoplan-owned-state.test.ts'], + 'test/fixtures/autoplan-pairing/run-20261014-pairs.json': ['test/autoplan-pairing.test.ts'], 'test/fixtures/autoplan-phase-consumption-491.json': ['test/autoplan-publication-guard.test.ts'], 'test/fixtures/autoplan-phase-dash-ao.json': ['test/autoplan-phase-observer.test.ts'], 'test/fixtures/autoplan-phase-entry-alias-f359.json': ['test/autoplan-method-read-audit.test.ts'], diff --git a/test/pregate-guards.test.ts b/test/pregate-guards.test.ts index 14ee0ec8d..7719b9ec9 100644 --- a/test/pregate-guards.test.ts +++ b/test/pregate-guards.test.ts @@ -175,10 +175,13 @@ describe('guards and lanes: install verdict admission (integration item 8)', () expect(checkRow(repo, 'guards')).toMatchObject({ status: 'incomplete', code: 'BUN_RESOLUTION_DRIFT' }); expect(checkRow(repo, 'guards').detail).toContain(`recorded bun 1.4.3 at ${repo.root}/gone/bun is gone`); expect(ran(repo)).toBe(false); - verdict(repo, { bun_path: fs.realpathSync(process.execPath), bun_version: Bun.version }); + const stub = path.join(fs.realpathSync(repo.root), 'pinned', 'bun'); + fs.mkdirSync(path.dirname(stub), { recursive: true }); + fs.writeFileSync(stub, `#!/bin/sh\n[ "$1" = --version ] && { echo 1.4.2; exit 0; }\nexec '${fs.realpathSync(process.execPath)}' "$@"\n`, { mode: 0o755 }); + verdict(repo, { bun_path: stub, bun_version: '1.4.2' }); const ok = run(repo); expect(ok.status, ok.out).toBe(EXIT.ok); - expect(ok.out).toContain(`runtime: bun ${Bun.version} at ${fs.realpathSync(process.execPath)} (recorded by the install verdict)`); + expect(ok.out).toContain(`runtime: bun 1.4.2 at ${stub} (recorded by the install verdict)`); expect(ran(repo)).toBe(true); }); }); diff --git a/test/redact-prepush-hook.test.ts b/test/redact-prepush-hook.test.ts index 66727b828..964e4c511 100644 --- a/test/redact-prepush-hook.test.ts +++ b/test/redact-prepush-hook.test.ts @@ -406,6 +406,7 @@ describe("install UX surfaces (#1946 / eng review D3+D10)", () => { describe("one-time consent prompt in setup (#1946, decision 6)", () => { const setup = fs.readFileSync(path.join(ROOT, "setup"), "utf8"); const block = setup.slice(setup.indexOf("# ─── Redact pre-push guard consent")); + const readyLine = setup.slice(setup.indexOf("_setup_ready_line() {"), setup.indexOf("\n}\n", setup.indexOf("_setup_ready_line() {")) + 3); test("prompt is gated on key ABSENCE and a real TTY, with a timed default-N read", () => { expect(block).toContain("grep -q '^redact_prepush_hook:'"); @@ -432,6 +433,7 @@ describe("install UX surfaces (#1946 / eng review D3+D10)", () => { "QUIET=0", 'log() { echo "$@"; }', `GSTACK_CONFIG="${path.join(ROOT, "bin", "gstack-config")}"`, + readyLine, block, ].join("\n"); const r = spawnSync("bash", ["-c", script], { @@ -459,6 +461,7 @@ describe("install UX surfaces (#1946 / eng review D3+D10)", () => { "QUIET=0", 'log() { echo "$@"; }', `GSTACK_CONFIG="${path.join(ROOT, "bin", "gstack-config")}"`, + readyLine, block, ].join("\n"); const r = spawnSync("bash", ["-c", script], { diff --git a/test/setup-hook-syntax-gate.test.ts b/test/setup-hook-syntax-gate.test.ts index 49dd6e8ca..4ee713ea4 100644 --- a/test/setup-hook-syntax-gate.test.ts +++ b/test/setup-hook-syntax-gate.test.ts @@ -36,6 +36,7 @@ function slice(from: string, to: string | null): string { } const HOOK_SECTIONS = [ + slice('_setup_ready_line() {', '\n}\n') + '\n}\n', slice('CANONICAL_GSTACK_ROOT="${CLAUDE_CONFIG_DIR', '# ─── GBrain detection'), slice('# 11. Plan-tune cathedral hook install', '# ─── Redact pre-push guard consent'), slice('if [ -n "${_HOOK_REFUSED:-}" ]; then', null), diff --git a/test/setup-playwright-best-effort.test.ts b/test/setup-playwright-best-effort.test.ts index ffc8f5f1c..edcc8ded0 100644 --- a/test/setup-playwright-best-effort.test.ts +++ b/test/setup-playwright-best-effort.test.ts @@ -486,6 +486,7 @@ function runSummary(reason: string, telemetry: 'ok' | 'fail' | 'missing', prelud 'log() { [ "$QUIET" -eq 0 ] && echo "$@" || true; }', `SOURCE_GSTACK_DIR="${tmp}"`, `_PW_FAIL_REASON="${reason}"`, + extractFn('_setup_ready_line'), ...prelude, tail, 'echo "REACHED_END=1"',