@tangle-network/agent-eval 0.203.2 → 0.203.4

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.
@@ -1,126 +0,0 @@
1
- import { u as JudgeScore } from "./types-DLxe96rp.js";
2
- import { i as ContinuousAgreementOptions, r as ContinuousAgreement } from "./judge-calibration-DFtEMlde.js";
3
- //#region src/statistics/agreement-irr.d.ts
4
- /**
5
- * Inter-rater reliability — Krippendorff's α under the squared-difference
6
- * metric, pooled across dimensions.
7
- *
8
- * Each inner array is one judge's scores. Items are matched by position
9
- * WITHIN a dimension: the k-th score a judge supplies carrying dimension
10
- * `d` is item k of `d`, and the ratings compared against each other are
11
- * the ones different judges gave to the same item. Every judge that scores
12
- * a dimension at all must supply the same number of scores for it —
13
- * ragged input cannot be aligned into items and throws rather than
14
- * comparing mismatched items.
15
- *
16
- * α = 1 − D_observed / D_expected: D_observed averages the squared
17
- * difference over within-item judge pairs, D_expected over every pair of
18
- * ratings irrespective of item. α = 1 is perfect agreement, 0 is chance,
19
- * negative is systematic disagreement.
20
- */
21
- declare function interRaterReliability(judgeScores: JudgeScore[][]): number;
22
- interface CorpusScoreRecord {
23
- /** Stable identifier for the rated item (scenario, span, turn, …). */
24
- itemId: string;
25
- /** Identifier for the judge that produced this score. */
26
- judgeName: string;
27
- /** Dimension name (matches `JudgeScore.dimension`). */
28
- dimension: string;
29
- /** Numeric score; must be finite. */
30
- score: number;
31
- }
32
- interface CorpusAgreementPerDimension extends ContinuousAgreement {
33
- dimension: string;
34
- /** Item IDs that contributed to this dimension's matrix (every judge scored them). */
35
- itemIds: string[];
36
- /** Judge IDs that contributed to this dimension's matrix. */
37
- judgeIds: string[];
38
- }
39
- interface CorpusAgreementReport {
40
- /** Per-dimension ICC(2,1) + κ_w + Pearson + Spearman + bootstrap CIs. */
41
- perDimension: CorpusAgreementPerDimension[];
42
- /** Mean ICC across dimensions (NaN if no dimension yielded a finite ICC). */
43
- overallIcc: number;
44
- /** Mean weighted κ across dimensions (NaN if none finite). */
45
- overallWeightedKappa: number;
46
- /** Dimensions evaluated (sorted). */
47
- dimensions: string[];
48
- /** Judges seen across the corpus (sorted). */
49
- judgeIds: string[];
50
- }
51
- interface CorpusAgreementOptions extends ContinuousAgreementOptions {
52
- /**
53
- * Restrict the audit to these dimensions. Default = every dimension
54
- * that appears in the input. A dimension named here but absent from
55
- * the input throws — silent omission would corrupt the overall metric.
56
- */
57
- dimensions?: string[];
58
- /**
59
- * Restrict the audit to these judges. Default = every judge that
60
- * appears in the input. A judge named here but absent from a
61
- * dimension throws (see "fail loud" below).
62
- */
63
- judges?: string[];
64
- }
65
- /**
66
- * Corpus-wide inter-rater agreement across N items × M judges × D dimensions.
67
- *
68
- * For each dimension, builds the [n_items][n_judges] matrix of scores
69
- * (keeping only items every judge rated on that dimension), then runs
70
- * `continuousAgreement` to get ICC(2,1), κ_w, Pearson, Spearman, and
71
- * bootstrap CIs. Reports a pooled mean across dimensions as a single
72
- * "is this judge panel reliable on this corpus?" number.
73
- *
74
- * Fail-loud contract:
75
- * - Empty input throws.
76
- * - Fewer than 2 judges or fewer than 2 items per dimension throws.
77
- * - A judge present in some dimensions but with zero scored items on
78
- * another dimension throws (would silently shrink the matrix).
79
- * - Duplicate (itemId, judgeName, dimension) records throw.
80
- */
81
- declare function corpusInterRaterAgreement(records: CorpusScoreRecord[], opts?: CorpusAgreementOptions): CorpusAgreementReport;
82
- /**
83
- * Convenience adapter for `JudgeScore[]` data keyed externally by item.
84
- *
85
- * Use when you have per-item arrays of `JudgeScore[]` (e.g. one
86
- * `ScenarioResult.judgeScores` per scenario) and want corpus-wide
87
- * agreement without manually flattening. `itemId` must be unique per
88
- * row of `itemsScores`.
89
- */
90
- declare function corpusInterRaterAgreementFromJudgeScores(itemsScores: Array<{
91
- itemId: string;
92
- scores: JudgeScore[];
93
- }>, opts?: CorpusAgreementOptions): CorpusAgreementReport;
94
- //#endregion
95
- //#region src/series-convergence.d.ts
96
- /**
97
- * Series convergence — detects whether a sequence of scalar measurements
98
- * is stabilizing, drifting, or noisy. It reads drift *across* runs, e.g.
99
- * "are my nightly eval scores stabilizing?".
100
- *
101
- * Three signals:
102
- * - stabilized: last K values have low variance (< epsilon) — done
103
- * - drifting: recent trend is monotonic and beyond noise — regressing or improving
104
- * - noisy: neither — keep iterating, but flag as untrustworthy for gating
105
- */
106
- interface SeriesConvergenceOptions {
107
- /** Window size for "recent" analysis (default 5). */
108
- window?: number;
109
- /** Coefficient-of-variation threshold below which the window is stabilized (default 0.05 = 5%). */
110
- stableCv?: number;
111
- /** Minimum monotone run length to call drift (default 3). */
112
- driftRun?: number;
113
- }
114
- interface SeriesConvergenceResult {
115
- state: 'stabilized' | 'drifting-up' | 'drifting-down' | 'noisy' | 'insufficient-data';
116
- windowMean: number;
117
- windowCv: number;
118
- /** Longest monotonic run at the tail of the series (positive for up, negative for down). */
119
- tailRun: number;
120
- /** True when n ≥ window AND windowCv ≤ stableCv. */
121
- stable: boolean;
122
- }
123
- declare function analyzeSeries(values: number[], options?: SeriesConvergenceOptions): SeriesConvergenceResult;
124
- //#endregion
125
- export { CorpusAgreementPerDimension as a, corpusInterRaterAgreement as c, CorpusAgreementOptions as i, corpusInterRaterAgreementFromJudgeScores as l, SeriesConvergenceResult as n, CorpusAgreementReport as o, analyzeSeries as r, CorpusScoreRecord as s, SeriesConvergenceOptions as t, interRaterReliability as u };
126
- //# sourceMappingURL=series-convergence-DLy0bQMV.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"series-convergence-DLy0bQMV.d.ts","names":[],"sources":["../src/statistics/agreement-irr.ts","../src/series-convergence.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;iBAyBgB,sBAAsB,aAAa;UA0ElC;;EAEf;;EAEA;;EAEA;;EAEA;;UAGe,oCAAoC;EACnD;;EAEA;;EAEA;;UAGe;;EAEf,cAAc;;EAEd;;EAEA;;EAEA;;EAEA;;UAGe,+BAA+B;;;;;;EAM9C;;;;;;EAMA;;;;;;;;;;;;;;;;;;iBAmBc,0BACd,SAAS,qBACT,OAAM,yBACL;;;;;;;;;iBA0Ha,yCACd,aAAa;EAAQ;EAAgB,QAAQ;IAC7C,OAAM,yBACL;;;;;;;;;;;;;UCvRc;;EAEf;;EAEA;;EAEA;;UAGe;EACf;EACA;EACA;;EAEA;;EAEA;;iBAGc,cACd,kBACA,UAAS,2BACR"}