mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-04 15:57:33 +01:00
* test(free): split files over the 60 s seed ceiling and the Windows doctor file Eight free test files the fresh recordings put over the seed ratchet's 60 s ceiling, and test/gstack-doctor.test.ts (343 s on Windows), are split by describe block or test with shared helpers moved to test/helpers/. Test bodies are unchanged. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(todos): note the GSTA-151 seed-ceiling splits Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(free): reseed both duration seeds at this head Recorded by free-durations-record.yml (open_pr=false) run 40818261447 atec6faf1: 1,416 Linux files on ubicloud-standard-8 and the 795 curated Windows files on windows-latest. test/setup-codex-scope.test.ts fell to 49 s and leaves the seed allowlist. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore: changelog entry for the GSTA-151 seed-ceiling splits (unreleased) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(free): split test/ubicloud-runner.test.ts over the 60 s seed ceiling; keep setup-codex-scope allowlisted The reseed at the main merge (free-durations-record run 41226501374,221320e) put test/ubicloud-runner.test.ts, which main added after this branch's first reseed, at 127 s and test/setup-codex-scope.test.ts back at 66 s. The fake-API cases move into four parts by describe topic with their shared fake VM in test/helpers/ubi-runner-fake-vm.ts (46 tests before and after). The allowlist keeps main's setup-codex-scope entry. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(free): reseed both duration seeds at the main merge; changelog fragment Recorded by free-durations-record.yml (open_pr=false) run 41229924108 at4f5bd2d: 1,470 Linux files on ubicloud-standard-8 and 822 curated Windows files. The Windows recorder was red on browse/test/cookie-import-native-job.test.ts (known Edge leak) and test/hook-scripts.test.ts, plus test/free-seed-ratchet.test.ts on both OSes against the pre-reseed seed; their durations are kept. The CHANGELOG entry moves to changelog.d/ now that main runs on fragments. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: correct the seed-ceiling TODO and the ubicloud-runner test paths after the split Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
61 lines
3.1 KiB
TypeScript
61 lines
3.1 KiB
TypeScript
import { afterAll, afterEach, describe, expect, test } from 'bun:test';
|
|
import { spawnSync } from 'node:child_process';
|
|
import { symlinkSync } from 'node:fs';
|
|
import { join } from 'node:path';
|
|
import { cleanupFixtures, cleanupSeed, fixtureWriteFileSync, fixtureCopyFileSync, fixtureMkdirSync, fixtureUtimesSync, tree, fixture } from './helpers/install-fixture';
|
|
import { claudeOnlySetupPreservesCyclicLink } from './helpers/setup-codex-scope-cyclic';
|
|
|
|
afterEach(cleanupFixtures);
|
|
afterAll(cleanupSeed);
|
|
|
|
describe.skipIf(process.platform === 'win32')('F13 independent review boundaries', () => {
|
|
for (const target of ['legacy', 'replacement', 'legacy-skill']) {
|
|
test(`Claude-only setup preserves cyclic foreign ownership link: ${target}`, () => claudeOnlySetupPreservesCyclicLink(target), 90_000);
|
|
}
|
|
|
|
for (const alias of [false, true]) for (const windows of [false, true]) {
|
|
test(`global generation namespace is refused before mutation: alias=${alias}, Windows=${windows}`, () => {
|
|
const f = fixture('ordinary');
|
|
const agents = join(f.source, '.agents');
|
|
fixtureMkdirSync(agents, { recursive: true });
|
|
const codexHome = alias ? join(f.home, 'generation-alias') : agents;
|
|
if (alias) symlinkSync(agents, codexHome, 'dir');
|
|
if (windows) {
|
|
fixtureWriteFileSync(join(f.dir, 'commands/uname'), '#!/bin/sh\nprintf "MINGW64_NT-10.0\n"\n', { mode: 0o755 });
|
|
for (const rel of ['browse/dist/browse.exe', 'design/dist/design.exe', 'make-pdf/dist/pdf.exe']) {
|
|
fixtureCopyFileSync(join(f.source, rel.replace('.exe', '')), join(f.source, rel));
|
|
fixtureUtimesSync(join(f.source, rel), new Date('2040-01-01'), new Date('2040-01-01'));
|
|
}
|
|
}
|
|
const before = tree(f.dir);
|
|
for (let run = 0; run < 2; run++) {
|
|
const result = spawnSync('bash', [join(f.source, 'setup'), '--host', 'codex', '--no-team', '--no-plan-tune-hooks', '--no-timeline-stop-hook'], {
|
|
cwd: f.other, env: { ...f.env, CODEX_HOME: codexHome }, encoding: 'utf8', timeout: 60_000,
|
|
});
|
|
expect(result.status, result.stdout + result.stderr).toBe(1);
|
|
expect(result.stderr).toContain('host namespace');
|
|
expect(tree(f.dir)).toEqual(before);
|
|
}
|
|
}, 90_000);
|
|
}
|
|
|
|
for (const leaf of ['SKILL.md', 'agents']) {
|
|
test(`selected generated cyclic write remains fail-closed: ${leaf}`, () => {
|
|
const f = fixture('ordinary');
|
|
const generated = join(f.source, '.agents/skills/gstack-review');
|
|
fixtureMkdirSync(generated, { recursive: true });
|
|
const link = join(generated, leaf);
|
|
symlinkSync(link, link);
|
|
const before = tree(f.dir);
|
|
for (let run = 0; run < 2; run++) {
|
|
const result = spawnSync('bash', [join(f.source, 'setup'), '--host', 'codex', '--no-team', '--no-plan-tune-hooks', '--no-timeline-stop-hook'], {
|
|
cwd: f.other, env: f.env, encoding: 'utf8', timeout: 60_000,
|
|
});
|
|
expect(result.status, result.stdout + result.stderr).toBe(1);
|
|
expect(result.stderr).toContain('ELOOP');
|
|
expect(tree(f.dir)).toEqual(before);
|
|
}
|
|
}, 90_000);
|
|
}
|
|
});
|