agent-gauntlet 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-gauntlet",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A CLI tool for testing AI coding agents",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paul Caplan",
@@ -44,16 +44,19 @@ export async function loadConfig(
44
44
  const filePath = path.join(checksPath, file);
45
45
  const content = await fs.readFile(filePath, "utf-8");
46
46
  const raw = YAML.parse(content);
47
- // Ensure name matches filename if not provided or just use filename as key
47
+ const name = path.basename(file, path.extname(file));
48
48
  const parsed: CheckGateConfig = checkGateSchema.parse(raw);
49
49
 
50
50
  // Load fix instructions if specified
51
- const loadedCheck: LoadedCheckGateConfig = { ...parsed };
51
+ const loadedCheck: LoadedCheckGateConfig = {
52
+ ...parsed,
53
+ name,
54
+ };
52
55
  if (parsed.fix_instructions) {
53
56
  // Security: Reject absolute paths to prevent reading arbitrary files
54
57
  if (path.isAbsolute(parsed.fix_instructions)) {
55
58
  throw new Error(
56
- `Fix instructions path must be relative to .gauntlet/ directory, got absolute path: ${parsed.fix_instructions} (referenced by check "${parsed.name}")`,
59
+ `Fix instructions path must be relative to .gauntlet/ directory, got absolute path: ${parsed.fix_instructions} (referenced by check "${name}")`,
57
60
  );
58
61
  }
59
62
 
@@ -75,12 +78,12 @@ export async function loadConfig(
75
78
  relativePath === ""
76
79
  ) {
77
80
  throw new Error(
78
- `Fix instructions path must stay within .gauntlet/ directory and point to a file: ${parsed.fix_instructions} resolves to ${fixInstructionsPath} (referenced by check "${parsed.name}")`,
81
+ `Fix instructions path must stay within .gauntlet/ directory and point to a file: ${parsed.fix_instructions} resolves to ${fixInstructionsPath} (referenced by check "${name}")`,
79
82
  );
80
83
  }
81
84
  if (!(await fileExists(fixInstructionsPath))) {
82
85
  throw new Error(
83
- `Fix instructions file not found: ${fixInstructionsPath} (referenced by check "${parsed.name}")`,
86
+ `Fix instructions file not found: ${fixInstructionsPath} (referenced by check "${name}")`,
84
87
  );
85
88
  }
86
89
  loadedCheck.fixInstructionsContent = await fs.readFile(
@@ -89,7 +92,7 @@ export async function loadConfig(
89
92
  );
90
93
  }
91
94
 
92
- checks[parsed.name] = loadedCheck;
95
+ checks[name] = loadedCheck;
93
96
  }
94
97
  }
95
98
  }
@@ -7,7 +7,6 @@ export const cliConfigSchema = z.object({
7
7
 
8
8
  export const checkGateSchema = z
9
9
  .object({
10
- name: z.string().min(1),
11
10
  command: z.string().min(1),
12
11
  working_directory: z.string().optional(),
13
12
  parallel: z.boolean().default(false),
@@ -32,6 +32,7 @@ export type ServiceConfig = z.infer<typeof serviceConfigSchema>;
32
32
 
33
33
  // Extended check config with loaded content
34
34
  export interface LoadedCheckGateConfig extends CheckGateConfig {
35
+ name: string;
35
36
  fixInstructionsContent?: string;
36
37
  }
37
38
 
@@ -462,7 +462,6 @@ export class ReviewGateExecutor {
462
462
  const resultMsg = `Review result (${adapter.name}): ${evaluation.status} - ${evaluation.message}`;
463
463
  await adapterLogger(`${resultMsg}\n`);
464
464
 
465
-
466
465
  return { adapter: adapter.name, evaluation };
467
466
  } catch (error: unknown) {
468
467
  const err = error as { message?: string };
@@ -44,8 +44,7 @@ export class ConsoleReporter {
44
44
  let logInfo = "";
45
45
  if (result.status !== "pass") {
46
46
  // Try to find a relevant log path
47
- const logPath =
48
- result.logPath || (result.logPaths && result.logPaths[0]);
47
+ const logPath = result.logPath || result.logPaths?.[0];
49
48
  if (logPath) {
50
49
  logInfo = `\n Log: ${logPath}`;
51
50
  }
@@ -261,39 +260,4 @@ export class ConsoleReporter {
261
260
 
262
261
  return details;
263
262
  }
264
-
265
- private printFailureDetails(result: GateResult, details: string[]) {
266
- const statusColor = result.status === "error" ? chalk.magenta : chalk.red;
267
- const statusLabel = result.status === "error" ? "ERROR" : "FAIL";
268
-
269
- console.log(statusColor(`[${statusLabel}] ${result.jobId}`));
270
- if (result.message) {
271
- console.log(chalk.dim(` Summary: ${result.message}`));
272
- }
273
-
274
- if (details.length > 0) {
275
- console.log(chalk.dim(" Details:"));
276
- details.forEach((detail) => {
277
- console.log(detail);
278
- });
279
- }
280
-
281
- if (result.logPaths && result.logPaths.length > 0) {
282
- result.logPaths.forEach((p) => {
283
- console.log(chalk.dim(` Log: ${p}`));
284
- });
285
- } else if (result.logPath) {
286
- console.log(chalk.dim(` Log: ${result.logPath}`));
287
- }
288
-
289
- if (result.fixInstructions) {
290
- console.log(
291
- chalk.cyan(
292
- ` Fix instructions: available (${result.fixInstructions.split("\n").length} lines)`,
293
- ),
294
- );
295
- }
296
-
297
- console.log(""); // Empty line between failures
298
- }
299
263
  }