mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-01 06:24:41 +01:00
test: seed the versioned slug cache in the memory-injection deny case (#2901)
The preference hook now resolves the project bucket from gstack-slug's v2 slug-cache entry instead of basename(cwd); this fixture still wrote preferences under the basename bucket without the entry the skill preamble always writes first.
This commit is contained in:
1 parent
59ab809e4a
commit
09dd7403f0
1 file changed
+6
@@ -12,6 +12,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as os from 'os';
|
||||
import { spawnSync } from 'child_process';
|
||||
import { slugCacheFile } from '../lib/bin-context';
|
||||
|
||||
const ROOT = path.resolve(import.meta.dir, '..');
|
||||
const HOOK = path.join(ROOT, 'hosts', 'claude', 'hooks', 'question-preference-hook');
|
||||
@@ -161,6 +162,11 @@ describe('memory injection', () => {
|
||||
},
|
||||
]);
|
||||
// Set a never-ask preference and check both deny AND memory are surfaced.
|
||||
// The hook resolves the project bucket from gstack-slug's versioned
|
||||
// slug-cache entry (#2901), which the skill preamble writes first.
|
||||
const cacheFile = slugCacheFile(stateRoot, fixtureCwd);
|
||||
fs.mkdirSync(path.dirname(cacheFile), { recursive: true });
|
||||
fs.writeFileSync(cacheFile, `v2:${cwdSlug}`);
|
||||
fs.mkdirSync(path.join(stateRoot, 'projects', cwdSlug), { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(stateRoot, 'projects', cwdSlug, 'question-preferences.json'),
|
||||
|
||||
Reference in new issue
Block a user