@forwardimpact/libeval 0.1.57 → 0.1.59
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/bin/fit-benchmark.js +8 -6
- package/bin/fit-eval.js +6 -8
- package/package.json +2 -2
- package/src/agent-runner.js +3 -1
- package/src/commands/benchmark-run.js +7 -3
- package/src/commands/discuss.js +3 -2
- package/src/commands/facilitate.js +3 -2
- package/src/commands/run.js +2 -1
- package/src/commands/supervise.js +3 -2
- package/src/discusser.js +3 -2
- package/src/redaction.js +10 -0
package/bin/fit-benchmark.js
CHANGED
|
@@ -10,6 +10,10 @@ import { createLogger } from "@forwardimpact/libtelemetry";
|
|
|
10
10
|
import { runBenchmarkRunCommand } from "../src/commands/benchmark-run.js";
|
|
11
11
|
import { runBenchmarkInvariantsCommand } from "../src/commands/benchmark-invariants.js";
|
|
12
12
|
import { runBenchmarkReportCommand } from "../src/commands/benchmark-report.js";
|
|
13
|
+
import {
|
|
14
|
+
BENCHMARK_AGENT_MODEL,
|
|
15
|
+
LEAD_MODEL,
|
|
16
|
+
} from "@forwardimpact/libutil/models";
|
|
13
17
|
|
|
14
18
|
export const definition = {
|
|
15
19
|
name: "fit-benchmark",
|
|
@@ -38,17 +42,15 @@ export const definition = {
|
|
|
38
42
|
},
|
|
39
43
|
"agent-model": {
|
|
40
44
|
type: "string",
|
|
41
|
-
description:
|
|
42
|
-
"Claude model for the agent-under-test (default: claude-sonnet-4-6)",
|
|
45
|
+
description: `Claude model for the agent-under-test (default: ${BENCHMARK_AGENT_MODEL})`,
|
|
43
46
|
},
|
|
44
47
|
"lead-model": {
|
|
45
48
|
type: "string",
|
|
46
|
-
description:
|
|
47
|
-
"Claude model for the lead role (default: claude-opus-4-7)",
|
|
49
|
+
description: `Claude model for the lead role (default: ${LEAD_MODEL})`,
|
|
48
50
|
},
|
|
49
51
|
"judge-model": {
|
|
50
52
|
type: "string",
|
|
51
|
-
description:
|
|
53
|
+
description: `Claude model for the judge (default: ${LEAD_MODEL})`,
|
|
52
54
|
},
|
|
53
55
|
"agent-profile": {
|
|
54
56
|
type: "string",
|
|
@@ -126,7 +128,7 @@ export const definition = {
|
|
|
126
128
|
},
|
|
127
129
|
examples: [
|
|
128
130
|
"fit-benchmark run --family=./families/coding",
|
|
129
|
-
|
|
131
|
+
`fit-benchmark run --family=./families/coding --runs=10 --agent-model=${BENCHMARK_AGENT_MODEL}`,
|
|
130
132
|
"fit-benchmark invariants --family=./families/coding --task=todo-api --workdir=./benchmark-runs/runs/todo-api/0",
|
|
131
133
|
"fit-benchmark report --format=text",
|
|
132
134
|
"fit-benchmark report --input=./runs/today --k=1,3,5 --format=text",
|
package/bin/fit-eval.js
CHANGED
|
@@ -13,6 +13,7 @@ import { runSuperviseCommand } from "../src/commands/supervise.js";
|
|
|
13
13
|
import { runFacilitateCommand } from "../src/commands/facilitate.js";
|
|
14
14
|
import { runDiscussCommand } from "../src/commands/discuss.js";
|
|
15
15
|
import { runCallbackCommand } from "../src/commands/callback.js";
|
|
16
|
+
import { AGENT_MODEL, LEAD_MODEL } from "@forwardimpact/libutil/models";
|
|
16
17
|
|
|
17
18
|
const LEAD_OPTIONS = {
|
|
18
19
|
"lead-profile": {
|
|
@@ -21,8 +22,7 @@ const LEAD_OPTIONS = {
|
|
|
21
22
|
},
|
|
22
23
|
"lead-model": {
|
|
23
24
|
type: "string",
|
|
24
|
-
description:
|
|
25
|
-
"Claude model for the lead role (default: claude-opus-4-7[1m])",
|
|
25
|
+
description: `Claude model for the lead role (default: ${LEAD_MODEL})`,
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
|
|
@@ -64,8 +64,7 @@ const definition = {
|
|
|
64
64
|
...TASK_INPUT_OPTIONS,
|
|
65
65
|
"agent-model": {
|
|
66
66
|
type: "string",
|
|
67
|
-
description:
|
|
68
|
-
"Claude model for the agent (default: claude-opus-4-7[1m])",
|
|
67
|
+
description: `Claude model for the agent (default: ${AGENT_MODEL})`,
|
|
69
68
|
},
|
|
70
69
|
"max-turns": {
|
|
71
70
|
type: "string",
|
|
@@ -102,8 +101,7 @@ const definition = {
|
|
|
102
101
|
...TASK_INPUT_OPTIONS,
|
|
103
102
|
"agent-model": {
|
|
104
103
|
type: "string",
|
|
105
|
-
description:
|
|
106
|
-
"Claude model for the agent (default: claude-opus-4-7[1m])",
|
|
104
|
+
description: `Claude model for the agent (default: ${AGENT_MODEL})`,
|
|
107
105
|
},
|
|
108
106
|
...LEAD_OPTIONS,
|
|
109
107
|
"max-turns": {
|
|
@@ -147,7 +145,7 @@ const definition = {
|
|
|
147
145
|
...TASK_INPUT_OPTIONS,
|
|
148
146
|
"agent-model": {
|
|
149
147
|
type: "string",
|
|
150
|
-
description:
|
|
148
|
+
description: `Claude model for agents (default: ${AGENT_MODEL})`,
|
|
151
149
|
},
|
|
152
150
|
...LEAD_OPTIONS,
|
|
153
151
|
"max-turns": {
|
|
@@ -184,7 +182,7 @@ const definition = {
|
|
|
184
182
|
...TASK_INPUT_OPTIONS,
|
|
185
183
|
"agent-model": {
|
|
186
184
|
type: "string",
|
|
187
|
-
description:
|
|
185
|
+
description: `Claude model for agents (default: ${AGENT_MODEL})`,
|
|
188
186
|
},
|
|
189
187
|
...LEAD_OPTIONS,
|
|
190
188
|
"max-turns": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forwardimpact/libeval",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.59",
|
|
4
4
|
"description": "Agent evaluation framework — prove whether agent changes improved outcomes with reproducible evidence.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eval",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"test": "bun test test/*.test.js"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@anthropic-ai/claude-agent-sdk": "0.
|
|
54
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.170",
|
|
55
55
|
"@forwardimpact/libcli": "^0.1.0",
|
|
56
56
|
"@forwardimpact/libconfig": "^0.1.0",
|
|
57
57
|
"@forwardimpact/libpreflight": "^0.1.0",
|
package/src/agent-runner.js
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* Follows OO+DI: constructor injection, factory function, tests bypass factory.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { AGENT_MODEL } from "@forwardimpact/libutil/models";
|
|
10
|
+
|
|
9
11
|
const DEFAULT_ALLOWED_TOOLS = ["Bash", "Read", "Glob", "Grep", "Write", "Edit"];
|
|
10
12
|
|
|
11
13
|
// fit-eval and kata-action run headless in CI/CD with no human to answer
|
|
@@ -43,7 +45,7 @@ export class AgentRunner {
|
|
|
43
45
|
this.query = deps.query;
|
|
44
46
|
this.output = deps.output;
|
|
45
47
|
this.redactor = deps.redactor;
|
|
46
|
-
this.model = deps.model ??
|
|
48
|
+
this.model = deps.model ?? AGENT_MODEL;
|
|
47
49
|
this.maxTurns = deps.maxTurns ?? 50;
|
|
48
50
|
this.allowedTools = deps.allowedTools ?? DEFAULT_ALLOWED_TOOLS;
|
|
49
51
|
this.onLine = deps.onLine ?? null;
|
|
@@ -8,6 +8,10 @@ import { resolve } from "node:path";
|
|
|
8
8
|
|
|
9
9
|
import { createConfig } from "@forwardimpact/libconfig";
|
|
10
10
|
import { createBenchmarkRunner } from "../benchmark/runner.js";
|
|
11
|
+
import {
|
|
12
|
+
BENCHMARK_AGENT_MODEL,
|
|
13
|
+
LEAD_MODEL,
|
|
14
|
+
} from "@forwardimpact/libutil/models";
|
|
11
15
|
|
|
12
16
|
/**
|
|
13
17
|
* @param {import("@forwardimpact/libcli").InvocationContext} ctx
|
|
@@ -54,9 +58,9 @@ function parseRunOptions(values) {
|
|
|
54
58
|
family,
|
|
55
59
|
runs,
|
|
56
60
|
output: resolve(output),
|
|
57
|
-
agentModel: values["agent-model"] ??
|
|
58
|
-
supervisorModel: values["lead-model"] ??
|
|
59
|
-
judgeModel: values["judge-model"] ??
|
|
61
|
+
agentModel: values["agent-model"] ?? BENCHMARK_AGENT_MODEL,
|
|
62
|
+
supervisorModel: values["lead-model"] ?? LEAD_MODEL,
|
|
63
|
+
judgeModel: values["judge-model"] ?? LEAD_MODEL,
|
|
60
64
|
profiles: {
|
|
61
65
|
agent: values["agent-profile"] ?? null,
|
|
62
66
|
judge: values["judge-profile"] ?? null,
|
package/src/commands/discuss.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createDiscusser } from "../discusser.js";
|
|
|
4
4
|
import { createRedactor } from "../redaction.js";
|
|
5
5
|
import { createTeeWriter } from "../tee-writer.js";
|
|
6
6
|
import { resolveTaskContent } from "./task-input.js";
|
|
7
|
+
import { AGENT_MODEL, LEAD_MODEL } from "@forwardimpact/libutil/models";
|
|
7
8
|
|
|
8
9
|
function parseAgentProfiles(raw, cwd, maxTurns) {
|
|
9
10
|
if (!raw) return [];
|
|
@@ -52,8 +53,8 @@ export function parseDiscussOptions(values, runtime) {
|
|
|
52
53
|
taskAmend,
|
|
53
54
|
agentConfigs,
|
|
54
55
|
leadProfile: values["lead-profile"] ?? undefined,
|
|
55
|
-
leadModel: values["lead-model"] ??
|
|
56
|
-
agentModel: values["agent-model"] ??
|
|
56
|
+
leadModel: values["lead-model"] ?? LEAD_MODEL,
|
|
57
|
+
agentModel: values["agent-model"] ?? AGENT_MODEL,
|
|
57
58
|
maxTurns,
|
|
58
59
|
maxLeadTurns,
|
|
59
60
|
outputPath: values.output,
|
|
@@ -4,6 +4,7 @@ import { createFacilitator } from "../facilitator.js";
|
|
|
4
4
|
import { createRedactor } from "../redaction.js";
|
|
5
5
|
import { createTeeWriter } from "../tee-writer.js";
|
|
6
6
|
import { resolveTaskContent } from "./task-input.js";
|
|
7
|
+
import { AGENT_MODEL, LEAD_MODEL } from "@forwardimpact/libutil/models";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Parse comma-separated agent profile names into structured configs.
|
|
@@ -50,8 +51,8 @@ export function parseFacilitateOptions(values, runtime) {
|
|
|
50
51
|
taskAmend,
|
|
51
52
|
agentConfigs,
|
|
52
53
|
facilitatorCwd: resolve(values["facilitator-cwd"] ?? "."),
|
|
53
|
-
agentModel: values["agent-model"] ??
|
|
54
|
-
facilitatorModel: values["lead-model"] ??
|
|
54
|
+
agentModel: values["agent-model"] ?? AGENT_MODEL,
|
|
55
|
+
facilitatorModel: values["lead-model"] ?? LEAD_MODEL,
|
|
55
56
|
maxTurns,
|
|
56
57
|
outputPath: values.output,
|
|
57
58
|
facilitatorProfile: values["lead-profile"] ?? undefined,
|
package/src/commands/run.js
CHANGED
|
@@ -8,6 +8,7 @@ import { createTeeWriter } from "../tee-writer.js";
|
|
|
8
8
|
import { SequenceCounter } from "../sequence-counter.js";
|
|
9
9
|
import { resolveTaskContent } from "./task-input.js";
|
|
10
10
|
import { createServiceConfig } from "@forwardimpact/libconfig";
|
|
11
|
+
import { AGENT_MODEL } from "@forwardimpact/libutil/models";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Parse and validate run command options from parsed values.
|
|
@@ -26,7 +27,7 @@ function parseRunOptions(values, runtime) {
|
|
|
26
27
|
taskContent,
|
|
27
28
|
taskAmend,
|
|
28
29
|
cwd: resolve(values.cwd ?? "."),
|
|
29
|
-
agentModel: values["agent-model"] ??
|
|
30
|
+
agentModel: values["agent-model"] ?? AGENT_MODEL,
|
|
30
31
|
maxTurns: maxTurnsRaw === "0" ? 0 : parseInt(maxTurnsRaw, 10),
|
|
31
32
|
outputPath: values.output,
|
|
32
33
|
agentProfile: values["agent-profile"] ?? undefined,
|
|
@@ -5,6 +5,7 @@ import { createRedactor } from "../redaction.js";
|
|
|
5
5
|
import { createTeeWriter } from "../tee-writer.js";
|
|
6
6
|
import { resolveTaskContent } from "./task-input.js";
|
|
7
7
|
import { createServiceConfig } from "@forwardimpact/libconfig";
|
|
8
|
+
import { AGENT_MODEL, LEAD_MODEL } from "@forwardimpact/libutil/models";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Parse all supervise flags from parsed values into an options object.
|
|
@@ -30,8 +31,8 @@ export async function parseSuperviseOptions(values, runtime) {
|
|
|
30
31
|
taskAmend,
|
|
31
32
|
supervisorCwd: resolve(values["supervisor-cwd"] ?? "."),
|
|
32
33
|
agentCwd,
|
|
33
|
-
agentModel: values["agent-model"] ??
|
|
34
|
-
supervisorModel: values["lead-model"] ??
|
|
34
|
+
agentModel: values["agent-model"] ?? AGENT_MODEL,
|
|
35
|
+
supervisorModel: values["lead-model"] ?? LEAD_MODEL,
|
|
35
36
|
maxTurns: (() => {
|
|
36
37
|
const raw = values["max-turns"] ?? "200";
|
|
37
38
|
return raw === "0" ? 0 : parseInt(raw, 10);
|
package/src/discusser.js
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
DISCUSS_AGENT_SYSTEM_PROMPT,
|
|
30
30
|
} from "./discuss-tools.js";
|
|
31
31
|
import { OrchestrationLoop } from "./orchestration-loop.js";
|
|
32
|
+
import { AGENT_MODEL, LEAD_MODEL } from "@forwardimpact/libutil/models";
|
|
32
33
|
|
|
33
34
|
/** System prompt for the discuss-mode lead. L0 mechanics only per COALIGNED. */
|
|
34
35
|
export const DISCUSS_SYSTEM_PROMPT =
|
|
@@ -314,7 +315,7 @@ export function createDiscusser({
|
|
|
314
315
|
cwd: config.cwd ?? resolvedLeadCwd,
|
|
315
316
|
query,
|
|
316
317
|
output: devNull,
|
|
317
|
-
model: agentModel ??
|
|
318
|
+
model: agentModel ?? AGENT_MODEL,
|
|
318
319
|
maxTurns: config.maxTurns ?? 50,
|
|
319
320
|
allowedTools: config.allowedTools,
|
|
320
321
|
onLine: (line) => discusser.loop.emitLine(config.name, line),
|
|
@@ -347,7 +348,7 @@ export function createDiscusser({
|
|
|
347
348
|
cwd: resolvedLeadCwd,
|
|
348
349
|
query,
|
|
349
350
|
output: devNull,
|
|
350
|
-
model: leadModel ??
|
|
351
|
+
model: leadModel ?? LEAD_MODEL,
|
|
351
352
|
maxTurns: maxTurns ?? 80,
|
|
352
353
|
allowedTools: ["Read", "Glob", "Grep"],
|
|
353
354
|
disallowedTools: defaultDisallowed,
|
package/src/redaction.js
CHANGED
|
@@ -36,6 +36,16 @@ export const DEFAULT_PATTERNS = Object.freeze([
|
|
|
36
36
|
{ kind: "gh-installation", regex: /\bghs_[A-Za-z0-9]{36}\b/g },
|
|
37
37
|
{ kind: "gh-oauth", regex: /\bgho_[A-Za-z0-9]{36}\b/g },
|
|
38
38
|
{ kind: "gh-fine-grained", regex: /\bgithub_pat_[A-Za-z0-9_]{82}\b/g },
|
|
39
|
+
// git persists HTTP basic-auth credentials base64-encoded in
|
|
40
|
+
// `http.<url>.extraheader` as `AUTHORIZATION: basic <b64>` where the
|
|
41
|
+
// plaintext is `x-access-token:<token>` (actions/checkout form) — a shape
|
|
42
|
+
// the raw-byte layers above cannot see. The plaintext prefix is 15 bytes
|
|
43
|
+
// — five whole base64 triplets — so every encoding starts with the same
|
|
44
|
+
// 20 chars no matter which token follows.
|
|
45
|
+
{
|
|
46
|
+
kind: "gh-b64-basic-credential",
|
|
47
|
+
regex: /\beC1hY2Nlc3MtdG9rZW46[A-Za-z0-9+/]{8,}={0,2}/g,
|
|
48
|
+
},
|
|
39
49
|
]);
|
|
40
50
|
|
|
41
51
|
const ENV_PLACEHOLDER = (name) => `[REDACTED:env:${name}]`;
|