modelrig 0.11.1 → 0.12.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 +34 -0
- package/dist/adapters/anthropic.d.ts +4 -4
- package/dist/adapters/anthropic.d.ts.map +1 -1
- package/dist/adapters/anthropic.js +8 -1
- package/dist/adapters/deepseek.d.ts +2 -4
- package/dist/adapters/deepseek.d.ts.map +1 -1
- package/dist/adapters/deepseek.js +9 -5
- package/dist/adapters/gemini.d.ts +4 -1
- package/dist/adapters/gemini.d.ts.map +1 -1
- package/dist/adapters/gemini.js +16 -1
- package/dist/adapters/grok.d.ts +2 -4
- package/dist/adapters/grok.d.ts.map +1 -1
- package/dist/adapters/grok.js +8 -4
- package/dist/adapters/history-mapping.d.ts +126 -0
- package/dist/adapters/history-mapping.d.ts.map +1 -0
- package/dist/adapters/history-mapping.js +230 -0
- package/dist/adapters/openai-compat.d.ts +2 -4
- package/dist/adapters/openai-compat.d.ts.map +1 -1
- package/dist/adapters/openai-compat.js +9 -5
- package/dist/adapters/openai.d.ts +2 -4
- package/dist/adapters/openai.d.ts.map +1 -1
- package/dist/adapters/openai.js +8 -4
- package/dist/adapters/responses-api.d.ts.map +1 -1
- package/dist/adapters/responses-api.js +9 -4
- package/dist/artifacts/artifact.d.ts.map +1 -1
- package/dist/artifacts/artifact.js +79 -0
- package/dist/artifacts/conversation.d.ts +128 -0
- package/dist/artifacts/conversation.d.ts.map +1 -0
- package/dist/artifacts/conversation.js +172 -0
- package/dist/artifacts/index.d.ts +1 -1
- package/dist/artifacts/index.d.ts.map +1 -1
- package/dist/artifacts/media.d.ts +46 -0
- package/dist/artifacts/media.d.ts.map +1 -0
- package/dist/artifacts/media.js +88 -0
- package/dist/artifacts/run-context.d.ts +61 -2
- package/dist/artifacts/run-context.d.ts.map +1 -1
- package/dist/artifacts/run-context.js +183 -12
- package/dist/artifacts/scrub.d.ts +3 -0
- package/dist/artifacts/scrub.d.ts.map +1 -1
- package/dist/bakeoff/engine.d.ts.map +1 -1
- package/dist/bakeoff/engine.js +34 -7
- package/dist/bakeoff/eval-cases.d.ts +5 -0
- package/dist/bakeoff/eval-cases.d.ts.map +1 -1
- package/dist/bakeoff/eval-cases.js +10 -1
- package/dist/bakeoff/replay.d.ts +15 -0
- package/dist/bakeoff/replay.d.ts.map +1 -1
- package/dist/bakeoff/replay.js +19 -1
- package/dist/bakeoff/report.d.ts.map +1 -1
- package/dist/bakeoff/report.js +9 -2
- package/dist/bakeoff/turn-replay.d.ts +93 -0
- package/dist/bakeoff/turn-replay.d.ts.map +1 -0
- package/dist/bakeoff/turn-replay.js +150 -0
- package/dist/bakeoff/types.d.ts +12 -0
- package/dist/bakeoff/types.d.ts.map +1 -1
- package/dist/feedback/grade.d.ts +7 -2
- package/dist/feedback/grade.d.ts.map +1 -1
- package/dist/feedback/grade.js +14 -0
- package/dist/feedback/outcome.d.ts +103 -0
- package/dist/feedback/outcome.d.ts.map +1 -0
- package/dist/feedback/outcome.js +175 -0
- package/dist/gateway/history-bridge.d.ts +32 -0
- package/dist/gateway/history-bridge.d.ts.map +1 -0
- package/dist/gateway/history-bridge.js +64 -0
- package/dist/gateway/serve-client.d.ts.map +1 -1
- package/dist/gateway/serve-client.js +6 -0
- package/dist/index.d.ts +44 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +106 -6
- package/dist/init/observe.d.ts.map +1 -1
- package/dist/init/observe.js +3 -3
- package/dist/registry/build.d.ts +4 -0
- package/dist/registry/build.d.ts.map +1 -1
- package/dist/registry/generation-models.d.ts +68 -0
- package/dist/registry/generation-models.d.ts.map +1 -0
- package/dist/registry/generation-models.js +168 -0
- package/dist/registry/model-kind.d.ts +34 -0
- package/dist/registry/model-kind.d.ts.map +1 -0
- package/dist/registry/model-kind.js +40 -0
- package/dist/registry/pricing-shape.d.ts +29 -1
- package/dist/registry/pricing-shape.d.ts.map +1 -1
- package/dist/registry/pricing-shape.js +9 -0
- package/dist/registry/pricing.d.ts +26 -0
- package/dist/registry/pricing.d.ts.map +1 -1
- package/dist/registry/pricing.js +29 -0
- package/dist/registry/rows.d.ts.map +1 -1
- package/dist/registry/rows.js +3 -1
- package/dist/registry/unit-pricing.d.ts +32 -0
- package/dist/registry/unit-pricing.d.ts.map +1 -0
- package/dist/registry/unit-pricing.js +62 -0
- package/dist/routes/input-loader.d.ts +38 -0
- package/dist/routes/input-loader.d.ts.map +1 -0
- package/dist/routes/input-loader.js +80 -0
- package/dist/routes/loader.d.ts.map +1 -1
- package/dist/routes/loader.js +3 -0
- package/dist/routes/resolved-bundle.d.ts +2 -0
- package/dist/routes/resolved-bundle.d.ts.map +1 -1
- package/dist/routes/resolved-bundle.js +3 -0
- package/dist/run/cost.d.ts +28 -0
- package/dist/run/cost.d.ts.map +1 -1
- package/dist/run/cost.js +74 -0
- package/dist/run/dispatch.d.ts +4 -1
- package/dist/run/dispatch.d.ts.map +1 -1
- package/dist/run/dispatch.js +3 -0
- package/dist/run/limits.d.ts +88 -0
- package/dist/run/limits.d.ts.map +1 -0
- package/dist/run/limits.js +155 -0
- package/dist/run/messages.d.ts +199 -0
- package/dist/run/messages.d.ts.map +1 -0
- package/dist/run/messages.js +430 -0
- package/dist/run/raw-finalize.d.ts +5 -2
- package/dist/run/raw-finalize.d.ts.map +1 -1
- package/dist/run/raw-finalize.js +8 -5
- package/dist/run/raw-request.d.ts.map +1 -1
- package/dist/run/raw-request.js +2 -1
- package/dist/run/raw.d.ts +10 -4
- package/dist/run/raw.d.ts.map +1 -1
- package/dist/run/raw.js +11 -3
- package/dist/run/record-attempt.d.ts.map +1 -1
- package/dist/run/record-attempt.js +16 -6
- package/dist/run/record-call.d.ts +13 -2
- package/dist/run/record-call.d.ts.map +1 -1
- package/dist/run/record-call.js +50 -7
- package/dist/run/run.d.ts.map +1 -1
- package/dist/run/run.js +12 -8
- package/dist/telemetry/attempt-meta.d.ts +49 -1
- package/dist/telemetry/attempt-meta.d.ts.map +1 -1
- package/dist/telemetry/attempt-meta.js +45 -1
- package/dist/telemetry/exporter.d.ts.map +1 -1
- package/dist/telemetry/exporter.js +2 -1
- package/dist/telemetry/grade-mappers.d.ts +1 -1
- package/dist/telemetry/grade-mappers.d.ts.map +1 -1
- package/dist/telemetry/grade-mappers.js +7 -1
- package/dist/telemetry/grade-task.d.ts +49 -0
- package/dist/telemetry/grade-task.d.ts.map +1 -0
- package/dist/telemetry/grade-task.js +85 -0
- package/dist/telemetry/grades-sql.d.ts +16 -1
- package/dist/telemetry/grades-sql.d.ts.map +1 -1
- package/dist/telemetry/grades-sql.js +64 -4
- package/dist/telemetry/ingest-protocol.d.ts +24 -1
- package/dist/telemetry/ingest-protocol.d.ts.map +1 -1
- package/dist/telemetry/ingest-protocol.js +72 -43
- package/dist/telemetry/otel-content.d.ts +31 -0
- package/dist/telemetry/otel-content.d.ts.map +1 -0
- package/dist/telemetry/otel-content.js +106 -0
- package/dist/telemetry/otel-hierarchy.d.ts +57 -0
- package/dist/telemetry/otel-hierarchy.d.ts.map +1 -0
- package/dist/telemetry/otel-hierarchy.js +155 -0
- package/dist/telemetry/otel-normalize.d.ts +15 -1
- package/dist/telemetry/otel-normalize.d.ts.map +1 -1
- package/dist/telemetry/otel-normalize.js +24 -39
- package/dist/telemetry/sinks.d.ts +4 -1
- package/dist/telemetry/sinks.d.ts.map +1 -1
- package/dist/telemetry/sinks.js +53 -34
- package/dist/telemetry/store-migrations.d.ts.map +1 -1
- package/dist/telemetry/store-migrations.js +8 -0
- package/dist/telemetry/store.d.ts +9 -0
- package/dist/telemetry/store.d.ts.map +1 -1
- package/dist/telemetry/store.js +10 -0
- package/dist/telemetry/uniform-rows.d.ts +43 -0
- package/dist/telemetry/uniform-rows.d.ts.map +1 -0
- package/dist/telemetry/uniform-rows.js +139 -0
- package/dist/types/failures-teaching.d.ts.map +1 -1
- package/dist/types/failures-teaching.js +11 -0
- package/dist/types/failures.d.ts +1 -1
- package/dist/types/failures.d.ts.map +1 -1
- package/dist/types/failures.js +2 -0
- package/dist/types/provider.d.ts +12 -0
- package/dist/types/provider.d.ts.map +1 -1
- package/dist/types/route.d.ts +13 -0
- package/dist/types/route.d.ts.map +1 -1
- package/dist/types/telemetry.d.ts +14 -1
- package/dist/types/telemetry.d.ts.map +1 -1
- package/docs/agent-skill/SKILL.md +16 -3
- package/docs/how-it-fits.md +3 -3
- package/docs/instrumentation.md +15 -6
- package/docs/llms.txt +55 -7
- package/docs/mcp-oracle.md +15 -4
- package/docs/quickstart.md +6 -5
- package/package.json +4 -2
- package/registry/registry.json +456 -0
- package/templates/creative-approval.json +81 -0
- package/templates/support-conversation.json +82 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Uniform key sets for `stampBatch`'s bulk writes (COV-1c). Extracted from
|
|
3
|
+
* ingest-protocol.ts so stampBatch stays under the LOC cap (P1).
|
|
4
|
+
*
|
|
5
|
+
* A PostgREST bulk insert requires every row in the array to carry the SAME
|
|
6
|
+
* keys — one row that omits a key the others carry fails the whole POST with
|
|
7
|
+
* PGRST102 ("All object keys must match") before any SQL runs. The wire is
|
|
8
|
+
* spread-iff-present by design (an older SDK's payload stays byte-identical),
|
|
9
|
+
* so rows in one batch legitimately differ: a web-search surcharge row carries
|
|
10
|
+
* `meta: null` (no `meta` key after validation) beside metered rows that carry
|
|
11
|
+
* one. Two remedies, chosen by the write's conflict policy:
|
|
12
|
+
*
|
|
13
|
+
* - merge=false (an immutable fact: inferences, steps, artifacts) — FILL every
|
|
14
|
+
* absent optional column with its DB default (null, or the NOT NULL column's
|
|
15
|
+
* default). Safe because ignore-duplicates never rewrites a landed row.
|
|
16
|
+
* - merge=true (a mutable projection: tasks, runs) — SPLIT into one write per
|
|
17
|
+
* key set (the routes precedent). Filling would null out a column a merge
|
|
18
|
+
* upsert must leave untouched.
|
|
19
|
+
*
|
|
20
|
+
* `undefined` values count as absent: JSON.stringify drops the key, so a row
|
|
21
|
+
* holding `{ meta: undefined }` reaches PostgREST without `meta`.
|
|
22
|
+
*/
|
|
23
|
+
import type { Tenancy, WireInference } from "./ingest-protocol";
|
|
24
|
+
/** Every `inferences` column the wire can carry, plus the stamped tenancy. ONE
|
|
25
|
+
* list — the uniform key set of every inferences write. */
|
|
26
|
+
export declare const INFERENCE_WRITE_COLUMNS: readonly ["org_id", "project_id", "source_id", "id", "ts", "route", "route_version", "provider", "model", "requested_tier", "served_tier", "tokens_in", "tokens_out", "tokens_cached", "cost_estimate_usd", "latency_ms", "ttfb_ms", "failure_class", "attempts", "tags", "fingerprint_cell", "served_variant", "repaired_by", "pricing_missing", "tokens_cache_write", "tokens_cache_write_1h", "cache_key", "prefix_fingerprint", "call_id", "attempt_seq", "candidate_index", "meta", "mask"];
|
|
27
|
+
export type InferenceWriteColumn = (typeof INFERENCE_WRITE_COLUMNS)[number];
|
|
28
|
+
/** A wire inference → its `inferences` row with EXACTLY `INFERENCE_WRITE_COLUMNS`
|
|
29
|
+
* as keys. Tenancy is stamped from the principal and never read from the row
|
|
30
|
+
* (T3) — the list order puts it first, and the wire type cannot carry it. */
|
|
31
|
+
export declare function normalizeInferenceRow(row: WireInference, tenancy: Tenancy): Record<string, unknown>;
|
|
32
|
+
/** merge=false fill: for each of `optional` that ANY row in the write carries,
|
|
33
|
+
* give the rows lacking it an explicit null, so rows that differ only in those
|
|
34
|
+
* spread-iff-present columns share one key set. A write where no row carries
|
|
35
|
+
* the column is returned key-for-key unchanged (byte-identical to pre-COV-1c). */
|
|
36
|
+
export declare function fillNulls(rows: readonly Record<string, unknown>[], optional: readonly string[]): Record<string, unknown>[];
|
|
37
|
+
/** The key set a row reaches PostgREST with (undefined-valued keys dropped, as
|
|
38
|
+
* JSON.stringify drops them), sorted — the PGRST102 comparison. */
|
|
39
|
+
export declare function wireKeySet(row: Record<string, unknown>): string;
|
|
40
|
+
/** merge=true split: group rows by key set, first-seen order, so each bulk POST
|
|
41
|
+
* is uniform without writing a null a merge upsert would apply. */
|
|
42
|
+
export declare function splitByKeySet(rows: readonly Record<string, unknown>[]): Record<string, unknown>[][];
|
|
43
|
+
//# sourceMappingURL=uniform-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uniform-rows.d.ts","sourceRoot":"","sources":["../../src/telemetry/uniform-rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEhE;2DAC2D;AAC3D,eAAO,MAAM,uBAAuB,keAkC1B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAwB5E;;6EAE6E;AAC7E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAanG;AAED;;;kFAGkF;AAClF,wBAAgB,SAAS,CACvB,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACxC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAO3B;AAED;mEACmE;AACnE,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAK/D;AAED;mEACmE;AACnE,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,CASnG"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Uniform key sets for `stampBatch`'s bulk writes (COV-1c). Extracted from
|
|
4
|
+
* ingest-protocol.ts so stampBatch stays under the LOC cap (P1).
|
|
5
|
+
*
|
|
6
|
+
* A PostgREST bulk insert requires every row in the array to carry the SAME
|
|
7
|
+
* keys — one row that omits a key the others carry fails the whole POST with
|
|
8
|
+
* PGRST102 ("All object keys must match") before any SQL runs. The wire is
|
|
9
|
+
* spread-iff-present by design (an older SDK's payload stays byte-identical),
|
|
10
|
+
* so rows in one batch legitimately differ: a web-search surcharge row carries
|
|
11
|
+
* `meta: null` (no `meta` key after validation) beside metered rows that carry
|
|
12
|
+
* one. Two remedies, chosen by the write's conflict policy:
|
|
13
|
+
*
|
|
14
|
+
* - merge=false (an immutable fact: inferences, steps, artifacts) — FILL every
|
|
15
|
+
* absent optional column with its DB default (null, or the NOT NULL column's
|
|
16
|
+
* default). Safe because ignore-duplicates never rewrites a landed row.
|
|
17
|
+
* - merge=true (a mutable projection: tasks, runs) — SPLIT into one write per
|
|
18
|
+
* key set (the routes precedent). Filling would null out a column a merge
|
|
19
|
+
* upsert must leave untouched.
|
|
20
|
+
*
|
|
21
|
+
* `undefined` values count as absent: JSON.stringify drops the key, so a row
|
|
22
|
+
* holding `{ meta: undefined }` reaches PostgREST without `meta`.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.INFERENCE_WRITE_COLUMNS = void 0;
|
|
26
|
+
exports.normalizeInferenceRow = normalizeInferenceRow;
|
|
27
|
+
exports.fillNulls = fillNulls;
|
|
28
|
+
exports.wireKeySet = wireKeySet;
|
|
29
|
+
exports.splitByKeySet = splitByKeySet;
|
|
30
|
+
/** Every `inferences` column the wire can carry, plus the stamped tenancy. ONE
|
|
31
|
+
* list — the uniform key set of every inferences write. */
|
|
32
|
+
exports.INFERENCE_WRITE_COLUMNS = [
|
|
33
|
+
"org_id",
|
|
34
|
+
"project_id",
|
|
35
|
+
"source_id",
|
|
36
|
+
"id",
|
|
37
|
+
"ts",
|
|
38
|
+
"route",
|
|
39
|
+
"route_version",
|
|
40
|
+
"provider",
|
|
41
|
+
"model",
|
|
42
|
+
"requested_tier",
|
|
43
|
+
"served_tier",
|
|
44
|
+
"tokens_in",
|
|
45
|
+
"tokens_out",
|
|
46
|
+
"tokens_cached",
|
|
47
|
+
"cost_estimate_usd",
|
|
48
|
+
"latency_ms",
|
|
49
|
+
"ttfb_ms",
|
|
50
|
+
"failure_class",
|
|
51
|
+
"attempts",
|
|
52
|
+
"tags",
|
|
53
|
+
"fingerprint_cell",
|
|
54
|
+
"served_variant",
|
|
55
|
+
"repaired_by",
|
|
56
|
+
"pricing_missing",
|
|
57
|
+
"tokens_cache_write",
|
|
58
|
+
"tokens_cache_write_1h",
|
|
59
|
+
"cache_key",
|
|
60
|
+
"prefix_fingerprint",
|
|
61
|
+
"call_id",
|
|
62
|
+
"attempt_seq",
|
|
63
|
+
"candidate_index",
|
|
64
|
+
"meta",
|
|
65
|
+
"mask",
|
|
66
|
+
];
|
|
67
|
+
// Compile-time drift lock: a WireInference field missing from the list above
|
|
68
|
+
// fails tsc here, rather than being silently dropped from the write.
|
|
69
|
+
const _everyWireFieldListed = true;
|
|
70
|
+
void _everyWireFieldListed;
|
|
71
|
+
/** The value written for an ABSENT column: the NOT NULL columns' DB defaults
|
|
72
|
+
* (00001 / 00005 / 00049), null for every nullable one (00002/00003/00007/
|
|
73
|
+
* 00049/00054/00056/00062 add them nullable with no default). Writing the
|
|
74
|
+
* default explicitly is what the omitted key produced before. */
|
|
75
|
+
const ABSENT_DEFAULTS = {
|
|
76
|
+
tokens_in: 0,
|
|
77
|
+
tokens_out: 0,
|
|
78
|
+
tokens_cached: 0,
|
|
79
|
+
cost_estimate_usd: 0,
|
|
80
|
+
latency_ms: 0,
|
|
81
|
+
attempts: {},
|
|
82
|
+
tags: {},
|
|
83
|
+
pricing_missing: false,
|
|
84
|
+
tokens_cache_write: 0,
|
|
85
|
+
tokens_cache_write_1h: 0,
|
|
86
|
+
};
|
|
87
|
+
/** A wire inference → its `inferences` row with EXACTLY `INFERENCE_WRITE_COLUMNS`
|
|
88
|
+
* as keys. Tenancy is stamped from the principal and never read from the row
|
|
89
|
+
* (T3) — the list order puts it first, and the wire type cannot carry it. */
|
|
90
|
+
function normalizeInferenceRow(row, tenancy) {
|
|
91
|
+
const source = {
|
|
92
|
+
...row,
|
|
93
|
+
org_id: tenancy.org_id,
|
|
94
|
+
project_id: tenancy.project_id,
|
|
95
|
+
source_id: tenancy.source_id,
|
|
96
|
+
};
|
|
97
|
+
const out = {};
|
|
98
|
+
for (const col of exports.INFERENCE_WRITE_COLUMNS) {
|
|
99
|
+
const v = source[col];
|
|
100
|
+
out[col] = v !== undefined ? v : (ABSENT_DEFAULTS[col] ?? null);
|
|
101
|
+
}
|
|
102
|
+
return out;
|
|
103
|
+
}
|
|
104
|
+
/** merge=false fill: for each of `optional` that ANY row in the write carries,
|
|
105
|
+
* give the rows lacking it an explicit null, so rows that differ only in those
|
|
106
|
+
* spread-iff-present columns share one key set. A write where no row carries
|
|
107
|
+
* the column is returned key-for-key unchanged (byte-identical to pre-COV-1c). */
|
|
108
|
+
function fillNulls(rows, optional) {
|
|
109
|
+
const carried = optional.filter((k) => rows.some((r) => r[k] !== undefined));
|
|
110
|
+
return rows.map((r) => {
|
|
111
|
+
const out = { ...r };
|
|
112
|
+
for (const k of carried)
|
|
113
|
+
if (out[k] === undefined)
|
|
114
|
+
out[k] = null;
|
|
115
|
+
return out;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/** The key set a row reaches PostgREST with (undefined-valued keys dropped, as
|
|
119
|
+
* JSON.stringify drops them), sorted — the PGRST102 comparison. */
|
|
120
|
+
function wireKeySet(row) {
|
|
121
|
+
return Object.keys(row)
|
|
122
|
+
.filter((k) => row[k] !== undefined)
|
|
123
|
+
.sort()
|
|
124
|
+
.join(",");
|
|
125
|
+
}
|
|
126
|
+
/** merge=true split: group rows by key set, first-seen order, so each bulk POST
|
|
127
|
+
* is uniform without writing a null a merge upsert would apply. */
|
|
128
|
+
function splitByKeySet(rows) {
|
|
129
|
+
const groups = new Map();
|
|
130
|
+
for (const r of rows) {
|
|
131
|
+
const key = wireKeySet(r);
|
|
132
|
+
const g = groups.get(key);
|
|
133
|
+
if (g === undefined)
|
|
134
|
+
groups.set(key, [r]);
|
|
135
|
+
else
|
|
136
|
+
g.push(r);
|
|
137
|
+
}
|
|
138
|
+
return [...groups.values()];
|
|
139
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failures-teaching.d.ts","sourceRoot":"","sources":["../../src/types/failures-teaching.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE3D,2EAA2E;AAC3E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC1C,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;4EACwE;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,eAAe,GAAG,IAAI,CAAC;CAC5E;AAID,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"failures-teaching.d.ts","sourceRoot":"","sources":["../../src/types/failures-teaching.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OA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MAAM,CAapE"}
|
|
@@ -157,6 +157,17 @@ exports.FAILURE_TEACHING = {
|
|
|
157
157
|
"falling through, at the cost of one extra call.",
|
|
158
158
|
}),
|
|
159
159
|
},
|
|
160
|
+
limit_exceeded: {
|
|
161
|
+
class: "limit_exceeded",
|
|
162
|
+
what: "The run reached one of the limits you set on it (maxUsd, maxCalls, maxWallMs or " +
|
|
163
|
+
"maxRepeatToolCall), so ModelRig refused the next call in-process and ended the run as failed " +
|
|
164
|
+
"with failure_reason `limit:<which>` (e.g. `limit:max_usd`). Nothing was sent to a provider for the refused call.",
|
|
165
|
+
fixHint: "Look at the run before raising the limit: a stuck tool loop (the same tool with the same " +
|
|
166
|
+
"arguments again and again) or a runaway agent looks exactly like an under-sized limit. If the " +
|
|
167
|
+
"run was legitimately bigger, raise that one limit on run.start({ limits }) or " +
|
|
168
|
+
"rig.conversation(id, { limits }).",
|
|
169
|
+
docsUrl: `${DOCS_BASE}#limit_exceeded`,
|
|
170
|
+
},
|
|
160
171
|
};
|
|
161
172
|
/** Provider → the env var that keys it. Mirrors config.ts's PROVIDER_KEY_ENV;
|
|
162
173
|
* kept as a local lookup so this table has no import cycle with config. */
|
package/dist/types/failures.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* errors never cross the adapter boundary. Retry budgets are per-class and
|
|
5
5
|
* non-fungible (see run/retry.ts).
|
|
6
6
|
*/
|
|
7
|
-
export type FailureClass = "content_invalid" | "capacity_shed" | "network" | "refusal" | "cache_invalid" | "timeout" | "config_auth" | "budget_exhausted" | "invariant_violation" | "quality_rejected";
|
|
7
|
+
export type FailureClass = "content_invalid" | "capacity_shed" | "network" | "refusal" | "cache_invalid" | "timeout" | "config_auth" | "budget_exhausted" | "invariant_violation" | "quality_rejected" | "limit_exceeded";
|
|
8
8
|
export interface RigFailure {
|
|
9
9
|
readonly class: FailureClass;
|
|
10
10
|
readonly message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failures.d.ts","sourceRoot":"","sources":["../../src/types/failures.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,eAAe,GACf,SAAS,GACT,SAAS,GACT,eAAe,GACf,SAAS,GACT,aAAa,GACb,kBAAkB,GAClB,qBAAqB,GACrB,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"failures.d.ts","sourceRoot":"","sources":["../../src/types/failures.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,eAAe,GACf,SAAS,GACT,SAAS,GACT,eAAe,GACf,SAAS,GACT,aAAa,GACb,kBAAkB,GAClB,qBAAqB,GACrB,kBAAkB,GAClB,gBAAgB,CAAC;AAErB,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,gBAAgB,EAAE,WAAW,CAAC,YAAY,CAIrD,CAAC;AAgBH;kFACkF;AAClF,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;gBAEjB,OAAO,EAAE,UAAU;CAKhC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAIhE"}
|
package/dist/types/failures.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.isRigFailure = isRigFailure;
|
|
|
11
11
|
exports.TERMINAL_CLASSES = new Set([
|
|
12
12
|
"budget_exhausted",
|
|
13
13
|
"invariant_violation",
|
|
14
|
+
"limit_exceeded",
|
|
14
15
|
]);
|
|
15
16
|
const FAILURE_CLASSES = new Set([
|
|
16
17
|
"content_invalid",
|
|
@@ -23,6 +24,7 @@ const FAILURE_CLASSES = new Set([
|
|
|
23
24
|
"budget_exhausted",
|
|
24
25
|
"invariant_violation",
|
|
25
26
|
"quality_rejected",
|
|
27
|
+
"limit_exceeded",
|
|
26
28
|
]);
|
|
27
29
|
/** Error subclass for the rare paths that must throw (config errors, terminal
|
|
28
30
|
* failures surfacing to the caller). The failure travels intact on `.failure`. */
|
package/dist/types/provider.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { RigFailure } from "./failures";
|
|
7
7
|
import type { AttemptMetaV1 } from "../telemetry/attempt-meta";
|
|
8
|
+
import type { HistoryMessage } from "../run/messages";
|
|
8
9
|
export type ProviderId = "gemini" | "openai" | "deepseek" | "anthropic" | "grok" | "deepinfra" | "fireworks" | "zai";
|
|
9
10
|
/** Runtime enumeration of every ProviderId — the single list a raw-model lane
|
|
10
11
|
* (`provider/model`) validates against (http gateway spec §3.3). Kept in sync
|
|
@@ -171,6 +172,17 @@ export interface AdapterRequest {
|
|
|
171
172
|
readonly tools?: readonly ToolDefinition[];
|
|
172
173
|
/** Tool-selection directive; only meaningful alongside `tools`. */
|
|
173
174
|
readonly toolChoice?: ToolChoice;
|
|
175
|
+
/**
|
|
176
|
+
* ARC-β messages lane (agent-archetypes spec §4) — the conversation history,
|
|
177
|
+
* validated by `run/messages.ts`. Identical semantics in every adapter:
|
|
178
|
+
* - ABSENT ⇒ today's single-turn code path, BYTE-IDENTICAL request (pinned by
|
|
179
|
+
* adapters/one-turn-parity.test.ts).
|
|
180
|
+
* - PRESENT ⇒ provider messages = system(`systemPrompt`) + map(history), and a
|
|
181
|
+
* NON-EMPTY `userPrompt` is appended as a final user message (a route
|
|
182
|
+
* template's final instruction); an empty `userPrompt` appends nothing.
|
|
183
|
+
* Per-family mapping lives in adapters/history-mapping.ts.
|
|
184
|
+
*/
|
|
185
|
+
readonly history?: readonly HistoryMessage[];
|
|
174
186
|
}
|
|
175
187
|
export interface AdapterUsage {
|
|
176
188
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/types/provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,WAAW,GACX,MAAM,GAGN,WAAW,GACX,WAAW,GAIX,KAAK,CAAC;AAEV;;;;iBAIiB;AACjB,eAAO,MAAM,YAAY,iGASf,CAAC;AAYX,MAAM,MAAM,cAAc,GACtB,mBAAmB,GACnB,WAAW,GACX,iBAAiB,GACjB,wBAAwB,GACxB,kBAAkB,GAClB,uBAAuB,GACvB,WAAW,GACX,eAAe,GACf,gBAAgB,CAAC;AAErB;sEACsE;AACtE,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAUzD,CAAC;AAEF;;;;;;4EAM4E;AAC5E,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,WAAW,CAAC;AAM9D;oCACoC;AACpC,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,UAAU,GAAG,mBAAmB,CAE3E;AAsBD;oEACoE;AACpE,wBA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C,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;CAAE,CAAC;AAEhI;;;;4BAI4B;AAC5B,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1D;;;qFAGiF;IACjF,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAClD;mFAC+E;IAC/E,MAAM,CAAC,CAAC,GAAG,EAAE,cAAc,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACjE"}
|
package/dist/types/route.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { MaskReceipt, ResolvedMaskPolicy } from "../mask/types";
|
|
|
10
10
|
import type { ResolvedScreenPolicy, ScreenReceipt } from "../screen/types";
|
|
11
11
|
import type { DataClassification } from "../artifacts/classification";
|
|
12
12
|
import type { Manifest } from "../prompts/manifest";
|
|
13
|
+
import type { HistoryMessage } from "../run/messages";
|
|
13
14
|
export interface CandidateSpec {
|
|
14
15
|
readonly provider: ProviderId;
|
|
15
16
|
readonly model: string;
|
|
@@ -242,6 +243,12 @@ export interface RouteBundle {
|
|
|
242
243
|
* Additive & optional.
|
|
243
244
|
*/
|
|
244
245
|
readonly userTemplate?: string;
|
|
246
|
+
/** ARC-β messages lane — `input: { kind: messages }` declares a chat/tool-loop
|
|
247
|
+
* route: callers pass `RunOptions.messages` (required on such a route) and the
|
|
248
|
+
* template renders only the system prompt. Present ONLY when declared (absent
|
|
249
|
+
* ⇒ a variables route, unchanged `bundle_sha`). Carried on the resolved
|
|
250
|
+
* (mirror) bundle. Additive & optional. */
|
|
251
|
+
readonly inputKind?: "messages";
|
|
245
252
|
readonly variables: readonly string[];
|
|
246
253
|
readonly policy: RoutePolicy;
|
|
247
254
|
/** Base-config repair rung (Phase 3 WS2) — variants may override. */
|
|
@@ -388,6 +395,12 @@ export interface RunOptions {
|
|
|
388
395
|
* protocol only — the caller executes the tool. */
|
|
389
396
|
readonly tools?: readonly ToolDefinition[];
|
|
390
397
|
readonly toolChoice?: ToolChoice;
|
|
398
|
+
/** ARC-β messages lane — the conversation the model answers (validated by
|
|
399
|
+
* run/messages.ts). Allowed ONLY on a route that declares `input: { kind:
|
|
400
|
+
* messages }`; the route template still renders the system prompt from
|
|
401
|
+
* `input` as today, and `prompt.user` (when declared) is appended as a final
|
|
402
|
+
* instruction. Absent ⇒ BYTE-IDENTICAL single-turn run. */
|
|
403
|
+
readonly messages?: readonly HistoryMessage[];
|
|
391
404
|
/**
|
|
392
405
|
* Customer-managed cache handle pass-through (CE-1, spec §2). A provider-native
|
|
393
406
|
* cache identifier the CUSTOMER created and OWNS — gemini `cachedContents/<id>`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../src/types/route.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EA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AM,CAAC,EAAE,aAAa,CAAC;IAChC;;;;;;;;4EAQwE;IACxE,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;CACpC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -164,7 +164,7 @@ export interface GradeRow {
|
|
|
164
164
|
readonly scaleLabel: string | null;
|
|
165
165
|
/** Written guidance (was feedback.note / evaluation.explanation). */
|
|
166
166
|
readonly comment: string | null;
|
|
167
|
-
readonly kind:
|
|
167
|
+
readonly kind: GradeKind;
|
|
168
168
|
/** The specific grader name (was evaluation.evaluator / the feedback source). */
|
|
169
169
|
readonly grader: string | null;
|
|
170
170
|
/** Provenance (was feedback.source) — "sdk", "console", a review-agent name. */
|
|
@@ -182,7 +182,20 @@ export interface GradeRow {
|
|
|
182
182
|
* Additive: stored locally as a JSON `criteria` TEXT column (v16), read back as
|
|
183
183
|
* null for any row written before F4. */
|
|
184
184
|
readonly criteria?: readonly GradeCriterion[];
|
|
185
|
+
/** ARC-3 (00089): the RAW business value of an OUTCOME grade (revenue, CTR,
|
|
186
|
+
* handle time …). Present only on `kind: "outcome"`; absent on every other
|
|
187
|
+
* grade so its row/wire shape is byte-identical to pre-ARC. `score` stays the
|
|
188
|
+
* 0–1 primitive. Stored locally as the nullable `value` REAL column (v17). */
|
|
189
|
+
readonly value?: number | null;
|
|
190
|
+
/** ARC-3 (fix round 1, L3): the outcome's idempotency key, carried to the
|
|
191
|
+
* server so it re-derives the org-scoped id (outcomeGradeId). Outcome only;
|
|
192
|
+
* local column `idempotency_key` (v17). */
|
|
193
|
+
readonly idempotencyKey?: string;
|
|
185
194
|
}
|
|
195
|
+
/** The grade kinds (00070 + ARC-3/00089 `outcome`). An `outcome` is a delayed
|
|
196
|
+
* business ground truth (resolved, booked, approved, CTR) — `grader` is
|
|
197
|
+
* `outcome:<name>`; it is a receipt, never a calibration gate (ARC-D3). */
|
|
198
|
+
export type GradeKind = "human" | "model-judge" | "deterministic" | "outcome";
|
|
186
199
|
/** One execution of a customer pipeline (Expansion E2 chunk A). Local SQLite is
|
|
187
200
|
* the write path (run.start/run.end); the exporter mirrors it to `public.runs`
|
|
188
201
|
* on its own watermark. A mutable projection: start → end. `source_id`/`org_id`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/types/telemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,kBAAkB,CAAC;AAEvB,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;wCAEoC;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,YAAY,EAAE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AQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,GAAG,EAAE,YAAY,GAAG,IAAI,CAAC;IAChC;gCAC4B;IAC5B,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,GAAG,EAAE,MAAM,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAAC;IACvE,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IAC7C,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9C,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,CAAC;IAC1D,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -33,6 +33,11 @@ Codex, and anywhere else skills load. It deliberately holds almost no facts.
|
|
|
33
33
|
{ "mcpServers": { "modelrig": { "command": "npx", "args": ["modelrig-oracle"] } } }
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
The write tools (`set_task_settings` grading guides, `record_grade`) need
|
|
37
|
+
`modelrig-oracle` 0.3.0 or later. If `set_task_settings` rejects
|
|
38
|
+
`grading_guide`, the agent is running an older copy: refresh it with
|
|
39
|
+
`npx -y modelrig-oracle@latest`.
|
|
40
|
+
|
|
36
41
|
3. **Fall back to the raw registry** when neither is available:
|
|
37
42
|
<https://raw.githubusercontent.com/modelrig/modelrig/main/registry/registry.json>
|
|
38
43
|
|
|
@@ -109,13 +114,13 @@ await rig.close(); // flushes the exporter — call once at shutdown
|
|
|
109
114
|
<!-- /BLOCK:RUN_WRAP -->
|
|
110
115
|
|
|
111
116
|
<!-- BLOCK:NOT_CAPTURED -->
|
|
112
|
-
**What ModelRig does not see unless you record it.** ModelRig records the calls your code makes through the SDK (`rig.run`, `rig.runBundle`, `rig.runRaw`, `rig.runRawStream`) or the gateway, plus any call your code makes itself and reports with `rig.recordCall`. Nothing else is seen. Five things stay invisible or unattached unless you record them: (1) direct provider SDK calls, with or without a JSON schema; (2) streams you read from a provider client yourself; (3) a fallback your code makes after the raw lane refuses a `responseSchema` it cannot enforce (deepseek, deepinfra, fireworks and zai fail closed with `invariant_violation`); (4) calls made outside `run.scope` / `run.start`, which land on /inferences but on no run; (5) embeddings. A recorded call shows as "
|
|
117
|
+
**What ModelRig does not see unless you record it.** ModelRig records the calls your code makes through the SDK (`rig.run`, `rig.runBundle`, `rig.runRaw`, `rig.runRawStream`) or the gateway, plus any call your code makes itself and reports with `rig.recordCall`. Nothing else is seen. Five things stay invisible or unattached unless you record them: (1) direct provider SDK calls, with or without a JSON schema; (2) streams you read from a provider client yourself; (3) a fallback your code makes after the raw lane refuses a `responseSchema` it cannot enforce (deepseek, deepinfra, fireworks and zai fail closed with `invariant_violation`); (4) calls made outside `run.scope` / `run.start`, which land on /inferences but on no run; (5) embeddings. A recorded call shows as "Reported by your code": ModelRig neither dispatched nor validated it, and its tokens are the numbers you reported. Details and the console tells: https://modelrig.dev/not-captured.html.
|
|
113
118
|
<!-- /BLOCK:NOT_CAPTURED -->
|
|
114
119
|
|
|
115
120
|
A provider call you can't move onto a lane (an unsupported client, a stream you read yourself, a fallback, an embedding): record it right after it returns, never leave it invisible (https://modelrig.dev/not-captured.html):
|
|
116
121
|
|
|
117
122
|
<!-- BLOCK:RECORD_CALL -->
|
|
118
|
-
**Record a call your code makes itself.** A provider call your code makes directly (a client ModelRig has no lane for, a stream you read yourself, an embedding, a fallback) is invisible until you report it. Call `rig.recordCall` right after it returns, inside the run, with the tokens the provider reported: the call shows on /inferences as "
|
|
123
|
+
**Record a call your code makes itself.** A provider call your code makes directly (a client ModelRig has no lane for, a stream you read yourself, an embedding, a fallback) is invisible until you report it. Call `rig.recordCall` right after it returns, inside the run, with the tokens the provider reported: the call shows on /inferences as "Reported by your code", joins its run and step, and counts toward cost. It is synchronous and never throws; invalid input warns once and records nothing (`inferenceId: null`). Spread optional fields only when the provider reported them, so the call type-checks under `exactOptionalPropertyTypes`.
|
|
119
124
|
|
|
120
125
|
```ts
|
|
121
126
|
const started = Date.now();
|
|
@@ -322,7 +327,15 @@ The cycle, once a key is configured:
|
|
|
322
327
|
optimize envelope. It files a proposal (or an honest no); nothing is applied.
|
|
323
328
|
4. **Author the grading guide** the optimizer and graders learn from with
|
|
324
329
|
`get_task_settings` / `set_task_settings` — the rubric is what turns your
|
|
325
|
-
grades into a teachable signal, closing the loop.
|
|
330
|
+
grades into a teachable signal, closing the loop. A grader exists for a
|
|
331
|
+
**step or a route**: a route registers on route sync, a `runRaw` /
|
|
332
|
+
`recordCall` step registers on its first call that sets `tags.step`, and
|
|
333
|
+
`POST /v1/tasks {"task":"<name>"}` creates one up front (`GET /v1/tasks` lists
|
|
334
|
+
them). Writing a guide over MCP needs modelrig-oracle 0.3.0 or later (see
|
|
335
|
+
above); on an older copy, refresh it or use `PATCH /v1/tasks/<task>/settings`.
|
|
336
|
+
The full walk-through, with a
|
|
337
|
+
copy-paste prompt for a coding agent, is
|
|
338
|
+
[Set up a grader](https://modelrig.dev/set-up-a-grader.html).
|
|
326
339
|
|
|
327
340
|
**Two honest limits worth stating up front.** `run_optimizer` proposes a
|
|
328
341
|
`prompt-change` only when the published content-custody terms license the
|
package/docs/how-it-fits.md
CHANGED
|
@@ -10,15 +10,15 @@ Routing is half of it. ModelRig also records the **execution graph** of your wor
|
|
|
10
10
|
|
|
11
11
|
What is retained beyond that is your choice, per route, and there are two lanes.
|
|
12
12
|
|
|
13
|
-
**Pure router** (capture off).
|
|
13
|
+
**Pure router** (capture off). Keeps no replay samples and contributes nothing to the community; telemetry rows and saved artifacts follow your org's content custody. Real, supported, selectable, and the honest answer for a ZDR-strict or data-residency-bound workload.
|
|
14
14
|
|
|
15
15
|
**Optimization on** (recommended). Your traffic is what makes the routing smarter and the bill smaller. **What is kept:** per-inference telemetry rows, and bounded review samples for the bake-offs you create. **Where:** your organization, row-scoped by the database, not by our application code. **How you leave:** see it all in the console and export it; never a silent swap — promote a change in ModelRig (console or MCP; versioned, reversible) or merge it as a PR if you keep routes in git. **What you get back:** community priors on your very first bake-off and RigIndex-grade evidence on your own routes — at the same flat 2% either way; the corpus earns its place by being useful, not by being a discount.
|
|
16
16
|
|
|
17
|
-
Captures power **bake-offs**: replay your own recent traffic through route variants — a cheaper model, a different prompt — and get the effective cost of conformance for each, with confidence intervals. A winning variant is a proposal
|
|
17
|
+
Captures power **bake-offs**: replay your own recent traffic through route variants — a cheaper model, a different prompt — and get the effective cost of conformance for each, with confidence intervals. A winning variant is a proposal. Never a silent swap: automated changes (opt-in) are proven before they apply, and a change you promote in ModelRig (console or MCP) is versioned and reversible — or merge it as a PR if you keep routes in git.
|
|
18
18
|
|
|
19
19
|
The **registry** feeds routing from the side: declared claims, probed measurements, and observed traffic per model, with disagreements shown. A probed fact beats a declared claim — a model that declares schema support but failed our probes is not eligible to serve a schema route natively.
|
|
20
20
|
|
|
21
|
-
The loop, end to end: routes in your repo → `rig.run` in your app → local telemetry (+ captures on the routes where you turn Optimization on) → synced console → bake-offs prove cheaper variants → you edit the YAML.
|
|
21
|
+
The loop, end to end: routes in your repo → `rig.run` in your app → local telemetry (+ captures on the routes where you turn Optimization on) → synced console → bake-offs prove cheaper variants → you promote the winner (console or MCP), or edit the YAML if you keep routes in git. Automated changes (opt-in) are proven before they apply; a change you promote in ModelRig is versioned and reversible.
|
|
22
22
|
|
|
23
23
|
## More capabilities
|
|
24
24
|
|
package/docs/instrumentation.md
CHANGED
|
@@ -128,6 +128,13 @@ instead of `start`/`end` — each scope keeps its own ambient context so
|
|
|
128
128
|
overlapping runs never cross-attribute. `run.start` uses `enterWith`, which is
|
|
129
129
|
right for one run at a time on a request/async path.
|
|
130
130
|
|
|
131
|
+
**Why a run failed.** *(needs `modelrig` 0.12.0 or newer)* End a failed run with its
|
|
132
|
+
reason — `run.end("failed", { failureReason: "eps_integrity_failure" })` — or,
|
|
133
|
+
inside `run.scope`, call `rig.artifacts.run.setFailureReason("…")` before the
|
|
134
|
+
callback throws. The reason must be an identifier (≤128 characters, no
|
|
135
|
+
whitespace). It lands in `runs.meta.failure_reason`, and the run-outcome verdict
|
|
136
|
+
on `/runs` uses it as the failed run's label instead of a step's failure class.
|
|
137
|
+
|
|
131
138
|
## Steps vs. artifacts
|
|
132
139
|
|
|
133
140
|
- An **artifact** is a work product — a durable thing your pipeline made. It
|
|
@@ -138,20 +145,22 @@ right for one run at a time on a request/async path.
|
|
|
138
145
|
inside a run context. A stage whose model call does *not* go through the rig
|
|
139
146
|
and is not reported with `rig.recordCall` produces artifacts with `step_key`
|
|
140
147
|
set and **no step row**, which is correct and honest: the console renders
|
|
141
|
-
"
|
|
148
|
+
"—" for that step's cost (shown as "cost n/a" with Developer details on)
|
|
149
|
+
rather than inventing a number. Report the call
|
|
142
150
|
(below) and the step gets its tokens and cost.
|
|
143
151
|
|
|
144
152
|
### Record a call your code made itself (`rig.recordCall`)
|
|
145
153
|
|
|
146
|
-
|
|
154
|
+
*Needs `modelrig` 0.11.0 or newer.*
|
|
147
155
|
|
|
148
156
|
If a stage's model call has to stay a direct provider call, report it instead:
|
|
149
157
|
`rig.recordCall({ provider, model, usage: { tokensIn, tokensOut, tokensCached }, servedTier, latencyMs, stepKey })`
|
|
150
158
|
right after the call returns. Inside a run context it records a step row for
|
|
151
159
|
that `stepKey` (stored as `ground-truth`, the only joined-inference value),
|
|
152
|
-
joined to the recorded inference, so the step gets a cost instead of "
|
|
153
|
-
The console shows that step and its call as
|
|
154
|
-
|
|
160
|
+
joined to the recorded inference, so the step gets a cost instead of "—" (shown as
|
|
161
|
+
"cost n/a" with Developer details on). The console shows that step and its call as
|
|
162
|
+
**Reported by your code** (**recorded · unverified** with Developer details on),
|
|
163
|
+
never as measured:
|
|
155
164
|
ModelRig neither dispatched nor validated the call, and the tokens are the ones
|
|
156
165
|
you reported. It is synchronous and never throws (bad input warns and returns
|
|
157
166
|
`inferenceId: null`); the returned `inferenceId` is gradeable with `rig.grade`.
|
|
@@ -159,7 +168,7 @@ Full contract, usage convention and cost notes:
|
|
|
159
168
|
[Not captured → record them](not-captured.md#calls-your-code-makes-itself-record-them).
|
|
160
169
|
|
|
161
170
|
<!-- BLOCK:RECORD_CALL -->
|
|
162
|
-
**Record a call your code makes itself.** A provider call your code makes directly (a client ModelRig has no lane for, a stream you read yourself, an embedding, a fallback) is invisible until you report it. Call `rig.recordCall` right after it returns, inside the run, with the tokens the provider reported: the call shows on /inferences as "
|
|
171
|
+
**Record a call your code makes itself.** A provider call your code makes directly (a client ModelRig has no lane for, a stream you read yourself, an embedding, a fallback) is invisible until you report it. Call `rig.recordCall` right after it returns, inside the run, with the tokens the provider reported: the call shows on /inferences as "Reported by your code", joins its run and step, and counts toward cost. It is synchronous and never throws; invalid input warns once and records nothing (`inferenceId: null`). Spread optional fields only when the provider reported them, so the call type-checks under `exactOptionalPropertyTypes`.
|
|
163
172
|
|
|
164
173
|
```ts
|
|
165
174
|
const started = Date.now();
|