Skip to content

Commit 8909b41

Browse files
author
Sean Roberts
committed
fix: skip mode
1 parent a6b5b04 commit 8909b41

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

src/config/validator.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ export function validateScenario(data: unknown, filePath: string): asserts data
8989
throw new Error(`Invalid scenario at ${filePath}: "rubric" must be a string or array`);
9090
}
9191

92+
if (obj.skip !== undefined && typeof obj.skip !== "boolean") {
93+
throw new Error(`Invalid scenario at ${filePath}: "skip" must be a boolean`);
94+
}
95+
9296
if (obj.agents !== undefined) {
9397
if (!Array.isArray(obj.agents) || obj.agents.length === 0) {
9498
throw new Error(`Invalid scenario at ${filePath}: "agents" must be a non-empty array of strings`);

src/runner/runner.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,24 @@ export async function run(options: RunOptions = {}): Promise<RunOutput> {
8282
// --- Discovery phase ---
8383
const jobs: Job[] = [];
8484
const agents = normalizeAgents(config.agents);
85+
const skippedKeys = new Set<string>();
8586

8687
for (const { name: agentName, config: agentConfig } of agents) {
8788
if (options.agentFilter?.length && !options.agentFilter.includes(agentName)) {
8889
continue;
8990
}
9091

91-
const scenarios = await discoverScenarios(configDir, config.scenarios, agentConfig.scenarios);
92+
const allScenarios = await discoverScenarios(configDir, config.scenarios, agentConfig.scenarios);
93+
94+
// Partition into active and skipped
95+
const scenarios: Scenario[] = [];
96+
for (const s of allScenarios) {
97+
if (s.skip) {
98+
skippedKeys.add(s.key);
99+
} else {
100+
scenarios.push(s);
101+
}
102+
}
92103

93104
const filteredScenarios = options.scenarioFilter?.length
94105
? scenarios.filter((s) => options.scenarioFilter!.some((f) => f === s.key))
@@ -103,6 +114,10 @@ export async function run(options: RunOptions = {}): Promise<RunOutput> {
103114
}
104115
}
105116

117+
if (skippedKeys.size > 0) {
118+
logger.info(`Skipped ${skippedKeys.size} scenario${skippedKeys.size > 1 ? "s" : ""}: ${[...skippedKeys].join(", ")}`);
119+
}
120+
106121
if (jobs.length === 0) {
107122
logger.info("No jobs discovered.");
108123
return buildOutput(runStart, []);

src/types/scenario.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ export interface Scenario {
22
/** Stable identifier derived from file path relative to scenarios root, sans .json */
33
key: string;
44
name: string;
5+
/** When true, the scenario is excluded from runs. */
6+
skip?: boolean;
57
setup?: LifecycleAction[];
68
prompt: string;
79
rubric: string | RubricCriterion[];

0 commit comments

Comments
 (0)