Skip to content

Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA

TypeScript

v1.91.294.0 fix(doctor): cut Git Bash process starts so the doctor tests fit Windows CI (GSTA-138) (#3540)

Garry Tan4b8c03bea9d1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6f9bb7543..30ebc2a80 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## [1.91.294.0] - 2026-10-28
+
+**`gstack-doctor` and setup's hook check start far fewer processes, so the doctor tests fit the Windows CI lane again.** On Windows Git Bash each process start costs 12 to 77 ms, and the doctor spent most of its time starting them: about 3.3 s per `--check` and 6 s per dashboard run. `windows-free-shard (1)` was red on main because `test/gstack-doctor.test.ts` took 553 to 647 s there. Every doctor row, fix line and JSON field prints the same as before.
+
+### Changed
+- **`bin/gstack-doctor`**: `clamp` uses bash builtins under `LC_ALL=C`, bytewise like the `tr` and `cut` it replaces. The doctor reads `codex_reviews`, `artifacts_sync_mode`, `telemetry`, `update_check` and `test_backend` in-process through `gstack_config_select`, the reader `gstack-config get` uses, with the same defaults, instead of starting `gstack-config` six times per `--check`.
+- **`bin/gstack-hook-check`** scans each hook shim's TypeScript entries once, reads the shebang with `read` and dedupes its marker-scan list in bash.
+- **`bin/gstack-launch-probe.sh`** takes the first non-blank output line in one subshell instead of a five-process pipeline.
+- Measured on `windows-latest` (profile runs 40672710554 and 40676938495): the doctor test file went from 481 s to 185 s, its slowest case from 25.6 s to 9.9 s, and shard 1 from 682 s (red) to 402 s (green). Dispatched run 40678519767 was green on all six Windows shards.
+
+### Tests
+- `test/gstack-doctor.test.ts`: the `--check` state-root row names `GSTACK_HOME` when `GSTACK_HOME` selected the root, in text and JSON.
+- `test/gstack-launch-probe.test.ts`: a broken binary's detail is its first non-blank line, with CRs dropped, cut to 200 bytes.
+
+### Gate integrity
+- `test/owner-brief-contributor-banned.test.ts` no longer pins the source text `gstack-config" get test_backend` in `bin/gstack-doctor-check.sh`, which the in-process read removed. It runs `gstack-doctor --check --require cores` against a state root holding `test_backend: ubicloud` and expects `test_backend=ubicloud`, with an empty state root as the negative control (`test_backend=local`). The under-8-cores wording pin stays.
+
## [1.91.293.0] - 2026-10-28
**`gstack-harness` errors print again, and `register qm` says plainly that QM cannot import gstack yet.** Every refused `gstack-harness` command crashed with `TypeError: e.line is not a function` instead of printing its reason, because Bun gives each thrown error its own numeric `line` property. Harness Evals then found that QM registration never worked: QM imports a skill pack by cloning the whole repository and stops at 32 MiB and 5,000 files, and gstack's repository is about 73 MiB in 4,300 files.
diff --git a/VERSION b/VERSION
index 25e49b3c3..3b2d0fdc4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.91.293.0
+1.91.294.0
diff --git a/agents-digest/gstack-AGENTS.md b/agents-digest/gstack-AGENTS.md
index cb90fdb38..25babf755 100644
--- a/agents-digest/gstack-AGENTS.md
+++ b/agents-digest/gstack-AGENTS.md
@@ -1,4 +1,4 @@
-# gstack digest v1.91.293.0 — regenerate/re-copy after upgrading gstack
+# gstack digest v1.91.294.0 — regenerate/re-copy after upgrading gstack
Behavioral rules from gstack (https://github.com/garrytan/gstack), compressed
for agent hosts without a full skill install. The full skills add workflows,
diff --git a/bin/gstack-doctor b/bin/gstack-doctor
index 9e18a5a38..0690fb3a9 100755
--- a/bin/gstack-doctor
+++ b/bin/gstack-doctor
@@ -93,7 +93,14 @@ row() {
sq() { printf "'%s'" "$(printf '%s' "$1" | sed "s/'/'\\\\''/g")"; }
# clamp CHARSET MAX — stdin's first line reduced to CHARSET, at most MAX chars.
-clamp() { head -1 | tr -cd "$1" | cut -c1-"$2"; }
+# Builtins only, bytewise like tr and cut: every caller feeds it stdin, and on
+# Windows a head | tr | cut chain costs three process starts (~60 ms).
+clamp() { local LC_ALL=C line pat="[^$1]"; IFS= read -r line; line=${line//$pat/}; printf '%s' "${line:0:$2}"; }
+
+# cfg KEY DEFAULT — sets _cfg to KEY as `gstack-config get` reads it, or DEFAULT
+# (gstack-config's own default) when unset. In-process through
+# gstack-state-root.sh, sourced below: a gstack-config start costs ~200 ms on Windows.
+cfg() { local sr_var=${_gstack_sr_var-}; gstack_config_select "$1" 2>/dev/null; _gstack_sr_var=$sr_var; _cfg="${_gstack_cfg_value:-$2}"; }
# epoch_of VALUE — epoch seconds for an epoch or an ISO-8601 UTC time; "" otherwise.
epoch_of() {
@@ -202,7 +209,7 @@ check_hooks() {
check_codex() {
local reviews probe="$BIN/gstack-codex-probe" sel rc model src
CODEX_READY=0
- reviews=$("$BIN/gstack-config" get codex_reviews 2>/dev/null || echo enabled)
+ cfg codex_reviews enabled; reviews=$_cfg
if [ "$reviews" = disabled ]; then
row "not configured" codex "codex_reviews disabled; $CODEX_FEATURES skip Codex" "$BIN/gstack-config set codex_reviews enabled"
return
@@ -269,7 +276,7 @@ check_codex_probe() {
check_sync() {
local mode file json status held drainable drain push queue=0 now f detail case_names fix="$BIN/gstack-brain-sync --status"
- mode=$("$BIN/gstack-config" get artifacts_sync_mode 2>/dev/null || echo off)
+ cfg artifacts_sync_mode off; mode=$_cfg
if [ ! -d "$STATE_ROOT/.git" ]; then
row "not configured" "artifacts sync" "off; cross-machine artifacts sync is unavailable" "$BIN/gstack-artifacts-init"
return
@@ -373,7 +380,7 @@ check_binaries() {
check_cso() {
local file="$SRC/bin/.gstack-cso-build-result" result stage reason installed diag usable=0
[ -x "$SRC/bin/gstack-cso-launcher$EXE" ] && [ -x "$SRC/bin/gstack-cso-core$EXE" ] && usable=1
- cso_field() { sed -n "s/^$1=//p" "$file" 2>/dev/null | head -1 | clamp ' -~' 200; }
+ cso_field() { sed -n "s/^$1=//p" "$file" 2>/dev/null | clamp ' -~' 200; }
result=$(cso_field result) stage=$(cso_field stage) reason=$(cso_field reason) installed=$(cso_field installed) diag=$(cso_field diagnostic)
case "$result" in
ok) if [ "$usable" -eq 1 ]; then row ok cso "native helper $installed"
@@ -603,7 +610,7 @@ if [ "$CHECK" -eq 1 ]; then
exit $?
fi
-echo "gstack doctor $(head -1 "$ROOT/VERSION" 2>/dev/null | clamp '0-9A-Za-z.+-' 40)"
+echo "gstack doctor $(clamp '0-9A-Za-z.+-' 40 2>/dev/null <"$ROOT/VERSION")"
check_install
check_rescue_refs
check_state_root
diff --git a/bin/gstack-doctor-check.sh b/bin/gstack-doctor-check.sh
index b11f20f71..0cb0d5956 100644
--- a/bin/gstack-doctor-check.sh
+++ b/bin/gstack-doctor-check.sh
@@ -2,7 +2,7 @@
# gstack-doctor-check.sh — `gstack-doctor --check`: the one-line install verdict.
#
# Sourced by bin/gstack-doctor after its prelude (ROOT, ROOT_REAL, BIN, SRC,
-# DOCS, STATE_ROOT, EXE, clamp, the launch probe, the codex status helpers)
+# DOCS, STATE_ROOT, EXE, clamp, cfg, the launch probe, the codex status helpers)
# and never executed on its own. Prints `required: <ids>`, one
# `PASS | FAIL | SKIP <id>` row per component in bin/gstack-doctor-components.sh
# (generated from lib/doctor-components.ts; the same ids feed --for, --require
@@ -142,7 +142,7 @@ _dc_check_patch() {
fi
# A tier 2+ render keeps the patch in the shared sections/preamble.md its SKILL.md points to.
for f in "$file" "${file%/SKILL.md}/sections/preamble.md"; do
- model=$(grep -F 'Model-Specific Behavioral Patch (' "$f" 2>/dev/null | head -1 | sed 's/.*Model-Specific Behavioral Patch (\([^)]*\)).*/\1/' | clamp 'A-Za-z0-9._:/-' 60)
+ model=$(grep -F 'Model-Specific Behavioral Patch (' "$f" 2>/dev/null | sed 's/.*Model-Specific Behavioral Patch (\([^)]*\)).*/\1/' | clamp 'A-Za-z0-9._:/-' 60)
[ -n "$model" ] && { file="$f"; break; }
done
if [ -n "$model" ]; then
@@ -154,7 +154,7 @@ _dc_check_patch() {
_dc_check_codex_cli() {
local probe="$BIN/gstack-codex-probe" reviews sel rc model out state optional_note="optional; a Claude subagent serves as the outside voice"
- reviews=$("$BIN/gstack-config" get codex_reviews 2>/dev/null || echo enabled)
+ cfg codex_reviews enabled; reviews=$_cfg
if ! command -v codex >/dev/null 2>&1; then
_dc_fail_or_skip codex-cli "Codex CLI not installed" "npm install -g @openai/codex, then codex login" COMPONENT_MISSING "$optional_note; Codex CLI not installed"
return
@@ -228,7 +228,7 @@ _dc_check_browser() {
if [ "$rc" -eq 0 ] && printf '%s\n' "$out" | grep -q '^RENDER_OK'; then
_dc_row PASS browser "Chromium $(printf '%s\n' "$out" | sed -n 's/^RENDER_OK //p' | clamp '0-9.' 20) launched and rendered ($engine)"
else
- _dc_row FAIL browser "Chromium did not launch and render via $engine (exit $rc: $(printf '%s\n' "$out" | grep -v '^[[:space:]]*$' | head -1 | clamp ' -~' 160))" "$fix" BROWSER_UNAVAILABLE
+ _dc_row FAIL browser "Chromium did not launch and render via $engine (exit $rc: $(printf '%s\n' "$out" | grep -v '^[[:space:]]*$' | clamp ' -~' 160))" "$fix" BROWSER_UNAVAILABLE
fi
}
@@ -238,7 +238,7 @@ _dc_check_cso() {
_dc_row PASS cso "native helper built"
return
fi
- [ -f "$file" ] && reason=$(sed -n 's/^reason=//p' "$file" 2>/dev/null | head -1 | clamp ' -~' 100)
+ [ -f "$file" ] && reason=$(sed -n 's/^reason=//p' "$file" 2>/dev/null | clamp ' -~' 100)
_dc_fail_or_skip cso "native helper not built${reason:+ ($reason)}" "cd $SRC && ./setup (it names any missing build prerequisite)" COMPONENT_MISSING "optional; toolchain absent or helper not built${reason:+: $reason}"
}
@@ -376,7 +376,7 @@ _dc_check_pins() {
return
fi
_dc_row FAIL pins "$failline$note" "$fix" PROJECT_PIN_MISMATCH ;;
- *) _dc_row SKIP pins "gstack-runtime-pins could not evaluate $project (exit $rc: $(printf '%s\n' "$out" | grep -v '^[[:space:]]*$' | head -1 | clamp ' -~' 120))" ;;
+ *) _dc_row SKIP pins "gstack-runtime-pins could not evaluate $project (exit $rc: $(printf '%s\n' "$out" | grep -v '^[[:space:]]*$' | clamp ' -~' 120))" ;;
esac
}
@@ -394,7 +394,7 @@ _dc_check_state_root() {
}
# _dc_cfg KEY DEFAULT — a clamped config value, never the file or a message.
-_dc_cfg() { local v; v=$("$BIN/gstack-config" get "$1" 2>/dev/null </dev/null | clamp 'a-z0-9_-' 24); printf '%s' "${v:-$2}"; }
+_dc_cfg() { local v; cfg "$1" "$2"; v=$(printf '%s' "$_cfg" | clamp 'a-z0-9_-' 24); printf '%s' "${v:-$2}"; }
_dc_check_privacy() {
_dc_row PASS privacy "telemetry=$(_dc_cfg telemetry off) artifacts_sync=$(_dc_cfg artifacts_sync_mode off) codex_reviews=$(_dc_cfg codex_reviews enabled) update_check=$(_dc_cfg update_check true)"
@@ -408,7 +408,7 @@ _dc_check_cores() {
local n backend
n=$(nproc 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 0)
n=$(printf '%s' "$n" | clamp '0-9' 6)
- backend=$("$BIN/gstack-config" get test_backend 2>/dev/null </dev/null | clamp 'a-z' 8); backend=${backend:-local}
+ cfg test_backend local; backend=$(printf '%s' "$_cfg" | clamp 'a-z' 8); backend=${backend:-local}
case "$n" in ''|0) _dc_row PASS cores "unknown CPU count test_backend=$backend"; return ;; esac
if [ "$n" -lt 8 ] && [ "$backend" = local ]; then
_dc_row PASS cores "$n test_backend=local (under 8: run full unit and E2E tiers on a remote gate; set gstack-config set test_backend ubicloud, scripts/ubicloud/ubi-runner.sh)"
@@ -454,7 +454,7 @@ _dc_check_min_revision() {
_dc_check_revision() {
local installed head="" want="$CHECK_REVISION" target=""
- installed=$(head -1 "$ROOT/VERSION" 2>/dev/null | clamp '0-9A-Za-z.+-' 40)
+ installed=$(clamp '0-9A-Za-z.+-' 40 2>/dev/null <"$ROOT/VERSION")
head=$(git -C "$ROOT_REAL" rev-parse --short HEAD 2>/dev/null | clamp '0-9a-f' 12)
_dc_revision="${installed:-unknown}"
_dc_check_min_revision "${installed:-0}" "$head" || return
@@ -500,7 +500,7 @@ _dc_check_floor() {
# first occurrence wins (the top-level field in a policy file), and only the
# first 64 KiB are read: a real policy is a few KB.
flat=$(head -c 65536 "$file" 2>/dev/null | tr '\n\r\t' ' ')
- floor=$(printf '%s' "$flat" | grep -o '"'"$GSTACK_PROJECT_FLOOR_FIELD"'" *: *"[0-9][0-9.]*"' | head -1 | sed 's/.*"\([0-9][0-9.]*\)"$/\1/' | clamp '0-9.' 32)
+ floor=$(printf '%s' "$flat" | grep -o '"'"$GSTACK_PROJECT_FLOOR_FIELD"'" *: *"[0-9][0-9.]*"' | sed 's/.*"\([0-9][0-9.]*\)"$/\1/' | clamp '0-9.' 32)
if [ -z "$floor" ]; then
if printf '%s' "$flat" | grep -q '"'"$GSTACK_PROJECT_FLOOR_FIELD"'" *: *"'; then
_dc_row SKIP floor "$file sets $GSTACK_PROJECT_FLOOR_FIELD to something other than a plain dotted version"
@@ -509,7 +509,7 @@ _dc_check_floor() {
fi
return
fi
- installed=$(head -1 "$ROOT/VERSION" 2>/dev/null | clamp '0-9A-Za-z.+-' 40)
+ installed=$(clamp '0-9A-Za-z.+-' 40 2>/dev/null <"$ROOT/VERSION")
if _dc_version_below "${installed:-0}" "$floor"; then
if [ -n "${GSTACK_CAPY_WRAPPER_PATH:-}" ]; then
fix="bash $GSTACK_CAPY_WRAPPER_PATH${CHECK_FOR:+ --for $CHECK_FOR} (fast-forwards a clean checkout to origin and reinstalls), or $SRC/bin/gstack-upgrade"
diff --git a/bin/gstack-hook-check b/bin/gstack-hook-check
index a399d2ba6..63f5e5eb5 100755
--- a/bin/gstack-hook-check
+++ b/bin/gstack-hook-check
@@ -155,11 +155,17 @@ ts_entries() {
# One bun process bundles every hook's TypeScript entries (a bun start costs
# seconds on Windows). Each line is "<entry>\tok\t<input>" per bundled input,
# or "<entry>\tfail\t<file:line>\t<message>".
+# TS_OF[i] keeps hook i's entries for the check loop below, so each shim is
+# scanned once (four process starts, ~80 ms on Windows).
ENTRIES=""
+i=0
for hook in $HOOKS; do
shim="$ROOT/$hook"
+ TS_OF[i]=""
+ [ -f "$shim" ] && TS_OF[i]=$(ts_entries "$shim")
+ i=$((i + 1))
[ -f "$shim" ] || continue
- for entry in $(ts_entries "$shim"); do
+ for entry in ${TS_OF[i - 1]}; do
[ -f "${shim%/*}/$entry" ] && ENTRIES="$ENTRIES${shim%/*}/$entry$NL"
done
done
@@ -190,11 +196,14 @@ if [ -n "$ENTRIES" ]; then
}' $ENTRIES) > "$BUILT" 2>/dev/null || true
fi
+i=0
for hook in $HOOKS; do
shim="$ROOT/$hook"
+ i=$((i + 1))
if [ ! -f "$shim" ]; then echo "missing $hook"; continue; fi
hook_ok=1
- shebang=$(head -1 "$shim")
+ shebang=""
+ IFS= read -r shebang < "$shim"
case "$shebang" in
'#!'*bash*) interp=bash ;;
'#!'*/sh|'#!'*/sh' '*|'#!'*' sh'|'#!'*' sh '*) interp=sh ;;
@@ -217,7 +226,7 @@ for hook in $HOOKS; do
scan="$scan$NL$helper"
done
dir=${shim%/*}
- for entry in $(ts_entries "$shim"); do
+ for entry in ${TS_OF[i - 1]}; do
if [ ! -f "$dir/$entry" ]; then
fail "$hook" "$dir/$entry:1" "missing TypeScript entry (the hook runs it)"
hook_ok=0
@@ -244,7 +253,11 @@ for hook in $HOOKS; do
# and -H prefixes "<file>:<line>:" (the line is the last colon field before
# the marker text, so paths containing colons still split right).
# shellcheck disable=SC2046 # newline-split list (IFS is a newline)
- for found in $(grep -HnE -m1 '^(<<<<<<<|=======|>>>>>>>)( |$)' $(printf '%s\n' "$scan" | awk '!seen[$0]++') 2>/dev/null); do
+ files=""
+ for f in $scan; do
+ case "$NL$files" in *"$NL$f$NL"*) ;; *) files="$files$f$NL" ;; esac
+ done
+ for found in $(grep -HnE -m1 '^(<<<<<<<|=======|>>>>>>>)( |$)' $files 2>/dev/null); do
marker_file=${found%%:[0-9]*:[<=>]*}
marker_line=${found#"$marker_file":}
marker_line=${marker_line%%:*}
diff --git a/bin/gstack-launch-probe.sh b/bin/gstack-launch-probe.sh
index 098587025..8fa4a35fe 100644
--- a/bin/gstack-launch-probe.sh
+++ b/bin/gstack-launch-probe.sh
@@ -30,7 +30,10 @@ gstack_launch_probe() {
out=$("$1" --version </dev/null 2>&1)
fi
rc=$?
- _glp_detail=$(printf '%s\n' "$out" | tr -d '\r' | grep -v '^[[:space:]]*$' | head -1 | cut -c1-200)
+ # The first non-blank line, CRs dropped, at most 200 bytes: one subshell, not
+ # a five-process pipeline (each process start is ~20 ms on Windows).
+ _glp_detail=$(set -f; IFS='
+'; LC_ALL=C; for line in $out; do line=${line//$'\r'/}; case "$line" in *[![:space:]]*) printf '%s' "${line:0:200}"; break ;; esac; done)
case "$out" in
*[Aa]pplication\ [Cc]ontrol*|*"Smart App Control"*|*"blocked by group policy"*|*"has blocked this file"*)
_glp_state=blocked; return 0 ;;
diff --git a/package.json b/package.json
index 386cfb905..455ca838f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gstack",
- "version": "1.91.293",
+ "version": "1.91.294",
"description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.",
"license": "MIT",
"type": "module",
diff --git a/test/gstack-doctor.test.ts b/test/gstack-doctor.test.ts
index 3e04ef275..dc81a8c06 100644
--- a/test/gstack-doctor.test.ts
+++ b/test/gstack-doctor.test.ts
@@ -507,6 +507,20 @@ describe('gstack-doctor --check', () => {
expect(probeCalls(f)).not.toContain('probe-model');
});
+ // Value: protects=the --check state-root row names the variable that selected the root, after earlier rows read config;
+ // fails_when=an in-process config read reselects the root from the doctor's own GSTACK_STATE_ROOT;
+ // why_new=every other fixture sets GSTACK_STATE_ROOT itself, so a wrong "selected by" still reads GSTACK_STATE_ROOT; seam=none;
+ // no_claim=CLAUDE_PLUGIN_DATA and default selection (GSTACK_HOME stands in for every selector other than GSTACK_STATE_ROOT)
+ test('the state-root row names GSTACK_HOME when GSTACK_HOME selected the root, in text and JSON', () => {
+ const f = makeFixture();
+ installCodex(f);
+ const byHome = { GSTACK_STATE_ROOT: '', GSTACK_HOME: f.state };
+ const r = row(f, [], byHome);
+ expect(r.rows['state-root'].rest, r.out).toContain('(selected by GSTACK_HOME;');
+ const json = JSON.parse(doctor(f, ['--json'], byHome).out);
+ expect(json.rows.find((x: { id: string }) => x.id === 'state-root').detail).toContain('(selected by GSTACK_HOME;');
+ });
+
test('--for autoplan: healthy Capy machine with Claude subagents as the outside voice and no Codex CLI passes', () => {
const f = makeFixture();
installCodex(f);
diff --git a/test/gstack-launch-probe.test.ts b/test/gstack-launch-probe.test.ts
index fcf76bc36..5acc2c580 100644
--- a/test/gstack-launch-probe.test.ts
+++ b/test/gstack-launch-probe.test.ts
@@ -51,6 +51,14 @@ describe.skipIf(process.platform === 'win32')('gstack-launch-probe.sh classifica
expect(probe(fakeBinary('echo "Unknown argument: --version" >&2; exit 3'))).toEqual({ state: 'broken', detail: 'exit 3: Unknown argument: --version' });
});
+ // Value: protects=the detail is the first non-blank line with CRs dropped, cut to 200 bytes (Windows CRLF output);
+ // fails_when=the builtin line picker keeps a CR, returns a blank line or cuts at another length;
+ // why_new=every other case prints one clean LF line; seam=none; no_claim=real Git Bash output (a sh fake prints the bytes)
+ test('a broken binary\'s detail is its first non-blank line, CRs dropped, at most 200 bytes', () => {
+ const long = 'y'.repeat(250);
+ expect(probe(fakeBinary(`printf '\\r\\n \\n\\t\\r\\n${long}\\r\\nnext\\n'; exit 3`))).toEqual({ state: 'broken', detail: `exit 3: ${'y'.repeat(200)}` });
+ });
+
test('an absent binary is missing', () => {
expect(probe(fakeBinary(null)).state).toBe('missing');
});
diff --git a/test/owner-brief-contributor-banned.test.ts b/test/owner-brief-contributor-banned.test.ts
index 66b485130..03ca4a558 100644
--- a/test/owner-brief-contributor-banned.test.ts
+++ b/test/owner-brief-contributor-banned.test.ts
@@ -222,8 +222,13 @@ describe('test_backend config', () => {
expect(cfg('set', 'test_backend', 'mars').code).not.toBe(0);
expect(cfg('get', 'test_backend').out).toBe('ubicloud');
expect(cfg('defaults').out).toContain('test_backend');
+ const coresRow = (root: string) => {
+ const r = spawnSync('bash', [path.join(ROOT, 'bin', 'gstack-doctor'), '--check', '--require', 'cores'], { encoding: 'utf8', timeout: 30_000, env: { ...process.env, GSTACK_STATE_ROOT: root, GSTACK_HOME: root } });
+ return (r.stdout ?? '').split('\n').find(line => line.startsWith('PASS cores ')) ?? `no cores row: ${r.stdout}${r.stderr}`;
+ };
+ expect(coresRow(state)).toContain('test_backend=ubicloud');
+ expect(coresRow(tmp('gstack-test-backend-unset-'))).toContain('test_backend=local');
const doctor = fs.readFileSync(path.join(ROOT, 'bin', 'gstack-doctor-check.sh'), 'utf8');
- expect(doctor).toContain('gstack-config" get test_backend');
expect(doctor).toContain('set gstack-config set test_backend ubicloud, scripts/ubicloud/ubi-runner.sh');
});
});