Windows: a python3 that won't run no longer deletes skills on update, and long test commands fail clearly (#4793)

On Windows, an update no longer deletes your brain-aware skills when
`python3` is the Microsoft Store alias, and a pre-ship test command too
long for Git Bash is split to fit or refused clearly instead of running
cut off.

Why: keeps install and upgrade working on Windows, where gstack promises
minimal support (#4752 by @Barack-zero-to-one, #4773 by @targetpark).

Nothing to do.

Co-authored-by: Barack-zero-to-one <121355791+Barack-zero-to-one@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: bin/gstack-config:1335:completeness reader=core
Review-Finding: lib/pregate/checks/lanes.ts:457:completeness reader=core
Review-Finding: lib/pregate/checks/lanes.ts:442:completeness reader=core
Review-Finding: lib/pregate/checks/lanes.ts:456:completeness reader=core
This commit is contained in:
authored and GitHub committed 2026-11-24 18:45:33 +00:00
1 parent 62e244d631
commit 3b9d9757fd
10 files changed
+207 -40

No files matched your search

+14
View File
@@ -10,6 +10,7 @@ import * as fs from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
import { bunIsolationArgs } from '../lib/bun-isolation';
import { classifyEnvironment } from '../lib/pregate/environment';
import {
bashCommandInvocation, resolveWindowsBash, resolveWindowsBashCached, runBashSync, runScriptSync, scriptInvocation, wtreeFingerprint,
type BashProbe,
@@ -94,6 +95,19 @@ describe('scriptInvocation', () => {
expect(bashCommandInvocation('echo hi', noBash).ok).toBe(false);
});
test('a bash -c command over the 8,186 characters Git Bash keeps is refused on Windows, never run cut off (#4773)', () => {
const fits = `echo ${'x'.repeat(8186 - 5)}`;
expect(bashCommandInvocation(fits, win)).toEqual({ ok: true, cmd: WIN_GIT_BASH, argv: ['-c', fits] });
const long = `${fits}y`;
const inv = bashCommandInvocation(long, win);
expect(inv.ok).toBe(false);
if (inv.ok) return;
expect(inv.error).toContain('8,187 characters');
expect(inv.error).toContain('8,186');
expect(classifyEnvironment(inv.error, null)?.kind).toBe('arg-limit');
expect(bashCommandInvocation(long, { platform: 'linux' })).toEqual({ ok: true, cmd: 'bash', argv: ['-c', long] });
});
test('runScriptSync and runBashSync return a spawnSync-shaped failure the callers already handle', () => {
const r = runScriptSync(path.join(BIN, 'gstack-wtree'), [], { encoding: 'utf8', timeout: 5_000 }, noBash);
expect(r.status).toBeNull();