@tangle-network/agent-eval 0.126.6 → 0.127.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 +51 -0
- package/README.md +2 -2
- package/dist/analyst/index.d.ts +52 -40
- package/dist/analyst/index.js +4 -4
- package/dist/belief-state/index.d.ts +34 -36
- package/dist/belief-state/index.js +2 -2
- package/dist/benchmarks/index.d.ts +30 -12
- package/dist/benchmarks/index.js +12 -10
- package/dist/builder-eval/index.js +1 -1
- package/dist/campaign/index.d.ts +432 -146
- package/dist/campaign/index.js +11 -9
- package/dist/{chunk-ARU2PZFM.js → chunk-424XHVKV.js} +43 -23
- package/dist/chunk-424XHVKV.js.map +1 -0
- package/dist/{chunk-NUKSVU3W.js → chunk-5DTSBUL2.js} +2 -2
- package/dist/{chunk-BTACVO2W.js → chunk-65QETEKG.js} +542 -258
- package/dist/chunk-65QETEKG.js.map +1 -0
- package/dist/{chunk-CGG5SLH3.js → chunk-ARCFIY7U.js} +2 -2
- package/dist/{chunk-P22LJ3Y2.js → chunk-CLELFRQG.js} +6 -4
- package/dist/chunk-CLELFRQG.js.map +1 -0
- package/dist/{chunk-LUNF2SEL.js → chunk-DJKY2TSY.js} +3 -3
- package/dist/chunk-DPUHNQLN.js +232 -0
- package/dist/chunk-DPUHNQLN.js.map +1 -0
- package/dist/{chunk-IPYXE555.js → chunk-EJGRPCO3.js} +36 -13
- package/dist/chunk-EJGRPCO3.js.map +1 -0
- package/dist/{chunk-K6IAZZ6L.js → chunk-FA3MFYNA.js} +132 -110
- package/dist/chunk-FA3MFYNA.js.map +1 -0
- package/dist/chunk-IG35YDN3.js +614 -0
- package/dist/chunk-IG35YDN3.js.map +1 -0
- package/dist/{chunk-DPZAEKA6.js → chunk-IMGJZBFG.js} +84 -56
- package/dist/chunk-IMGJZBFG.js.map +1 -0
- package/dist/{chunk-H5UD2323.js → chunk-IN455XKS.js} +53 -1
- package/dist/chunk-IN455XKS.js.map +1 -0
- package/dist/{chunk-PJQFMIOX.js → chunk-MHELPNRP.js} +31 -1
- package/dist/chunk-MHELPNRP.js.map +1 -0
- package/dist/{chunk-IILEIWGW.js → chunk-NL33OXEP.js} +41 -36
- package/dist/chunk-NL33OXEP.js.map +1 -0
- package/dist/{chunk-474LBSOX.js → chunk-OD5NQ2CS.js} +41 -16
- package/dist/chunk-OD5NQ2CS.js.map +1 -0
- package/dist/{chunk-QOTFXW5L.js → chunk-P5W7RQKK.js} +2 -2
- package/dist/{chunk-IR3KBHOY.js → chunk-P6FYH6K4.js} +39 -3
- package/dist/chunk-P6FYH6K4.js.map +1 -0
- package/dist/{chunk-J5SQWP6Y.js → chunk-PBE2LOSS.js} +18 -2
- package/dist/chunk-PBE2LOSS.js.map +1 -0
- package/dist/{chunk-E3IADPLG.js → chunk-PRB53E3J.js} +50 -224
- package/dist/chunk-PRB53E3J.js.map +1 -0
- package/dist/{chunk-X4UCIOTZ.js → chunk-S5YLIBFX.js} +2 -2
- package/dist/{chunk-7VYEGHWF.js → chunk-SZLVEKMJ.js} +41 -20
- package/dist/chunk-SZLVEKMJ.js.map +1 -0
- package/dist/{chunk-LKKT3IVV.js → chunk-TSN7JT6D.js} +6 -4
- package/dist/{chunk-LKKT3IVV.js.map → chunk-TSN7JT6D.js.map} +1 -1
- package/dist/{chunk-M7AH34KV.js → chunk-UTA2TGC4.js} +32 -16
- package/dist/chunk-UTA2TGC4.js.map +1 -0
- package/dist/{chunk-MAX3TN3C.js → chunk-UWZZKKU7.js} +7 -19
- package/dist/chunk-UWZZKKU7.js.map +1 -0
- package/dist/{chunk-ZVCHKKOP.js → chunk-WED5KLZQ.js} +39 -15
- package/dist/chunk-WED5KLZQ.js.map +1 -0
- package/dist/{chunk-OCFJACJU.js → chunk-X6VOPMLD.js} +74 -14
- package/dist/chunk-X6VOPMLD.js.map +1 -0
- package/dist/{chunk-MOXWMGPC.js → chunk-Y5CYOL42.js} +159 -70
- package/dist/chunk-Y5CYOL42.js.map +1 -0
- package/dist/{chunk-FO7HEH76.js → chunk-YJBNWCAA.js} +2 -2
- package/dist/chunk-ZPUEEM5U.js +179 -0
- package/dist/chunk-ZPUEEM5U.js.map +1 -0
- package/dist/{chunk-KE2VWPZX.js → chunk-ZUUWPZCV.js} +3 -3
- package/dist/cli.js +4 -4
- package/dist/contract/index.d.ts +464 -126
- package/dist/contract/index.js +425 -211
- package/dist/contract/index.js.map +1 -1
- package/dist/control.d.ts +34 -32
- package/dist/control.js +2 -2
- package/dist/hosted/index.d.ts +142 -41
- package/dist/hosted/index.js +23 -1
- package/dist/index.d.ts +365 -256
- package/dist/index.js +315 -226
- package/dist/index.js.map +1 -1
- package/dist/meta-eval/index.d.ts +32 -32
- package/dist/meta-eval/index.js +2 -2
- package/dist/multishot/index.d.ts +1 -0
- package/dist/openapi.json +1 -1
- package/dist/pipelines/index.js +2 -2
- package/dist/reporting.d.ts +97 -74
- package/dist/reporting.js +5 -4
- package/dist/rl.d.ts +177 -131
- package/dist/rl.js +232 -126
- package/dist/rl.js.map +1 -1
- package/dist/rollout/index.d.ts +53 -63
- package/dist/rollout/index.js +7 -5
- package/dist/{run-campaign-FFRM3RH5.js → run-campaign-3A2EBYBE.js} +4 -3
- package/dist/supervisor-run/index.d.ts +7 -15
- package/dist/supervisor-run/index.js +2 -2
- package/dist/traces.d.ts +66 -41
- package/dist/traces.js +9 -5
- package/dist/wire/index.d.ts +1 -0
- package/dist/wire/index.js +2 -2
- package/docs/concepts.md +18 -1
- package/docs/hosted-ingest-spec.md +37 -40
- package/docs/insight-report.md +57 -7
- package/docs/research-report-methodology.md +20 -21
- package/docs/rollout.md +13 -8
- package/package.json +21 -14
- package/dist/chunk-474LBSOX.js.map +0 -1
- package/dist/chunk-7VYEGHWF.js.map +0 -1
- package/dist/chunk-ARU2PZFM.js.map +0 -1
- package/dist/chunk-BTACVO2W.js.map +0 -1
- package/dist/chunk-DPZAEKA6.js.map +0 -1
- package/dist/chunk-E3IADPLG.js.map +0 -1
- package/dist/chunk-H5UD2323.js.map +0 -1
- package/dist/chunk-IILEIWGW.js.map +0 -1
- package/dist/chunk-IPYXE555.js.map +0 -1
- package/dist/chunk-IR3KBHOY.js.map +0 -1
- package/dist/chunk-J5SQWP6Y.js.map +0 -1
- package/dist/chunk-K6IAZZ6L.js.map +0 -1
- package/dist/chunk-M7AH34KV.js.map +0 -1
- package/dist/chunk-MAX3TN3C.js.map +0 -1
- package/dist/chunk-MOXWMGPC.js.map +0 -1
- package/dist/chunk-OCFJACJU.js.map +0 -1
- package/dist/chunk-P22LJ3Y2.js.map +0 -1
- package/dist/chunk-PJQFMIOX.js.map +0 -1
- package/dist/chunk-ZVCHKKOP.js.map +0 -1
- package/dist/chunk-ZZUXHH3R.js +0 -99
- package/dist/chunk-ZZUXHH3R.js.map +0 -1
- /package/dist/{chunk-NUKSVU3W.js.map → chunk-5DTSBUL2.js.map} +0 -0
- /package/dist/{chunk-CGG5SLH3.js.map → chunk-ARCFIY7U.js.map} +0 -0
- /package/dist/{chunk-LUNF2SEL.js.map → chunk-DJKY2TSY.js.map} +0 -0
- /package/dist/{chunk-QOTFXW5L.js.map → chunk-P5W7RQKK.js.map} +0 -0
- /package/dist/{chunk-X4UCIOTZ.js.map → chunk-S5YLIBFX.js.map} +0 -0
- /package/dist/{chunk-FO7HEH76.js.map → chunk-YJBNWCAA.js.map} +0 -0
- /package/dist/{chunk-KE2VWPZX.js.map → chunk-ZUUWPZCV.js.map} +0 -0
- /package/dist/{run-campaign-FFRM3RH5.js.map → run-campaign-3A2EBYBE.js.map} +0 -0
package/dist/control.d.ts
CHANGED
|
@@ -770,7 +770,8 @@ interface AgentProfileCell {
|
|
|
770
770
|
* researcher loop SHOULD be recorded as a `RunRecord`. The mandatory
|
|
771
771
|
* fields are exactly those the paper "Two Loops, Three Roles" requires
|
|
772
772
|
* for reproducibility: who/what/when/cost/seed/hash, plus the search vs
|
|
773
|
-
* holdout split tag
|
|
773
|
+
* holdout split tag. A task score is optional because execution-only records
|
|
774
|
+
* must preserve missing labels instead of converting errors into zero quality.
|
|
774
775
|
*
|
|
775
776
|
* This is intentionally NOT a replacement for the rich `Run` /
|
|
776
777
|
* `ProposeReviewReport` / `ScenarioResult` types already in the
|
|
@@ -791,6 +792,13 @@ interface AgentProfileCell {
|
|
|
791
792
|
/** Search/dev/holdout split tag. 'search' is the paper-grade alias for the
|
|
792
793
|
* combined train+test pool that the optimizer is allowed to read. */
|
|
793
794
|
type RunSplitTag = 'search' | 'dev' | 'holdout';
|
|
795
|
+
/**
|
|
796
|
+
* Explicit execution-lifecycle result for a run.
|
|
797
|
+
*
|
|
798
|
+
* This is separate from task quality (`outcome`) and failure classification.
|
|
799
|
+
* Producers set it only from root-run or process evidence.
|
|
800
|
+
*/
|
|
801
|
+
type RunTerminalOutcome = 'succeeded' | 'failed' | 'cancelled' | 'incomplete' | 'unknown';
|
|
794
802
|
interface RunTokenUsage {
|
|
795
803
|
input: number;
|
|
796
804
|
/** All generated tokens charged as output, including reasoning tokens. */
|
|
@@ -804,11 +812,6 @@ interface RunTokenUsage {
|
|
|
804
812
|
}
|
|
805
813
|
/**
|
|
806
814
|
* How a run's USD amount was obtained.
|
|
807
|
-
*
|
|
808
|
-
* `costUsd` remains mandatory for wire compatibility. New producers should
|
|
809
|
-
* always populate this discriminated union so a missing bill is never
|
|
810
|
-
* mistaken for an observed zero-dollar run. For `uncaptured`, `costUsd` uses
|
|
811
|
-
* the legacy `0` sentinel while this field carries the truthful null.
|
|
812
815
|
*/
|
|
813
816
|
type RunCostProvenance = {
|
|
814
817
|
kind: 'observed';
|
|
@@ -854,8 +857,8 @@ interface JudgeScoresRecord {
|
|
|
854
857
|
perJudge: Record<string, Record<string, number>>;
|
|
855
858
|
/** Per-dim mean across judges. Convenience — derivable from `perJudge`. */
|
|
856
859
|
perDimMean: Record<string, number>;
|
|
857
|
-
/** Composite mean across
|
|
858
|
-
*
|
|
860
|
+
/** Composite mean across successful judges. Mirrors the task score only
|
|
861
|
+
* when `failedJudges` is empty. */
|
|
859
862
|
composite: number;
|
|
860
863
|
/** Judges that errored or returned an unparseable verdict. Recorded
|
|
861
864
|
* by id (e.g. `['glm-5.1']`) so a partial-failure case is explicit,
|
|
@@ -866,11 +869,11 @@ interface JudgeScoresRecord {
|
|
|
866
869
|
notes?: string;
|
|
867
870
|
}
|
|
868
871
|
interface RunOutcome {
|
|
869
|
-
/** Score on the search/optimization split. Optional
|
|
870
|
-
*
|
|
872
|
+
/** Score on the search/optimization split. Optional for holdout-only and
|
|
873
|
+
* execution-only records. */
|
|
871
874
|
searchScore?: number;
|
|
872
|
-
/** Score on the held-out split. Optional
|
|
873
|
-
*
|
|
875
|
+
/** Score on the held-out split. Optional for search-only and execution-only
|
|
876
|
+
* records. When both scores are absent, the run is explicitly unlabeled. */
|
|
874
877
|
holdoutScore?: number;
|
|
875
878
|
/** Bag of any other metric the run produced — judge dimensions,
|
|
876
879
|
* pass/fail counters, latency stats, etc. Numeric only — keeps
|
|
@@ -934,42 +937,39 @@ interface RunRecord {
|
|
|
934
937
|
wallMs: number;
|
|
935
938
|
/** Time spent queued before execution started, if known. */
|
|
936
939
|
queueMs?: number;
|
|
937
|
-
/** Total USD cost
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
costUsd: number;
|
|
942
|
-
/** Observed, model-priced estimate, or genuinely uncaptured USD amount.
|
|
943
|
-
* Optional only so existing serialized RunRecords remain valid. */
|
|
944
|
-
costProvenance?: RunCostProvenance;
|
|
940
|
+
/** Total USD cost, or null when the producer could not capture one. */
|
|
941
|
+
costUsd: number | null;
|
|
942
|
+
/** Whether `costUsd` came from billing data, a price calculation, or is unavailable. */
|
|
943
|
+
costProvenance: RunCostProvenance;
|
|
945
944
|
/** Token usage breakdown. */
|
|
946
945
|
tokenUsage: RunTokenUsage;
|
|
946
|
+
/** Root-run or process terminal result. Never inferred from a child span. */
|
|
947
|
+
terminalOutcome: RunTerminalOutcome;
|
|
948
|
+
/** Root-run or process failure reason. Valid only for a failed, cancelled,
|
|
949
|
+
* or incomplete terminal result; never populated from a child span. */
|
|
950
|
+
terminalFailureReason?: string;
|
|
947
951
|
/** Judge-side metadata, if a judge was used. */
|
|
948
952
|
judgeMetadata?: RunJudgeMetadata;
|
|
949
953
|
/** Per-split scores + raw bag. */
|
|
950
954
|
outcome: RunOutcome;
|
|
951
|
-
/** Canonical
|
|
955
|
+
/** Canonical task-failure class drawn from the shared
|
|
952
956
|
* `FAILURE_CLASSES` taxonomy. This is the aggregation key that makes
|
|
953
957
|
* "which failure dominates across the whole fleet" answerable in ONE
|
|
954
958
|
* vocabulary — every agent classifies against the same enum. Producers
|
|
955
|
-
* set it
|
|
956
|
-
*
|
|
959
|
+
* set it only from task-result evidence. Execution errors belong in
|
|
960
|
+
* `outcome.raw.execution_error_count`, even when the run later fails. */
|
|
957
961
|
failureClass?: FailureClass;
|
|
958
|
-
/** Free-form
|
|
962
|
+
/** Free-form task-failure detail, scoped UNDER `failureClass`
|
|
959
963
|
* (e.g. failureClass='tool_recovery_failure', failureMode='forge_build_unsatisfied').
|
|
960
|
-
*
|
|
964
|
+
* Do not populate this from a child execution error alone. */
|
|
961
965
|
failureMode?: string;
|
|
962
966
|
/** Which split this run was drawn from. */
|
|
963
967
|
splitTag: RunSplitTag;
|
|
964
968
|
/**
|
|
965
|
-
* Stable scenario identifier the run was scored against.
|
|
966
|
-
*
|
|
967
|
-
* that pairs runs by scenario (preferences, paired stats, BT tournament)
|
|
968
|
-
* keys on this. The campaign artifact populates it canonically; legacy
|
|
969
|
-
* runs without it fall back to inference from `outcome.raw.scenario_id`
|
|
970
|
-
* or `experimentId`.
|
|
969
|
+
* Stable scenario identifier the run observed or was scored against.
|
|
970
|
+
* Comparison primitives match this identity rather than input order.
|
|
971
971
|
*/
|
|
972
|
-
scenarioId
|
|
972
|
+
scenarioId: string;
|
|
973
973
|
/**
|
|
974
974
|
* Canonical identity for the agent profile cell that produced this row:
|
|
975
975
|
* profile artifact hash plus optional harness/model/prompt/reporting
|
|
@@ -982,6 +982,7 @@ interface RunRecord {
|
|
|
982
982
|
|
|
983
983
|
interface RunEvidenceMetadata {
|
|
984
984
|
experimentId: string;
|
|
985
|
+
scenarioId: string;
|
|
985
986
|
candidateId: string;
|
|
986
987
|
seed: number;
|
|
987
988
|
model: string;
|
|
@@ -990,6 +991,7 @@ interface RunEvidenceMetadata {
|
|
|
990
991
|
commitSha: string;
|
|
991
992
|
splitTag: RunSplitTag;
|
|
992
993
|
tokenUsage: RunTokenUsage;
|
|
994
|
+
costProvenance: RunRecord['costProvenance'];
|
|
993
995
|
queueMs?: number;
|
|
994
996
|
judgeMetadata?: RunRecord['judgeMetadata'];
|
|
995
997
|
raw?: Record<string, number>;
|
package/dist/control.js
CHANGED
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
stopOnNoProgress,
|
|
11
11
|
stopOnRepeatedAction,
|
|
12
12
|
subjectiveEval
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OD5NQ2CS.js";
|
|
14
14
|
import "./chunk-VQMK5FMP.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-NL33OXEP.js";
|
|
16
16
|
import "./chunk-MA6HLL3S.js";
|
|
17
17
|
import "./chunk-VSMTAMNK.js";
|
|
18
18
|
import "./chunk-ONWEPEDO.js";
|
package/dist/hosted/index.d.ts
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Paper-grade RunRecord schema + runtime validator.
|
|
5
|
+
*
|
|
6
|
+
* Every run that participates in a promotion gate, paper table, or
|
|
7
|
+
* researcher loop SHOULD be recorded as a `RunRecord`. The mandatory
|
|
8
|
+
* fields are exactly those the paper "Two Loops, Three Roles" requires
|
|
9
|
+
* for reproducibility: who/what/when/cost/seed/hash, plus the search vs
|
|
10
|
+
* holdout split tag. A task score is optional because execution-only records
|
|
11
|
+
* must preserve missing labels instead of converting errors into zero quality.
|
|
12
|
+
*
|
|
13
|
+
* This is intentionally NOT a replacement for the rich `Run` /
|
|
14
|
+
* `ProposeReviewReport` / `ScenarioResult` types already in the
|
|
15
|
+
* package. Those are runtime structures with full provenance. A
|
|
16
|
+
* `RunRecord` is the analysis-time projection — the JSON-friendly
|
|
17
|
+
* row you'd put in a parquet file or paste into a notebook.
|
|
18
|
+
*
|
|
19
|
+
* Validate at the boundary:
|
|
20
|
+
*
|
|
21
|
+
* const rec = validateRunRecord(rawJson) // throws on missing
|
|
22
|
+
* const ok = isRunRecord(rawJson) // boolean check
|
|
23
|
+
* const rec = parseRunRecordSafe(rawJson) // { ok, value | error }
|
|
24
|
+
*
|
|
25
|
+
* The validator runs in pure TS — zod is intentionally NOT a
|
|
26
|
+
* dependency. Round-trip tested in `tests/run-record.test.ts`.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Explicit execution-lifecycle result for a run.
|
|
31
|
+
*
|
|
32
|
+
* This is separate from task quality (`outcome`) and failure classification.
|
|
33
|
+
* Producers set it only from root-run or process evidence.
|
|
34
|
+
*/
|
|
35
|
+
type RunTerminalOutcome = 'succeeded' | 'failed' | 'cancelled' | 'incomplete' | 'unknown';
|
|
36
|
+
|
|
1
37
|
/**
|
|
2
38
|
* Pass A substrate types — `runCampaign` is the one primitive every
|
|
3
39
|
* eval flow composes from. Three contracts in this file:
|
|
@@ -102,7 +138,7 @@ interface ParetoPoint {
|
|
|
102
138
|
onFrontier: boolean;
|
|
103
139
|
/** Optional gate verdict for this candidate, if a `GateDecision`
|
|
104
140
|
* for it was passed in. */
|
|
105
|
-
gate?: 'promote' | '
|
|
141
|
+
gate?: 'promote' | 'reject';
|
|
106
142
|
}
|
|
107
143
|
interface ParetoFigureSpec {
|
|
108
144
|
kind: 'pareto-cost-quality';
|
|
@@ -176,8 +212,8 @@ interface InsightReport {
|
|
|
176
212
|
/** Number of runs analyzed. */
|
|
177
213
|
n: number;
|
|
178
214
|
/** Runtime facts carried by the run records. These describe execution,
|
|
179
|
-
* not task quality: duration, queueing, token categories, models,
|
|
180
|
-
*
|
|
215
|
+
* not task quality: duration, queueing, token categories, models,
|
|
216
|
+
* execution errors, and terminal outcomes. */
|
|
181
217
|
execution: ExecutionInsight;
|
|
182
218
|
/** Composite-score distribution across all runs. Always present. */
|
|
183
219
|
composite: ScalarDistribution;
|
|
@@ -235,10 +271,9 @@ interface InsightReport {
|
|
|
235
271
|
* Surfaced metrics: composite, cost, duration, tokenUsage, plus any
|
|
236
272
|
* per-dimension judge metric present in both windows. */
|
|
237
273
|
priorPeriodComparison?: PriorPeriodComparison;
|
|
238
|
-
/** Model-free failure
|
|
239
|
-
* by count descending.
|
|
240
|
-
*
|
|
241
|
-
* the harness already recorded — actionable with no analyst wired. */
|
|
274
|
+
/** Model-free task-failure breakdown from `RunRecord.failureClass` or
|
|
275
|
+
* `failureMode`, ranked by count descending. Tags from successful or
|
|
276
|
+
* otherwise non-failed tasks are excluded. */
|
|
242
277
|
failureModes?: FailureModeTally[];
|
|
243
278
|
/** Top-N actionable recommendations, ranked by priority. The packet's
|
|
244
279
|
* human-readable layer; the numeric sections are the evidence. */
|
|
@@ -287,15 +322,46 @@ interface ExecutionInsight {
|
|
|
287
322
|
events: number;
|
|
288
323
|
reportingRuns: number;
|
|
289
324
|
};
|
|
290
|
-
/**
|
|
291
|
-
*
|
|
292
|
-
|
|
325
|
+
/** Runs with explicit execution-error telemetry. This is independent of
|
|
326
|
+
* whether the root run ultimately succeeded, failed, or has no terminal
|
|
327
|
+
* evidence. */
|
|
328
|
+
executionErrors: {
|
|
293
329
|
runs: number;
|
|
294
|
-
|
|
295
|
-
|
|
330
|
+
/** Share among runs that supplied an execution-error count.
|
|
331
|
+
* `null` when no run supplied error telemetry. */
|
|
332
|
+
fraction: number | null;
|
|
333
|
+
/** Execution-error events reported through the canonical count. */
|
|
334
|
+
events: number;
|
|
335
|
+
/** Runs that supplied an execution-error count, including explicit zeroes. */
|
|
296
336
|
reportingRuns: number;
|
|
337
|
+
/** Exact sum of `outcome.raw.error_span_count`, kept separate from other errors. */
|
|
338
|
+
errorSpanEvents: number;
|
|
339
|
+
/** Runs that supplied `outcome.raw.error_span_count`, including explicit zeroes. */
|
|
340
|
+
errorSpanReportingRuns: number;
|
|
341
|
+
/**
|
|
342
|
+
* Error-telemetry coverage crossed with independently reported terminal
|
|
343
|
+
* outcomes. `unreported` is distinct from a reported zero.
|
|
344
|
+
*/
|
|
345
|
+
byTerminalOutcome: Record<RunTerminalOutcome, ExecutionErrorOutcomeCell>;
|
|
346
|
+
};
|
|
347
|
+
/** Root-run or process outcomes. Missing `RunRecord.terminalOutcome` values
|
|
348
|
+
* count as `unknown`; child-span status never changes these counts. */
|
|
349
|
+
terminalOutcomes: {
|
|
350
|
+
succeeded: number;
|
|
351
|
+
failed: number;
|
|
352
|
+
cancelled: number;
|
|
353
|
+
incomplete: number;
|
|
354
|
+
unknown: number;
|
|
297
355
|
};
|
|
298
356
|
}
|
|
357
|
+
interface ExecutionErrorOutcomeCell {
|
|
358
|
+
/** Runs that explicitly reported one or more execution errors. */
|
|
359
|
+
withErrors: number;
|
|
360
|
+
/** Runs that explicitly reported zero execution errors. */
|
|
361
|
+
withoutErrors: number;
|
|
362
|
+
/** Runs with no execution-error count from the producer. */
|
|
363
|
+
unreported: number;
|
|
364
|
+
}
|
|
299
365
|
interface TokenUsageInsight {
|
|
300
366
|
input: ScalarDistribution;
|
|
301
367
|
output: ScalarDistribution;
|
|
@@ -314,12 +380,18 @@ interface TokenUsageInsight {
|
|
|
314
380
|
interface ScalarDistribution {
|
|
315
381
|
/** Sample count after dropping non-finite values. */
|
|
316
382
|
n: number;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
383
|
+
/** Null when `n` is zero. */
|
|
384
|
+
mean: number | null;
|
|
385
|
+
/** Null when `n` is zero. */
|
|
386
|
+
p50: number | null;
|
|
387
|
+
/** Null when `n` is zero. */
|
|
388
|
+
p95: number | null;
|
|
389
|
+
/** Null when `n` is zero. */
|
|
390
|
+
stddev: number | null;
|
|
391
|
+
/** Null when `n` is zero. */
|
|
392
|
+
min: number | null;
|
|
393
|
+
/** Null when `n` is zero. */
|
|
394
|
+
max: number | null;
|
|
323
395
|
/** Histogram bins using `agent-eval`'s `gainHistogram` primitive. */
|
|
324
396
|
histogram: GainDistributionBin[];
|
|
325
397
|
/** Worst-N runs by score, ascending. Populated for the composite
|
|
@@ -385,12 +457,16 @@ interface LiftInsight {
|
|
|
385
457
|
pValue: number;
|
|
386
458
|
/** Number of paired observations. */
|
|
387
459
|
n: number;
|
|
388
|
-
/**
|
|
389
|
-
|
|
460
|
+
/** Scored baseline observations without a candidate match. */
|
|
461
|
+
unpairedBaseline: number;
|
|
462
|
+
/** Scored candidate observations without a baseline match. */
|
|
463
|
+
unpairedCandidate: number;
|
|
464
|
+
/** Cohen's dz for paired deltas; null when the observed delta variance is zero. */
|
|
465
|
+
cohensD: number | null;
|
|
390
466
|
/** Minimum detectable effect at current n, 80% power. */
|
|
391
467
|
mde: number;
|
|
392
|
-
/**
|
|
393
|
-
requiredN: number;
|
|
468
|
+
/** Paired sample size needed to detect the standardized effect at 80% power. */
|
|
469
|
+
requiredN: number | null;
|
|
394
470
|
}
|
|
395
471
|
interface FailureClusterInsight {
|
|
396
472
|
/** All clusters identified by the registry, ranked by share descending. */
|
|
@@ -454,7 +530,7 @@ interface ReleaseSummary {
|
|
|
454
530
|
status: 'pass' | 'warn' | 'fail';
|
|
455
531
|
axes: Array<{
|
|
456
532
|
name: 'quality-lift' | 'contamination' | 'composite-distribution';
|
|
457
|
-
status: 'pass' | 'warn' | 'fail';
|
|
533
|
+
status: 'pass' | 'warn' | 'fail' | 'not_evaluated';
|
|
458
534
|
detail: string;
|
|
459
535
|
}>;
|
|
460
536
|
/** Free-form issues surfaced beyond the standard axes. Empty by default;
|
|
@@ -514,9 +590,8 @@ interface Recommendation {
|
|
|
514
590
|
* # Hosted-tier wire format — the schema that EVERY orchestrator (ours,
|
|
515
591
|
* a partner's self-hosted one, a future open implementation) must accept.
|
|
516
592
|
*
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
* (`HostedWireVersion` literal increment).
|
|
593
|
+
* This package implements exactly one wire version. Servers reject every
|
|
594
|
+
* other version instead of translating old payloads.
|
|
520
595
|
*
|
|
521
596
|
* The wire format is two event streams in one transport:
|
|
522
597
|
*
|
|
@@ -535,7 +610,7 @@ interface Recommendation {
|
|
|
535
610
|
* ever sees another tenant's data.
|
|
536
611
|
*/
|
|
537
612
|
|
|
538
|
-
declare const HOSTED_WIRE_VERSION: "2026-
|
|
613
|
+
declare const HOSTED_WIRE_VERSION: "2026-07-24.v1";
|
|
539
614
|
type HostedWireVersion = typeof HOSTED_WIRE_VERSION;
|
|
540
615
|
/** Every ingest request carries these. */
|
|
541
616
|
interface HostedIngestHeaders {
|
|
@@ -545,8 +620,8 @@ interface HostedIngestHeaders {
|
|
|
545
620
|
'x-tangle-tenant-id': string;
|
|
546
621
|
/** Wire-version pin so the server can reject incompatible payloads. */
|
|
547
622
|
'x-tangle-wire-version': HostedWireVersion;
|
|
548
|
-
/**
|
|
549
|
-
'idempotency-key'
|
|
623
|
+
/** Stable request key generated once and reused across retries. */
|
|
624
|
+
'idempotency-key': string;
|
|
550
625
|
}
|
|
551
626
|
/** Lifecycle stages of an eval-run as the substrate reports them. */
|
|
552
627
|
type EvalRunStatus = 'started' | 'baseline-complete' | 'generation-complete' | 'gate-decided' | 'finished' | 'errored';
|
|
@@ -555,11 +630,15 @@ interface EvalRunCellScore {
|
|
|
555
630
|
scenarioId: string;
|
|
556
631
|
/** Repetition index when reps > 1; 0 for the default. */
|
|
557
632
|
rep: number;
|
|
558
|
-
/** Composite score across
|
|
559
|
-
compositeMean: number;
|
|
560
|
-
/** Per-judge
|
|
633
|
+
/** Composite score across successful judges, or null when unscored. */
|
|
634
|
+
compositeMean: number | null;
|
|
635
|
+
/** Per-judge and per-dimension scores; failed or missing judges are absent. */
|
|
561
636
|
dimensions: Record<string, Record<string, number>>;
|
|
562
|
-
/**
|
|
637
|
+
/** Root execution result, kept separate from task quality. */
|
|
638
|
+
terminalOutcome: RunTerminalOutcome;
|
|
639
|
+
/** Canonical execution-error count, or null when the producer did not measure it. */
|
|
640
|
+
executionErrorCount: number | null;
|
|
641
|
+
/** Per-cell dispatch or judge error. Missing on success. */
|
|
563
642
|
errorMessage?: string;
|
|
564
643
|
}
|
|
565
644
|
interface EvalRunGenerationSnapshot {
|
|
@@ -573,8 +652,8 @@ interface EvalRunGenerationSnapshot {
|
|
|
573
652
|
surface?: MutableSurface;
|
|
574
653
|
/** Per-cell scores for this generation. */
|
|
575
654
|
cells: EvalRunCellScore[];
|
|
576
|
-
/**
|
|
577
|
-
compositeMean: number;
|
|
655
|
+
/** Mean across scored cells, or null when no cell has a task-quality label. */
|
|
656
|
+
compositeMean: number | null;
|
|
578
657
|
/** Total $ spent across this generation. */
|
|
579
658
|
costUsd: number;
|
|
580
659
|
/** Wall-clock duration of this generation. */
|
|
@@ -614,10 +693,14 @@ interface EvalRunEvent {
|
|
|
614
693
|
* paired-bootstrap lift CI, judge stats, inter-rater agreement,
|
|
615
694
|
* contamination check, failure clusters (when an analyst is wired),
|
|
616
695
|
* outcome correlation (when downstream signal is supplied), and the
|
|
617
|
-
* recommendations the dashboard surfaces verbatim.
|
|
618
|
-
* clients that don't know about this field continue to work. */
|
|
696
|
+
* recommendations the dashboard surfaces verbatim. */
|
|
619
697
|
insightReport?: InsightReport;
|
|
620
698
|
}
|
|
699
|
+
/**
|
|
700
|
+
* Canonical unsigned 64-bit integer encoded as a base-10 string.
|
|
701
|
+
* JSON numbers cannot represent OTLP nanosecond timestamps exactly.
|
|
702
|
+
*/
|
|
703
|
+
type UnixNanoTimestamp = string;
|
|
621
704
|
/**
|
|
622
705
|
* OTel-shape span with a few additional attributes for eval-run pivoting.
|
|
623
706
|
* Compatible with any OTLP collector — `name`, `traceId`, `spanId`,
|
|
@@ -628,11 +711,11 @@ interface TraceSpanEvent {
|
|
|
628
711
|
spanId: string;
|
|
629
712
|
parentSpanId?: string;
|
|
630
713
|
name: string;
|
|
631
|
-
startTimeUnixNano:
|
|
632
|
-
endTimeUnixNano:
|
|
714
|
+
startTimeUnixNano: UnixNanoTimestamp;
|
|
715
|
+
endTimeUnixNano: UnixNanoTimestamp;
|
|
633
716
|
attributes: Record<string, string | number | boolean>;
|
|
634
717
|
events?: Array<{
|
|
635
|
-
timeUnixNano:
|
|
718
|
+
timeUnixNano: UnixNanoTimestamp;
|
|
636
719
|
name: string;
|
|
637
720
|
attributes?: Record<string, string | number | boolean>;
|
|
638
721
|
}>;
|
|
@@ -740,4 +823,22 @@ declare function hostedClientFromEnv(overrides?: Partial<HostedTenant> & {
|
|
|
740
823
|
env?: Record<string, string | undefined>;
|
|
741
824
|
}): HostedClient | undefined;
|
|
742
825
|
|
|
743
|
-
|
|
826
|
+
declare const UnixNanoTimestampSchema: z.ZodType<UnixNanoTimestamp>;
|
|
827
|
+
declare const InsightReportSchema: z.ZodType<InsightReport>;
|
|
828
|
+
declare const MutableSurfaceSchema: z.ZodType<MutableSurface>;
|
|
829
|
+
declare const RunTerminalOutcomeSchema: z.ZodEnum<{
|
|
830
|
+
succeeded: "succeeded";
|
|
831
|
+
unknown: "unknown";
|
|
832
|
+
failed: "failed";
|
|
833
|
+
cancelled: "cancelled";
|
|
834
|
+
incomplete: "incomplete";
|
|
835
|
+
}>;
|
|
836
|
+
declare const EvalRunCellScoreSchema: z.ZodType<EvalRunCellScore>;
|
|
837
|
+
declare const EvalRunGenerationSnapshotSchema: z.ZodType<EvalRunGenerationSnapshot>;
|
|
838
|
+
declare const EvalRunEventSchema: z.ZodType<EvalRunEvent>;
|
|
839
|
+
declare const TraceSpanEventSchema: z.ZodType<TraceSpanEvent>;
|
|
840
|
+
declare const IngestEvalRunsRequestSchema: z.ZodType<IngestEvalRunsRequest>;
|
|
841
|
+
declare const IngestTracesRequestSchema: z.ZodType<IngestTracesRequest>;
|
|
842
|
+
declare const IngestResponseSchema: z.ZodType<IngestResponse>;
|
|
843
|
+
|
|
844
|
+
export { type EvalRunCellScore, EvalRunCellScoreSchema, type EvalRunEvent, EvalRunEventSchema, type EvalRunGenerationSnapshot, EvalRunGenerationSnapshotSchema, type EvalRunStatus, HOSTED_WIRE_VERSION, type HostedClient, type HostedIngestHeaders, type HostedTenant, type HostedWireVersion, type IngestEvalRunsRequest, IngestEvalRunsRequestSchema, type IngestResponse, IngestResponseSchema, type IngestTracesRequest, IngestTracesRequestSchema, type InsightReport, InsightReportSchema, MutableSurfaceSchema, RunTerminalOutcomeSchema, type TraceSpanEvent, TraceSpanEventSchema, type UnixNanoTimestamp, UnixNanoTimestampSchema, createHostedClient, hostedClientFromEnv, hostedTenantFromEnv };
|
package/dist/hosted/index.js
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
+
EvalRunCellScoreSchema,
|
|
3
|
+
EvalRunEventSchema,
|
|
4
|
+
EvalRunGenerationSnapshotSchema,
|
|
2
5
|
HOSTED_WIRE_VERSION,
|
|
6
|
+
IngestEvalRunsRequestSchema,
|
|
7
|
+
IngestResponseSchema,
|
|
8
|
+
IngestTracesRequestSchema,
|
|
9
|
+
InsightReportSchema,
|
|
10
|
+
MutableSurfaceSchema,
|
|
11
|
+
RunTerminalOutcomeSchema,
|
|
12
|
+
TraceSpanEventSchema,
|
|
13
|
+
UnixNanoTimestampSchema,
|
|
3
14
|
createHostedClient,
|
|
4
15
|
hostedClientFromEnv,
|
|
5
16
|
hostedTenantFromEnv
|
|
6
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-IG35YDN3.js";
|
|
7
18
|
import "../chunk-PZ5AY32C.js";
|
|
8
19
|
export {
|
|
20
|
+
EvalRunCellScoreSchema,
|
|
21
|
+
EvalRunEventSchema,
|
|
22
|
+
EvalRunGenerationSnapshotSchema,
|
|
9
23
|
HOSTED_WIRE_VERSION,
|
|
24
|
+
IngestEvalRunsRequestSchema,
|
|
25
|
+
IngestResponseSchema,
|
|
26
|
+
IngestTracesRequestSchema,
|
|
27
|
+
InsightReportSchema,
|
|
28
|
+
MutableSurfaceSchema,
|
|
29
|
+
RunTerminalOutcomeSchema,
|
|
30
|
+
TraceSpanEventSchema,
|
|
31
|
+
UnixNanoTimestampSchema,
|
|
10
32
|
createHostedClient,
|
|
11
33
|
hostedClientFromEnv,
|
|
12
34
|
hostedTenantFromEnv
|