Free tests write to the developer's real $HOME (setup run in team-mode tests, prepush skip log)
Author: Jey2311Created Sep 17, 2026Updated Sep 17, 2026
What happens
Two free-tier test files write to the real $HOME of whoever runs them:
test/team-mode.test.ts- What it does: the two tests in
setup --team / --no-team / -qrun${ROOT}/setup -qandsetup --local -qwithenv: {...process.env}, sosetupacts on the developer's real install. - What
setupdoes there:- installs or re-renders the checkout's skills (into
~/.gstack/render/claude, linked from~/.claude/skills); - writes the checkout's
VERSIONto~/.gstack/.last-setup-version; - runs the checkout's pending
gstack-upgrade/migrationsagainst the real state, withGSTACK_INSTALL_DIRset to the checkout.
- installs or re-renders the checkout's skills (into
- The tests only check stdout, not the exit code, so they pass either way.
- What it does: the two tests in
test/redact-prepush-hook.test.ts: three tests run the pre-push hook withGSTACK_REDACT_PREPUSH=skipand noGSTACK_HOME.logSkipinbin/gstack-redact-prepushthen appendsenv-skiplines to the real~/.gstack/security/prepush-skip.jsonl.
Why it matters
Running bun test from a checkout that differs from the installed gstack has three effects:
- the live skills are silently replaced by the checkout's;
- the recorded setup version moves ahead of the installed one, so the next real upgrade skips the migrations in between;
- the prepush-skip audit log fills with entries nobody made.
Seen on a machine with gstack 1.84.1.0 installed, while running these files from a 1.87.4.0 checkout (for #2892):
- the live render served 1.87's skills;
- a brain-blocks check dropped from 10/12 to 9/11;
~/.gstack/.last-setup-versionread1.87.4.0;prepush-skip.jsonlgained twoenv-skiplines per run.
Reproduce without touching your install
T=$(mktemp -d); mkdir -p "$T/.claude/skills"
HOME=$T GSTACK_HOME=$T/.gstack ./setup -q
cat "$T/.gstack/.last-setup-version" # the checkout's VERSION
ls "$T/.claude/skills" | wc -l # the checkout's skills
HOME=$T GSTACK_HOME=$T/.gstack bun test test/redact-prepush-hook.test.ts
cat "$T/.gstack/security/prepush-skip.jsonl" # env-skip lines
With the real HOME, both writes land in the real install.
Suggested fix
- Give those tests a throwaway
HOMEandGSTACK_HOME, plusGSTACK_USER_RENDER_DIRforsetup, as most other tests already do. - Or have
scripts/test-free-shards.tsrun every file under a temporaryHOME. - The setup tests should also assert
setup's exit code: with a bareHOME,setup -qstops early and the test still passes.
Source: garrytan/gstack