Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/34934-skill-eval-arm-root-tmpdir.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 6 additions & 2 deletions packages/qa/scenarios/src/skill-evals/arms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions packages/qa/scenarios/src/skill-evals/self-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -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';
Expand Down
20 changes: 13 additions & 7 deletions packages/qa/scenarios/test/skill-evals/skill-evals.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
Loading