@introspection-ai/recipes 0.57.0 → 0.58.0
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/dist/batch/index.d.ts +2 -0
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +2 -1
- package/dist/batch/index.js.map +1 -1
- package/dist/batch/runner.d.ts +5 -0
- package/dist/batch/runner.d.ts.map +1 -1
- package/dist/batch/runner.js +6 -0
- package/dist/batch/runner.js.map +1 -1
- package/dist/judges/classifier.d.ts +8 -0
- package/dist/judges/classifier.d.ts.map +1 -0
- package/dist/judges/classifier.js +30 -0
- package/dist/judges/classifier.js.map +1 -0
- package/dist/judges/cli-main.d.ts +41 -0
- package/dist/judges/cli-main.d.ts.map +1 -0
- package/dist/judges/cli-main.js +182 -0
- package/dist/judges/cli-main.js.map +1 -0
- package/dist/judges/cli.d.ts +2 -0
- package/dist/judges/cli.d.ts.map +1 -0
- package/dist/judges/cli.js +43 -0
- package/dist/judges/cli.js.map +1 -0
- package/dist/judges/controller.d.ts +78 -0
- package/dist/judges/controller.d.ts.map +1 -0
- package/dist/judges/controller.js +243 -0
- package/dist/judges/controller.js.map +1 -0
- package/dist/judges/definition.d.ts +86 -0
- package/dist/judges/definition.d.ts.map +1 -0
- package/dist/judges/definition.js +100 -0
- package/dist/judges/definition.js.map +1 -0
- package/dist/judges/gate.d.ts +46 -0
- package/dist/judges/gate.d.ts.map +1 -0
- package/dist/judges/gate.js +256 -0
- package/dist/judges/gate.js.map +1 -0
- package/dist/judges/identity.d.ts +21 -0
- package/dist/judges/identity.d.ts.map +1 -0
- package/dist/judges/identity.js +48 -0
- package/dist/judges/identity.js.map +1 -0
- package/dist/judges/index.d.ts +10 -0
- package/dist/judges/index.d.ts.map +1 -0
- package/dist/judges/index.js +10 -0
- package/dist/judges/index.js.map +1 -0
- package/dist/judges/resolve-hooks.d.ts +10 -0
- package/dist/judges/resolve-hooks.d.ts.map +1 -0
- package/dist/judges/resolve-hooks.js +25 -0
- package/dist/judges/resolve-hooks.js.map +1 -0
- package/dist/judges/run.d.ts +123 -0
- package/dist/judges/run.d.ts.map +1 -0
- package/dist/judges/run.js +319 -0
- package/dist/judges/run.js.map +1 -0
- package/dist/judges/session.d.ts +9 -0
- package/dist/judges/session.d.ts.map +1 -0
- package/dist/judges/session.js +109 -0
- package/dist/judges/session.js.map +1 -0
- package/dist/judges/trajectory.d.ts +91 -0
- package/dist/judges/trajectory.d.ts.map +1 -0
- package/dist/judges/trajectory.js +223 -0
- package/dist/judges/trajectory.js.map +1 -0
- package/dist/judges/verdict.d.ts +31 -0
- package/dist/judges/verdict.d.ts.map +1 -0
- package/dist/judges/verdict.js +121 -0
- package/dist/judges/verdict.js.map +1 -0
- package/dist/model-binding.d.ts +10 -0
- package/dist/model-binding.d.ts.map +1 -1
- package/dist/model-binding.js +27 -6
- package/dist/model-binding.js.map +1 -1
- package/dist/recipe/manifest.generated.d.ts +1 -1
- package/dist/recipe/manifest.generated.js +1 -1
- package/dist/recipe/model.d.ts +5 -12
- package/dist/recipe/model.d.ts.map +1 -1
- package/dist/recipe/model.js +197 -263
- package/dist/recipe/model.js.map +1 -1
- package/dist/session.d.ts +6 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +4 -2
- package/dist/session.js.map +1 -1
- package/docs/README.md +1 -0
- package/docs/judges.md +269 -0
- package/docs/recipe-format.md +9 -9
- package/docs/recipe-judges.md +119 -59
- package/package.json +10 -6
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { nodeBatchFiles } from "../batch/files.js";
|
|
4
|
+
import { runBatch } from "../batch/index.js";
|
|
5
|
+
import { jsonlResults } from "../batch/shards.js";
|
|
6
|
+
import { evaluateGate, gateView } from "./gate.js";
|
|
7
|
+
import { CONTRACT_VERSION, judgementId, samplesIn } from "./identity.js";
|
|
8
|
+
import { trajectoryFromPiSession } from "./session.js";
|
|
9
|
+
import { CLASSIFIER_BUDGET_UNITS, evidenceHash, renderTrajectoryInput, toJudgeInput, } from "./trajectory.js";
|
|
10
|
+
import { completeClassifierVerdict, completeLlmVerdict, stripCodeFence, } from "./verdict.js";
|
|
11
|
+
/** The batch's agent name; each line's own judge is resolved from its id. */
|
|
12
|
+
const BATCH_AGENT = "judges";
|
|
13
|
+
/**
|
|
14
|
+
* The run details recorded under `path`, by run id. A last line a crash cut
|
|
15
|
+
* short is trimmed from the file, as the batch trims its own results, so the
|
|
16
|
+
* next append starts a line of its own; its run has no recorded line in the
|
|
17
|
+
* batch either, and runs again.
|
|
18
|
+
*/
|
|
19
|
+
async function readRunDetails(files, path) {
|
|
20
|
+
const details = new Map();
|
|
21
|
+
for (const raw of (await jsonlResults(files, path).read()).split("\n")) {
|
|
22
|
+
if (!raw.trim())
|
|
23
|
+
continue;
|
|
24
|
+
try {
|
|
25
|
+
const { run_id: runId, ...rest } = JSON.parse(raw);
|
|
26
|
+
if (typeof runId === "string")
|
|
27
|
+
details.set(runId, rest);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
// Not a details line; nothing reads it.
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return details;
|
|
34
|
+
}
|
|
35
|
+
/** A run whose output has had one surrounding code fence removed. */
|
|
36
|
+
function unfenced(run) {
|
|
37
|
+
return typeof run.output === "string"
|
|
38
|
+
? { ...run, output: stripCodeFence(run.output) }
|
|
39
|
+
: run;
|
|
40
|
+
}
|
|
41
|
+
function message(error) {
|
|
42
|
+
return error instanceof Error ? error.message : String(error);
|
|
43
|
+
}
|
|
44
|
+
function isRecord(value) {
|
|
45
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
46
|
+
}
|
|
47
|
+
async function readLines(input, files) {
|
|
48
|
+
const lines = [];
|
|
49
|
+
for (const [index, entry] of input.entries()) {
|
|
50
|
+
if (typeof entry !== "string" && !(entry instanceof URL)) {
|
|
51
|
+
lines.push({ value: entry, label: `input ${index + 1}` });
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const path = entry instanceof URL ? fileURLToPath(entry) : entry;
|
|
55
|
+
const text = await files.read(path);
|
|
56
|
+
if (text === null)
|
|
57
|
+
throw new Error(`judge input ${path} does not exist`);
|
|
58
|
+
text.split("\n").forEach((raw, number) => {
|
|
59
|
+
if (!raw.trim())
|
|
60
|
+
return;
|
|
61
|
+
const label = `${path} line ${number + 1}`;
|
|
62
|
+
try {
|
|
63
|
+
lines.push({ value: JSON.parse(raw), label });
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
throw new Error(`${label} is not JSON: ${message(error)}`);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const seen = new Map();
|
|
71
|
+
for (const line of lines) {
|
|
72
|
+
const { value, label } = line;
|
|
73
|
+
if (!isRecord(value) ||
|
|
74
|
+
typeof value.session_file !== "string" ||
|
|
75
|
+
value.trajectory !== undefined) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const session = await files.read(value.session_file);
|
|
79
|
+
if (session === null) {
|
|
80
|
+
throw new Error(`${label}: ${value.session_file} does not exist`);
|
|
81
|
+
}
|
|
82
|
+
const { session_file: _file, ...rest } = value;
|
|
83
|
+
try {
|
|
84
|
+
line.value = { ...rest, trajectory: trajectoryFromPiSession(session) };
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
throw new Error(`${label}: ${value.session_file}: ${message(error)}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return lines.map(({ value, label }) => {
|
|
91
|
+
if (!isRecord(value) || !Array.isArray(value.trajectory)) {
|
|
92
|
+
throw new Error(`${label} needs a trajectory array or a session_file`);
|
|
93
|
+
}
|
|
94
|
+
// An exported conversation names itself by its conversation id.
|
|
95
|
+
const customId = value.custom_id ?? value.conversation_id;
|
|
96
|
+
if (typeof customId !== "string" || !customId) {
|
|
97
|
+
throw new Error(`${label} needs a custom_id or a conversation_id`);
|
|
98
|
+
}
|
|
99
|
+
const earlier = seen.get(customId);
|
|
100
|
+
if (earlier) {
|
|
101
|
+
throw new Error(`${label} repeats custom_id ${customId}, first seen at ${earlier}`);
|
|
102
|
+
}
|
|
103
|
+
seen.set(customId, label);
|
|
104
|
+
return { ...value, custom_id: customId };
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Run every judge over every conversation it applies to, as one batch, and
|
|
109
|
+
* return the judgements. A judge whose gate does not match a conversation is
|
|
110
|
+
* skipped, not graded; a judge that cannot reach a verdict records `error`,
|
|
111
|
+
* never `fail`.
|
|
112
|
+
*
|
|
113
|
+
* Each judge and conversation pair is one line of the batch: an LLM judge's
|
|
114
|
+
* line is a fresh session with the judge's `ai:` settings, and a classifier
|
|
115
|
+
* judge's line is one decision-model call. One conversation under many judges
|
|
116
|
+
* and many conversations under one judge are the same run, sharing the
|
|
117
|
+
* batch's pool, its rate-limit retries and its resume.
|
|
118
|
+
*/
|
|
119
|
+
export async function runJudges(options) {
|
|
120
|
+
const files = options.files ?? nodeBatchFiles;
|
|
121
|
+
const lines = await readLines(options.input, files);
|
|
122
|
+
const skipped = [];
|
|
123
|
+
const pairs = new Map();
|
|
124
|
+
const failed = new Map();
|
|
125
|
+
// A changed definition is a different judge: its lines have ids of their
|
|
126
|
+
// own, so a rerun grades them rather than resuming the old definition's.
|
|
127
|
+
const pairId = (judge, line) => `${judge.name}@${judge.definitionHash.slice(0, 12)}/${line.custom_id}`;
|
|
128
|
+
// Who answered each run and its usage, kept beside the batch's state: a
|
|
129
|
+
// resumed run's controller never saw the runs that already completed.
|
|
130
|
+
const detailsPath = options.directory
|
|
131
|
+
? join(options.directory, "run-details.jsonl")
|
|
132
|
+
: undefined;
|
|
133
|
+
const recorded = detailsPath
|
|
134
|
+
? await readRunDetails(files, detailsPath)
|
|
135
|
+
: new Map();
|
|
136
|
+
const runDetails = (runId) => {
|
|
137
|
+
if (!runId)
|
|
138
|
+
return {};
|
|
139
|
+
// The controller knows the runs it made; a resumed run's earlier ones are
|
|
140
|
+
// only on disk.
|
|
141
|
+
const live = options.controller.runDetails?.(runId);
|
|
142
|
+
const details = live?.model || live?.usage ? live : recorded.get(runId);
|
|
143
|
+
return {
|
|
144
|
+
...(details?.model ? { model: details.model } : {}),
|
|
145
|
+
...(details?.usage && details.usage.total_tokens > 0
|
|
146
|
+
? { usage: details.usage }
|
|
147
|
+
: {}),
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
const judgement = (judge, line, outcome, evidence, batch) => {
|
|
151
|
+
const judgeId = options.operational?.[judge.name]?.judge_id;
|
|
152
|
+
const conversationId = line.conversation_id ?? line.custom_id;
|
|
153
|
+
return {
|
|
154
|
+
custom_id: line.custom_id,
|
|
155
|
+
judge: judge.name,
|
|
156
|
+
conversation_id: conversationId,
|
|
157
|
+
definition_hash: judge.definitionHash,
|
|
158
|
+
contract_version: CONTRACT_VERSION,
|
|
159
|
+
...(judgeId && evidence
|
|
160
|
+
? {
|
|
161
|
+
judgement_id: judgementId(judgeId, judge.definitionHash, evidence, conversationId),
|
|
162
|
+
}
|
|
163
|
+
: {}),
|
|
164
|
+
...("error" in outcome
|
|
165
|
+
? { result: "error", status: "error", error: outcome.error }
|
|
166
|
+
: {
|
|
167
|
+
result: outcome.verdict,
|
|
168
|
+
status: "ok",
|
|
169
|
+
...(outcome.reasoning !== undefined
|
|
170
|
+
? { reasoning: outcome.reasoning }
|
|
171
|
+
: {}),
|
|
172
|
+
...(outcome.scores ? { scores: outcome.scores } : {}),
|
|
173
|
+
}),
|
|
174
|
+
...(evidence ? { sequence_hash: evidence } : {}),
|
|
175
|
+
...runDetails(batch?.result.run_id),
|
|
176
|
+
...(batch?.result.run_id ? { run_id: batch.result.run_id } : {}),
|
|
177
|
+
...(batch ? { attempts: batch.batch.attempts } : {}),
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
for (const judge of options.judges) {
|
|
181
|
+
const operational = options.operational?.[judge.name] ?? {};
|
|
182
|
+
for (const line of lines) {
|
|
183
|
+
const skip = (reason) => skipped.push({ custom_id: line.custom_id, judge: judge.name, reason });
|
|
184
|
+
if (operational.enabled === false) {
|
|
185
|
+
skip("disabled");
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
if (line.environment === "production" &&
|
|
189
|
+
!samplesIn(operational.judge_id ?? judge.name, line.conversation_id ?? line.custom_id, operational.sample_rate ?? 1)) {
|
|
190
|
+
skip("sampled_out");
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
const input = toJudgeInput(line.trajectory, line.system_instructions);
|
|
195
|
+
if (input.trajectory.length === 0 && !input.system_instructions) {
|
|
196
|
+
skip("no_evidence");
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (!evaluateGate(judge.on, gateView(input, line.feedback_events))) {
|
|
200
|
+
skip("gate");
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
pairs.set(pairId(judge, line), {
|
|
204
|
+
judge,
|
|
205
|
+
line,
|
|
206
|
+
transcript: judge.kind === "classifier"
|
|
207
|
+
? renderTrajectoryInput(input, {
|
|
208
|
+
maxUnits: CLASSIFIER_BUDGET_UNITS,
|
|
209
|
+
slim: true,
|
|
210
|
+
})
|
|
211
|
+
: renderTrajectoryInput(input),
|
|
212
|
+
evidence: evidenceHash(input),
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
const result = judgement(judge, line, { error: message(error) });
|
|
217
|
+
failed.set(pairId(judge, line), result);
|
|
218
|
+
await options.onResult?.(result);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// Throws when an output is outside the judge's contract.
|
|
223
|
+
const verdictOf = (id, output) => {
|
|
224
|
+
const { judge, transcript } = pairs.get(id);
|
|
225
|
+
return judge.kind === "classifier"
|
|
226
|
+
? completeClassifierVerdict(judge.questions, JSON.parse(output).answers)
|
|
227
|
+
: completeLlmVerdict(transcript, output);
|
|
228
|
+
};
|
|
229
|
+
const complete = (batch) => {
|
|
230
|
+
const { judge, line, evidence } = pairs.get(batch.custom_id);
|
|
231
|
+
if (batch.result.type !== "succeeded") {
|
|
232
|
+
return judgement(judge, line, { error: batch.result.error?.message ?? `run ${batch.result.type}` }, evidence, batch);
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
return judgement(judge, line, verdictOf(batch.custom_id, batch.result.output ?? ""), evidence, batch);
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
return judgement(judge, line, { error: message(error) }, evidence, batch);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
// The batch names one agent; each line's judge is the one its id was built
|
|
242
|
+
// from, so the controller is asked for that judge.
|
|
243
|
+
const controller = {
|
|
244
|
+
start: (input) => {
|
|
245
|
+
const pair = pairs.get(input.label ?? "");
|
|
246
|
+
return options.controller.start(pair
|
|
247
|
+
? { ...input, name: pair.judge.name, label: pair.line.custom_id }
|
|
248
|
+
: input);
|
|
249
|
+
},
|
|
250
|
+
// A fenced JSON reply is still an answer: unfence it before the batch's
|
|
251
|
+
// JSON check, which would otherwise ask the judge to repair it.
|
|
252
|
+
wait: async (id, signal) => unfenced(await options.controller.wait(id, signal)),
|
|
253
|
+
message: async (id, text) => unfenced(await options.controller.message(id, text)),
|
|
254
|
+
// The batch closes a session before it records the line, so the line's
|
|
255
|
+
// details are on disk before the line is.
|
|
256
|
+
close: async (id) => {
|
|
257
|
+
const details = options.controller.runDetails?.(id);
|
|
258
|
+
if (detailsPath && (details?.model || details?.usage)) {
|
|
259
|
+
await files.appendLine(detailsPath, JSON.stringify({ run_id: id, ...details }));
|
|
260
|
+
}
|
|
261
|
+
return options.controller.close(id);
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
const completed = new Map();
|
|
265
|
+
let stopped = false;
|
|
266
|
+
if (pairs.size > 0) {
|
|
267
|
+
const outcome = await runBatch({
|
|
268
|
+
agent: BATCH_AGENT,
|
|
269
|
+
input: [...pairs].map(([id, { transcript }]) => ({
|
|
270
|
+
custom_id: id,
|
|
271
|
+
prompt: transcript,
|
|
272
|
+
})),
|
|
273
|
+
controller,
|
|
274
|
+
// A classifier's answers are JSON too, so one format serves every line.
|
|
275
|
+
output_format: "json",
|
|
276
|
+
// A reply outside the judge's contract is an errored line, not a
|
|
277
|
+
// succeeded one, so a resumed run asks again.
|
|
278
|
+
checkOutput: (input, output) => {
|
|
279
|
+
try {
|
|
280
|
+
verdictOf(input.custom_id, output);
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
return message(error);
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
...(options.directory
|
|
288
|
+
? { directory: join(options.directory, "batch") }
|
|
289
|
+
: {}),
|
|
290
|
+
...(options.concurrency ? { concurrency: options.concurrency } : {}),
|
|
291
|
+
...(options.max_attempts ? { max_attempts: options.max_attempts } : {}),
|
|
292
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
293
|
+
files,
|
|
294
|
+
// A line resumed from an earlier run was reported then, and is in the
|
|
295
|
+
// returned results below.
|
|
296
|
+
onResult: async (batch) => {
|
|
297
|
+
const result = complete(batch);
|
|
298
|
+
completed.set(batch.custom_id, result);
|
|
299
|
+
await options.onResult?.(result);
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
stopped = outcome.stopped;
|
|
303
|
+
for (const batch of outcome.results) {
|
|
304
|
+
if (!completed.has(batch.custom_id)) {
|
|
305
|
+
completed.set(batch.custom_id, complete(batch));
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
const results = options.judges.flatMap((judge) => lines.flatMap((line) => {
|
|
310
|
+
const id = pairId(judge, line);
|
|
311
|
+
const result = failed.get(id) ?? completed.get(id);
|
|
312
|
+
return result ? [result] : [];
|
|
313
|
+
}));
|
|
314
|
+
if (options.directory) {
|
|
315
|
+
await files.write(join(options.directory, "results.jsonl"), results.map((line) => `${JSON.stringify(line)}\n`).join(""));
|
|
316
|
+
}
|
|
317
|
+
return { results, skipped, stopped };
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/judges/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASlD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAA2B,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,qBAAqB,EACrB,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,cAAc,GAGf,MAAM,cAAc,CAAC;AAwHtB,6EAA6E;AAC7E,MAAM,WAAW,GAAG,QAAQ,CAAC;AAE7B;;;;;GAKG;AACH,KAAK,UAAU,cAAc,CAC3B,KAAiB,EACjB,IAAY;IAEZ,MAAM,OAAO,GAAG,IAAI,GAAG,EAA2B,CAAC;IACnD,KAAK,MAAM,GAAG,IAAI,CAAC,MAAM,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;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AAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC,CAAC,CACH,CAAC;IACF,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,KAAK,CAAC,KAAK,CACf,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC,EACxC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAC5D,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type TrajectoryEvent } from "./trajectory.js";
|
|
2
|
+
/**
|
|
3
|
+
* A Pi session file as judge evidence: what the user and the assistant said
|
|
4
|
+
* and the tools the assistant ran, on the session's active branch. The system
|
|
5
|
+
* prompt, reasoning, and the entries Pi keeps for its own state are not
|
|
6
|
+
* evidence.
|
|
7
|
+
*/
|
|
8
|
+
export declare function trajectoryFromPiSession(sessionJsonl: string): TrajectoryEvent[];
|
|
9
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/judges/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA4CvE;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,MAAM,GACnB,eAAe,EAAE,CAiEnB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { parseMaybeJson } from "./trajectory.js";
|
|
2
|
+
function isRecord(value) {
|
|
3
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
function text(content) {
|
|
6
|
+
if (typeof content === "string")
|
|
7
|
+
return content;
|
|
8
|
+
if (!Array.isArray(content))
|
|
9
|
+
return "";
|
|
10
|
+
return content
|
|
11
|
+
.filter((part) => isRecord(part) && part.type === "text" && typeof part.text === "string")
|
|
12
|
+
.map((part) => part.text)
|
|
13
|
+
.join("\n");
|
|
14
|
+
}
|
|
15
|
+
/** The entries on the session's active branch, oldest first. */
|
|
16
|
+
function activeBranch(entries) {
|
|
17
|
+
const byId = new Map();
|
|
18
|
+
for (const entry of entries) {
|
|
19
|
+
if (typeof entry.id === "string")
|
|
20
|
+
byId.set(entry.id, entry);
|
|
21
|
+
}
|
|
22
|
+
const branch = [];
|
|
23
|
+
let entry = [...entries]
|
|
24
|
+
.reverse()
|
|
25
|
+
.find((candidate) => candidate.type !== "session");
|
|
26
|
+
while (entry) {
|
|
27
|
+
branch.push(entry);
|
|
28
|
+
entry =
|
|
29
|
+
typeof entry.parentId === "string" ? byId.get(entry.parentId) : undefined;
|
|
30
|
+
}
|
|
31
|
+
return branch.reverse();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A Pi session file as judge evidence: what the user and the assistant said
|
|
35
|
+
* and the tools the assistant ran, on the session's active branch. The system
|
|
36
|
+
* prompt, reasoning, and the entries Pi keeps for its own state are not
|
|
37
|
+
* evidence.
|
|
38
|
+
*/
|
|
39
|
+
export function trajectoryFromPiSession(sessionJsonl) {
|
|
40
|
+
const entries = sessionJsonl
|
|
41
|
+
.split("\n")
|
|
42
|
+
.filter((raw) => raw.trim())
|
|
43
|
+
.map((raw, index) => {
|
|
44
|
+
try {
|
|
45
|
+
return JSON.parse(raw);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
throw new Error(`session line ${index + 1} is not JSON`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (entries[0]?.type !== "session") {
|
|
52
|
+
throw new Error("not a Pi session file: its first line is not a session");
|
|
53
|
+
}
|
|
54
|
+
const events = [];
|
|
55
|
+
for (const entry of activeBranch(entries)) {
|
|
56
|
+
if (entry.type !== "message" || !isRecord(entry.message))
|
|
57
|
+
continue;
|
|
58
|
+
const message = entry.message;
|
|
59
|
+
const timestamp = typeof entry.timestamp === "string" ? { timestamp: entry.timestamp } : {};
|
|
60
|
+
if (message.role === "user") {
|
|
61
|
+
events.push({
|
|
62
|
+
type: "message",
|
|
63
|
+
role: "user",
|
|
64
|
+
content: text(message.content),
|
|
65
|
+
...timestamp,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else if (message.role === "assistant") {
|
|
69
|
+
const said = text(message.content);
|
|
70
|
+
if (said) {
|
|
71
|
+
events.push({
|
|
72
|
+
type: "message",
|
|
73
|
+
role: "assistant",
|
|
74
|
+
content: said,
|
|
75
|
+
...timestamp,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
for (const part of Array.isArray(message.content)
|
|
79
|
+
? message.content
|
|
80
|
+
: []) {
|
|
81
|
+
if (!isRecord(part) || part.type !== "toolCall")
|
|
82
|
+
continue;
|
|
83
|
+
events.push({
|
|
84
|
+
type: "tool_call",
|
|
85
|
+
id: String(part.id),
|
|
86
|
+
name: String(part.name),
|
|
87
|
+
...(isRecord(part.arguments) ? { arguments: part.arguments } : {}),
|
|
88
|
+
...timestamp,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else if (message.role === "toolResult") {
|
|
93
|
+
const output = text(message.content);
|
|
94
|
+
events.push({
|
|
95
|
+
type: "tool_result",
|
|
96
|
+
tool_call_id: String(message.toolCallId),
|
|
97
|
+
...(typeof message.toolName === "string"
|
|
98
|
+
? { name: message.toolName }
|
|
99
|
+
: {}),
|
|
100
|
+
...(message.isError === true
|
|
101
|
+
? { error: { type: "ToolError", message: output } }
|
|
102
|
+
: { content: parseMaybeJson(output) }),
|
|
103
|
+
...timestamp,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return events;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/judges/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AAUvE,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,IAAI,CAAC,OAAgB;IAC5B,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC;IAChD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,OAAO,OAAO;SACX,MAAM,CACL,CAAC,IAAI,EAA0C,EAAE,CAC/C,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAC1E;SACA,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,gEAAgE;AAChE,SAAS,YAAY,CAAC,OAAgC;IACpD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC7C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ;YAAE,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;oBACnB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;oBACvB,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAClE,GAAG,SAAS;iBACb,CAAC,CAAC;YACL,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACrC,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,aAAa;gBACnB,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;gBACxC,GAAG,CAAC,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;oBACtC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE;oBAC5B,CAAC,CAAC,EAAE,CAAC;gBACP,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI;oBAC1B,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;oBACnD,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;gBACxC,GAAG,SAAS;aACb,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** A tool result larger than this was captured truncated: a gate cannot inspect it. */
|
|
2
|
+
export declare const TOOL_RESULT_TRUNCATE_BYTES = 4096;
|
|
3
|
+
/** What a classifier judge reads: decision models take far less than a chat model. */
|
|
4
|
+
export declare const CLASSIFIER_BUDGET_UNITS = 75000;
|
|
5
|
+
interface TrajectoryError {
|
|
6
|
+
type: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
/** A runner-neutral agent transcript event: what a judge reads and a gate matches. */
|
|
10
|
+
export type TrajectoryEvent = {
|
|
11
|
+
type: "message";
|
|
12
|
+
role: "user" | "assistant";
|
|
13
|
+
content: string;
|
|
14
|
+
timestamp?: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: "tool_call";
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
arguments?: Record<string, unknown>;
|
|
20
|
+
timestamp?: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: "tool_result";
|
|
23
|
+
tool_call_id: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
content?: unknown;
|
|
26
|
+
error?: TrajectoryError;
|
|
27
|
+
timestamp?: string;
|
|
28
|
+
};
|
|
29
|
+
/** One record of a conversation's trajectory export, keyed by `role`. */
|
|
30
|
+
export type ReplayTrajectoryRecord = {
|
|
31
|
+
role: "meta";
|
|
32
|
+
source: string;
|
|
33
|
+
model?: string;
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
} | {
|
|
36
|
+
role: "user";
|
|
37
|
+
content: string;
|
|
38
|
+
timestamp: string;
|
|
39
|
+
} | {
|
|
40
|
+
role: "reasoning";
|
|
41
|
+
content: string;
|
|
42
|
+
timestamp: string;
|
|
43
|
+
} | {
|
|
44
|
+
role: "assistant";
|
|
45
|
+
content?: string | null;
|
|
46
|
+
timestamp: string;
|
|
47
|
+
tool_calls?: {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
args: string;
|
|
51
|
+
}[];
|
|
52
|
+
} | {
|
|
53
|
+
role: "tool";
|
|
54
|
+
tool_call_id: string;
|
|
55
|
+
content: string;
|
|
56
|
+
timestamp: string;
|
|
57
|
+
ok?: boolean;
|
|
58
|
+
};
|
|
59
|
+
/** The evidence one judge run grades. */
|
|
60
|
+
export interface JudgeInput {
|
|
61
|
+
schema_version: number;
|
|
62
|
+
trajectory: TrajectoryEvent[];
|
|
63
|
+
system_instructions?: string;
|
|
64
|
+
}
|
|
65
|
+
/** A tool result's text as the JSON it holds, or the text itself. */
|
|
66
|
+
export declare function parseMaybeJson(raw: string): unknown;
|
|
67
|
+
/**
|
|
68
|
+
* A trajectory export as judge evidence. Reasoning and meta records are not
|
|
69
|
+
* evidence; a tool call's arguments arrive as a JSON string and are parsed.
|
|
70
|
+
*/
|
|
71
|
+
export declare function normalizeReplayTrajectory(records: readonly ReplayTrajectoryRecord[]): TrajectoryEvent[];
|
|
72
|
+
/**
|
|
73
|
+
* Judge evidence from either form a caller holds: a trajectory export's
|
|
74
|
+
* `role` records, or events already normalized (`type`).
|
|
75
|
+
*/
|
|
76
|
+
export declare function toJudgeInput(trajectory: readonly unknown[], systemInstructions?: string): JudgeInput;
|
|
77
|
+
/** Sort object keys at every depth, so a transcript and its hash do not depend on key order. */
|
|
78
|
+
export declare function canonical(value: unknown): unknown;
|
|
79
|
+
/** The identity of what a judge read: the same evidence hashes the same in every run. */
|
|
80
|
+
export declare function evidenceHash(input: JudgeInput): string;
|
|
81
|
+
/**
|
|
82
|
+
* The transcript a judge reads. `slim` clips long tool arguments and results
|
|
83
|
+
* first, so a small budget is spent on the conversation rather than on one
|
|
84
|
+
* tool's output; what still does not fit loses its middle.
|
|
85
|
+
*/
|
|
86
|
+
export declare function renderTrajectoryInput(input: JudgeInput, options?: {
|
|
87
|
+
maxUnits?: number;
|
|
88
|
+
slim?: boolean;
|
|
89
|
+
}): string;
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=trajectory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trajectory.d.ts","sourceRoot":"","sources":["../../src/judges/trajectory.ts"],"names":[],"mappings":"AAMA,uFAAuF;AACvF,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAG/C,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAI9C,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OA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