@agenticprimitives/evaluation 0.0.0-alpha.4 → 0.0.0-alpha.6
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/dist/act.d.ts +97 -0
- package/dist/act.d.ts.map +1 -0
- package/dist/act.js +115 -0
- package/dist/act.js.map +1 -0
- package/dist/assessment.d.ts +136 -0
- package/dist/assessment.d.ts.map +1 -0
- package/dist/assessment.js +162 -0
- package/dist/assessment.js.map +1 -0
- package/dist/canonical.d.ts +2 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +4 -0
- package/dist/canonical.js.map +1 -0
- package/dist/capture.d.ts +90 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +195 -0
- package/dist/capture.js.map +1 -0
- package/dist/compare-runner.d.ts +204 -0
- package/dist/compare-runner.d.ts.map +1 -0
- package/dist/compare-runner.js +313 -0
- package/dist/compare-runner.js.map +1 -0
- package/dist/conformal.d.ts +113 -0
- package/dist/conformal.d.ts.map +1 -0
- package/dist/conformal.js +113 -0
- package/dist/conformal.js.map +1 -0
- package/dist/consensus.d.ts +53 -0
- package/dist/consensus.d.ts.map +1 -0
- package/dist/consensus.js +64 -0
- package/dist/consensus.js.map +1 -0
- package/dist/experiment.d.ts +218 -0
- package/dist/experiment.d.ts.map +1 -0
- package/dist/experiment.js +196 -0
- package/dist/experiment.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +128 -0
- package/dist/ledger.d.ts.map +1 -0
- package/dist/ledger.js +146 -0
- package/dist/ledger.js.map +1 -0
- package/dist/measure.d.ts +63 -0
- package/dist/measure.d.ts.map +1 -0
- package/dist/measure.js +95 -0
- package/dist/measure.js.map +1 -0
- package/dist/replay.d.ts +50 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/replay.js +61 -0
- package/dist/replay.js.map +1 -0
- package/dist/report.d.ts +189 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +282 -0
- package/dist/report.js.map +1 -0
- package/dist/rollup.d.ts +91 -0
- package/dist/rollup.d.ts.map +1 -0
- package/dist/rollup.js +80 -0
- package/dist/rollup.js.map +1 -0
- package/dist/selection-gates.d.ts +283 -0
- package/dist/selection-gates.d.ts.map +1 -0
- package/dist/selection-gates.js +331 -0
- package/dist/selection-gates.js.map +1 -0
- package/dist/selection-score.d.ts +285 -0
- package/dist/selection-score.d.ts.map +1 -0
- package/dist/selection-score.js +392 -0
- package/dist/selection-score.js.map +1 -0
- package/dist/selection.d.ts +83 -0
- package/dist/selection.d.ts.map +1 -0
- package/dist/selection.js +86 -0
- package/dist/selection.js.map +1 -0
- package/dist/signals.d.ts +37 -0
- package/dist/signals.d.ts.map +1 -0
- package/dist/signals.js +44 -0
- package/dist/signals.js.map +1 -0
- package/dist/stats.d.ts +62 -0
- package/dist/stats.d.ts.map +1 -0
- package/dist/stats.js +279 -0
- package/dist/stats.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AssessmentOutcomeV1, AssessmentV1 } from './assessment.js';
|
|
2
|
+
import type { JudgeKindV1 } from './selection.js';
|
|
3
|
+
export interface AggregateOptsV1 {
|
|
4
|
+
/** Declared weight per evaluator SA. Absent ⇒ 1. Visible in the output; never derived from stake. */
|
|
5
|
+
weights?: Readonly<Record<string, number>>;
|
|
6
|
+
/** How many MADs from the median before a score is called an outlier. Default 3; stated, not hidden. */
|
|
7
|
+
madThreshold?: number;
|
|
8
|
+
/** Judge kinds to include. Omitted ⇒ all, kept apart in the output (J4). */
|
|
9
|
+
kinds?: readonly JudgeKindV1[];
|
|
10
|
+
}
|
|
11
|
+
export interface ScoreAggregateV1 {
|
|
12
|
+
median: number;
|
|
13
|
+
mad: number;
|
|
14
|
+
/** Scores kept, with who gave them — so a reader can see the sample, not just its summary. */
|
|
15
|
+
kept: ReadonlyArray<{
|
|
16
|
+
evaluator: string;
|
|
17
|
+
score: number;
|
|
18
|
+
weight: number;
|
|
19
|
+
}>;
|
|
20
|
+
/** Scores rejected as outliers, and by how far. Rejected loudly: a dropped data point is a decision. */
|
|
21
|
+
rejected: ReadonlyArray<{
|
|
22
|
+
evaluator: string;
|
|
23
|
+
score: number;
|
|
24
|
+
madsFromMedian: number;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
export interface CriterionAggregateV1 {
|
|
28
|
+
criterionId: string;
|
|
29
|
+
/** Count per outcome, per judge kind. Kinds are never summed together (J4). */
|
|
30
|
+
byKind: Readonly<Record<JudgeKindV1, Partial<Record<AssessmentOutcomeV1, number>>>>;
|
|
31
|
+
/** `agreement` when every included evaluator returned the same outcome; otherwise `disagreement`. */
|
|
32
|
+
state: 'agreement' | 'disagreement' | 'no-assessments';
|
|
33
|
+
/** Present only on agreement. On disagreement the caller is shown the distribution and decides. */
|
|
34
|
+
agreedOutcome?: AssessmentOutcomeV1;
|
|
35
|
+
/** Present only where scores were given. */
|
|
36
|
+
score?: ScoreAggregateV1;
|
|
37
|
+
}
|
|
38
|
+
export interface SubjectAggregateV1 {
|
|
39
|
+
runRef: string;
|
|
40
|
+
assessments: number;
|
|
41
|
+
evaluators: readonly string[];
|
|
42
|
+
weights: Readonly<Record<string, number>>;
|
|
43
|
+
criteria: readonly CriterionAggregateV1[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Aggregate assessments of one subject (one `runRef`). Pure.
|
|
47
|
+
*
|
|
48
|
+
* Supersession is the CALLER's to resolve: pass the assessments that currently stand. This function will not
|
|
49
|
+
* guess which of two assessments by the same evaluator is live, because `supersedes` is a chain and a
|
|
50
|
+
* half-read chain produces a confident wrong answer.
|
|
51
|
+
*/
|
|
52
|
+
export declare function aggregateAssessments(runRef: string, assessments: readonly AssessmentV1[], opts?: AggregateOptsV1): SubjectAggregateV1;
|
|
53
|
+
//# sourceMappingURL=consensus.d.ts.map
|
|
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AAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1C,QAAQ,EAAE,SAAS,oBAAoB,EAAE,CAAC;CAC3C;AAUD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,YAAY,EAAE,EACpC,IAAI,GAAE,eAAoB,GACzB,kBAAkB,CAwDpB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const median = (xs) => {
|
|
2
|
+
const s = [...xs].sort((a, b) => a - b);
|
|
3
|
+
const mid = s.length >> 1;
|
|
4
|
+
return s.length % 2 ? s[mid] : (s[mid - 1] + s[mid]) / 2;
|
|
5
|
+
};
|
|
6
|
+
const KINDS = ['mechanical', 'model', 'human'];
|
|
7
|
+
/**
|
|
8
|
+
* Aggregate assessments of one subject (one `runRef`). Pure.
|
|
9
|
+
*
|
|
10
|
+
* Supersession is the CALLER's to resolve: pass the assessments that currently stand. This function will not
|
|
11
|
+
* guess which of two assessments by the same evaluator is live, because `supersedes` is a chain and a
|
|
12
|
+
* half-read chain produces a confident wrong answer.
|
|
13
|
+
*/
|
|
14
|
+
export function aggregateAssessments(runRef, assessments, opts = {}) {
|
|
15
|
+
const madThreshold = opts.madThreshold ?? 3;
|
|
16
|
+
const included = assessments
|
|
17
|
+
.filter((a) => a.subject?.runRef === runRef)
|
|
18
|
+
.filter((a) => !opts.kinds || opts.kinds.includes(a.evaluator.kind));
|
|
19
|
+
const evaluators = [...new Set(included.map((a) => a.evaluator.sa))].sort();
|
|
20
|
+
const weightOf = (sa) => opts.weights?.[sa] ?? 1;
|
|
21
|
+
const weights = Object.fromEntries(evaluators.map((e) => [e, weightOf(e)]));
|
|
22
|
+
const criterionIds = [...new Set(included.flatMap((a) => a.results.map((r) => r.criterionId)))].sort();
|
|
23
|
+
const criteria = criterionIds.map((criterionId) => {
|
|
24
|
+
const rows = included
|
|
25
|
+
.map((a) => ({ a, r: a.results.find((x) => x.criterionId === criterionId) }))
|
|
26
|
+
.filter((x) => Boolean(x.r));
|
|
27
|
+
const byKind = Object.fromEntries(KINDS.map((k) => [k, {}]));
|
|
28
|
+
for (const { a, r } of rows) {
|
|
29
|
+
const bucket = byKind[a.evaluator.kind];
|
|
30
|
+
bucket[r.outcome] = (bucket[r.outcome] ?? 0) + 1;
|
|
31
|
+
}
|
|
32
|
+
const outcomes = new Set(rows.map((x) => x.r.outcome));
|
|
33
|
+
const state = rows.length === 0 ? 'no-assessments' : outcomes.size === 1 ? 'agreement' : 'disagreement';
|
|
34
|
+
const scored = rows.filter((x) => typeof x.r.score === 'number' && Number.isFinite(x.r.score));
|
|
35
|
+
let score;
|
|
36
|
+
if (scored.length > 0) {
|
|
37
|
+
const values = scored.map((x) => x.r.score);
|
|
38
|
+
const m = median(values);
|
|
39
|
+
const mad = median(values.map((v) => Math.abs(v - m)));
|
|
40
|
+
// With a MAD of zero every non-median value is infinitely far out, which would reject a lone dissenter
|
|
41
|
+
// on a tie. Treat zero spread as "no basis to reject" and keep everything — visibly.
|
|
42
|
+
const kept = [];
|
|
43
|
+
const rejected = [];
|
|
44
|
+
for (const x of scored) {
|
|
45
|
+
const dist = mad === 0 ? 0 : Math.abs(x.r.score - m) / mad;
|
|
46
|
+
if (dist > madThreshold)
|
|
47
|
+
rejected.push({ evaluator: x.a.evaluator.sa, score: x.r.score, madsFromMedian: dist });
|
|
48
|
+
else
|
|
49
|
+
kept.push({ evaluator: x.a.evaluator.sa, score: x.r.score, weight: weightOf(x.a.evaluator.sa) });
|
|
50
|
+
}
|
|
51
|
+
const keptValues = kept.flatMap((k) => Array.from({ length: Math.max(1, Math.round(k.weight)) }, () => k.score));
|
|
52
|
+
score = { median: keptValues.length ? median(keptValues) : m, mad, kept, rejected };
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
criterionId,
|
|
56
|
+
byKind,
|
|
57
|
+
state,
|
|
58
|
+
...(state === 'agreement' ? { agreedOutcome: [...outcomes][0] } : {}),
|
|
59
|
+
...(score ? { score } : {}),
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
return { runRef, assessments: included.length, evaluators, weights, criteria };
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=consensus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consensus.js","sourceRoot":"","sources":["../src/consensus.ts"],"names":[],"mappings":"AA+DA,MAAM,MAAM,GAAG,CAAC,EAAqB,EAAU,EAAE;IAC/C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;IAC1B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAE,GAAG,CAAC,CAAC,GAAG,CAAE,CAAC,GAAG,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,KAAK,GAA2B,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,WAAoC,EACpC,OAAwB,EAAE;IAE1B,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,WAAW;SACzB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,KAA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C,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;YACjH,KAAK,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACtF,CAAC;QAED,OAAO;YACL,WAAW;YACX,MAAM;YACN,KAAK;YACL,GAAG,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import type { SelectionVerdictV1 } from './selection.js';
|
|
2
|
+
import type { SelectionScoreV1, SelectionVerdictReportV1, SelectionComparisonV1, SelectionThresholdsV1, SelectionRowV1 } from './selection-score.js';
|
|
3
|
+
import type { CaptureLevelV1 } from './capture.js';
|
|
4
|
+
/** What a run may be asked to differ in — the knob `/harness/ask` accepts on a development estate (A4). Every field
|
|
5
|
+
* is one COMPONENT of the variant; a request the estate does not know is refused, never ignored. */
|
|
6
|
+
export interface VariantRequestV1 {
|
|
7
|
+
/** model (the deployment's planner) | rule-based. */
|
|
8
|
+
plannerKind?: 'model' | 'rule-based';
|
|
9
|
+
/** How instruction skills are selected: `model` over the descriptions, `declared` by the contracts' utterances (holds). */
|
|
10
|
+
selection?: 'model' | 'declared' | 'ontology' | 'judgment' | 'ontology+judgment' | 'propose+judgment' | 'ontology-first' | 'framed-judgment' | 'outcome' | 'outcome-selective';
|
|
11
|
+
/** A provider the estate offers (`groq`, `anthropic`, …) — the one every role runs on unless a role names its own. */
|
|
12
|
+
provider?: string;
|
|
13
|
+
/** PER-AREA PROVIDERS (2026-10-01). A comparison may put a different provider on each of the three model roles —
|
|
14
|
+
* the SELECTOR (the planner and the selection judge), the ANSWER (an instruction skill's answer, the pairwise's
|
|
15
|
+
* second answer) and the JUDGE (quality, outcome and pairwise judges) — so "answered with Gemini, judged with Claude"
|
|
16
|
+
* is one variant and the confound it carries is named. Each falls back to `provider`, then the deployment default. */
|
|
17
|
+
selectionProvider?: string;
|
|
18
|
+
answerProvider?: string;
|
|
19
|
+
judgeProvider?: string;
|
|
20
|
+
/** Harness-capability toggles by notation (`retrieval/kb` → off | tool | playbook). */
|
|
21
|
+
toggles?: Record<string, string>;
|
|
22
|
+
/** The playbook this run must run under, by definition digest — refused when the agent's playbook differs. */
|
|
23
|
+
playbook?: string;
|
|
24
|
+
/** The seeded records the run begins from (a comparison's fixture). */
|
|
25
|
+
startingState?: {
|
|
26
|
+
domain: string;
|
|
27
|
+
scenarioId: string;
|
|
28
|
+
digest: string;
|
|
29
|
+
};
|
|
30
|
+
/** Spec 416 W3 — acceptance by a fitted conformal map (inline, cited by digest). */
|
|
31
|
+
acceptance?: {
|
|
32
|
+
method: 'conformal';
|
|
33
|
+
alpha: number;
|
|
34
|
+
temperature: number;
|
|
35
|
+
qhat: number;
|
|
36
|
+
mapDigest: string;
|
|
37
|
+
};
|
|
38
|
+
/** Spec 416 — the judge's profile (`fast`: one call, one question, the provider's light model). */
|
|
39
|
+
judgeProfile?: 'thorough' | 'fast' | 'logprob';
|
|
40
|
+
/** Spec 416 §4h — a seeded asker context (set per run by the runner from an intent's starting state). */
|
|
41
|
+
askerContext?: {
|
|
42
|
+
digest: string;
|
|
43
|
+
recentSkills?: Array<{
|
|
44
|
+
id: string;
|
|
45
|
+
times: number;
|
|
46
|
+
}>;
|
|
47
|
+
memoryTags?: string[];
|
|
48
|
+
heldClasses?: string[];
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export declare const variantRequestDigest: (v: VariantRequestV1) => Promise<`sha256:${string}`>;
|
|
52
|
+
export declare const thresholdsDigest: (t: SelectionThresholdsV1) => Promise<`sha256:${string}`>;
|
|
53
|
+
/** The components two variant requests differ in. One ⇒ a clean comparison; more ⇒ confounded (spec 414 §7). */
|
|
54
|
+
export declare function confoundsOf(a: VariantRequestV1, b: VariantRequestV1): string[];
|
|
55
|
+
export interface ExperimentPlanV1 {
|
|
56
|
+
type: 'ap.experiment-plan.v1';
|
|
57
|
+
id: string;
|
|
58
|
+
replaySetDigest: string;
|
|
59
|
+
criterionDigest: string;
|
|
60
|
+
split: 'development' | 'held-out' | 'all';
|
|
61
|
+
repeats: number;
|
|
62
|
+
variants: Record<string, VariantRequestV1>;
|
|
63
|
+
thresholds: SelectionThresholdsV1;
|
|
64
|
+
/** Skill-selection observation policy. */
|
|
65
|
+
policy?: 'primary' | 'any-fire';
|
|
66
|
+
registeredAt: string;
|
|
67
|
+
}
|
|
68
|
+
/** The plan's identity: its COMPONENTS — set, criterion, split, repeats, variants, thresholds, policy. The moment of
|
|
69
|
+
* registration is not one of them (the same plan registered twice is the same plan; a changed component is a new plan). */
|
|
70
|
+
export declare const experimentPlanDigest: (p: ExperimentPlanV1) => Promise<`sha256:${string}`>;
|
|
71
|
+
export declare function validateExperimentPlan(raw: unknown): {
|
|
72
|
+
ok: true;
|
|
73
|
+
plan: ExperimentPlanV1;
|
|
74
|
+
} | {
|
|
75
|
+
ok: false;
|
|
76
|
+
errors: string[];
|
|
77
|
+
};
|
|
78
|
+
export declare function experimentPlan(input: Omit<ExperimentPlanV1, 'type' | 'thresholds' | 'registeredAt'> & {
|
|
79
|
+
thresholds?: SelectionThresholdsV1;
|
|
80
|
+
registeredAt?: string;
|
|
81
|
+
}): ExperimentPlanV1;
|
|
82
|
+
/** One dispatched run, as the record keeps it. */
|
|
83
|
+
export interface ExperimentRunV1 {
|
|
84
|
+
intentId: string;
|
|
85
|
+
variant: string;
|
|
86
|
+
repeat: number;
|
|
87
|
+
/** The run reference (pseudonymised in the eval store). */
|
|
88
|
+
runRef: string | null;
|
|
89
|
+
status: 'ok' | 'failed' | 'unreadable';
|
|
90
|
+
/** What the trace said was selected (canonical skill ids after mapping; tool ids when unmapped). */
|
|
91
|
+
selected: string[];
|
|
92
|
+
evidence: 'stamped' | 'inferred' | 'none';
|
|
93
|
+
/** The variant the run ACTUALLY ran under, from its trace — a mismatch with the request is a finding. */
|
|
94
|
+
ranUnder?: {
|
|
95
|
+
variantDigest?: string;
|
|
96
|
+
plannerKind?: string;
|
|
97
|
+
toggles?: string[];
|
|
98
|
+
} | null;
|
|
99
|
+
/** WHICH MODEL CARRIED EACH ROLE, from the trace's ModelInvocation activities (2026-10-01): a run that names no provider
|
|
100
|
+
* goes to the deployment's default, and the variant digest does not change when the provider does — so without this
|
|
101
|
+
* a record cannot say whether it ran on Gemini or Claude. One row per (role, provider, model) with the call count. */
|
|
102
|
+
models?: Array<{
|
|
103
|
+
role: string;
|
|
104
|
+
provider: string;
|
|
105
|
+
model: string;
|
|
106
|
+
calls: number;
|
|
107
|
+
}>;
|
|
108
|
+
verdict?: SelectionVerdictV1;
|
|
109
|
+
/** The level the run was exported at, or null when the firewall refused (the reason is counted on the record). */
|
|
110
|
+
captureLevel: CaptureLevelV1 | null;
|
|
111
|
+
/** What the run's model calls used, as providers REPORTED it: the selection (the model planner's or the judge's calls)
|
|
112
|
+
* and the whole run; `unreported` counts calls that reported nothing (so a total is never read as complete when it
|
|
113
|
+
* is not). Numbers only. */
|
|
114
|
+
tokens?: RunTokensV1;
|
|
115
|
+
/** Milliseconds the harness spent CHOOSING (the planner's call or the selection arm), apart from the whole ask. */
|
|
116
|
+
selectionMs?: number;
|
|
117
|
+
/** Milliseconds until the reply arrived (`ms` also counts reading the run back for judging). */
|
|
118
|
+
askMs?: number;
|
|
119
|
+
/** Milliseconds per runtime stage of the ask (stage names and numbers only). */
|
|
120
|
+
stages?: Record<string, number>;
|
|
121
|
+
/** Spec 416 §4h — the answer's quality by the rubric (P(true) per question and their mean); numbers only. */
|
|
122
|
+
quality?: {
|
|
123
|
+
score: number;
|
|
124
|
+
scores: Record<string, number>;
|
|
125
|
+
};
|
|
126
|
+
/** Spec 416 §4h — the two answers judged side by side: probability per answer id (and `tie`). */
|
|
127
|
+
pairwise?: Record<string, number>;
|
|
128
|
+
/** Spec 418 A2 — the outcome check: did the answer deliver each class the plan was for (mean P, and per class). */
|
|
129
|
+
outcome?: {
|
|
130
|
+
score: number;
|
|
131
|
+
classes: Record<string, number>;
|
|
132
|
+
};
|
|
133
|
+
/** Spec 418 §12 — the act laboratory: did the harness reach THE act asked for (capability, parties, amount, whose
|
|
134
|
+
* authority) and leave its receipt — every check by name, booleans only. */
|
|
135
|
+
act?: import('./act.js').ActVerdictV1;
|
|
136
|
+
ms?: number;
|
|
137
|
+
error?: string;
|
|
138
|
+
/** Spec 415 A4 — what the selection arm decided (its grounding, survivors, distribution) — what the gates read. */
|
|
139
|
+
selection?: import('./selection-gates.js').RunSelectionFactsV1;
|
|
140
|
+
}
|
|
141
|
+
export interface ExperimentRecordV1 {
|
|
142
|
+
type: 'ap.experiment.v1';
|
|
143
|
+
id: string;
|
|
144
|
+
planDigest: string;
|
|
145
|
+
plan: ExperimentPlanV1;
|
|
146
|
+
startedAt: string;
|
|
147
|
+
finishedAt: string;
|
|
148
|
+
runs: ExperimentRunV1[];
|
|
149
|
+
/** `capture.refused.<reason>=<n>` */
|
|
150
|
+
refused: string[];
|
|
151
|
+
scores: Record<string, SelectionScoreV1>;
|
|
152
|
+
verdicts: Record<string, SelectionVerdictReportV1>;
|
|
153
|
+
comparisons: Array<{
|
|
154
|
+
a: string;
|
|
155
|
+
b: string;
|
|
156
|
+
confounds: string[];
|
|
157
|
+
confounded: boolean;
|
|
158
|
+
comparison: SelectionComparisonV1 | null;
|
|
159
|
+
error?: string;
|
|
160
|
+
}>;
|
|
161
|
+
}
|
|
162
|
+
/** The scorer's rows for one variant: the first repeat is Stage 1, every later repeat a Stage-2 trial. A run whose
|
|
163
|
+
* trace could not be read is a row with `readActivity: false` (undetected — never a miss). */
|
|
164
|
+
export declare function selectionRowsOf(runs: readonly ExperimentRunV1[], variant: string): SelectionRowV1[];
|
|
165
|
+
/** The plan as JSON-LD (`apeval:ExperimentPlan`, a p-plan:Plan): digests only. */
|
|
166
|
+
export declare function experimentPlanToJsonLd(plan: ExperimentPlanV1, opts: {
|
|
167
|
+
context: Record<string, unknown> | string;
|
|
168
|
+
}): Promise<Record<string, unknown>>;
|
|
169
|
+
/** The experiment as JSON-LD (`apeval:Experiment`, a prov:Activity that used the plan and every run's bundle). */
|
|
170
|
+
export declare function experimentToJsonLd(rec: ExperimentRecordV1, opts: {
|
|
171
|
+
context: Record<string, unknown> | string;
|
|
172
|
+
runIri: (runRef: string) => string;
|
|
173
|
+
}): Record<string, unknown>;
|
|
174
|
+
export interface RunTokensV1 {
|
|
175
|
+
selectionIn: number;
|
|
176
|
+
selectionOut: number;
|
|
177
|
+
totalIn: number;
|
|
178
|
+
totalOut: number;
|
|
179
|
+
calls: number;
|
|
180
|
+
unreported: number; /** Input served from the provider's prompt cache, where it said so. */
|
|
181
|
+
cachedIn?: number; /** Steps the plan had (a turn's work, apart from model calls). */
|
|
182
|
+
planSteps?: number;
|
|
183
|
+
}
|
|
184
|
+
/** A run's reported usage from its planner trace: the planner and judge calls are SELECTION; everything is TOTAL. */
|
|
185
|
+
export declare function runTokensOf(trace: unknown): RunTokensV1 | undefined;
|
|
186
|
+
export interface ScorecardRowV1 {
|
|
187
|
+
experiment: string;
|
|
188
|
+
variant: string;
|
|
189
|
+
runs: number;
|
|
190
|
+
right: number;
|
|
191
|
+
positives: number;
|
|
192
|
+
rightOnPositives: number;
|
|
193
|
+
negatives: number;
|
|
194
|
+
declined: number;
|
|
195
|
+
askP50: number | null;
|
|
196
|
+
askP90: number | null;
|
|
197
|
+
pickP50: number | null;
|
|
198
|
+
selectionIn: number | null;
|
|
199
|
+
selectionOut: number | null;
|
|
200
|
+
totalIn: number | null;
|
|
201
|
+
totalOut: number | null;
|
|
202
|
+
cachedIn: number | null;
|
|
203
|
+
modelCalls: number | null;
|
|
204
|
+
planSteps: number | null;
|
|
205
|
+
unreported: number;
|
|
206
|
+
/** Median milliseconds per runtime stage, for stages present in at least half the runs, slowest first. */
|
|
207
|
+
stagesP50: Record<string, number>;
|
|
208
|
+
/** Spec 416 §4h — mean answer quality over the runs that were scored, and how many were. */
|
|
209
|
+
quality: number | null;
|
|
210
|
+
qualityRuns: number;
|
|
211
|
+
/** Mean side-by-side preference over the runs that were compared (`default` · `light` · `tie`). */
|
|
212
|
+
preference: Record<string, number> | null;
|
|
213
|
+
preferenceRuns: number;
|
|
214
|
+
}
|
|
215
|
+
export declare function scorecardOf(experiments: ReadonlyArray<Pick<ExperimentRecordV1, 'id' | 'runs'>>, criteria: Record<string, {
|
|
216
|
+
expected: string | null;
|
|
217
|
+
}>): ScorecardRowV1[];
|
|
218
|
+
//# sourceMappingURL=experiment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiment.d.ts","sourceRoot":"","sources":["../src/experiment.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAErJ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;qGACqG;AACrG,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,WAAW,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IACrC,2HAA2H;IAC3H,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,UAA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AM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAClI,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IACxE,0GAA0G;IAC1G,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,4FAA4F;IAC5F,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAC5C,mGAAmG;IACnG,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;CACnE;AAGD,wBAAgB,WAAW,CAAC,WAAW,EAAE,aAAa,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,GAAG,cAAc,EAAE,CA6BxK"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
// EXPERIMENTS — spec 414 §7 / 415 A4 + SEL-3. A comparison is PRE-REGISTERED: the plan fixes the replay set, the
|
|
2
|
+
// criterion, the variants and the thresholds BY DIGEST before the first run, and scoring refuses across them. Two
|
|
3
|
+
// variants that differ in more than one component are CONFOUNDED — the plan says so, and the comparison is labelled,
|
|
4
|
+
// never read as a lift (change one thing). The experiment record is what the eval store keeps: every run by
|
|
5
|
+
// pseudonymised reference, every judgment, the scores, the gate, the comparisons, and what the firewall refused.
|
|
6
|
+
import { canonicalJson } from './canonical.js';
|
|
7
|
+
import { DEFAULT_SELECTION_THRESHOLDS } from './selection-score.js';
|
|
8
|
+
const sha256 = async (s) => {
|
|
9
|
+
const b = new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(s)));
|
|
10
|
+
return `sha256:${Array.from(b, (x) => x.toString(16).padStart(2, '0')).join('')}`;
|
|
11
|
+
};
|
|
12
|
+
export const variantRequestDigest = (v) => sha256(canonicalJson(v));
|
|
13
|
+
export const thresholdsDigest = (t) => sha256(canonicalJson(t));
|
|
14
|
+
/** The components two variant requests differ in. One ⇒ a clean comparison; more ⇒ confounded (spec 414 §7). */
|
|
15
|
+
export function confoundsOf(a, b) {
|
|
16
|
+
const out = [];
|
|
17
|
+
if ((a.plannerKind ?? 'model') !== (b.plannerKind ?? 'model'))
|
|
18
|
+
out.push('plannerKind');
|
|
19
|
+
if ((a.selection ?? 'model') !== (b.selection ?? 'model'))
|
|
20
|
+
out.push('selection');
|
|
21
|
+
if ((a.provider ?? '') !== (b.provider ?? ''))
|
|
22
|
+
out.push('provider');
|
|
23
|
+
for (const role of ['selectionProvider', 'answerProvider', 'judgeProvider'])
|
|
24
|
+
if ((a[role] ?? '') !== (b[role] ?? ''))
|
|
25
|
+
out.push(role);
|
|
26
|
+
if ((a.playbook ?? '') !== (b.playbook ?? ''))
|
|
27
|
+
out.push('playbook');
|
|
28
|
+
if (canonicalJson(a.startingState ?? null) !== canonicalJson(b.startingState ?? null))
|
|
29
|
+
out.push('startingState');
|
|
30
|
+
// Spec 416 W3 — the acceptance rule is a component (a missing one here once read "changed: nothing" for floor/margin
|
|
31
|
+
// against a conformal map).
|
|
32
|
+
if (canonicalJson(a.acceptance ?? null) !== canonicalJson(b.acceptance ?? null))
|
|
33
|
+
out.push('acceptance');
|
|
34
|
+
if ((a.judgeProfile ?? 'thorough') !== (b.judgeProfile ?? 'thorough'))
|
|
35
|
+
out.push('judgeProfile');
|
|
36
|
+
for (const k of new Set([...Object.keys(a.toggles ?? {}), ...Object.keys(b.toggles ?? {})]))
|
|
37
|
+
if ((a.toggles?.[k] ?? '') !== (b.toggles?.[k] ?? ''))
|
|
38
|
+
out.push(`toggles/${k}`);
|
|
39
|
+
return out.sort();
|
|
40
|
+
}
|
|
41
|
+
/** The plan's identity: its COMPONENTS — set, criterion, split, repeats, variants, thresholds, policy. The moment of
|
|
42
|
+
* registration is not one of them (the same plan registered twice is the same plan; a changed component is a new plan). */
|
|
43
|
+
export const experimentPlanDigest = (p) => { const { registeredAt: _t, ...rest } = p; return sha256(canonicalJson(rest)); };
|
|
44
|
+
export function validateExperimentPlan(raw) {
|
|
45
|
+
const p = raw;
|
|
46
|
+
const errors = [];
|
|
47
|
+
if (!p || p.type !== 'ap.experiment-plan.v1')
|
|
48
|
+
return { ok: false, errors: ['an experiment plan is { type: "ap.experiment-plan.v1", id, replaySetDigest, criterionDigest, split, repeats, variants, thresholds, registeredAt }'] };
|
|
49
|
+
if (typeof p.id !== 'string' || !p.id)
|
|
50
|
+
errors.push('id required');
|
|
51
|
+
for (const k of ['replaySetDigest', 'criterionDigest'])
|
|
52
|
+
if (typeof p[k] !== 'string' || !/^sha256:[0-9a-f]{64}$/.test(p[k]))
|
|
53
|
+
errors.push(`${k} must be a sha256: digest`);
|
|
54
|
+
if (!['development', 'held-out', 'all'].includes(String(p.split)))
|
|
55
|
+
errors.push('split must be development | held-out | all');
|
|
56
|
+
if (!Number.isInteger(p.repeats) || p.repeats < 1)
|
|
57
|
+
errors.push('repeats must be an integer ≥ 1');
|
|
58
|
+
const names = Object.keys(p.variants ?? {});
|
|
59
|
+
if (!names.length)
|
|
60
|
+
errors.push('at least one variant required');
|
|
61
|
+
for (const n of names) {
|
|
62
|
+
const v = p.variants[n];
|
|
63
|
+
if (v.plannerKind !== undefined && v.plannerKind !== 'model' && v.plannerKind !== 'rule-based')
|
|
64
|
+
errors.push(`variants.${n}.plannerKind must be model | rule-based`);
|
|
65
|
+
if (v.selection !== undefined && !['model', 'declared', 'ontology', 'judgment', 'ontology+judgment', 'propose+judgment', 'ontology-first', 'framed-judgment', 'outcome', 'outcome-selective'].includes(v.selection))
|
|
66
|
+
errors.push(`variants.${n}.selection must be model | declared | ontology | judgment | ontology+judgment | propose+judgment | ontology-first | framed-judgment`);
|
|
67
|
+
for (const role of ['provider', 'selectionProvider', 'answerProvider', 'judgeProvider'])
|
|
68
|
+
if (v[role] !== undefined && (typeof v[role] !== 'string' || !/^[a-z][a-z0-9-]{1,30}$/.test(v[role])))
|
|
69
|
+
errors.push(`variants.${n}.${role} must be a provider name`);
|
|
70
|
+
for (const k of Object.keys(v))
|
|
71
|
+
if (!['plannerKind', 'selection', 'provider', 'selectionProvider', 'answerProvider', 'judgeProvider', 'toggles', 'playbook', 'startingState', 'acceptance', 'judgeProfile', 'askerContext'].includes(k))
|
|
72
|
+
errors.push(`variants.${n}.${k}: not a variant component`);
|
|
73
|
+
}
|
|
74
|
+
if (!p.thresholds || typeof p.thresholds !== 'object')
|
|
75
|
+
errors.push('thresholds required (DEFAULT_SELECTION_THRESHOLDS when nothing is pre-registered)');
|
|
76
|
+
if (typeof p.registeredAt !== 'string' || Number.isNaN(Date.parse(p.registeredAt)))
|
|
77
|
+
errors.push('registeredAt must be an ISO date-time');
|
|
78
|
+
return errors.length ? { ok: false, errors } : { ok: true, plan: p };
|
|
79
|
+
}
|
|
80
|
+
export function experimentPlan(input) {
|
|
81
|
+
return { type: 'ap.experiment-plan.v1', ...input, thresholds: input.thresholds ?? DEFAULT_SELECTION_THRESHOLDS, registeredAt: input.registeredAt ?? new Date().toISOString() };
|
|
82
|
+
}
|
|
83
|
+
/** The scorer's rows for one variant: the first repeat is Stage 1, every later repeat a Stage-2 trial. A run whose
|
|
84
|
+
* trace could not be read is a row with `readActivity: false` (undetected — never a miss). */
|
|
85
|
+
export function selectionRowsOf(runs, variant) {
|
|
86
|
+
return runs.filter((r) => r.variant === variant).map((r) => ({
|
|
87
|
+
caseId: r.intentId, trial: r.repeat, stage: r.repeat === 0 ? 1 : 2,
|
|
88
|
+
fired: r.status === 'ok' ? r.selected.map((skill) => ({ skill, tier: r.evidence })) : [],
|
|
89
|
+
readActivity: r.status === 'ok',
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
/** The plan as JSON-LD (`apeval:ExperimentPlan`, a p-plan:Plan): digests only. */
|
|
93
|
+
export async function experimentPlanToJsonLd(plan, opts) {
|
|
94
|
+
const digests = await Promise.all(Object.entries(plan.variants).map(async ([n, v]) => [n, await variantRequestDigest(v)]));
|
|
95
|
+
const names = Object.keys(plan.variants);
|
|
96
|
+
const confounded = names.some((a, i) => names.slice(i + 1).some((b) => confoundsOf(plan.variants[a], plan.variants[b]).length > 1));
|
|
97
|
+
return {
|
|
98
|
+
'@context': opts.context,
|
|
99
|
+
id: `urn:ap:experiment-plan:${plan.id}`,
|
|
100
|
+
type: ['Entity', 'Plan', 'ExperimentPlan'],
|
|
101
|
+
replaySetDigest: plan.replaySetDigest,
|
|
102
|
+
criterionDigest: plan.criterionDigest,
|
|
103
|
+
thresholdsDigest: await thresholdsDigest(plan.thresholds),
|
|
104
|
+
variantDigest: digests.map(([, d]) => d),
|
|
105
|
+
split: plan.split,
|
|
106
|
+
repeats: plan.repeats,
|
|
107
|
+
confounded,
|
|
108
|
+
startedAtTime: plan.registeredAt,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** The experiment as JSON-LD (`apeval:Experiment`, a prov:Activity that used the plan and every run's bundle). */
|
|
112
|
+
export function experimentToJsonLd(rec, opts) {
|
|
113
|
+
return {
|
|
114
|
+
'@context': opts.context,
|
|
115
|
+
id: `urn:ap:experiment:${rec.id}`,
|
|
116
|
+
type: ['Activity', 'Experiment'],
|
|
117
|
+
planDigest: rec.planDigest,
|
|
118
|
+
used: [`urn:ap:experiment-plan:${rec.plan.id}`],
|
|
119
|
+
hasRun: rec.runs.filter((r) => r.runRef && r.captureLevel).map((r) => opts.runIri(r.runRef)),
|
|
120
|
+
refusedCount: rec.refused,
|
|
121
|
+
startedAtTime: rec.startedAt,
|
|
122
|
+
endedAtTime: rec.finishedAt,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/** A run's reported usage from its planner trace: the planner and judge calls are SELECTION; everything is TOTAL. */
|
|
126
|
+
export function runTokensOf(trace) {
|
|
127
|
+
const t = trace;
|
|
128
|
+
if (!t || typeof t !== 'object')
|
|
129
|
+
return undefined;
|
|
130
|
+
const out = { selectionIn: 0, selectionOut: 0, totalIn: 0, totalOut: 0, calls: 0, unreported: 0 };
|
|
131
|
+
const add = (u, selection) => {
|
|
132
|
+
out.calls++;
|
|
133
|
+
if (!u || typeof u.tokensIn !== 'number') {
|
|
134
|
+
out.unreported++;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
out.totalIn += u.tokensIn;
|
|
138
|
+
out.totalOut += u.tokensOut ?? 0;
|
|
139
|
+
if (typeof u.cachedIn === 'number')
|
|
140
|
+
out.cachedIn = (out.cachedIn ?? 0) + u.cachedIn;
|
|
141
|
+
if (selection) {
|
|
142
|
+
out.selectionIn += u.tokensIn;
|
|
143
|
+
out.selectionOut += u.tokensOut ?? 0;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
if (t.plannerUsage)
|
|
147
|
+
add(t.plannerUsage, true);
|
|
148
|
+
for (const c of t.structuredCalls ?? [])
|
|
149
|
+
add(c, c.role === 'judge');
|
|
150
|
+
if (t.composeUsage || t.route?.composer?.provider)
|
|
151
|
+
add(t.composeUsage, false);
|
|
152
|
+
if (Array.isArray(t.plan))
|
|
153
|
+
out.planSteps = t.plan.length;
|
|
154
|
+
return out.calls ? out : undefined;
|
|
155
|
+
}
|
|
156
|
+
const pct = (xs, q) => { if (!xs.length)
|
|
157
|
+
return null; const a = [...xs].sort((x, y) => x - y); return a[Math.min(a.length - 1, Math.floor(q * a.length))]; };
|
|
158
|
+
const mean = (xs) => (xs.length ? Math.round((xs.reduce((a, b) => a + b, 0) / xs.length) * 10) / 10 : null);
|
|
159
|
+
export function scorecardOf(experiments, criteria) {
|
|
160
|
+
const rows = [];
|
|
161
|
+
for (const e of experiments) {
|
|
162
|
+
const names = [...new Set(e.runs.map((r) => r.variant))];
|
|
163
|
+
for (const v of names) {
|
|
164
|
+
const rs = e.runs.filter((r) => r.variant === v);
|
|
165
|
+
const ok = (r) => r.verdict?.earl === 'passed';
|
|
166
|
+
const pos = rs.filter((r) => criteria[r.intentId]?.expected);
|
|
167
|
+
const neg = rs.filter((r) => criteria[r.intentId] && !criteria[r.intentId].expected);
|
|
168
|
+
const tk = rs.map((r) => r.tokens).filter((x) => !!x);
|
|
169
|
+
rows.push({ experiment: e.id, variant: v, runs: rs.length,
|
|
170
|
+
right: rs.filter(ok).length, positives: pos.length, rightOnPositives: pos.filter(ok).length, negatives: neg.length, declined: neg.filter(ok).length,
|
|
171
|
+
askP50: pct(rs.map((r) => r.askMs ?? r.ms).filter((x) => typeof x === 'number'), 0.5), askP90: pct(rs.map((r) => r.askMs ?? r.ms).filter((x) => typeof x === 'number'), 0.9),
|
|
172
|
+
pickP50: pct(rs.map((r) => r.selectionMs).filter((x) => typeof x === 'number'), 0.5),
|
|
173
|
+
selectionIn: mean(tk.map((t) => t.selectionIn)), selectionOut: mean(tk.map((t) => t.selectionOut)), totalIn: mean(tk.map((t) => t.totalIn)), totalOut: mean(tk.map((t) => t.totalOut)),
|
|
174
|
+
cachedIn: tk.some((t) => t.cachedIn !== undefined) ? mean(tk.map((t) => t.cachedIn ?? 0)) : null,
|
|
175
|
+
modelCalls: mean(tk.map((t) => t.calls)), planSteps: tk.some((t) => t.planSteps !== undefined) ? mean(tk.map((t) => t.planSteps ?? 0)) : null,
|
|
176
|
+
unreported: tk.reduce((n, t) => n + t.unreported, 0),
|
|
177
|
+
quality: (() => { const q = rs.map((r) => r.quality?.score).filter((x) => typeof x === 'number'); return q.length ? Math.round((q.reduce((a, b) => a + b, 0) / q.length) * 1000) / 1000 : null; })(),
|
|
178
|
+
qualityRuns: rs.filter((r) => typeof r.quality?.score === 'number').length,
|
|
179
|
+
preference: (() => { const ps = rs.map((r) => r.pairwise).filter((x) => !!x); if (!ps.length)
|
|
180
|
+
return null; const keys = [...new Set(ps.flatMap((p) => Object.keys(p)))]; return Object.fromEntries(keys.map((k) => [k, Math.round((ps.reduce((a, p) => a + (p[k] ?? 0), 0) / ps.length) * 1000) / 1000])); })(),
|
|
181
|
+
preferenceRuns: rs.filter((r) => !!r.pairwise).length,
|
|
182
|
+
stagesP50: (() => {
|
|
183
|
+
const names = new Map();
|
|
184
|
+
for (const r of rs)
|
|
185
|
+
for (const [k, v] of Object.entries(r.stages ?? {})) {
|
|
186
|
+
const l = names.get(k) ?? [];
|
|
187
|
+
l.push(v);
|
|
188
|
+
names.set(k, l);
|
|
189
|
+
}
|
|
190
|
+
return Object.fromEntries([...names.entries()].filter(([, l]) => l.length * 2 >= rs.length).map(([k, l]) => [k, pct(l, 0.5)]).sort((a, b) => b[1] - a[1]));
|
|
191
|
+
})() });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return rows;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=experiment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiment.js","sourceRoot":"","sources":["../src/experiment.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,kHAAkH;AAClH,qHAAqH;AACrH,4GAA4G;AAC5G,iHAAiH;AACjH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAiCpE,MAAM,MAAM,GAAG,KAAK,EAAE,CAAS,EAA+B,EAAE;IAC9D,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7F,OAAO,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,C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