From 0230fc29a50d0fd549950d85eebb5383b5302bc7 Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 27 Oct 2026 00:51:08 +0000 Subject: [PATCH] fix(docsync): install lib/ beside bin/ in the fixture so the declared cap gate can load (2524ec4 rerun: module error, not a verdict) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- test/docsync-command-grammar.test.ts | 6 ++++++ test/helpers/docsync-fixture.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/test/docsync-command-grammar.test.ts b/test/docsync-command-grammar.test.ts index 87dc5c829..c08452e7c 100644 --- a/test/docsync-command-grammar.test.ts +++ b/test/docsync-command-grammar.test.ts @@ -543,4 +543,10 @@ test('Step 14.5 housekeeping commands and the docs record are declared exactly a expect(docsToolFailures(write(path.join(fixture.repo, '.gstack/tmp/review-loop.json')), fixture, [], false)).toEqual(['non-document product write attempt', 'write outside docs fixture authority']); expect(docsToolFailures(write(path.join(fixture.repo, '.gstack/ship-policy.json')), fixture, [], false)).toEqual(['non-document product write attempt', 'write outside docs fixture authority']); expect(gitAt(fixture.repo, 'rev-parse', '--verify', 'origin/main')).toBe(gitAt(fixture.repo, 'rev-parse', '--verify', 'main')); + // The declared gate must run from the fixture install: bin/gstack-ship-receipt imports ../lib/*, so the install carries lib/ too. + const gate = spawnSync('bun', ['--no-env-file', '--config=/dev/null', path.join(fixture.skills, 'bin/gstack-ship-receipt'), 'docs-caps', '--base', 'main'], + { cwd: fixture.repo, encoding: 'utf8', env: { ...process.env, ...fixture.env, HOME: fixture.home }, timeout: 60_000 }); + expect(gate.stderr).toBe(''); + expect(gate.stdout.trim()).toBe('DOCS_CAP: none declared'); + expect(gate.status).toBe(0); }); diff --git a/test/helpers/docsync-fixture.ts b/test/helpers/docsync-fixture.ts index 6faf7998e..8370e2c73 100644 --- a/test/helpers/docsync-fixture.ts +++ b/test/helpers/docsync-fixture.ts @@ -78,6 +78,12 @@ export function fixtureDocs(scenario: DocsScenario, generatedRoot = process.env. recursive: true, filter: source => !fs.statSync(source).isFile() || fs.statSync(source).size < 5_000_000, }); + // Step 14.5's cap gate (bin/gstack-ship-receipt docs-caps) imports ../lib/*; an install without lib/ fails the gate + // with a module error instead of a DOCS_CAP verdict (gate at 2524ec4: both lifecycle cases blocked on it). + fs.cpSync(path.join(DOCSYNC_ROOT, 'lib'), path.join(skills, 'lib'), { + recursive: true, + filter: source => !fs.statSync(source).isFile() || (/\.(?:ts|json)$/.test(source) && fs.statSync(source).size < 5_000_000), + }); const state = path.join(home, 'state'); fs.mkdirSync(state); fs.writeFileSync(path.join(state, 'config.yaml'), 'update_check: false\n');