@warmdrift/kgauto-compiler 2.0.0-alpha.61 → 2.0.0-alpha.63
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/README.md +30 -12
- package/dist/brain-proxy.js +5 -1
- package/dist/brain-proxy.mjs +1 -1
- package/dist/{chunk-5TI6PNSK.mjs → chunk-3KQAID63.mjs} +5 -0
- package/dist/{chunk-IUWFML6Z.mjs → chunk-65ZMX5OT.mjs} +5 -1
- package/dist/{chunk-IIMPJZNH.mjs → chunk-YZRPNSSQ.mjs} +10 -0
- package/dist/{chunk-3RMLZCUK.mjs → chunk-ZU62HRWK.mjs} +1 -1
- package/dist/dialect.d.mts +14 -2
- package/dist/dialect.d.ts +14 -2
- package/dist/dialect.js +5 -0
- package/dist/dialect.mjs +1 -1
- package/dist/glassbox/index.d.mts +3 -3
- package/dist/glassbox/index.d.ts +3 -3
- package/dist/glassbox-routes/format.d.mts +2 -2
- package/dist/glassbox-routes/format.d.ts +2 -2
- package/dist/glassbox-routes/index.d.mts +4 -4
- package/dist/glassbox-routes/index.d.ts +4 -4
- package/dist/glassbox-routes/index.js +10 -0
- package/dist/glassbox-routes/index.mjs +1 -1
- package/dist/glassbox-routes/react/index.d.mts +2 -2
- package/dist/glassbox-routes/react/index.d.ts +2 -2
- package/dist/index.d.mts +193 -6
- package/dist/index.d.ts +193 -6
- package/dist/index.js +685 -2
- package/dist/index.mjs +655 -4
- package/dist/{ir-DAKlQsVb.d.mts → ir-B2dRyJXO.d.mts} +74 -9
- package/dist/{ir-DmUuJsWc.d.ts → ir-ClU56aBc.d.ts} +74 -9
- package/dist/key-health.js +1 -1
- package/dist/key-health.mjs +1 -1
- package/dist/profiles.d.mts +1 -1
- package/dist/profiles.d.ts +1 -1
- package/dist/{types-B8X1Pyhx.d.ts → types-ByN3r0_7.d.ts} +1 -1
- package/dist/{types-DR62iPcO.d.ts → types-C-Wp7HpI.d.ts} +1 -1
- package/dist/{types-MRMBUqzY.d.mts → types-CSDweZsl.d.mts} +1 -1
- package/dist/{types-CssWqd0X.d.mts → types-axAX1Bg0.d.mts} +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createBrainForwardRoutes
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-65ZMX5OT.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ALL_ARCHETYPES,
|
|
6
6
|
DIALECT_VERSION,
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
hashShape,
|
|
12
12
|
isArchetype,
|
|
13
13
|
learningKey
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-3KQAID63.mjs";
|
|
15
15
|
import {
|
|
16
16
|
LIBRARY_VERSION,
|
|
17
17
|
createKeyHealthRoute
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZU62HRWK.mjs";
|
|
19
19
|
import {
|
|
20
20
|
ABSOLUTE_FLOOR,
|
|
21
21
|
ARCHETYPE_FLOOR_DEFAULT,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
loadChainsFromBrain,
|
|
41
41
|
readBrainReadEnv,
|
|
42
42
|
resolveProviderKey
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-YZRPNSSQ.mjs";
|
|
44
44
|
import {
|
|
45
45
|
ALIASES,
|
|
46
46
|
LATENCY_TIER_MS,
|
|
@@ -3160,6 +3160,61 @@ async function recordShadowProbe(input) {
|
|
|
3160
3160
|
void send();
|
|
3161
3161
|
}
|
|
3162
3162
|
}
|
|
3163
|
+
function peekRegisteredShapeKey(handle) {
|
|
3164
|
+
return compileRegistry.get(handle)?.shapeKey;
|
|
3165
|
+
}
|
|
3166
|
+
function buildGoldenIrRow(input) {
|
|
3167
|
+
return {
|
|
3168
|
+
app_id: input.appId,
|
|
3169
|
+
intent_archetype: input.archetype,
|
|
3170
|
+
shape_key: input.shapeKey ?? null,
|
|
3171
|
+
ir: input.ir,
|
|
3172
|
+
incumbent_model: input.incumbentModel,
|
|
3173
|
+
incumbent_output: input.incumbentOutput ?? null,
|
|
3174
|
+
incumbent_latency_ms: input.incumbentLatencyMs ?? null,
|
|
3175
|
+
incumbent_tokens_in: input.incumbentTokensIn ?? null,
|
|
3176
|
+
incumbent_tokens_out: input.incumbentTokensOut ?? null,
|
|
3177
|
+
source: input.source,
|
|
3178
|
+
consent: input.consent,
|
|
3179
|
+
outcome_handle: input.outcomeHandle ?? null
|
|
3180
|
+
};
|
|
3181
|
+
}
|
|
3182
|
+
async function recordGoldenIr(input) {
|
|
3183
|
+
if (!activeConfig) return;
|
|
3184
|
+
const config = activeConfig;
|
|
3185
|
+
const fetchFn = brainWriteFetch(config);
|
|
3186
|
+
const row = buildGoldenIrRow(input);
|
|
3187
|
+
const send = async () => {
|
|
3188
|
+
noteSent();
|
|
3189
|
+
try {
|
|
3190
|
+
const res = await fetchFn(`${config.endpoint}/golden_irs`, {
|
|
3191
|
+
method: "POST",
|
|
3192
|
+
headers: {
|
|
3193
|
+
"Content-Type": "application/json",
|
|
3194
|
+
Prefer: "return=minimal",
|
|
3195
|
+
...config.apiKey ? { Authorization: `Bearer ${config.apiKey}` } : {}
|
|
3196
|
+
},
|
|
3197
|
+
body: JSON.stringify(row)
|
|
3198
|
+
});
|
|
3199
|
+
assertNotRedirected(res, "golden_irs");
|
|
3200
|
+
if (!res.ok) {
|
|
3201
|
+
const text = await res.text().catch(() => "<no body>");
|
|
3202
|
+
throw new Error(describeBrainWriteFailure(res.status, "golden_irs", text));
|
|
3203
|
+
}
|
|
3204
|
+
noteAck();
|
|
3205
|
+
maybeAutoFlush();
|
|
3206
|
+
} catch (err) {
|
|
3207
|
+
noteFailure(err);
|
|
3208
|
+
pushDeadLetter("golden_irs", config.endpoint, row, err);
|
|
3209
|
+
(config.onError ?? defaultOnError4)(err);
|
|
3210
|
+
}
|
|
3211
|
+
};
|
|
3212
|
+
if (config.sync) {
|
|
3213
|
+
await send();
|
|
3214
|
+
} else {
|
|
3215
|
+
void send();
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3163
3218
|
|
|
3164
3219
|
// src/ir.ts
|
|
3165
3220
|
var CallError = class extends Error {
|
|
@@ -3175,6 +3230,45 @@ var CallError = class extends Error {
|
|
|
3175
3230
|
}
|
|
3176
3231
|
};
|
|
3177
3232
|
|
|
3233
|
+
// src/golden.ts
|
|
3234
|
+
function parseGoldenCaptureRate(raw) {
|
|
3235
|
+
if (raw === void 0 || raw.trim() === "") return 0;
|
|
3236
|
+
const n = Number(raw);
|
|
3237
|
+
if (!Number.isFinite(n)) return 0;
|
|
3238
|
+
return Math.max(0, Math.min(1, n));
|
|
3239
|
+
}
|
|
3240
|
+
function resolveGoldenCaptureRate(optRate) {
|
|
3241
|
+
if (optRate !== void 0 && Number.isFinite(optRate)) {
|
|
3242
|
+
return Math.max(0, Math.min(1, optRate));
|
|
3243
|
+
}
|
|
3244
|
+
const env = typeof process !== "undefined" && process.env ? process.env.KGAUTO_GOLDEN_CAPTURE : void 0;
|
|
3245
|
+
return parseGoldenCaptureRate(env);
|
|
3246
|
+
}
|
|
3247
|
+
function shouldCaptureGolden(rate, rng = Math.random) {
|
|
3248
|
+
if (rate <= 0) return false;
|
|
3249
|
+
if (rate >= 1) return true;
|
|
3250
|
+
return rng() < rate;
|
|
3251
|
+
}
|
|
3252
|
+
async function captureGoldenIr(ctx) {
|
|
3253
|
+
try {
|
|
3254
|
+
await recordGoldenIr({
|
|
3255
|
+
appId: ctx.ir.appId,
|
|
3256
|
+
archetype: ctx.ir.intent.archetype,
|
|
3257
|
+
shapeKey: ctx.shapeKey,
|
|
3258
|
+
ir: ctx.ir,
|
|
3259
|
+
incumbentModel: ctx.servedModel,
|
|
3260
|
+
incumbentOutput: ctx.response.text,
|
|
3261
|
+
incumbentLatencyMs: ctx.latencyMs,
|
|
3262
|
+
incumbentTokensIn: ctx.response.tokens.input,
|
|
3263
|
+
incumbentTokensOut: ctx.response.tokens.output,
|
|
3264
|
+
source: "sampled",
|
|
3265
|
+
consent: ctx.consent,
|
|
3266
|
+
outcomeHandle: ctx.handle
|
|
3267
|
+
});
|
|
3268
|
+
} catch {
|
|
3269
|
+
}
|
|
3270
|
+
}
|
|
3271
|
+
|
|
3178
3272
|
// src/streaming.ts
|
|
3179
3273
|
var ANTHROPIC_URL = "https://api.anthropic.com/v1/messages";
|
|
3180
3274
|
async function streamAnthropic(request, apiKey, opts) {
|
|
@@ -3886,6 +3980,8 @@ async function call(ir, opts = {}) {
|
|
|
3886
3980
|
);
|
|
3887
3981
|
const fellOver = targetModel !== initial.target;
|
|
3888
3982
|
const fallbackReason = fellOver ? normalizeFallbackReason(attempts) : void 0;
|
|
3983
|
+
const goldenRate = resolveGoldenCaptureRate(opts.goldenCapture?.sampleRate);
|
|
3984
|
+
const goldenShapeKey = goldenRate > 0 ? peekRegisteredShapeKey(initial.handle) : void 0;
|
|
3889
3985
|
await record({
|
|
3890
3986
|
handle: initial.handle,
|
|
3891
3987
|
tokensIn: validated.response.tokens.input,
|
|
@@ -3938,6 +4034,23 @@ async function call(ir, opts = {}) {
|
|
|
3938
4034
|
void probe;
|
|
3939
4035
|
}
|
|
3940
4036
|
}
|
|
4037
|
+
if (goldenRate > 0 && validated.response.tokens.output > 0 && shouldCaptureGolden(goldenRate)) {
|
|
4038
|
+
const consent = opts.goldenCapture?.sampleRate !== void 0 ? `CallOptions.goldenCapture.sampleRate=${goldenRate} (consumer code opt-in)` + (opts.goldenCapture.consentNote ? ` \u2014 ${opts.goldenCapture.consentNote}` : "") : `KGAUTO_GOLDEN_CAPTURE=${goldenRate} (consumer env opt-in)`;
|
|
4039
|
+
const capture = captureGoldenIr({
|
|
4040
|
+
ir,
|
|
4041
|
+
servedModel: targetModel,
|
|
4042
|
+
response: validated.response,
|
|
4043
|
+
latencyMs: latencyMs2,
|
|
4044
|
+
handle: initial.handle,
|
|
4045
|
+
shapeKey: goldenShapeKey,
|
|
4046
|
+
consent
|
|
4047
|
+
});
|
|
4048
|
+
if (isBrainSync()) {
|
|
4049
|
+
await capture;
|
|
4050
|
+
} else {
|
|
4051
|
+
void capture;
|
|
4052
|
+
}
|
|
4053
|
+
}
|
|
3941
4054
|
return {
|
|
3942
4055
|
handle: initial.handle,
|
|
3943
4056
|
actualModel: targetModel,
|
|
@@ -4277,6 +4390,18 @@ function safeEmit(fn) {
|
|
|
4277
4390
|
} catch {
|
|
4278
4391
|
}
|
|
4279
4392
|
}
|
|
4393
|
+
var _internal = {
|
|
4394
|
+
compileAndRegister,
|
|
4395
|
+
validateStructuredContract,
|
|
4396
|
+
extractPromptPreview,
|
|
4397
|
+
normalizeFallbackReason,
|
|
4398
|
+
generateTraceId,
|
|
4399
|
+
safeEmit,
|
|
4400
|
+
shouldSampleProbe,
|
|
4401
|
+
normalizeProbeCandidates,
|
|
4402
|
+
runShadowProbe,
|
|
4403
|
+
runProbeCandidates
|
|
4404
|
+
};
|
|
4280
4405
|
|
|
4281
4406
|
// src/streamtext-helpers.ts
|
|
4282
4407
|
function attachCacheControlToStreamTextInput(result, convertedMessages) {
|
|
@@ -4376,6 +4501,519 @@ function extractKeptToolNames(result) {
|
|
|
4376
4501
|
return names;
|
|
4377
4502
|
}
|
|
4378
4503
|
|
|
4504
|
+
// src/golden-eval.ts
|
|
4505
|
+
var GENERIC_RUBRIC = "overall correctness, completeness against the request, clarity, and adherence to any requested format";
|
|
4506
|
+
var JUDGE_RUBRICS = {
|
|
4507
|
+
summarize: "faithfulness to the source (no fabricated facts), coverage of the key points, concision, and adherence to the requested output format",
|
|
4508
|
+
classify: "assignment of the correct category from the allowed set, and nothing outside the allowed set",
|
|
4509
|
+
generate: "relevance to the brief, quality and coherence of the writing, and adherence to the requested format and tone",
|
|
4510
|
+
extract: "completeness of extraction (nothing relevant missed), precision (no invented fields or values), and exact schema adherence",
|
|
4511
|
+
ask: "correctness of the answer with respect to the provided data, relevance, and absence of fabrication",
|
|
4512
|
+
hunt: "relevance and novelty of the discovered entities, and absence of duplicates or fabricated entries",
|
|
4513
|
+
plan: "quality of the decomposition (complete, ordered, actionable steps) and realism of the sequencing",
|
|
4514
|
+
critique: "specificity and correctness of the assessment, and actionability of the feedback",
|
|
4515
|
+
transform: "preservation of the source content and correctness of the target format or style"
|
|
4516
|
+
};
|
|
4517
|
+
function rubricFor(archetype) {
|
|
4518
|
+
return JUDGE_RUBRICS[archetype] ?? GENERIC_RUBRIC;
|
|
4519
|
+
}
|
|
4520
|
+
var INPUT_TRUNCATE_CHARS = 24e3;
|
|
4521
|
+
var OUTPUT_TRUNCATE_CHARS = 12e3;
|
|
4522
|
+
function renderIrForJudge(ir) {
|
|
4523
|
+
const sections = (ir.sections ?? []).map((s) => s.text).filter(Boolean).join("\n\n");
|
|
4524
|
+
const turn = typeof ir.currentTurn?.content === "string" ? ir.currentTurn.content : "";
|
|
4525
|
+
const combined = [
|
|
4526
|
+
sections ? `[system]
|
|
4527
|
+
${sections}` : "",
|
|
4528
|
+
turn ? `[user]
|
|
4529
|
+
${turn}` : ""
|
|
4530
|
+
].filter(Boolean).join("\n\n");
|
|
4531
|
+
return combined.length > INPUT_TRUNCATE_CHARS ? `${combined.slice(0, INPUT_TRUNCATE_CHARS)}
|
|
4532
|
+
\u2026[truncated]` : combined;
|
|
4533
|
+
}
|
|
4534
|
+
function buildPairwiseJudgePrompt(args) {
|
|
4535
|
+
const clip = (s) => s.length > OUTPUT_TRUNCATE_CHARS ? `${s.slice(0, OUTPUT_TRUNCATE_CHARS)}
|
|
4536
|
+
\u2026[truncated]` : s;
|
|
4537
|
+
return `You are a strict pairwise judge comparing two AI responses to the SAME request.
|
|
4538
|
+
|
|
4539
|
+
The request (archetype: ${args.archetype}):
|
|
4540
|
+
<request>
|
|
4541
|
+
${args.renderedInput}
|
|
4542
|
+
</request>
|
|
4543
|
+
|
|
4544
|
+
Response A:
|
|
4545
|
+
<response_a>
|
|
4546
|
+
${clip(args.outputA)}
|
|
4547
|
+
</response_a>
|
|
4548
|
+
|
|
4549
|
+
Response B:
|
|
4550
|
+
<response_b>
|
|
4551
|
+
${clip(args.outputB)}
|
|
4552
|
+
</response_b>
|
|
4553
|
+
|
|
4554
|
+
Judge which response better satisfies the request. Rubric for ${args.archetype}: ${rubricFor(args.archetype)}.
|
|
4555
|
+
|
|
4556
|
+
A tie is a legitimate verdict \u2014 declare it when the responses are of genuinely comparable quality. Do NOT prefer a response merely for being longer.
|
|
4557
|
+
|
|
4558
|
+
Output ONLY this JSON, no other text:
|
|
4559
|
+
{"winner": "A" | "B" | "tie", "rationale": "<one sentence>"}`;
|
|
4560
|
+
}
|
|
4561
|
+
function parseJudgeVerdict(raw) {
|
|
4562
|
+
const cleaned = raw.replace(/^```(?:json)?\s*/i, "").replace(/\s*```\s*$/, "").trim();
|
|
4563
|
+
let parsed;
|
|
4564
|
+
try {
|
|
4565
|
+
parsed = JSON.parse(cleaned);
|
|
4566
|
+
} catch {
|
|
4567
|
+
const match = cleaned.match(/\{[\s\S]*\}/);
|
|
4568
|
+
if (!match) return void 0;
|
|
4569
|
+
try {
|
|
4570
|
+
parsed = JSON.parse(match[0]);
|
|
4571
|
+
} catch {
|
|
4572
|
+
return void 0;
|
|
4573
|
+
}
|
|
4574
|
+
}
|
|
4575
|
+
if (!parsed || typeof parsed !== "object") return void 0;
|
|
4576
|
+
const obj = parsed;
|
|
4577
|
+
const winner = obj.winner;
|
|
4578
|
+
if (winner !== "A" && winner !== "B" && winner !== "tie") return void 0;
|
|
4579
|
+
return {
|
|
4580
|
+
winner,
|
|
4581
|
+
rationale: typeof obj.rationale === "string" ? obj.rationale : void 0
|
|
4582
|
+
};
|
|
4583
|
+
}
|
|
4584
|
+
function combineOrderSwappedVerdicts(run1, run2) {
|
|
4585
|
+
if (run1 === run2) return run1;
|
|
4586
|
+
return "tied";
|
|
4587
|
+
}
|
|
4588
|
+
function replayRetryDelayMs(errorCode) {
|
|
4589
|
+
return errorCode === "rate_limit" ? 65e3 : 2e3;
|
|
4590
|
+
}
|
|
4591
|
+
function p50(values) {
|
|
4592
|
+
if (values.length === 0) return null;
|
|
4593
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
4594
|
+
return sorted[Math.floor(sorted.length / 2)] ?? null;
|
|
4595
|
+
}
|
|
4596
|
+
function costUsd(model, tokensIn, tokensOut) {
|
|
4597
|
+
const profile = tryGetProfile(model);
|
|
4598
|
+
if (!profile) return null;
|
|
4599
|
+
return tokensIn / 1e6 * profile.costInputPer1m + tokensOut / 1e6 * profile.costOutputPer1m;
|
|
4600
|
+
}
|
|
4601
|
+
function hashForGolden(s) {
|
|
4602
|
+
let h = 5381;
|
|
4603
|
+
for (let i = 0; i < s.length; i += 1) {
|
|
4604
|
+
h = (h << 5) + h + s.charCodeAt(i) >>> 0;
|
|
4605
|
+
}
|
|
4606
|
+
return `g${h.toString(36)}`;
|
|
4607
|
+
}
|
|
4608
|
+
async function runGoldenEval(opts) {
|
|
4609
|
+
const fetchFn = opts.fetchImpl ?? fetch;
|
|
4610
|
+
const progress = opts.onProgress ?? (() => {
|
|
4611
|
+
});
|
|
4612
|
+
const limit = opts.limit ?? 50;
|
|
4613
|
+
const threshold = opts.winOrTieThreshold ?? 0.8;
|
|
4614
|
+
const latencyFloorRatio = opts.latencyFloorRatio ?? 3;
|
|
4615
|
+
const minJudgeable = opts.minJudgeableCases ?? 5;
|
|
4616
|
+
const judgeModel = opts.judgeModel ?? "claude-opus-4-8";
|
|
4617
|
+
const notes = [];
|
|
4618
|
+
const restHeaders = {
|
|
4619
|
+
apikey: opts.serviceKey,
|
|
4620
|
+
Authorization: `Bearer ${opts.serviceKey}`
|
|
4621
|
+
};
|
|
4622
|
+
const rest = (path) => `${opts.supabaseUrl}/rest/v1/${path}`;
|
|
4623
|
+
const setUrl = rest(
|
|
4624
|
+
`kgauto_golden_irs?app_id=eq.${encodeURIComponent(opts.appId)}&intent_archetype=eq.${encodeURIComponent(opts.archetype)}&active=is.true&select=id,app_id,intent_archetype,ir,incumbent_model&order=captured_at.desc&limit=${limit}`
|
|
4625
|
+
);
|
|
4626
|
+
const setRes = await fetchFn(setUrl, { headers: restHeaders });
|
|
4627
|
+
if (!setRes.ok) {
|
|
4628
|
+
throw new Error(
|
|
4629
|
+
`golden-eval: failed to load golden set (${setRes.status}): ${await setRes.text().catch(() => "<no body>")}`
|
|
4630
|
+
);
|
|
4631
|
+
}
|
|
4632
|
+
const goldenRows = await setRes.json();
|
|
4633
|
+
if (goldenRows.length === 0) {
|
|
4634
|
+
throw new Error(
|
|
4635
|
+
`golden-eval: no active golden IRs for (${opts.appId}, ${opts.archetype}) \u2014 seed via KGAUTO_GOLDEN_CAPTURE or scripts/seed-golden-set.mjs first.`
|
|
4636
|
+
);
|
|
4637
|
+
}
|
|
4638
|
+
progress(`Loaded ${goldenRows.length} golden case(s).`);
|
|
4639
|
+
let incumbentModel = opts.incumbentModel;
|
|
4640
|
+
if (!incumbentModel) {
|
|
4641
|
+
const counts = /* @__PURE__ */ new Map();
|
|
4642
|
+
for (const row of goldenRows) {
|
|
4643
|
+
counts.set(row.incumbent_model, (counts.get(row.incumbent_model) ?? 0) + 1);
|
|
4644
|
+
}
|
|
4645
|
+
const top = [...counts.entries()].sort((a, b) => b[1] - a[1])[0];
|
|
4646
|
+
if (!top) throw new Error("golden-eval: could not resolve an incumbent from the golden set.");
|
|
4647
|
+
incumbentModel = top[0];
|
|
4648
|
+
notes.push(`incumbent defaulted to most-captured model: ${incumbentModel}`);
|
|
4649
|
+
}
|
|
4650
|
+
if (incumbentModel === opts.candidateModel) {
|
|
4651
|
+
throw new Error("golden-eval: candidate and incumbent are the same model.");
|
|
4652
|
+
}
|
|
4653
|
+
const judgeProfile = tryGetProfile(judgeModel);
|
|
4654
|
+
if (!judgeProfile) {
|
|
4655
|
+
throw new Error(`golden-eval: judge model '${judgeModel}' is not in the roster.`);
|
|
4656
|
+
}
|
|
4657
|
+
if (judgeProfile.family && [incumbentModel, opts.candidateModel].some(
|
|
4658
|
+
(m) => tryGetProfile(m)?.family === judgeProfile.family
|
|
4659
|
+
)) {
|
|
4660
|
+
notes.push(
|
|
4661
|
+
`WARNING: judge family (${judgeProfile.family}) overlaps a compared model \u2014 self-preference risk; consider --judge from another provider.`
|
|
4662
|
+
);
|
|
4663
|
+
}
|
|
4664
|
+
const replay = async (ir, model) => {
|
|
4665
|
+
try {
|
|
4666
|
+
const evalIr = {
|
|
4667
|
+
...ir,
|
|
4668
|
+
models: [model],
|
|
4669
|
+
constraints: { ...ir.constraints ?? {}, forceModel: model }
|
|
4670
|
+
};
|
|
4671
|
+
const compiled = compile(evalIr);
|
|
4672
|
+
const attempt = () => execute(compiled.request, { apiKeys: opts.apiKeys, fetchImpl: opts.fetchImpl });
|
|
4673
|
+
let started = Date.now();
|
|
4674
|
+
let exec = await attempt();
|
|
4675
|
+
if (!exec.ok && exec.errorType === "retryable") {
|
|
4676
|
+
const delayMs = replayRetryDelayMs(exec.errorCode);
|
|
4677
|
+
await new Promise((r) => setTimeout(r, delayMs));
|
|
4678
|
+
started = Date.now();
|
|
4679
|
+
exec = await attempt();
|
|
4680
|
+
}
|
|
4681
|
+
const latencyMs = Date.now() - started;
|
|
4682
|
+
if (!exec.ok) {
|
|
4683
|
+
return {
|
|
4684
|
+
ok: false,
|
|
4685
|
+
text: "",
|
|
4686
|
+
structuredOutput: null,
|
|
4687
|
+
tokensIn: 0,
|
|
4688
|
+
tokensOut: 0,
|
|
4689
|
+
latencyMs,
|
|
4690
|
+
errorClass: exec.errorCode
|
|
4691
|
+
};
|
|
4692
|
+
}
|
|
4693
|
+
const validated = _internal.validateStructuredContract(exec, evalIr);
|
|
4694
|
+
if (!validated.ok) {
|
|
4695
|
+
return {
|
|
4696
|
+
ok: true,
|
|
4697
|
+
text: exec.response.text,
|
|
4698
|
+
structuredOutput: null,
|
|
4699
|
+
tokensIn: exec.response.tokens.input,
|
|
4700
|
+
tokensOut: exec.response.tokens.output,
|
|
4701
|
+
latencyMs,
|
|
4702
|
+
contractViolation: validated.errorCode
|
|
4703
|
+
};
|
|
4704
|
+
}
|
|
4705
|
+
return {
|
|
4706
|
+
ok: true,
|
|
4707
|
+
text: validated.response.text,
|
|
4708
|
+
structuredOutput: validated.response.structuredOutput,
|
|
4709
|
+
parseError: validated.response.parseError,
|
|
4710
|
+
tokensIn: validated.response.tokens.input,
|
|
4711
|
+
tokensOut: validated.response.tokens.output,
|
|
4712
|
+
latencyMs
|
|
4713
|
+
};
|
|
4714
|
+
} catch (err) {
|
|
4715
|
+
return {
|
|
4716
|
+
ok: false,
|
|
4717
|
+
text: "",
|
|
4718
|
+
structuredOutput: null,
|
|
4719
|
+
tokensIn: 0,
|
|
4720
|
+
tokensOut: 0,
|
|
4721
|
+
latencyMs: 0,
|
|
4722
|
+
errorClass: err instanceof Error ? `execute_rejected:${err.message}` : "execute_rejected"
|
|
4723
|
+
};
|
|
4724
|
+
}
|
|
4725
|
+
};
|
|
4726
|
+
const judgeOnce = async (ir, outputA, outputB) => {
|
|
4727
|
+
const judgeIr = {
|
|
4728
|
+
appId: opts.appId,
|
|
4729
|
+
intent: { name: "golden-eval-judge", archetype: "judge" },
|
|
4730
|
+
sections: [
|
|
4731
|
+
{
|
|
4732
|
+
id: "role",
|
|
4733
|
+
text: "You are a strict, impartial pairwise judge. You output only JSON.",
|
|
4734
|
+
weight: 10
|
|
4735
|
+
}
|
|
4736
|
+
],
|
|
4737
|
+
currentTurn: {
|
|
4738
|
+
role: "user",
|
|
4739
|
+
content: buildPairwiseJudgePrompt({
|
|
4740
|
+
archetype: opts.archetype,
|
|
4741
|
+
renderedInput: renderIrForJudge(ir),
|
|
4742
|
+
outputA,
|
|
4743
|
+
outputB
|
|
4744
|
+
})
|
|
4745
|
+
},
|
|
4746
|
+
models: [judgeModel],
|
|
4747
|
+
constraints: { forceModel: judgeModel }
|
|
4748
|
+
};
|
|
4749
|
+
try {
|
|
4750
|
+
const compiled = compile(judgeIr);
|
|
4751
|
+
const exec = await execute(compiled.request, {
|
|
4752
|
+
apiKeys: opts.apiKeys,
|
|
4753
|
+
fetchImpl: opts.fetchImpl
|
|
4754
|
+
});
|
|
4755
|
+
if (!exec.ok) return void 0;
|
|
4756
|
+
return parseJudgeVerdict(exec.response.text);
|
|
4757
|
+
} catch {
|
|
4758
|
+
return void 0;
|
|
4759
|
+
}
|
|
4760
|
+
};
|
|
4761
|
+
const cases = [];
|
|
4762
|
+
const floorDetail = {};
|
|
4763
|
+
const bumpFloor = (k) => {
|
|
4764
|
+
floorDetail[k] = (floorDetail[k] ?? 0) + 1;
|
|
4765
|
+
};
|
|
4766
|
+
for (const [i, row] of goldenRows.entries()) {
|
|
4767
|
+
progress(
|
|
4768
|
+
`Case ${i + 1}/${goldenRows.length} (golden #${row.id}): replaying ${incumbentModel} + ${opts.candidateModel}\u2026`
|
|
4769
|
+
);
|
|
4770
|
+
const [inc, cand] = await Promise.all([
|
|
4771
|
+
replay(row.ir, incumbentModel),
|
|
4772
|
+
replay(row.ir, opts.candidateModel)
|
|
4773
|
+
]);
|
|
4774
|
+
if (!inc.ok || inc.contractViolation) {
|
|
4775
|
+
const why = !inc.ok ? `incumbent replay failed (${inc.errorClass ?? "unknown"})` : `incumbent contract violation (${inc.contractViolation})`;
|
|
4776
|
+
cases.push({
|
|
4777
|
+
goldenIrId: row.id,
|
|
4778
|
+
verdict: "inconclusive",
|
|
4779
|
+
floorViolations: [],
|
|
4780
|
+
excludedReason: why
|
|
4781
|
+
});
|
|
4782
|
+
notes.push(`case #${row.id}: ${why} \u2014 excluded`);
|
|
4783
|
+
continue;
|
|
4784
|
+
}
|
|
4785
|
+
const incumbentLeg = {
|
|
4786
|
+
latencyMs: inc.latencyMs,
|
|
4787
|
+
tokensIn: inc.tokensIn,
|
|
4788
|
+
tokensOut: inc.tokensOut,
|
|
4789
|
+
text: inc.text
|
|
4790
|
+
};
|
|
4791
|
+
const violations = [];
|
|
4792
|
+
if (!cand.ok) {
|
|
4793
|
+
violations.push("candidate_error");
|
|
4794
|
+
bumpFloor("candidate_error");
|
|
4795
|
+
} else if (cand.tokensOut === 0 || cand.text.trim() === "" && !cand.structuredOutput) {
|
|
4796
|
+
violations.push("empty");
|
|
4797
|
+
bumpFloor("empty");
|
|
4798
|
+
} else if (cand.contractViolation) {
|
|
4799
|
+
violations.push("schema");
|
|
4800
|
+
bumpFloor("schema");
|
|
4801
|
+
}
|
|
4802
|
+
if (violations.length > 0) {
|
|
4803
|
+
cases.push({
|
|
4804
|
+
goldenIrId: row.id,
|
|
4805
|
+
verdict: "current-better",
|
|
4806
|
+
floorViolations: violations,
|
|
4807
|
+
errorClass: cand.errorClass ?? cand.contractViolation,
|
|
4808
|
+
incumbent: incumbentLeg,
|
|
4809
|
+
candidate: cand.ok ? { latencyMs: cand.latencyMs, tokensIn: cand.tokensIn, tokensOut: cand.tokensOut, text: cand.text } : void 0
|
|
4810
|
+
});
|
|
4811
|
+
continue;
|
|
4812
|
+
}
|
|
4813
|
+
const [order1, order2] = await Promise.all([
|
|
4814
|
+
judgeOnce(row.ir, inc.text, cand.text),
|
|
4815
|
+
judgeOnce(row.ir, cand.text, inc.text)
|
|
4816
|
+
]);
|
|
4817
|
+
if (!order1 || !order2) {
|
|
4818
|
+
cases.push({
|
|
4819
|
+
goldenIrId: row.id,
|
|
4820
|
+
verdict: "inconclusive",
|
|
4821
|
+
floorViolations: [],
|
|
4822
|
+
incumbent: incumbentLeg,
|
|
4823
|
+
candidate: { latencyMs: cand.latencyMs, tokensIn: cand.tokensIn, tokensOut: cand.tokensOut, text: cand.text },
|
|
4824
|
+
excludedReason: "judge call failed or unparseable"
|
|
4825
|
+
});
|
|
4826
|
+
notes.push(`case #${row.id}: judge failed \u2014 excluded`);
|
|
4827
|
+
continue;
|
|
4828
|
+
}
|
|
4829
|
+
const v1 = order1.winner === "tie" ? "tied" : order1.winner === "B" ? "candidate-better" : "current-better";
|
|
4830
|
+
const v2 = order2.winner === "tie" ? "tied" : order2.winner === "A" ? "candidate-better" : "current-better";
|
|
4831
|
+
const verdict2 = combineOrderSwappedVerdicts(v1, v2);
|
|
4832
|
+
cases.push({
|
|
4833
|
+
goldenIrId: row.id,
|
|
4834
|
+
verdict: verdict2,
|
|
4835
|
+
judgeRationale: order1.rationale ?? order2.rationale,
|
|
4836
|
+
floorViolations: [],
|
|
4837
|
+
incumbent: incumbentLeg,
|
|
4838
|
+
candidate: { latencyMs: cand.latencyMs, tokensIn: cand.tokensIn, tokensOut: cand.tokensOut, text: cand.text }
|
|
4839
|
+
});
|
|
4840
|
+
}
|
|
4841
|
+
const evaluable = cases.filter((c) => !c.excludedReason);
|
|
4842
|
+
const wins = evaluable.filter((c) => c.verdict === "candidate-better").length;
|
|
4843
|
+
const ties = evaluable.filter((c) => c.verdict === "tied").length;
|
|
4844
|
+
const losses = evaluable.filter((c) => c.verdict === "current-better").length;
|
|
4845
|
+
const floorViolations = evaluable.reduce((n, c) => n + c.floorViolations.length, 0);
|
|
4846
|
+
const winOrTieRatio = evaluable.length > 0 ? (wins + ties) / evaluable.length : null;
|
|
4847
|
+
const incP50 = p50(evaluable.map((c) => c.incumbent?.latencyMs ?? NaN).filter(Number.isFinite));
|
|
4848
|
+
const candP50 = p50(evaluable.map((c) => c.candidate?.latencyMs ?? NaN).filter(Number.isFinite));
|
|
4849
|
+
const latencyRatio = incP50 && candP50 ? candP50 / incP50 : null;
|
|
4850
|
+
const sum = (xs) => xs.some((x) => x === null) ? null : xs.reduce((a, b) => a + b, 0);
|
|
4851
|
+
const costIncumbentUsd = sum(
|
|
4852
|
+
evaluable.map(
|
|
4853
|
+
(c) => c.incumbent ? costUsd(incumbentModel, c.incumbent.tokensIn, c.incumbent.tokensOut) : null
|
|
4854
|
+
)
|
|
4855
|
+
);
|
|
4856
|
+
const costCandidateUsd = sum(
|
|
4857
|
+
evaluable.map(
|
|
4858
|
+
(c) => c.candidate ? costUsd(opts.candidateModel, c.candidate.tokensIn, c.candidate.tokensOut) : null
|
|
4859
|
+
)
|
|
4860
|
+
);
|
|
4861
|
+
const latencyFloorOk = latencyRatio === null || latencyRatio <= latencyFloorRatio;
|
|
4862
|
+
if (!latencyFloorOk) bumpFloor("latency");
|
|
4863
|
+
let verdict;
|
|
4864
|
+
if (evaluable.length < minJudgeable) {
|
|
4865
|
+
verdict = "inconclusive";
|
|
4866
|
+
notes.push(
|
|
4867
|
+
`only ${evaluable.length} evaluable case(s) < minJudgeableCases=${minJudgeable}`
|
|
4868
|
+
);
|
|
4869
|
+
} else if (winOrTieRatio !== null && winOrTieRatio >= threshold && floorViolations === 0 && latencyFloorOk) {
|
|
4870
|
+
verdict = "promote-ready";
|
|
4871
|
+
} else {
|
|
4872
|
+
verdict = "not-inferior";
|
|
4873
|
+
}
|
|
4874
|
+
const result = {
|
|
4875
|
+
verdict,
|
|
4876
|
+
appId: opts.appId,
|
|
4877
|
+
archetype: opts.archetype,
|
|
4878
|
+
incumbentModel,
|
|
4879
|
+
candidateModel: opts.candidateModel,
|
|
4880
|
+
judgeModel,
|
|
4881
|
+
nCases: evaluable.length,
|
|
4882
|
+
wins,
|
|
4883
|
+
ties,
|
|
4884
|
+
losses,
|
|
4885
|
+
floorViolations: floorViolations + (latencyFloorOk ? 0 : 1),
|
|
4886
|
+
floorDetail,
|
|
4887
|
+
winOrTieRatio,
|
|
4888
|
+
latencyRatio,
|
|
4889
|
+
costIncumbentUsd,
|
|
4890
|
+
costCandidateUsd,
|
|
4891
|
+
cases,
|
|
4892
|
+
notes
|
|
4893
|
+
};
|
|
4894
|
+
if (opts.dryRun) {
|
|
4895
|
+
notes.push("dry-run: no brain rows written");
|
|
4896
|
+
return result;
|
|
4897
|
+
}
|
|
4898
|
+
progress("Writing eval evidence to the brain\u2026");
|
|
4899
|
+
const runRes = await fetchFn(rest("kgauto_golden_eval_runs"), {
|
|
4900
|
+
method: "POST",
|
|
4901
|
+
headers: {
|
|
4902
|
+
...restHeaders,
|
|
4903
|
+
"Content-Type": "application/json",
|
|
4904
|
+
Prefer: "return=representation"
|
|
4905
|
+
},
|
|
4906
|
+
body: JSON.stringify({
|
|
4907
|
+
app_id: opts.appId,
|
|
4908
|
+
intent_archetype: opts.archetype,
|
|
4909
|
+
incumbent_model: incumbentModel,
|
|
4910
|
+
candidate_model: opts.candidateModel,
|
|
4911
|
+
trigger_source: opts.triggerSource ?? "manual",
|
|
4912
|
+
judge_model: judgeModel,
|
|
4913
|
+
n_cases: result.nCases,
|
|
4914
|
+
wins,
|
|
4915
|
+
ties,
|
|
4916
|
+
losses,
|
|
4917
|
+
floor_violations: result.floorViolations,
|
|
4918
|
+
floor_detail: floorDetail,
|
|
4919
|
+
win_or_tie_ratio: winOrTieRatio,
|
|
4920
|
+
latency_ratio: latencyRatio,
|
|
4921
|
+
verdict,
|
|
4922
|
+
win_or_tie_threshold: threshold,
|
|
4923
|
+
notes: notes.join(" | ") || null
|
|
4924
|
+
})
|
|
4925
|
+
});
|
|
4926
|
+
if (!runRes.ok) {
|
|
4927
|
+
throw new Error(
|
|
4928
|
+
`golden-eval: run-row write failed (${runRes.status}): ${await runRes.text().catch(() => "<no body>")}`
|
|
4929
|
+
);
|
|
4930
|
+
}
|
|
4931
|
+
const runRows = await runRes.json();
|
|
4932
|
+
result.runId = runRows[0]?.id;
|
|
4933
|
+
const caseRows = cases.filter((c) => !c.excludedReason).map((c) => {
|
|
4934
|
+
const row = goldenRows.find((g) => g.id === c.goldenIrId);
|
|
4935
|
+
const turn = typeof row?.ir.currentTurn?.content === "string" ? row.ir.currentTurn.content : "";
|
|
4936
|
+
return {
|
|
4937
|
+
app_id: opts.appId,
|
|
4938
|
+
intent_archetype: opts.archetype,
|
|
4939
|
+
family: tryGetProfile(opts.candidateModel)?.family ?? "unknown",
|
|
4940
|
+
candidate_model: opts.candidateModel,
|
|
4941
|
+
current_model: incumbentModel,
|
|
4942
|
+
prompt_hash: hashForGolden(turn),
|
|
4943
|
+
current_response: c.incumbent?.text.slice(0, 500) ?? null,
|
|
4944
|
+
candidate_response: c.candidate?.text.slice(0, 500) ?? null,
|
|
4945
|
+
judge_verdict: c.floorViolations.length > 0 ? null : c.verdict,
|
|
4946
|
+
judge_rationale: c.floorViolations.length > 0 ? `hard-floor violation: ${c.floorViolations.join(",")}` : c.judgeRationale ?? null,
|
|
4947
|
+
judge_model: judgeModel,
|
|
4948
|
+
tokens_current_in: c.incumbent?.tokensIn ?? null,
|
|
4949
|
+
tokens_current_out: c.incumbent?.tokensOut ?? null,
|
|
4950
|
+
tokens_candidate_in: c.candidate?.tokensIn ?? null,
|
|
4951
|
+
tokens_candidate_out: c.candidate?.tokensOut ?? null,
|
|
4952
|
+
latency_current_ms: c.incumbent?.latencyMs ?? null,
|
|
4953
|
+
latency_candidate_ms: c.candidate?.latencyMs ?? null,
|
|
4954
|
+
prompt_fidelity: 1,
|
|
4955
|
+
replay_source: "golden-replay",
|
|
4956
|
+
outcome: c.floorViolations.includes("candidate_error") ? "candidate_error" : "completed",
|
|
4957
|
+
// migration-032 taxonomy: error_class only on candidate_error rows;
|
|
4958
|
+
// schema-floor detail rides in judge_rationale + the run's floor_detail.
|
|
4959
|
+
error_class: c.floorViolations.includes("candidate_error") ? c.errorClass ?? null : null,
|
|
4960
|
+
golden_run_id: result.runId ?? null,
|
|
4961
|
+
golden_ir_id: c.goldenIrId
|
|
4962
|
+
};
|
|
4963
|
+
});
|
|
4964
|
+
if (caseRows.length > 0) {
|
|
4965
|
+
const casesRes = await fetchFn(rest("probe_outcomes"), {
|
|
4966
|
+
method: "POST",
|
|
4967
|
+
headers: { ...restHeaders, "Content-Type": "application/json", Prefer: "return=minimal" },
|
|
4968
|
+
body: JSON.stringify(caseRows)
|
|
4969
|
+
});
|
|
4970
|
+
if (!casesRes.ok) {
|
|
4971
|
+
notes.push(
|
|
4972
|
+
`case-row write failed (${casesRes.status}): ${await casesRes.text().catch(() => "<no body>")}`
|
|
4973
|
+
);
|
|
4974
|
+
}
|
|
4975
|
+
}
|
|
4976
|
+
const latestRes = await fetchFn(
|
|
4977
|
+
rest(
|
|
4978
|
+
`compile_outcomes?app_id=eq.${encodeURIComponent(opts.appId)}&select=id&order=id.desc&limit=1`
|
|
4979
|
+
),
|
|
4980
|
+
{ headers: restHeaders }
|
|
4981
|
+
);
|
|
4982
|
+
const latest = latestRes.ok ? await latestRes.json() : [];
|
|
4983
|
+
const latestOutcomeId = latest[0]?.id;
|
|
4984
|
+
if (latestOutcomeId !== void 0) {
|
|
4985
|
+
const costLine = costIncumbentUsd !== null && costCandidateUsd !== null ? ` Eval cost basis: incumbent $${costIncumbentUsd.toFixed(4)} vs candidate $${costCandidateUsd.toFixed(4)} across the set.` : "";
|
|
4986
|
+
const message = `Golden-set eval (run #${result.runId}): ${opts.candidateModel} vs ${incumbentModel} on ${opts.appId}/${opts.archetype} \u2014 verdict ${verdict.toUpperCase()}. ${wins}W/${ties}T/${losses}L over ${result.nCases} real workload case(s), wins-or-ties ${(100 * (winOrTieRatio ?? 0)).toFixed(0)}% (threshold ${(100 * threshold).toFixed(0)}%), ${result.floorViolations} hard-floor violation(s), latency ratio ${latencyRatio?.toFixed(2) ?? "n/a"}.` + costLine;
|
|
4987
|
+
const suggestion = verdict === "promote-ready" ? `Candidate passed the non-inferiority rule on your real workload. To promote: node v2/scripts/promote-model.mjs --model ${opts.candidateModel} (or ask kgauto-Cairn). Evidence: kgauto_golden_eval_runs #${result.runId} + probe_outcomes golden_run_id=${result.runId}.` : `Candidate did NOT clear the non-inferiority rule \u2014 no action needed; the incumbent stays. Evidence rows: golden_run_id=${result.runId}.`;
|
|
4988
|
+
const advRes = await fetchFn(rest("compile_outcome_advisories"), {
|
|
4989
|
+
method: "POST",
|
|
4990
|
+
headers: { ...restHeaders, "Content-Type": "application/json", Prefer: "return=minimal" },
|
|
4991
|
+
body: JSON.stringify({
|
|
4992
|
+
outcome_id: latestOutcomeId,
|
|
4993
|
+
code: "golden-eval-verdict",
|
|
4994
|
+
level: "info",
|
|
4995
|
+
recommendation_type: "model-swap",
|
|
4996
|
+
message,
|
|
4997
|
+
suggestion
|
|
4998
|
+
})
|
|
4999
|
+
});
|
|
5000
|
+
if (advRes.ok) {
|
|
5001
|
+
result.advisoryOutcomeId = latestOutcomeId;
|
|
5002
|
+
await fetchFn(rest(`kgauto_golden_eval_runs?id=eq.${result.runId}`), {
|
|
5003
|
+
method: "PATCH",
|
|
5004
|
+
headers: { ...restHeaders, "Content-Type": "application/json", Prefer: "return=minimal" },
|
|
5005
|
+
body: JSON.stringify({ advisory_outcome_id: latestOutcomeId })
|
|
5006
|
+
}).catch(() => {
|
|
5007
|
+
});
|
|
5008
|
+
} else {
|
|
5009
|
+
notes.push(`advisory write failed (${advRes.status})`);
|
|
5010
|
+
}
|
|
5011
|
+
} else {
|
|
5012
|
+
notes.push("no compile_outcomes row for app \u2014 evidence advisory skipped (view needs a real outcome_id)");
|
|
5013
|
+
}
|
|
5014
|
+
return result;
|
|
5015
|
+
}
|
|
5016
|
+
|
|
4379
5017
|
// src/oracle.ts
|
|
4380
5018
|
var DEFAULT_DIMENSIONS = ["correctness", "completeness", "conciseness", "format"];
|
|
4381
5019
|
var judgeCallTimes = [];
|
|
@@ -4813,6 +5451,7 @@ export {
|
|
|
4813
5451
|
DIALECT_VERSION,
|
|
4814
5452
|
FamilyResolutionError,
|
|
4815
5453
|
INTENT_ARCHETYPES,
|
|
5454
|
+
JUDGE_RUBRICS,
|
|
4816
5455
|
LATENCY_TIER_MS,
|
|
4817
5456
|
LIBRARY_VERSION,
|
|
4818
5457
|
MEASURED_GROUNDING_MIN_N,
|
|
@@ -4828,10 +5467,14 @@ export {
|
|
|
4828
5467
|
bucketContext,
|
|
4829
5468
|
bucketHistory,
|
|
4830
5469
|
bucketToolCount,
|
|
5470
|
+
buildGoldenIrRow,
|
|
4831
5471
|
buildLLMJudge,
|
|
5472
|
+
buildPairwiseJudgePrompt,
|
|
4832
5473
|
buildShadowProbeRow,
|
|
4833
5474
|
call,
|
|
5475
|
+
captureGoldenIr,
|
|
4834
5476
|
clearBrain,
|
|
5477
|
+
combineOrderSwappedVerdicts,
|
|
4835
5478
|
compile2 as compile,
|
|
4836
5479
|
compileForAISDKv6,
|
|
4837
5480
|
configureBrain,
|
|
@@ -4877,19 +5520,27 @@ export {
|
|
|
4877
5520
|
markAdvisoryResolved,
|
|
4878
5521
|
markExclusionFindingHandled,
|
|
4879
5522
|
markPromoteReadyHandled,
|
|
5523
|
+
parseGoldenCaptureRate,
|
|
5524
|
+
parseJudgeVerdict,
|
|
4880
5525
|
peekBrainDeadLetter,
|
|
4881
5526
|
probeShadow,
|
|
4882
5527
|
profileToRow,
|
|
4883
5528
|
profilesByProvider,
|
|
4884
5529
|
readBrainReadEnv,
|
|
4885
5530
|
record,
|
|
5531
|
+
recordGoldenIr,
|
|
4886
5532
|
recordOutcome,
|
|
4887
5533
|
recordShadowProbe,
|
|
5534
|
+
renderIrForJudge,
|
|
4888
5535
|
resetTokenizer,
|
|
4889
5536
|
resolveConventionsForProfile,
|
|
5537
|
+
resolveGoldenCaptureRate,
|
|
4890
5538
|
resolvePricingAt,
|
|
4891
5539
|
resolveProviderKey,
|
|
5540
|
+
rubricFor,
|
|
4892
5541
|
runAdvisor,
|
|
5542
|
+
runGoldenEval,
|
|
4893
5543
|
setTokenizer,
|
|
5544
|
+
shouldCaptureGolden,
|
|
4894
5545
|
tryGetProfile
|
|
4895
5546
|
};
|