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.300.0 test(flaky): 2026-10-28 free Linux timing pass: ubicloud fake ssh, coordinator clone, qa-fix-loop late clock (GSTA-139 S4) (#3543)
Garry Tan766093df3e85
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 652c7d273..678ddf26e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,17 @@# Changelog+## [1.91.300.0] - 2026-10-28++**Three free tests that went red at random now fail only when the code under test is wrong.** Today's flaky-test pass (GSTA-139) traced two Linux reds to their fixtures and fixed a third that was certain to fail under load. No product code changed.++### Fixed+- **`test/ubicloud-runner.test.ts`**: the watchdog cases expected exit 124 but got 2 or 0, about one run in 62. The cause was not timing. The fake `ssh` had a `*-O*` case arm, meant for `ssh -O exit` but never matched by it, and it caught any remote command whose checkout path held `-O`. That happened whenever the fixture's temporary directory name started with `O`. The arm is gone, and a new test runs a checkout named `ubi-run-O1x2y3`.+- **`test/ship-queue-train.test.ts`, `test/gstack-ship-queue.test.ts`**: `coordinatorClone` now clones the fixture origin with `--no-local`, through git's transport like a real clone of GitHub, instead of copying `origin.git/objects` file by file. Every push into the fixture origin leaves a detached `git maintenance run --auto` there. The local transport drops the shard's `GIT_CONFIG_COUNT` maintenance-off setting, so that process still creates and deletes `objects/maintenance.lock` after the push returns. Two runs failed with `failed to copy file … No such file or directory` on a loose object. The process that removed that object was not identified; the transport clone never lists the directory at all.+- **`test/qa-fix-loop-fixture.test.ts` late-timeout**: the scenario ran its real setup inside a 1000 ms mocked work budget under a 1160 ms deadline, so on a loaded machine the attempt never started (0 of 10 runs under 24 busy loops). It now uses #3413's qa-only fix: the clock stands still from the test body's start until the capture begins, and the deadline is the registered 6080 ms outer budget (20 of 20 under the same load).++### Gate integrity+- `test/qa-fix-loop-fixture.test.ts` late-timeout asserts that the capture gets exactly 1000 ms, where it used to accept anything between 0 and 1000, and its test deadline is the registered outer budget rather than budget − 5000 + 80 ms. If the workflow's outer budget drops back to the bare work budget, the scenario still fails. A new `slow-setup` scenario keeps the check the old range assertion gave. A controlled clock spends 400 ms in setup, and the capture must get exactly 600 ms. If the workflow passed the whole work budget to the capture instead of what setup left, it would fail.+## [1.91.299.0] - 2026-10-28**The Captain brief now says what `rec` does when a gate carries earlier decisions.** At a gate after the owner already answered some items, such as a round-cap gate, `gstack-owner-brief render --captain` listed each item's recommendation ("keep the plan as written", `rec resolves to d2a`) while `gstack-gate render` and `gstack-autoplan answer --reply rec` keep the carried answer (`d2b`). A Captain relaying the brief told the owner the opposite of what their one-word reply would record (#3546). The brief now takes its choices from the same resolver `gstack-gate render` uses.diff --git a/VERSION b/VERSIONindex 9b80917b9..6dad6df3e 100644--- a/VERSION+++ b/VERSION@@ -1 +1 @@-1.91.299.0+1.91.300.0diff --git a/agents-digest/gstack-AGENTS.md b/agents-digest/gstack-AGENTS.mdindex 2c8bebe50..b7cab5f77 100644--- a/agents-digest/gstack-AGENTS.md+++ b/agents-digest/gstack-AGENTS.md@@ -1,4 +1,4 @@-# gstack digest v1.91.299.0 — regenerate/re-copy after upgrading gstack+# gstack digest v1.91.300.0 — regenerate/re-copy after upgrading gstackBehavioral rules from gstack (https://github.com/garrytan/gstack), compressedfor agent hosts without a full skill install. The full skills add workflows,diff --git a/docs/TESTING_INTERNALS.md b/docs/TESTING_INTERNALS.mdindex dad6ded38..31fefa201 100644--- a/docs/TESTING_INTERNALS.md+++ b/docs/TESTING_INTERNALS.md@@ -1427,7 +1427,13 @@ Free-suite flake rules:every shard child's `GIT_CONFIG_*` pairs as a backstop, so it covers fixturesthat inherit the environment, and `bun run scripts/ship-measure.ts free--backend local` measures with that environment; a fixture with its own- replacement env never sees the backstop.+ replacement env never sees the backstop. Neither does the receiving side of+ a push to a local path: git's local transport drops `GIT_CONFIG_*` from the+ `receive-pack` it starts, so every push into a fixture's bare origin still+ leaves a detached maintenance run in that origin. A fixture that clones such+ an origin passes `--no-local` (`coordinatorClone` in+ `test/helpers/ship-queue-fixture.ts`), so the clone reads it through git's+ transport instead of copying `objects/` entry by entry.To reproduce a ledger entry, take the shard's exact file list from the CI run's`free-plan` artifact, then rerun it with the flaky retry off on a CI-mirrored VM:diff --git a/package.json b/package.jsonindex da008c24c..4c951ed8f 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "gstack",- "version": "1.91.299",+ "version": "1.91.300","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/helpers/ship-queue-fixture.ts b/test/helpers/ship-queue-fixture.tsindex 0051fd548..87068b348 100644--- a/test/helpers/ship-queue-fixture.ts+++ b/test/helpers/ship-queue-fixture.ts@@ -98,10 +98,18 @@ export function ghQueueShim(repo: FixtureRepo, data: { prs: Record<string, unknoreturn { PATH: `${dir}:${process.env.PATH ?? ''}` };}-/** A coordinator's separate clone of the fixture origin. */+/**+ * A coordinator's separate clone of the fixture origin, fetched through git's+ * transport (--no-local) like a real clone of GitHub. A local clone copies+ * origin.git/objects entry by entry, and every push into the fixture origin+ * leaves a detached `git maintenance run --auto` there that creates and+ * deletes objects/maintenance.lock after the push returns: local transport+ * drops the shard's GIT_CONFIG_COUNT maintenance-off backstop, so it never+ * reaches that receive-pack.+ */export function coordinatorClone(repo: FixtureRepo): string {const dir = path.join(repo.root, 'coordinator');- const r = spawnSync('git', ['clone', '-q', repo.origin, dir], { timeout: 60_000, env: { ...process.env, ...repo.env } });+ const r = spawnSync('git', ['clone', '-q', '--no-local', repo.origin, dir], { timeout: 60_000, env: { ...process.env, ...repo.env } });if (r.status !== 0) throw new Error(`clone failed: ${r.stderr?.toString()}`);return dir;}diff --git a/test/qa-fix-loop-fixture.test.ts b/test/qa-fix-loop-fixture.test.tsindex 15956eee7..495c6c985 100644--- a/test/qa-fix-loop-fixture.test.ts+++ b/test/qa-fix-loop-fixture.test.ts@@ -5,7 +5,7 @@ import * as os from 'node:os';import * as path from 'node:path';import { spawnSync } from 'node:child_process';const ROOT = path.resolve(import.meta.dir, '..');-test.each(['success', 'bash-edit', 'max-turns', 'no-edit', 'no-commit', 'runner', 'retry', 'directory', 'recording', 'late-timeout'])+test.each(['success', 'bash-edit', 'max-turns', 'no-edit', 'no-commit', 'runner', 'retry', 'directory', 'recording', 'late-timeout', 'slow-setup'])('QA attempt recording and fixture ownership: %s', scenario => {const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'qa-fix-body-'));const script = path.join(dir, 'body.fixture.test.ts');@@ -21,7 +21,10 @@ const scenario = ${JSON.stringify(scenario)};const attempts = [], records = [], servers = [];const late = scenario === 'late-timeout';const workMs = 1000, drainMs = 80;-let finalized = false, outerMs;+const realNow = Date.now, slowSetup = scenario === 'slow-setup';+let finalized = false, outerMs, frozenAt, clock = realNow();+if (late) Date.now = () => frozenAt ?? realNow();+else if (slowSetup) Date.now = () => clock;const collector = { addTest: entry => {records.push({ ...entry, afterFinalization: finalized });if (scenario === 'recording') throw new Error('QA recorder failure');@@ -36,7 +39,7 @@ Bun.serve = options => {return server;};mock.module(path.join(root, 'test/helpers/aside-available.ts'), () => ({ asideAvailable: () => false }));-if (late) mock.module(path.join(root, 'test/helpers/eval-budgets.ts'), () => ({+if (late || slowSetup) mock.module(path.join(root, 'test/helpers/eval-budgets.ts'), () => ({JUDGE_MS: 120_000, CAPTURE_MS: 300_000, CAPTURE_LONG_MS: workMs,}));mock.module(path.join(root, 'test/helpers/e2e-helpers.ts'), () => ({@@ -46,13 +49,13 @@ mock.module(path.join(root, 'test/helpers/e2e-helpers.ts'), () => ({testConcurrentIfSelected: (id, body, budget) => {if (id !== 'qa-fix-loop') return;outerMs = budget;- // Keep the actual native outer deadline, scaling only its 5s recording- // margin to80ms. The pre-fix equal work/outer deadline stays equal.- const nativeBudget = late ? (budget >= workMs + 5000 ? budget - 5000 + 80 : budget) : 5000;- test(id, body, nativeBudget);+ // The late attempt's clock stands still through its real setup, so the+ // mocked work budget reaches the capture whole; the deadline is the+ // registered outer budget.+ test(id, late ? () => { frozenAt = realNow(); return body(); } : body, late ? budget : 5000);},copyDirSync: (source, target) => fs.cpSync(source, target, { recursive: true }),- setupBrowseShims: cwd => fs.mkdirSync(path.join(cwd, 'browse/bin'), { recursive: true }),+ setupBrowseShims: cwd => { fs.mkdirSync(path.join(cwd, 'browse/bin'), { recursive: true }); if (slowSetup) clock += 400; },logCost: () => {}, createEvalCollector: () => collector, finalizeEvalCollector: async () => {},recordE2E: (_collector, name, suite, result, extra) => collector.addTest({name, suite, exit_reason: result.exitReason, model: result.model,@@ -62,6 +65,7 @@ mock.module(path.join(root, 'test/helpers/e2e-helpers.ts'), () => ({mock.module(path.join(root, 'test/helpers/session-runner.ts'), () => ({SESSION_DRAIN_GRACE_MS: late ? drainMs : 5000,runSkillTest: async options => {+ frozenAt = undefined;const cwd = options.workingDirectory;const git = (...args) => execFileSync('git', args, { cwd, encoding: 'utf8', timeout: 5000 });const initial = fs.readFileSync(path.join(cwd, 'index.html'), 'utf8');@@ -102,6 +106,7 @@ afterAll(async () => {// behind child exit; this reproduces the observed late recording race.if (late) await new Promise(resolve => setTimeout(resolve, 200));fs.writeFileSync(${JSON.stringify(factsPath)}, JSON.stringify({ attempts, records, servers, outerMs }));+ Date.now = realNow;});await import(path.join(root, 'test/skill-e2e-qa-workflow.test.ts'));`);@@ -152,11 +157,11 @@ await import(path.join(root, 'test/skill-e2e-qa-workflow.test.ts'));}if (scenario === 'late-timeout') {expect(outerMs).toBe(1000 + 80 + 5000);- expect(attempts[0].captureBudgetMs).toBeGreaterThan(0);- expect(attempts[0].captureBudgetMs).toBeLessThan(1000);+ expect(attempts[0].captureBudgetMs).toBe(1000);expect(records[0].exit_reason).toBe('timeout');expect(child.stderr).not.toContain('Unhandled error between tests');}+ if (scenario === 'slow-setup') expect(attempts[0].captureBudgetMs).toBe(1000 - 400);if (scenario === 'directory') {expect(attempts[0].directoryStatus).toBe(404);expect(attempts[0].missingStatus).toBe(404);diff --git a/test/ship-queue-train.test.ts b/test/ship-queue-train.test.tsindex 3ad14c6a8..15e24c277 100644--- a/test/ship-queue-train.test.ts+++ b/test/ship-queue-train.test.ts@@ -59,6 +59,15 @@ function publishMain(fx: TrainFixture, prefixCommit: string, version: string, exreturn repo.git('rev-parse', 'HEAD');}+// fails_when=coordinatorClone copies origin.git/objects file by file again, so an entry that appears or vanishes there mid-copy (the detached maintenance.lock every push into the fixture origin leaves) fails the clone, as in two Free Tests reds on 2026-10-28 (GSTA-139 ledger); why_new=no other test clones while origin's objects directory changes; seam=a dangling symlink planted under objects/, which a local copy refuses on every run; no_claim=which process removed the loose object those runs named+test('the coordinator clone reads origin through git, never by copying its objects directory (GSTA-139)', () => {+ const fx = make();+ fs.symlinkSync(path.join(fx.repo.root, 'gone'), path.join(fx.repo.origin, 'objects', 'maintenance.lock'));+ const coord = coordinatorClone(fx.repo);+ expect(spawnSync('git', ['-C', coord, 'rev-parse', 'origin/main'], { encoding: 'utf8', timeout: 30_000, env: { ...process.env, ...fx.repo.env } }).stdout.trim()).toBe(fx.repo.git('rev-parse', 'origin/main'));+ expect(fs.existsSync(path.join(coord, '.git', 'objects', 'maintenance.lock'))).toBe(false);+});+describe('the train command surface', () => {test('train with no subcommand (flags only) prints the train help and exits usage; --help exits 0; bad arguments name what is missing', () => {const fx = make();diff --git a/test/ubicloud-runner.test.ts b/test/ubicloud-runner.test.tsindex 4a9e2a04c..bb6e66012 100644--- a/test/ubicloud-runner.test.ts+++ b/test/ubicloud-runner.test.ts@@ -391,7 +391,6 @@ describe('ubi-runner run, verify and quota against a fake API and a fake ssh', ('cmd=${*: -1}\n' +'printf \'%s\\n\' "$cmd" >> "$root/ssh.log"\n' +'case "$cmd" in\n' +- ' *-O*) exit 0 ;;\n' +' *pkill*) echo "$cmd" >> "$root/cancel.log" ;;\n' +' *captured*) cat > "$root/captured" ;;\n' +' *"cat > ~/.ubirun-env"*) cat > "$root/ubirun-env" ;;\n' +@@ -458,6 +457,18 @@ describe('ubi-runner run, verify and quota against a fake API and a fake ssh', (} finally { rmSync(f.root, { recursive: true, force: true }); }}, 60_000);+ test('run: the fake ssh dispatches on the remote command, so a checkout whose name holds -O still syncs and runs (GSTA-139)', () => {+ const f = fakeVm();+ try {+ const checkout = join(f.root, 'ubi-run-O1x2y3');+ mkdirSync(checkout);+ const r = run(f, ['run', '--src', checkout, '--', 'make test']);+ expect(r.exitCode, r.stderr.toString()).toBe(0);+ expect(r.stdout.toString()).toContain('ran: ');+ expect(f.ssh()).toContain('tar -xzf - -C work/ubi-run-O1x2y3');+ } finally { rmSync(f.root, { recursive: true, force: true }); }+ }, 60_000);+test('run: --pass forwards a named local variable only; UBICLOUD_* and non-names are refused before any API call', () => {const f = fakeVm();try {