modelrig 0.3.0 → 0.5.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/CHANGELOG.md +269 -0
- package/README.md +79 -14
- package/dist/adapters/deepseek.d.ts.map +1 -1
- package/dist/adapters/deepseek.js +8 -1
- package/dist/adapters/gemini.d.ts +45 -0
- package/dist/adapters/gemini.d.ts.map +1 -1
- package/dist/adapters/gemini.js +67 -6
- package/dist/adapters/grok.d.ts +7 -0
- package/dist/adapters/grok.d.ts.map +1 -1
- package/dist/adapters/grok.js +23 -1
- package/dist/adapters/openai-compat.d.ts +7 -0
- package/dist/adapters/openai-compat.d.ts.map +1 -1
- package/dist/adapters/openai-compat.js +24 -1
- package/dist/adapters/openai.d.ts +7 -0
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +23 -1
- package/dist/artifacts/artifact.d.ts +3 -2
- package/dist/artifacts/artifact.d.ts.map +1 -1
- package/dist/artifacts/artifact.js +11 -4
- package/dist/artifacts/run-context.d.ts +21 -2
- package/dist/artifacts/run-context.d.ts.map +1 -1
- package/dist/artifacts/run-context.js +46 -1
- package/dist/bakeoff/replay.d.ts.map +1 -1
- package/dist/bakeoff/replay.js +17 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +26 -5
- package/dist/config.d.ts +7 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +21 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -26
- package/dist/init/init-cli.d.ts.map +1 -1
- package/dist/init/init-cli.js +2 -1
- package/dist/init/observe-cli.d.ts.map +1 -1
- package/dist/init/observe-cli.js +2 -1
- package/dist/registry/select.d.ts +59 -0
- package/dist/registry/select.d.ts.map +1 -1
- package/dist/registry/select.js +66 -0
- package/dist/routes/loader-warnings.d.ts +28 -0
- package/dist/routes/loader-warnings.d.ts.map +1 -0
- package/dist/routes/loader-warnings.js +56 -0
- package/dist/routes/loader.d.ts +1 -11
- package/dist/routes/loader.d.ts.map +1 -1
- package/dist/routes/loader.js +44 -26
- package/dist/routes/sampling-config.d.ts.map +1 -1
- package/dist/routes/sampling-config.js +11 -0
- package/dist/run/dispatch.d.ts +14 -2
- package/dist/run/dispatch.d.ts.map +1 -1
- package/dist/run/dispatch.js +31 -2
- package/dist/run/ladder-key.d.ts +40 -0
- package/dist/run/ladder-key.d.ts.map +1 -0
- package/dist/run/ladder-key.js +39 -0
- package/dist/run/raw-defaults.d.ts +52 -0
- package/dist/run/raw-defaults.d.ts.map +1 -0
- package/dist/run/raw-defaults.js +123 -0
- package/dist/run/raw-support.d.ts +123 -0
- package/dist/run/raw-support.d.ts.map +1 -0
- package/dist/run/raw-support.js +150 -0
- package/dist/run/raw.d.ts +53 -11
- package/dist/run/raw.d.ts.map +1 -1
- package/dist/run/raw.js +157 -31
- package/dist/run/rawonly.d.ts +60 -0
- package/dist/run/rawonly.d.ts.map +1 -0
- package/dist/run/rawonly.js +120 -0
- package/dist/run/record-attempt.d.ts +14 -1
- package/dist/run/record-attempt.d.ts.map +1 -1
- package/dist/run/record-attempt.js +43 -2
- package/dist/run/resolve.d.ts +21 -1
- package/dist/run/resolve.d.ts.map +1 -1
- package/dist/run/resolve.js +29 -6
- package/dist/run/routing-docs.d.ts +73 -0
- package/dist/run/routing-docs.d.ts.map +1 -0
- package/dist/run/routing-docs.js +222 -0
- package/dist/run/run.d.ts +7 -1
- package/dist/run/run.d.ts.map +1 -1
- package/dist/run/run.js +38 -55
- package/dist/run/variant.d.ts +43 -0
- package/dist/run/variant.d.ts.map +1 -0
- package/dist/run/variant.js +86 -0
- package/dist/savings/emit.d.ts +33 -0
- package/dist/savings/emit.d.ts.map +1 -1
- package/dist/savings/emit.js +75 -3
- package/dist/telemetry/exporter.d.ts.map +1 -1
- package/dist/telemetry/exporter.js +6 -0
- package/dist/telemetry/ingest-protocol.d.ts +7 -0
- package/dist/telemetry/ingest-protocol.d.ts.map +1 -1
- package/dist/telemetry/load-error-report.d.ts.map +1 -1
- package/dist/telemetry/load-error-report.js +4 -1
- package/dist/telemetry/otel-map.d.ts.map +1 -1
- package/dist/telemetry/otel-map.js +8 -0
- package/dist/telemetry/store-migrations.d.ts +15 -0
- package/dist/telemetry/store-migrations.d.ts.map +1 -0
- package/dist/telemetry/store-migrations.js +119 -0
- package/dist/telemetry/store.d.ts.map +1 -1
- package/dist/telemetry/store.js +26 -93
- package/dist/types/failures-teaching.js +1 -1
- package/dist/types/provider.d.ts +13 -0
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/route.d.ts +37 -1
- package/dist/types/route.d.ts.map +1 -1
- package/dist/types/telemetry.d.ts +31 -0
- package/dist/types/telemetry.d.ts.map +1 -1
- package/dist/validate-cli.d.ts.map +1 -1
- package/dist/validate-cli.js +17 -4
- package/dist/watch/evaluate.d.ts +27 -1
- package/dist/watch/evaluate.d.ts.map +1 -1
- package/dist/watch/evaluate.js +13 -0
- package/dist/watch/proposals.d.ts +28 -0
- package/dist/watch/proposals.d.ts.map +1 -1
- package/dist/watch/proposals.js +51 -0
- package/package.json +1 -1
package/dist/run/run.js
CHANGED
|
@@ -17,6 +17,7 @@ const pricing_1 = require("../registry/pricing");
|
|
|
17
17
|
const failures_1 = require("../types/failures");
|
|
18
18
|
const manifest_1 = require("../routes/manifest");
|
|
19
19
|
const resolve_1 = require("./resolve");
|
|
20
|
+
const variant_1 = require("./variant");
|
|
20
21
|
const envelope_1 = require("./envelope");
|
|
21
22
|
const retry_1 = require("./retry");
|
|
22
23
|
const repair_1 = require("./repair");
|
|
@@ -24,37 +25,9 @@ const grounding_1 = require("./grounding");
|
|
|
24
25
|
const validate_1 = require("./validate");
|
|
25
26
|
const dispatch_1 = require("./dispatch");
|
|
26
27
|
const record_attempt_1 = require("./record-attempt");
|
|
28
|
+
const ladder_key_1 = require("./ladder-key");
|
|
27
29
|
const run_context_1 = require("../artifacts/run-context");
|
|
28
30
|
const capture_write_1 = require("./capture-write");
|
|
29
|
-
/** Look up a named variant; null = default (base config). Unknown names are
|
|
30
|
-
* config errors — the caller asked for something the bundle doesn't define. */
|
|
31
|
-
function resolveVariant(route, name) {
|
|
32
|
-
if (name === undefined || name === "default")
|
|
33
|
-
return null;
|
|
34
|
-
const variant = route.variants.find((v) => v.name === name);
|
|
35
|
-
if (variant === undefined) {
|
|
36
|
-
throw new loader_1.RouteConfigError(`route "${route.route}" has no variant "${name}" — defined: [${route.variants
|
|
37
|
-
.map((v) => v.name)
|
|
38
|
-
.join(", ")}]`);
|
|
39
|
-
}
|
|
40
|
-
return variant;
|
|
41
|
-
}
|
|
42
|
-
/** The variant-effective view of a route: narrowed candidates, overridden
|
|
43
|
-
* json rung, overridden template. Loader validation guarantees variant
|
|
44
|
-
* candidates ⊆ declared candidates, so the candidate-set invariant holds. */
|
|
45
|
-
function effectiveRoute(route, variant) {
|
|
46
|
-
if (variant === null)
|
|
47
|
-
return route;
|
|
48
|
-
return Object.freeze({
|
|
49
|
-
...route,
|
|
50
|
-
candidates: variant.candidates ?? route.candidates,
|
|
51
|
-
systemTemplate: variant.promptOverride ?? route.systemTemplate,
|
|
52
|
-
policy: Object.freeze({
|
|
53
|
-
...route.policy,
|
|
54
|
-
json: variant.json ?? route.policy.json,
|
|
55
|
-
}),
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
31
|
/** Phase 1 prompt convention: the bundle's system template carries the whole
|
|
59
32
|
* task (constitution, data, step instructions); the user turn is a terse
|
|
60
33
|
* trigger. Providers treat long system prompts + short user turns well, and
|
|
@@ -62,19 +35,6 @@ function effectiveRoute(route, variant) {
|
|
|
62
35
|
const USER_DIRECTIVE = "Produce the required output now, following the system instructions exactly.";
|
|
63
36
|
/** User turn for repair calls (WS2) — same terse-trigger convention. */
|
|
64
37
|
const REPAIR_DIRECTIVE = "Produce the corrected JSON object now, following the system instructions exactly.";
|
|
65
|
-
/** Schema coaching for the json_mode rung — ported from the production
|
|
66
|
-
* DeepSeek provider's schema-in-prompt guidance (minLength-is-a-FLOOR etc.). */
|
|
67
|
-
function jsonModeCoaching(schema) {
|
|
68
|
-
return ("\n\n---\nOUTPUT FORMAT (STRICT): Respond with a SINGLE valid JSON object and nothing else — " +
|
|
69
|
-
'no markdown fences, no introductory text, no sign-off. Your response MUST start with "{" and ' +
|
|
70
|
-
'end with "}". Sanitize every nested string so embedded quotes/brackets do not break the root ' +
|
|
71
|
-
"JSON escaping. The object MUST conform to this JSON Schema — match key names and types " +
|
|
72
|
-
"EXACTLY, include ALL required fields, and do not add commentary fields. CRITICAL: where the " +
|
|
73
|
-
"schema sets a minLength on a narrative/prose field, that is a FLOOR, not a target — write " +
|
|
74
|
-
"thorough, non-repetitive analysis that comfortably EXCEEDS the minimum (do not pad with " +
|
|
75
|
-
"repetition; add real substance). When unsure how long to make a prose field, write more, " +
|
|
76
|
-
`not less:\n\n${JSON.stringify(schema)}`);
|
|
77
|
-
}
|
|
78
38
|
/** prefer:[cost] ordering metric — combined input+output USD per million
|
|
79
39
|
* tokens from the pricing snapshot; null (unknown) sorts last in resolve. */
|
|
80
40
|
function costPerMTok(provider, model) {
|
|
@@ -85,10 +45,11 @@ function costPerMTok(provider, model) {
|
|
|
85
45
|
}
|
|
86
46
|
const DEFAULT_SLEEP = (ms) => ms <= 0 ? Promise.resolve() : new Promise((resolve) => setTimeout(resolve, ms));
|
|
87
47
|
async function run(deps, routeName, opts) {
|
|
48
|
+
const mode = deps.mode ?? "live";
|
|
88
49
|
const baseRoute = deps.routes.get(routeName);
|
|
89
|
-
const variant = resolveVariant(baseRoute, opts.variant);
|
|
50
|
+
const variant = (0, variant_1.resolveVariant)(baseRoute, opts.variant, mode);
|
|
90
51
|
const servedVariant = variant?.name ?? null;
|
|
91
|
-
const route = (0, resolve_1.applyRunRequirements)(effectiveRoute(baseRoute, variant), opts.zeroRetention === true);
|
|
52
|
+
const route = (0, resolve_1.applyRunRequirements)((0, variant_1.effectiveRoute)(baseRoute, variant), opts.zeroRetention === true);
|
|
92
53
|
const effectiveTags = route.require.includes("zero_retention") ? { ...opts.tags, zdr_enforced: "true" } : opts.tags;
|
|
93
54
|
// Data-hygiene warning (spec WS5): once per process per dimension.
|
|
94
55
|
(0, manifest_1.warnMissingRequiredDimensions)(deps.manifest ?? null, opts.tags);
|
|
@@ -108,7 +69,10 @@ async function run(deps, routeName, opts) {
|
|
|
108
69
|
// exit that records an inference also records a ground-truth step referencing
|
|
109
70
|
// it (attempt-per-row, ruling c). Inert without a run.start on this path.
|
|
110
71
|
const runCtx = (0, run_context_1.getActiveRunContext)();
|
|
111
|
-
const autoStepKey = runCtx !== null ? runCtx.nextStepKey(route.route) : null;
|
|
72
|
+
const autoStepKey = runCtx !== null ? (0, run_context_1.resolveStepKey)(opts.stepKey, opts.tags.step, () => runCtx.nextStepKey(route.route)) : null;
|
|
73
|
+
// Per-call ladder key (spec §2.1 R0): one call_id, a monotonic attempt_seq per
|
|
74
|
+
// row, and the current candidate_index (advanced by nextCandidate below).
|
|
75
|
+
const ladder = (0, ladder_key_1.createLadderKeyMinter)();
|
|
112
76
|
// Capture-WRITE gate (settings-plane §1.5, closes gate 5): the control-plane
|
|
113
77
|
// capture flag wins over the YAML flag, the task's scrub setting is honored,
|
|
114
78
|
// and capture OFF is a no-op writer (byte-identical). See ./capture-write.ts.
|
|
@@ -126,6 +90,7 @@ async function run(deps, routeName, opts) {
|
|
|
126
90
|
autoStepKey,
|
|
127
91
|
cache: opts.cache,
|
|
128
92
|
droppedCacheHandle,
|
|
93
|
+
ladder,
|
|
129
94
|
});
|
|
130
95
|
function failRun(candidate, failure, latencyMs) {
|
|
131
96
|
recordAttempt({
|
|
@@ -154,6 +119,14 @@ async function run(deps, routeName, opts) {
|
|
|
154
119
|
systemPrompt = originalSystemPrompt + (0, repair_1.repairFeedbackBlock)(errors);
|
|
155
120
|
}
|
|
156
121
|
else {
|
|
122
|
+
// Declare-first backstop (spec §4.4): the loader rejects a `trial` candidate
|
|
123
|
+
// as `repair_model`, but a programmatically-built bundle (runBundle) could
|
|
124
|
+
// bypass the loader — so refuse to mint a trial candidate for LIVE repair
|
|
125
|
+
// here too (the primary ladder's trial-drop has no repair-path equivalent).
|
|
126
|
+
if (mode === "live" &&
|
|
127
|
+
route.candidates.some((c) => c.provider === step.model.provider && c.model === step.model.model && c.trial === true)) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
157
130
|
// Brand stays in resolve.ts; loader validated repairModel ⊆ declared.
|
|
158
131
|
const minted = (0, resolve_1.resolveDeclaredCandidate)(route, step.model);
|
|
159
132
|
if (minted === null)
|
|
@@ -254,6 +227,7 @@ async function run(deps, routeName, opts) {
|
|
|
254
227
|
attemptsByClass: ledger.snapshot(),
|
|
255
228
|
servedVariant,
|
|
256
229
|
repairedBy,
|
|
230
|
+
callId: ladder.callId,
|
|
257
231
|
...(injectedSources !== null
|
|
258
232
|
? { citations: (0, grounding_1.extractCitations)(result.text, injectedSources) }
|
|
259
233
|
: {}),
|
|
@@ -262,8 +236,15 @@ async function run(deps, routeName, opts) {
|
|
|
262
236
|
};
|
|
263
237
|
}
|
|
264
238
|
const searchAvailable = deps.search !== undefined && deps.search !== null;
|
|
265
|
-
const iter = (0, resolve_1.resolveCandidates)(route, deps.capabilities, costPerMTok, searchAvailable, (0, resolve_1.candidateFilterFromOptions)(opts));
|
|
266
|
-
|
|
239
|
+
const iter = (0, resolve_1.resolveCandidates)(route, deps.capabilities, costPerMTok, searchAvailable, (0, resolve_1.candidateFilterFromOptions)(opts), undefined, mode);
|
|
240
|
+
// Advance the iterator AND publish the served candidate's index to the ladder,
|
|
241
|
+
// so every row of this candidate's turn (incl. repair rows) carries it (§2.1).
|
|
242
|
+
const nextCandidate = () => {
|
|
243
|
+
const c = iter.next();
|
|
244
|
+
ladder.setCandidateIndex(iter.index);
|
|
245
|
+
return c;
|
|
246
|
+
};
|
|
247
|
+
let candidate = nextCandidate();
|
|
267
248
|
if (candidate === null) {
|
|
268
249
|
throw new loader_1.RouteConfigError(`route "${route.route}" has no eligible candidate — none of the declared candidates ` +
|
|
269
250
|
`satisfy require=[${route.require.join(", ")}] with json=${route.policy.json}${(0, resolve_1.filterSummary)(opts)}`);
|
|
@@ -294,7 +275,7 @@ async function run(deps, routeName, opts) {
|
|
|
294
275
|
// the next (the invariant guard above already OK'd the pair); nothing
|
|
295
276
|
// dispatched, so nothing billed. All-inert surfaces via the final throw.
|
|
296
277
|
lastFailure = (0, serveability_1.inertCandidateFailure)(candidate, route.route);
|
|
297
|
-
candidate =
|
|
278
|
+
candidate = nextCandidate();
|
|
298
279
|
continue;
|
|
299
280
|
}
|
|
300
281
|
// Render against the SERVING candidate's capability flags.
|
|
@@ -324,14 +305,13 @@ async function run(deps, routeName, opts) {
|
|
|
324
305
|
try {
|
|
325
306
|
searchResponse = await deps.search.search(query);
|
|
326
307
|
guard?.settle(searchResponse.costUsd);
|
|
327
|
-
(0, dispatch_1.recordSearchCostRow)(deps.telemetry, route, effectiveTags, servedVariant, deps.search.id, searchResponse.costUsd);
|
|
308
|
+
(0, dispatch_1.recordSearchCostRow)(deps.telemetry, route, effectiveTags, servedVariant, deps.search.id, searchResponse.costUsd, ladder);
|
|
328
309
|
}
|
|
329
310
|
catch (err) {
|
|
330
311
|
const failure = {
|
|
331
312
|
class: "network",
|
|
332
313
|
message: `grounding search failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
333
|
-
fixHint: "check the search provider key/config (RigConfig.search)",
|
|
334
|
-
cause: err,
|
|
314
|
+
fixHint: "check the search provider key/config (RigConfig.search)", cause: err,
|
|
335
315
|
};
|
|
336
316
|
recordAttempt({
|
|
337
317
|
candidate,
|
|
@@ -342,13 +322,14 @@ async function run(deps, routeName, opts) {
|
|
|
342
322
|
costUsd: 0,
|
|
343
323
|
latencyMs: 0,
|
|
344
324
|
failure,
|
|
325
|
+
rung: "search", // the SEARCH failed, no model was asked — never a candidate dispatch
|
|
345
326
|
});
|
|
346
327
|
lastFailure = failure;
|
|
347
328
|
if (ledger.consume("network")) {
|
|
348
329
|
await sleep(ledger.delayMs("network"));
|
|
349
330
|
continue;
|
|
350
331
|
}
|
|
351
|
-
candidate =
|
|
332
|
+
candidate = nextCandidate();
|
|
352
333
|
continue;
|
|
353
334
|
}
|
|
354
335
|
}
|
|
@@ -360,7 +341,7 @@ async function run(deps, routeName, opts) {
|
|
|
360
341
|
const useJsonModeCoaching = route.outputSchema !== null &&
|
|
361
342
|
(route.policy.json === "json_mode" || !flags.has("structured_native"));
|
|
362
343
|
if (useJsonModeCoaching) {
|
|
363
|
-
systemPrompt += jsonModeCoaching(route.outputSchema);
|
|
344
|
+
systemPrompt += (0, dispatch_1.jsonModeCoaching)(route.outputSchema);
|
|
364
345
|
}
|
|
365
346
|
// Envelope precheck BEFORE dispatch — upper-bound estimate from the
|
|
366
347
|
// pricing snapshot (prompt-length input + full output budget).
|
|
@@ -404,6 +385,7 @@ async function run(deps, routeName, opts) {
|
|
|
404
385
|
attemptsByClass: ledger.snapshot(),
|
|
405
386
|
servedVariant,
|
|
406
387
|
pricingMissing,
|
|
388
|
+
callId: ladder.callId,
|
|
407
389
|
});
|
|
408
390
|
}
|
|
409
391
|
const outcome = (0, validate_1.validateOutput)(route, result.text);
|
|
@@ -440,6 +422,7 @@ async function run(deps, routeName, opts) {
|
|
|
440
422
|
attemptsByClass: ledger.snapshot(),
|
|
441
423
|
servedVariant,
|
|
442
424
|
repairedBy: null,
|
|
425
|
+
callId: ladder.callId,
|
|
443
426
|
...(injectedSources !== null
|
|
444
427
|
? { citations: (0, grounding_1.extractCitations)(result.text, injectedSources) }
|
|
445
428
|
: {}),
|
|
@@ -491,7 +474,7 @@ async function run(deps, routeName, opts) {
|
|
|
491
474
|
if (ledger.consume("content_invalid")) {
|
|
492
475
|
continue; // retry the SAME candidate until the class budget is spent
|
|
493
476
|
}
|
|
494
|
-
candidate =
|
|
477
|
+
candidate = nextCandidate(); // then advance within the declared set
|
|
495
478
|
continue;
|
|
496
479
|
}
|
|
497
480
|
// Adapter-level typed failure. F1: refusals/truncations that BILLED
|
|
@@ -531,7 +514,7 @@ async function run(deps, routeName, opts) {
|
|
|
531
514
|
await sleep(ledger.delayMs(failure.class));
|
|
532
515
|
continue; // retry the SAME candidate
|
|
533
516
|
}
|
|
534
|
-
candidate =
|
|
517
|
+
candidate = nextCandidate(); // class budget spent — advance candidate
|
|
535
518
|
}
|
|
536
519
|
throw new failures_1.RigFailureError(lastFailure ?? {
|
|
537
520
|
class: "network",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variant resolution — extracted from run.ts (spec §4.4, R3) to host the
|
|
3
|
+
* declare-first "a trial variant selected live is a config error" rule and to
|
|
4
|
+
* keep run.ts under the LOC cap. Pure: bundle + requested name (+ run mode) →
|
|
5
|
+
* the resolved variant and the variant-effective route view.
|
|
6
|
+
*/
|
|
7
|
+
import type { RouteBundle, RouteVariant } from "../types/route";
|
|
8
|
+
import type { RunMode } from "./resolve";
|
|
9
|
+
/**
|
|
10
|
+
* A variant is trial-only when it has candidates and EVERY one maps to a
|
|
11
|
+
* declared `trial` candidate. Computed dynamically from `route.candidates`
|
|
12
|
+
* rather than trusted from the stored `variant.trialOnly` stamp, so a bundle
|
|
13
|
+
* built in code — a programmatic `runBundle` whose variants never passed
|
|
14
|
+
* through the loader that sets the flag — is judged exactly like a loaded one
|
|
15
|
+
* (and still earns the teaching error on a live trial selection). The loader's
|
|
16
|
+
* stamp, when present, is honored as a fast path.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isTrialOnlyVariant(route: RouteBundle, variant: RouteVariant): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Look up a named variant; null = default (base config). Unknown names are
|
|
21
|
+
* config errors — the caller asked for something the bundle doesn't define.
|
|
22
|
+
*
|
|
23
|
+
* Declare-first (spec §4.4): a `trialOnly` variant — one whose candidates are
|
|
24
|
+
* ALL declared `trial` candidates — is valid only in bake-off replay
|
|
25
|
+
* (`mode: "trial"`). Selecting it on a LIVE path is a `RouteConfigError` with a
|
|
26
|
+
* teaching message that names the bake-off, never a silent fallback (residual
|
|
27
|
+
* flag F2′): the run loop must not dispatch an undeclared OR trial model live.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveVariant(route: RouteBundle, name: string | undefined, mode?: RunMode): RouteVariant | null;
|
|
30
|
+
/**
|
|
31
|
+
* The variant-effective view of a route: narrowed candidates, overridden json
|
|
32
|
+
* rung, overridden template. Loader validation guarantees variant candidates ⊆
|
|
33
|
+
* declared candidates, so the candidate-set invariant holds.
|
|
34
|
+
*
|
|
35
|
+
* Declare-first (spec §4.4): a variant's `candidates` entries are authored as
|
|
36
|
+
* bare `{provider, model}` and do NOT carry the route-level `trial` flag. We
|
|
37
|
+
* MUST re-attach it from the matching declared candidate — otherwise a variant
|
|
38
|
+
* that narrows to a trial candidate (e.g. a mixed trial+live variant, which is
|
|
39
|
+
* not `trialOnly` and IS selectable live) would strip the flag and
|
|
40
|
+
* `resolveCandidates`' live trial-drop would let the trial model serve live.
|
|
41
|
+
*/
|
|
42
|
+
export declare function effectiveRoute(route: RouteBundle, variant: RouteVariant | null): RouteBundle;
|
|
43
|
+
//# sourceMappingURL=variant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variant.d.ts","sourceRoot":"","sources":["../../src/run/variant.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAYrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,GAAE,OAAgB,GACrB,YAAY,GAAG,IAAI,CAkBrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,GAAG,WAAW,CAoB5F"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Variant resolution — extracted from run.ts (spec §4.4, R3) to host the
|
|
4
|
+
* declare-first "a trial variant selected live is a config error" rule and to
|
|
5
|
+
* keep run.ts under the LOC cap. Pure: bundle + requested name (+ run mode) →
|
|
6
|
+
* the resolved variant and the variant-effective route view.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.isTrialOnlyVariant = isTrialOnlyVariant;
|
|
10
|
+
exports.resolveVariant = resolveVariant;
|
|
11
|
+
exports.effectiveRoute = effectiveRoute;
|
|
12
|
+
const loader_1 = require("../routes/loader");
|
|
13
|
+
/**
|
|
14
|
+
* A variant is trial-only when it has candidates and EVERY one maps to a
|
|
15
|
+
* declared `trial` candidate. Computed dynamically from `route.candidates`
|
|
16
|
+
* rather than trusted from the stored `variant.trialOnly` stamp, so a bundle
|
|
17
|
+
* built in code — a programmatic `runBundle` whose variants never passed
|
|
18
|
+
* through the loader that sets the flag — is judged exactly like a loaded one
|
|
19
|
+
* (and still earns the teaching error on a live trial selection). The loader's
|
|
20
|
+
* stamp, when present, is honored as a fast path.
|
|
21
|
+
*/
|
|
22
|
+
function isTrialOnlyVariant(route, variant) {
|
|
23
|
+
if (variant.trialOnly === true)
|
|
24
|
+
return true;
|
|
25
|
+
const cands = variant.candidates;
|
|
26
|
+
return (cands !== undefined &&
|
|
27
|
+
cands.length > 0 &&
|
|
28
|
+
cands.every((vc) => route.candidates.some((rc) => rc.provider === vc.provider && rc.model === vc.model && rc.trial === true)));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Look up a named variant; null = default (base config). Unknown names are
|
|
32
|
+
* config errors — the caller asked for something the bundle doesn't define.
|
|
33
|
+
*
|
|
34
|
+
* Declare-first (spec §4.4): a `trialOnly` variant — one whose candidates are
|
|
35
|
+
* ALL declared `trial` candidates — is valid only in bake-off replay
|
|
36
|
+
* (`mode: "trial"`). Selecting it on a LIVE path is a `RouteConfigError` with a
|
|
37
|
+
* teaching message that names the bake-off, never a silent fallback (residual
|
|
38
|
+
* flag F2′): the run loop must not dispatch an undeclared OR trial model live.
|
|
39
|
+
*/
|
|
40
|
+
function resolveVariant(route, name, mode = "live") {
|
|
41
|
+
if (name === undefined || name === "default")
|
|
42
|
+
return null;
|
|
43
|
+
const variant = route.variants.find((v) => v.name === name);
|
|
44
|
+
if (variant === undefined) {
|
|
45
|
+
throw new loader_1.RouteConfigError(`route "${route.route}" has no variant "${name}" — defined: [${route.variants
|
|
46
|
+
.map((v) => v.name)
|
|
47
|
+
.join(", ")}]`);
|
|
48
|
+
}
|
|
49
|
+
if (mode === "live" && isTrialOnlyVariant(route, variant)) {
|
|
50
|
+
throw new loader_1.RouteConfigError(`route "${route.route}" variant "${name}" is a trial variant (all its candidates are declared ` +
|
|
51
|
+
`trial: true) — trial variants are declared but never served live. Measure it with a bake-off ` +
|
|
52
|
+
`(rig.bakeoff / "Run bake-off" in the console), then promote the winner to a live candidate.`);
|
|
53
|
+
}
|
|
54
|
+
return variant;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The variant-effective view of a route: narrowed candidates, overridden json
|
|
58
|
+
* rung, overridden template. Loader validation guarantees variant candidates ⊆
|
|
59
|
+
* declared candidates, so the candidate-set invariant holds.
|
|
60
|
+
*
|
|
61
|
+
* Declare-first (spec §4.4): a variant's `candidates` entries are authored as
|
|
62
|
+
* bare `{provider, model}` and do NOT carry the route-level `trial` flag. We
|
|
63
|
+
* MUST re-attach it from the matching declared candidate — otherwise a variant
|
|
64
|
+
* that narrows to a trial candidate (e.g. a mixed trial+live variant, which is
|
|
65
|
+
* not `trialOnly` and IS selectable live) would strip the flag and
|
|
66
|
+
* `resolveCandidates`' live trial-drop would let the trial model serve live.
|
|
67
|
+
*/
|
|
68
|
+
function effectiveRoute(route, variant) {
|
|
69
|
+
if (variant === null)
|
|
70
|
+
return route;
|
|
71
|
+
const candidates = variant.candidates === undefined
|
|
72
|
+
? route.candidates
|
|
73
|
+
: variant.candidates.map((vc) => {
|
|
74
|
+
const declared = route.candidates.find((c) => c.provider === vc.provider && c.model === vc.model);
|
|
75
|
+
return declared?.trial === true ? { ...vc, trial: true } : vc;
|
|
76
|
+
});
|
|
77
|
+
return Object.freeze({
|
|
78
|
+
...route,
|
|
79
|
+
candidates,
|
|
80
|
+
systemTemplate: variant.promptOverride ?? route.systemTemplate,
|
|
81
|
+
policy: Object.freeze({
|
|
82
|
+
...route.policy,
|
|
83
|
+
json: variant.json ?? route.policy.json,
|
|
84
|
+
}),
|
|
85
|
+
});
|
|
86
|
+
}
|
package/dist/savings/emit.d.ts
CHANGED
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
* greps for it.
|
|
7
7
|
*/
|
|
8
8
|
import type { CandidateSpec, RouteBundle } from "../types/route";
|
|
9
|
+
/** A challenger to declare/promote — just the identifying pair. Loose on purpose
|
|
10
|
+
* (`provider: string`): a challenger comes from a stored proposal or the picker,
|
|
11
|
+
* where the provider is already validated, and the emitters only render YAML. */
|
|
12
|
+
export interface ChallengerRef {
|
|
13
|
+
readonly provider: string;
|
|
14
|
+
readonly model: string;
|
|
15
|
+
}
|
|
9
16
|
export interface SwapChange {
|
|
10
17
|
readonly route: string;
|
|
11
18
|
readonly file: string;
|
|
@@ -34,5 +41,31 @@ export declare function buildRestoreYaml(route: string, incumbent: readonly {
|
|
|
34
41
|
readonly provider: string;
|
|
35
42
|
readonly model: string;
|
|
36
43
|
}[], currentVersion: number): string;
|
|
44
|
+
/** The paste-ready change that DECLARES a `trial` challenger (routing-console
|
|
45
|
+
* spec §4.4, declare step). Additive-only: nothing existing is removed. */
|
|
46
|
+
export interface DeclareTrialChange {
|
|
47
|
+
readonly route: string;
|
|
48
|
+
readonly file: string;
|
|
49
|
+
readonly challenger: ChallengerRef;
|
|
50
|
+
/** The auto-named trial variant a bake-off replays (`trial-<provider>-<model>`). */
|
|
51
|
+
readonly trialVariant: string;
|
|
52
|
+
readonly newVersion: number;
|
|
53
|
+
/** Paste-ready YAML: version bump + full candidates block (challenger appended
|
|
54
|
+
* with `trial: true`) + the trial variant to add. Complete, no elisions (A4). */
|
|
55
|
+
readonly yaml: string;
|
|
56
|
+
}
|
|
57
|
+
/** A stable, YAML-safe trial variant name for a challenger. */
|
|
58
|
+
export declare function trialVariantName(challenger: ChallengerRef): string;
|
|
59
|
+
/**
|
|
60
|
+
* Emit the declare-first YAML that adds a `trial` challenger to a route (spec
|
|
61
|
+
* §4.4 step 1): the challenger appended to `candidates` with `trial: true`, a
|
|
62
|
+
* `trial-<provider>-<model>` variant that narrows to it, and `version: n+1`. The
|
|
63
|
+
* challenger is DECLARED but never served live (the loader/resolver enforce
|
|
64
|
+
* that) — so a bake-off can measure it on real traffic before promotion. Pure,
|
|
65
|
+
* no filesystem (emit.test.ts greps for that). Throws when the challenger is
|
|
66
|
+
* already a declared candidate — you don't declare what's already declared (the
|
|
67
|
+
* server maps this to 422).
|
|
68
|
+
*/
|
|
69
|
+
export declare function buildDeclareTrialChange(bundle: RouteBundle, challenger: ChallengerRef): DeclareTrialChange;
|
|
37
70
|
export declare function buildSwapChange(bundle: RouteBundle, winningVariant: string): SwapChange;
|
|
38
71
|
//# sourceMappingURL=emit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/savings/emit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAgB,MAAM,gBAAgB,CAAC;AAE/E,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,S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AAE,EAAE,EAC3E,cAAc,EAAE,MAAM,GACrB,MAAM,CAgBR;AAED;2EAC2E;AAC3E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,oFAAoF;IACpF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;qFACiF;IACjF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,aAAa,GAAG,MAAM,CAElE;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,GAAG,kBAAkB,CAiC1G;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,UAAU,CAgEvF"}
|
package/dist/savings/emit.js
CHANGED
|
@@ -8,9 +8,19 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.buildRestoreYaml = buildRestoreYaml;
|
|
11
|
+
exports.trialVariantName = trialVariantName;
|
|
12
|
+
exports.buildDeclareTrialChange = buildDeclareTrialChange;
|
|
11
13
|
exports.buildSwapChange = buildSwapChange;
|
|
12
14
|
function candidateLines(candidates) {
|
|
13
|
-
|
|
15
|
+
// Preserve a candidate's `trial: true` (declare-first, spec §4.4) so an
|
|
16
|
+
// emitted candidates block never silently promotes a DECLARED-trial candidate
|
|
17
|
+
// to live. The promote path drops the flag from the WINNER explicitly (it
|
|
18
|
+
// passes a winner entry without `trial`), never here.
|
|
19
|
+
return candidates.flatMap((c) => [
|
|
20
|
+
` - provider: ${c.provider}`,
|
|
21
|
+
` model: ${c.model}`,
|
|
22
|
+
...(c.trial === true ? [" trial: true"] : []),
|
|
23
|
+
]);
|
|
14
24
|
}
|
|
15
25
|
function overrideLines(variant) {
|
|
16
26
|
const lines = [];
|
|
@@ -57,26 +67,88 @@ function buildRestoreYaml(route, incumbent, currentVersion) {
|
|
|
57
67
|
"",
|
|
58
68
|
].join("\n");
|
|
59
69
|
}
|
|
70
|
+
/** A stable, YAML-safe trial variant name for a challenger. */
|
|
71
|
+
function trialVariantName(challenger) {
|
|
72
|
+
return `trial-${challenger.provider}-${challenger.model}`.replace(/[^A-Za-z0-9._-]/g, "-");
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Emit the declare-first YAML that adds a `trial` challenger to a route (spec
|
|
76
|
+
* §4.4 step 1): the challenger appended to `candidates` with `trial: true`, a
|
|
77
|
+
* `trial-<provider>-<model>` variant that narrows to it, and `version: n+1`. The
|
|
78
|
+
* challenger is DECLARED but never served live (the loader/resolver enforce
|
|
79
|
+
* that) — so a bake-off can measure it on real traffic before promotion. Pure,
|
|
80
|
+
* no filesystem (emit.test.ts greps for that). Throws when the challenger is
|
|
81
|
+
* already a declared candidate — you don't declare what's already declared (the
|
|
82
|
+
* server maps this to 422).
|
|
83
|
+
*/
|
|
84
|
+
function buildDeclareTrialChange(bundle, challenger) {
|
|
85
|
+
if (bundle.candidates.some((c) => c.provider === challenger.provider && c.model === challenger.model)) {
|
|
86
|
+
throw new Error(`${challenger.provider}/${challenger.model} is already a declared candidate on "${bundle.route}" — ` +
|
|
87
|
+
"nothing to declare (pick a model that is not yet in the route to trial it)");
|
|
88
|
+
}
|
|
89
|
+
const file = `modelrig/routes/${bundle.route}.yaml`;
|
|
90
|
+
const newVersion = bundle.version + 1;
|
|
91
|
+
const variant = trialVariantName(challenger);
|
|
92
|
+
const newCandidates = [...bundle.candidates, { ...challenger, trial: true }];
|
|
93
|
+
const yaml = [
|
|
94
|
+
`# declare a trial of ${challenger.provider}/${challenger.model} on ${bundle.route}`,
|
|
95
|
+
`# a trial candidate is DECLARED but NEVER served live — a bake-off measures it, then Promote makes it live.`,
|
|
96
|
+
`# apply to ${file}:`,
|
|
97
|
+
`# 1) bump the version`,
|
|
98
|
+
`version: ${newVersion}`,
|
|
99
|
+
`# 2) replace your candidates: block with this (the challenger is appended and marked for trial)`,
|
|
100
|
+
"candidates:",
|
|
101
|
+
...candidateLines(newCandidates),
|
|
102
|
+
`# 3) add this entry to your variants: block (create the block if the route has none)`,
|
|
103
|
+
"variants:",
|
|
104
|
+
` - name: ${variant}`,
|
|
105
|
+
" candidates:",
|
|
106
|
+
` - provider: ${challenger.provider}`,
|
|
107
|
+
` model: ${challenger.model}`,
|
|
108
|
+
`# Requires the modelrig SDK release that understands \`trial:\` — an older SDK ignores the flag and`,
|
|
109
|
+
`# would serve the model live. Bake it off with: modelrig bakeoff --from-proposal <id>`,
|
|
110
|
+
"",
|
|
111
|
+
].join("\n");
|
|
112
|
+
return { route: bundle.route, file, challenger, trialVariant: variant, newVersion, yaml };
|
|
113
|
+
}
|
|
60
114
|
function buildSwapChange(bundle, winningVariant) {
|
|
61
115
|
const variant = bundle.variants.find((v) => v.name === winningVariant);
|
|
62
116
|
if (variant === undefined) {
|
|
63
117
|
throw new Error(`route "${bundle.route}" has no variant "${winningVariant}" — cannot emit a swap for it`);
|
|
64
118
|
}
|
|
65
|
-
|
|
119
|
+
// Promote drops `trial: true` from the WINNER and moves it to position 0. The
|
|
120
|
+
// flag is stripped EXPLICITLY here (not merely relied upon being absent from a
|
|
121
|
+
// bare variant candidate) so a hand-authored `trial: true` inside the variant's
|
|
122
|
+
// candidate block can never leave the promoted winner as a trial candidate — a
|
|
123
|
+
// silent no-op promotion where the "promoted" model is then dropped live. Other
|
|
124
|
+
// declared candidates keep their own trial flags (candidateLines preserves them).
|
|
125
|
+
const winners = (variant.candidates ?? bundle.candidates).map((c) => ({
|
|
126
|
+
provider: c.provider,
|
|
127
|
+
model: c.model,
|
|
128
|
+
}));
|
|
66
129
|
if (winners.length === 0) {
|
|
67
130
|
throw new Error(`variant "${winningVariant}" has no candidates to promote`);
|
|
68
131
|
}
|
|
69
132
|
const incumbent = bundle.candidates[0];
|
|
133
|
+
// Trial-winner promotes also remove the now-redundant trial variant (spec §4.4).
|
|
134
|
+
const isTrialPromotion = variant.trialOnly === true;
|
|
70
135
|
const promoted = promotedOrder(bundle.candidates, winners);
|
|
71
136
|
const file = `modelrig/routes/${bundle.route}.yaml`;
|
|
72
137
|
const newVersion = bundle.version + 1;
|
|
138
|
+
const applyComment = isTrialPromotion
|
|
139
|
+
? `# apply to ${file} — replace version + candidates, and REMOVE the trial variant "${winningVariant}" from variants:`
|
|
140
|
+
: `# apply to ${file} — replace the version and candidates fields; nothing else changes`;
|
|
141
|
+
const trialRemovalLine = isTrialPromotion
|
|
142
|
+
? [`# remove this now-promoted trial variant from variants: (its candidate is live at position 0 above):`, `# - name: ${winningVariant}`]
|
|
143
|
+
: [];
|
|
73
144
|
const yaml = [
|
|
74
145
|
`# swap: serve ${bundle.route} on ${winners[0].provider}/${winners[0].model}`,
|
|
75
|
-
|
|
146
|
+
applyComment,
|
|
76
147
|
`version: ${newVersion}`,
|
|
77
148
|
"candidates:",
|
|
78
149
|
...candidateLines(promoted),
|
|
79
150
|
...overrideLines(variant),
|
|
151
|
+
...trialRemovalLine,
|
|
80
152
|
"",
|
|
81
153
|
].join("\n");
|
|
82
154
|
const revertYaml = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../src/telemetry/exporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,C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
|
|
94
94
|
tokens_cache_write_1h: row.tokensCacheWrite1h ?? 0,
|
|
95
95
|
cache_key: row.cacheKey ?? null,
|
|
96
96
|
prefix_fingerprint: row.prefixFingerprint ?? null,
|
|
97
|
+
// Ladder key (spec §2.1 R0) — spread-iff-present: a row without it (pre-0.4.0
|
|
98
|
+
// SDK, read back as null) emits NO key, so the wire payload is byte-identical
|
|
99
|
+
// to before R0 and the server leaves the column null.
|
|
100
|
+
...(row.callId != null ? { call_id: row.callId } : {}),
|
|
101
|
+
...(row.attemptSeq != null ? { attempt_seq: row.attemptSeq } : {}),
|
|
102
|
+
...(row.candidateIndex != null ? { candidate_index: row.candidateIndex } : {}),
|
|
97
103
|
};
|
|
98
104
|
}
|
|
99
105
|
function toWireRun(row) {
|
|
@@ -83,6 +83,13 @@ export interface WireInference {
|
|
|
83
83
|
readonly tokens_cache_write_1h?: number;
|
|
84
84
|
readonly cache_key?: string | null;
|
|
85
85
|
readonly prefix_fingerprint?: string | null;
|
|
86
|
+
/** Per-call ladder key (routing-console spec §2.1 R0). OPTIONAL on the wire and
|
|
87
|
+
* OMITTED when unset (spread-iff-present in the exporter), so an older SDK's
|
|
88
|
+
* payload is byte-identical and the server defaults the columns to null.
|
|
89
|
+
* `attempt_seq ≥ 1`, `candidate_index ≥ 0` (ingest.validInference). */
|
|
90
|
+
readonly call_id?: string;
|
|
91
|
+
readonly attempt_seq?: number;
|
|
92
|
+
readonly candidate_index?: number;
|
|
86
93
|
}
|
|
87
94
|
export interface WireFeedback {
|
|
88
95
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest-protocol.d.ts","sourceRoot":"","sources":["../../src/telemetry/ingest-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B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5B;2EACuE;IACvE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,EAAE,CAgT7E;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,YAAY,EAAE,EAC7B,QAAQ,EAAE,MAAM,GACf,SAAS,MAAM,EAAE,CAInB;AAED;;oBAEoB;AACpB,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD;qCACiC;IACjC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-error-report.d.ts","sourceRoot":"","sources":["../../src/telemetry/load-error-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOpD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"load-error-report.d.ts","sourceRoot":"","sources":["../../src/telemetry/load-error-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOpD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAsBhF"}
|
|
@@ -35,7 +35,10 @@ function reportLoadError(config, error) {
|
|
|
35
35
|
// name/dimensions/contribution so the reporting upsert doesn't blank them.
|
|
36
36
|
let manifestMeta = null;
|
|
37
37
|
try {
|
|
38
|
-
|
|
38
|
+
// routesDir === null is a runRaw-only rig with no manifest (CE-8); it never
|
|
39
|
+
// reaches here (load errors come from the string path), so null ⇒ no meta.
|
|
40
|
+
if (config.routesDir !== null)
|
|
41
|
+
manifestMeta = (0, manifest_1.loadManifest)((0, node_path_1.dirname)(config.routesDir));
|
|
39
42
|
}
|
|
40
43
|
catch {
|
|
41
44
|
// rig.yaml is itself broken/absent; fall back to source-id naming so the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otel-map.d.ts","sourceRoot":"","sources":["../../src/telemetry/otel-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;4EAC4E;AAC5E,eAAO,MAAM,eAAe,WAAW,CAAC;AAMxC;sCACsC;AACtC,QAAA,MAAM,YAAY,IAAI,CAAC;AACvB,QAAA,MAAM,YAAY,IAAI,CAAC;AAGvB,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAA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