Files
gstack/test/design-research-fixture.test.ts
T
garrytan 7cbb5e04e4 test: derive paid touchfiles from each eval's static closure (E)
touchfiles.test.ts now checks, per key, that the paid file's static
test/helpers and test/fixtures closure (plus fixture paths it names in string
literals) is covered, and names the file, path, chain and key to fix when it is
not. Free *.test.ts files are no longer touchfiles, so editing a free replay
test stops selecting paid evals: 950 entries removed, 653 real closure paths
added. The hand-copied inventories go: periodic-fixture-selection,
fake-impeccable-touchfiles and 45 per-file selection examples. Selection for
the sample edits (plan-eng-review template, claude-pty-runner,
plan-count-fixture, gstack-config) loses no case under either profile.
CONTRIBUTING documents the rule and its lower bound.
2026-09-29 07:00:28 +00:00

24 lines
1.5 KiB
TypeScript

import { expect, test } from 'bun:test';
import { readFileSync } from 'node:fs';
import { extractDesignResearchContract } from './helpers/skill-fixture';
const source = readFileSync(new URL('../design-consultation/SKILL.md', import.meta.url), 'utf8');
test('research-only fixture supplies actual readiness and egress dependencies without expanding scope', () => {
const contract = extractDesignResearchContract(source);
expect(contract.match(/console\.log\("ASIDE_READY /g)).toHaveLength(1);
expect(contract).toContain('GSTACK_SKIP_ASIDE');
expect(contract).toContain('Reuse the Phase 0 BROWSER SETUP result');
expect(contract).toContain('_gstack_egress_run open aside-agent');
expect(contract.indexOf('ASIDE_READY')).toBeLessThan(contract.indexOf('## Web research runs in Aside'));
expect(contract).not.toContain('## Phase 2: Research');
expect(contract).not.toContain('**Step 2: Visual research');
expect(contract).not.toContain('best websites {current year}');
expect(contract).not.toContain('DESIGN.md');
expect(extractDesignResearchContract(source.replace('ASIDE_READY', 'PROBE_CHANGED'))).toContain('PROBE_CHANGED');
});
test.each(['## BROWSER SETUP', '### Rules for driving a real browser', '## Web research runs in Aside',
'## Phase 2: Research', '**Step 1: Identify', '**Step 2: Visual research', '_aside_exec()'])('missing %s fails closed before a paid run', marker => {
expect(() => extractDesignResearchContract(source.replace(marker, 'REMOVED'))).toThrow();
});