Files
gstack/test/troubleshooting-windows-recovery.test.ts
e6edff0265 v1.91.89.0 fix(windows,setup): Git Bash hook false-positive recovery, incoming-checker auto-update, setup never deletes its own checkout (Wave 9 Lane A0) (#3140)
Git Bash hands native Bun C:/ paths while gstack-hook-check looked them up as
/c/, so every TypeScript hook was refused and team-mode auto-update held every
release since 1.91.31. The checker maps Bun's paths back to the shell spelling,
the auto-updater lets the incoming release's own checker decide (installed
checker only as a fallback, hook-check-unavailable when neither verifies), and
docs/troubleshooting.md gives stuck installs one recovery command.
/gstack-upgrade and /spec guards use the --show-prefix root check, gstack-wtree
treats drive-letter --git-path answers as absolute, and setup refuses to
replace a runtime root that is or contains its own checkout, Kiro's in-place
root included (#3084), with --status suggesting the move. New sourced helper
bin/gstack-path-spelling.sh and TS twin lib/path-spelling.ts.

Co-authored-by: yuriysan <63948747+yuriysan@users.noreply.github.com>
Co-authored-by: y$un_ <3579304+szsunyuan@users.noreply.github.com>
Co-authored-by: Frederik Reventlow <267160539+dmfrede@users.noreply.github.com>
Co-authored-by: skleinbe-ny <226563731+skleinbe-ny@users.noreply.github.com>
Co-authored-by: bkermen <184220642+bkermen@users.noreply.github.com>
Co-authored-by: Drew Jankowski <3200063+andrewkjankowski@users.noreply.github.com>
2026-10-11 16:48:11 +00:00

47 lines
2.4 KiB
TypeScript

/**
* Installs stuck on the Git Bash hook-check false positive (#3088, #3100) run
* their own old updater and old /gstack-upgrade text, so code on main cannot
* reach them; the troubleshooting page their held-update and setup messages
* link to can. Both anchors name the false positive and give one copy-paste
* recovery, which also covers /gstack-upgrade's "is not a gstack checkout".
*/
import { describe, expect, test } from 'bun:test';
import * as fs from 'node:fs';
import * as path from 'node:path';
const ROOT = path.resolve(import.meta.dir, '..');
const DOC = fs.readFileSync(path.join(ROOT, 'docs/troubleshooting.md'), 'utf8');
const RECOVERY = 'cd ~/.claude/skills/gstack && git pull --ff-only --autostash && ./setup';
function section(anchor: string): string {
const start = DOC.indexOf(`<a id="${anchor}"></a>`);
expect(start).toBeGreaterThan(-1);
const next = DOC.indexOf('<a id="', start + 1);
return DOC.slice(start, next === -1 ? undefined : next);
}
describe('troubleshooting: the Git Bash hook false positive', () => {
for (const anchor of ['setup-hook-does-not-parse', 'auto-update-hook-does-not-parse']) {
test(`#${anchor} names the false positive and the one recovery`, () => {
const text = section(anchor);
expect(text).toContain('Git Bash');
expect(text).toContain('from 1.91.31');
expect(text).toContain('bun could not bundle the TypeScript entry');
expect(text).toContain(RECOVERY);
expect(text).toContain('is not a gstack checkout');
expect(text).not.toContain('Nothing to do locally');
});
}
test('#upgrade-not-a-checkout points Git Bash users at the same recovery', () => {
expect(section('upgrade-not-a-checkout')).toContain('cd <install dir> && git pull --ff-only --autostash && ./setup');
});
test('every anchor the updater, setup and doctor link to exists', () => {
const sources = ['bin/gstack-session-update', 'setup', 'bin/gstack-doctor', 'bin/gstack-install-registry.sh'];
const anchors = new Set(sources.flatMap(f => [...fs.readFileSync(path.join(ROOT, f), 'utf8').matchAll(/troubleshooting\.md#([a-z0-9-]+)/g)].map(m => m[1]!)));
for (const a of ['auto-update-hook-does-not-parse', 'auto-update-hook-check-unavailable', 'setup-hook-does-not-parse', 'setup-runtime-root-contains-checkout']) expect(anchors.has(a)).toBe(true);
for (const a of anchors) expect(DOC, a).toContain(`<a id="${a}"></a>`);
});
});