From 8f7facaa73f375e973f15e9c399fb53d3c6c508b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 16:59:28 +0000 Subject: [PATCH] fix(scenarios): make every skill-evals arm directory under the system temp directory prepareArmWorkdir took a defaulted base parameter, which the dispatch-gates scratch scan cannot bind, so its mkdtempSync site read UNRESOLVED and the slow tier of check:pm-dispatch-gates went red on main. The base is now spelled at the call; the self-test and the unit test remove the roots they make. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzg1NmbJpZhtiWQkTir --- .../34934-skill-eval-arm-root-tmpdir.md | 10 ++++++++++ packages/qa/scenarios/src/skill-evals/arms.ts | 8 ++++++-- .../qa/scenarios/src/skill-evals/self-test.ts | 4 ++-- .../test/skill-evals/skill-evals.test.ts | 20 ++++++++++++------- 4 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 .changeset/34934-skill-eval-arm-root-tmpdir.md diff --git a/.changeset/34934-skill-eval-arm-root-tmpdir.md b/.changeset/34934-skill-eval-arm-root-tmpdir.md new file mode 100644 index 00000000000..16a55c61921 --- /dev/null +++ b/.changeset/34934-skill-eval-arm-root-tmpdir.md @@ -0,0 +1,10 @@ +--- +'@objectstack/scenarios': patch +--- + +fix(scenarios): a skill-evals arm directory is always made under the system temp directory + +Clause-②: no +Metadata-protocol: none + +`skill-evals` made each turn's directory under a base its caller could pass, defaulting to the system temp directory. Every turn of a round already used that default; only the package's own tests passed a scratch base. The base is now spelled at the call, `join(tmpdir(), 'skill-eval-')`, so the repository's scratch-directory scan can read where it lands, and the internal `base` argument is gone. A round behaves exactly as before. diff --git a/packages/qa/scenarios/src/skill-evals/arms.ts b/packages/qa/scenarios/src/skill-evals/arms.ts index a475edebc84..eacc1af5fff 100644 --- a/packages/qa/scenarios/src/skill-evals/arms.ts +++ b/packages/qa/scenarios/src/skill-evals/arms.ts @@ -78,9 +78,13 @@ export interface ArmWorkdir { * Make one turn's directory: `ROOT/project` as the working directory, holding * `.claude/skills/BUNDLE/` (without `evals/`) on the with-skill arm and * nothing on the no-skill arm, and `ROOT/mcp.json` beside it. + * + * `ROOT` is always under the system temp directory, spelled at the call so the + * dispatch-gates scratch scan reads it as outside the tree; a caller that + * wants it gone removes `root` itself. */ -export function prepareArmWorkdir(arm: Arm, bundle: string, skillsRoot: string, base: string = tmpdir()): ArmWorkdir { - const root = mkdtempSync(join(base, 'skill-eval-')); +export function prepareArmWorkdir(arm: Arm, bundle: string, skillsRoot: string): ArmWorkdir { + const root = mkdtempSync(join(tmpdir(), 'skill-eval-')); const cwd = join(root, 'project'); mkdirSync(cwd); const mcpConfigPath = join(root, 'mcp.json'); diff --git a/packages/qa/scenarios/src/skill-evals/self-test.ts b/packages/qa/scenarios/src/skill-evals/self-test.ts index bb67498666c..001e61b004c 100644 --- a/packages/qa/scenarios/src/skill-evals/self-test.ts +++ b/packages/qa/scenarios/src/skill-evals/self-test.ts @@ -164,7 +164,7 @@ export function runSelfTest(deps: SelfTestDeps): SelfTestResult { { label: 'arms: the with-skill project holds the bundle without its evals/', run: () => { - const d = prepareArmWorkdir('with-skill', 'demo-skill', fixtureRoot, scratch); + const d = prepareArmWorkdir('with-skill', 'demo-skill', fixtureRoot); const skill = join(d.cwd, '.claude', 'skills', 'demo-skill'); const ok = existsSync(join(skill, 'SKILL.md')) && existsSync(join(skill, 'rules', 'filters.md')) && !existsSync(join(skill, 'evals')); rmSync(d.root, { recursive: true, force: true }); @@ -174,7 +174,7 @@ export function runSelfTest(deps: SelfTestDeps): SelfTestResult { { label: 'arms: the no-skill project holds no skill', run: () => { - const d = prepareArmWorkdir('no-skill', 'demo-skill', fixtureRoot, scratch); + const d = prepareArmWorkdir('no-skill', 'demo-skill', fixtureRoot); const ok = !existsSync(join(d.cwd, '.claude')); rmSync(d.root, { recursive: true, force: true }); return ok ? true : 'the no-skill project has a .claude/ directory'; diff --git a/packages/qa/scenarios/test/skill-evals/skill-evals.test.ts b/packages/qa/scenarios/test/skill-evals/skill-evals.test.ts index 6a6168fb572..ea3e0587b57 100644 --- a/packages/qa/scenarios/test/skill-evals/skill-evals.test.ts +++ b/packages/qa/scenarios/test/skill-evals/skill-evals.test.ts @@ -173,13 +173,19 @@ describe('the arms: one fresh directory per turn, differing only in the bundle', it('with-skill holds the bundle without evals/; no-skill holds nothing; the MCP config is empty and outside the project', () => { const root = writeCatalog(); - const w = prepareArmWorkdir('with-skill', 'alpha-skill', root, scratch); - expect(readdirSync(join(w.cwd, '.claude', 'skills'))).toEqual(['alpha-skill']); - expect(readdirSync(join(w.cwd, '.claude', 'skills', 'alpha-skill')).sort()).toEqual(['SKILL.md', 'rules']); - expect(JSON.parse(readFileSync(w.mcpConfigPath, 'utf8'))).toEqual({ mcpServers: {} }); - expect(w.mcpConfigPath.startsWith(w.cwd)).toBe(false); - const n = prepareArmWorkdir('no-skill', 'alpha-skill', root, scratch); - expect(readdirSync(n.cwd)).toEqual([]); + const w = prepareArmWorkdir('with-skill', 'alpha-skill', root); + const n = prepareArmWorkdir('no-skill', 'alpha-skill', root); + try { + expect(w.root.startsWith(join(tmpdir(), 'skill-eval-'))).toBe(true); + expect(readdirSync(join(w.cwd, '.claude', 'skills'))).toEqual(['alpha-skill']); + expect(readdirSync(join(w.cwd, '.claude', 'skills', 'alpha-skill')).sort()).toEqual(['SKILL.md', 'rules']); + expect(JSON.parse(readFileSync(w.mcpConfigPath, 'utf8'))).toEqual({ mcpServers: {} }); + expect(w.mcpConfigPath.startsWith(w.cwd)).toBe(false); + expect(readdirSync(n.cwd)).toEqual([]); + } finally { + rmSync(w.root, { recursive: true, force: true }); + rmSync(n.root, { recursive: true, force: true }); + } }); it('a round hands each turn its arm\'s directory, the prompt on stdin and an environment with no API key or effort override; records land and directories go', async () => {