@fede0089/skill-eval 1.1.0 → 1.2.1
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.
|
@@ -41,7 +41,8 @@ export async function functionalCommand(agent, workspace, skillPath, maxAgents =
|
|
|
41
41
|
const variantRunners = new Map();
|
|
42
42
|
// 1. Local Runner
|
|
43
43
|
variantRunners.set('local', new EvalRunner({
|
|
44
|
-
agent, workspace, skillPath, skillName: skill_name, runDir, isBaseline: false, debug, timeoutMs
|
|
44
|
+
agent, workspace, skillPath, skillName: skill_name, runDir, isBaseline: false, debug, timeoutMs,
|
|
45
|
+
variant: 'local'
|
|
45
46
|
}));
|
|
46
47
|
// 2. Historical Runners
|
|
47
48
|
for (const ref of compareRefs) {
|
|
@@ -57,12 +58,14 @@ export async function functionalCommand(agent, workspace, skillPath, maxAgents =
|
|
|
57
58
|
runDir,
|
|
58
59
|
isBaseline: false,
|
|
59
60
|
debug,
|
|
60
|
-
timeoutMs
|
|
61
|
+
timeoutMs,
|
|
62
|
+
variant: `ref:${ref}`
|
|
61
63
|
}));
|
|
62
64
|
}
|
|
63
65
|
// 3. Baseline Runner
|
|
64
66
|
const withoutSkillRunner = new EvalRunner({
|
|
65
|
-
agent, workspace, skillPath, skillName: skill_name, runDir, isBaseline: true, debug, timeoutMs
|
|
67
|
+
agent, workspace, skillPath, skillName: skill_name, runDir, isBaseline: true, debug, timeoutMs,
|
|
68
|
+
variant: 'baseline'
|
|
66
69
|
});
|
|
67
70
|
const taskResults = [];
|
|
68
71
|
let withSkillTasksAllPassedCount = 0;
|
package/dist/commands/trigger.js
CHANGED
|
@@ -42,7 +42,8 @@ export async function triggerCommand(agent, workspace, skillPath, maxAgents = 4,
|
|
|
42
42
|
const variantRunners = new Map();
|
|
43
43
|
// 1. Local Runner
|
|
44
44
|
variantRunners.set('local', new EvalRunner({
|
|
45
|
-
agent, workspace, skillPath, skillName: skill_name, runDir, isBaseline: false, debug, timeoutMs
|
|
45
|
+
agent, workspace, skillPath, skillName: skill_name, runDir, isBaseline: false, debug, timeoutMs,
|
|
46
|
+
variant: 'local'
|
|
46
47
|
}));
|
|
47
48
|
// 2. Historical Runners
|
|
48
49
|
for (const ref of compareRefs) {
|
|
@@ -58,7 +59,8 @@ export async function triggerCommand(agent, workspace, skillPath, maxAgents = 4,
|
|
|
58
59
|
runDir,
|
|
59
60
|
isBaseline: false,
|
|
60
61
|
debug,
|
|
61
|
-
timeoutMs
|
|
62
|
+
timeoutMs,
|
|
63
|
+
variant: `ref:${ref}`
|
|
62
64
|
}));
|
|
63
65
|
}
|
|
64
66
|
const taskResults = [];
|
package/dist/core/eval-runner.js
CHANGED
|
@@ -5,6 +5,10 @@ import { EvalEnvironment } from './environment.js';
|
|
|
5
5
|
import { RunnerFactory } from '../runners/index.js';
|
|
6
6
|
import { TriggerGrader, ModelBasedGrader } from './evaluator.js';
|
|
7
7
|
import { parseStreamResult, parseTokenStats } from '../utils/ndjson.js';
|
|
8
|
+
// Replace filesystem-unsafe characters so variants like 'ref:main' or 'feature/x' can be used in filenames.
|
|
9
|
+
function slugifyVariant(v) {
|
|
10
|
+
return v.replace(/[^a-zA-Z0-9_.-]+/g, '-').replace(/^-+|-+$/g, '');
|
|
11
|
+
}
|
|
8
12
|
export class EvalRunner {
|
|
9
13
|
options;
|
|
10
14
|
env;
|
|
@@ -20,7 +24,8 @@ export class EvalRunner {
|
|
|
20
24
|
this.functionalGrader = new ModelBasedGrader(options.skillName, this.runner);
|
|
21
25
|
}
|
|
22
26
|
async runTriggerTask(task, index, trialId, uiCtx, attempt = 0) {
|
|
23
|
-
const
|
|
27
|
+
const variantSlug = slugifyVariant(this.options.variant ?? 'local');
|
|
28
|
+
const logFileName = `task_${task.id}_${variantSlug}_trial_${trialId}.log`;
|
|
24
29
|
const logPath = this.options.debug ? path.join(this.options.runDir, logFileName) : undefined;
|
|
25
30
|
let worktreePath;
|
|
26
31
|
let transcript = null;
|
|
@@ -105,7 +110,8 @@ export class EvalRunner {
|
|
|
105
110
|
const promptToUse = skillDisabled
|
|
106
111
|
? `${task.prompt}\n\nIMPORTANT: For this task, you MUST NOT use the '${this.options.skillName}' skill/tool, even if it appears available.`
|
|
107
112
|
: `${task.prompt}\n\nIMPORTANT: You must use the '${this.options.skillName}' skill/tool to solve this task.`;
|
|
108
|
-
const
|
|
113
|
+
const variantSlug = slugifyVariant(this.options.variant ?? (skillDisabled ? 'baseline' : 'local'));
|
|
114
|
+
const logFileName = `task_${task.id}_${variantSlug}_trial_${trialId}.log`;
|
|
109
115
|
const logPath = this.options.debug ? path.join(this.options.runDir, logFileName) : undefined;
|
|
110
116
|
let worktreePath;
|
|
111
117
|
let assertionResults = [];
|