@agenticprimitives/evaluation 0.0.0-alpha.1 → 0.0.0-alpha.10

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.
Files changed (90) hide show
  1. package/README.md +2 -0
  2. package/dist/act.d.ts +97 -0
  3. package/dist/act.d.ts.map +1 -0
  4. package/dist/act.js +115 -0
  5. package/dist/act.js.map +1 -0
  6. package/dist/agent-record.d.ts +86 -0
  7. package/dist/agent-record.d.ts.map +1 -0
  8. package/dist/agent-record.js +108 -0
  9. package/dist/agent-record.js.map +1 -0
  10. package/dist/assessment.d.ts +158 -0
  11. package/dist/assessment.d.ts.map +1 -0
  12. package/dist/assessment.js +167 -0
  13. package/dist/assessment.js.map +1 -0
  14. package/dist/canonical.d.ts +2 -0
  15. package/dist/canonical.d.ts.map +1 -0
  16. package/dist/canonical.js +4 -0
  17. package/dist/canonical.js.map +1 -0
  18. package/dist/capture.d.ts +90 -0
  19. package/dist/capture.d.ts.map +1 -0
  20. package/dist/capture.js +195 -0
  21. package/dist/capture.js.map +1 -0
  22. package/dist/compare-runner.d.ts +211 -0
  23. package/dist/compare-runner.d.ts.map +1 -0
  24. package/dist/compare-runner.js +370 -0
  25. package/dist/compare-runner.js.map +1 -0
  26. package/dist/conformal.d.ts +113 -0
  27. package/dist/conformal.d.ts.map +1 -0
  28. package/dist/conformal.js +113 -0
  29. package/dist/conformal.js.map +1 -0
  30. package/dist/consensus.d.ts +53 -0
  31. package/dist/consensus.d.ts.map +1 -0
  32. package/dist/consensus.js +64 -0
  33. package/dist/consensus.js.map +1 -0
  34. package/dist/eval-file.d.ts +104 -0
  35. package/dist/eval-file.d.ts.map +1 -0
  36. package/dist/eval-file.js +92 -0
  37. package/dist/eval-file.js.map +1 -0
  38. package/dist/experiment.d.ts +277 -0
  39. package/dist/experiment.d.ts.map +1 -0
  40. package/dist/experiment.js +237 -0
  41. package/dist/experiment.js.map +1 -0
  42. package/dist/index.d.ts +38 -0
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +38 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/ledger.d.ts +128 -0
  47. package/dist/ledger.d.ts.map +1 -0
  48. package/dist/ledger.js +146 -0
  49. package/dist/ledger.js.map +1 -0
  50. package/dist/live-gates.d.ts +3 -0
  51. package/dist/live-gates.d.ts.map +1 -1
  52. package/dist/live-gates.js +3 -1
  53. package/dist/live-gates.js.map +1 -1
  54. package/dist/measure.d.ts +63 -0
  55. package/dist/measure.d.ts.map +1 -0
  56. package/dist/measure.js +95 -0
  57. package/dist/measure.js.map +1 -0
  58. package/dist/replay.d.ts +58 -0
  59. package/dist/replay.d.ts.map +1 -0
  60. package/dist/replay.js +65 -0
  61. package/dist/replay.js.map +1 -0
  62. package/dist/report.d.ts +249 -0
  63. package/dist/report.d.ts.map +1 -0
  64. package/dist/report.js +363 -0
  65. package/dist/report.js.map +1 -0
  66. package/dist/rollup.d.ts +91 -0
  67. package/dist/rollup.d.ts.map +1 -0
  68. package/dist/rollup.js +80 -0
  69. package/dist/rollup.js.map +1 -0
  70. package/dist/selection-gates.d.ts +283 -0
  71. package/dist/selection-gates.d.ts.map +1 -0
  72. package/dist/selection-gates.js +331 -0
  73. package/dist/selection-gates.js.map +1 -0
  74. package/dist/selection-score.d.ts +285 -0
  75. package/dist/selection-score.d.ts.map +1 -0
  76. package/dist/selection-score.js +392 -0
  77. package/dist/selection-score.js.map +1 -0
  78. package/dist/selection.d.ts +83 -0
  79. package/dist/selection.d.ts.map +1 -0
  80. package/dist/selection.js +86 -0
  81. package/dist/selection.js.map +1 -0
  82. package/dist/signals.d.ts +37 -0
  83. package/dist/signals.d.ts.map +1 -0
  84. package/dist/signals.js +44 -0
  85. package/dist/signals.js.map +1 -0
  86. package/dist/stats.d.ts +62 -0
  87. package/dist/stats.d.ts.map +1 -0
  88. package/dist/stats.js +279 -0
  89. package/dist/stats.js.map +1 -0
  90. package/package.json +17 -2
@@ -0,0 +1,63 @@
1
+ /** UCUM codes. */
2
+ export type MeasureUnitV1 = 'ms' | '{count}' | '1';
3
+ export interface MeasurementV1 {
4
+ /** The metric's `skos:notation` in `apeval:Metrics` (`latency-ms`, `verdicts-allow` …). */
5
+ metric: string;
6
+ value: number;
7
+ unit: MeasureUnitV1;
8
+ /** Present when the number is about one step rather than the run. */
9
+ stepRef?: string;
10
+ }
11
+ export interface MeasureInputV1 {
12
+ runRef: string;
13
+ outcome: string;
14
+ /** ISO — when the request arrived (or the first step started), and when the run ended. */
15
+ startedAt?: string;
16
+ endedAt: string;
17
+ stepsPlanned?: number;
18
+ steps: ReadonlyArray<{
19
+ stepRef: string;
20
+ status: string;
21
+ startedAt?: string;
22
+ endedAt?: string;
23
+ authority?: {
24
+ decision: string;
25
+ afterApproval: boolean;
26
+ };
27
+ observation?: {
28
+ outcome: string;
29
+ };
30
+ replayed?: boolean;
31
+ }>;
32
+ modelCalls?: ReadonlyArray<{
33
+ tokensIn?: number;
34
+ tokensOut?: number;
35
+ stepRef?: string;
36
+ }>;
37
+ vaultCalls?: number;
38
+ /** Admission refusals that forced a replan. */
39
+ replans?: number;
40
+ /** Harness-capability engagements on the run and its steps. */
41
+ engagements?: number;
42
+ }
43
+ /** The run's measurements: run-level first (in a fixed order), then each step's, in step order. */
44
+ export declare function measureRun(input: MeasureInputV1): MeasurementV1[];
45
+ /** A metric's IRI, DERIVED from its notation (`latency-ms` → `apeval:m-latencyMs`) — the rule the T-box was written by. */
46
+ export declare const metricIri: (notation: string) => string;
47
+ export interface MeasuresJsonLdOptions {
48
+ /** The published `run-measures.jsonld` context (its `@context` value), or its URL. */
49
+ context: Record<string, unknown> | string;
50
+ /** The agent the run ran at, as the provenance graph names it (`urn:ap:agent:…`). */
51
+ agentIri: string;
52
+ /** The runtime that bore the run (`urn:ap:prov:runtime:…`) — the measuring is mechanical and ran there. */
53
+ runtimeIri: string;
54
+ /** ISO — when the measuring happened. */
55
+ at: string;
56
+ }
57
+ /** One run's measurements as ONE JSON-LD record (`run.measures:<runRef>`): an `apeval:RunMeasures` bundle derived from
58
+ * the run's provenance bundle, a measuring activity that used it, and one `apeval:RunMeasurement` per number,
59
+ * computedOn the run's or the step's activity (the same IRIs the provenance graph gives them). */
60
+ export declare function measuresToJsonLd(runRef: string, measurements: readonly MeasurementV1[], opts: MeasuresJsonLdOptions): Record<string, unknown>;
61
+ /** The vault record key a run's measurements live under, beside its provenance. */
62
+ export declare const runMeasuresRecordKey: (runRef: string) => string;
63
+ //# sourceMappingURL=measure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../src/measure.ts"],"names":[],"mappings":"AAaA,kBAAkB;AAClB,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,GAAG,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,2FAA2F;IAC3F,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;IACpB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,aAAa,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,aAAa,EAAE,OAAO,CAAA;SAAE,CAAC;QACzD,WAAW,CAAC,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;QAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAQD,mGAAmG;AACnG,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,aAAa,EAAE,CAwCjE;AAID,2HAA2H;AAC3H,eAAO,MAAM,SAAS,aAAc,MAAM,KAAG,MAAyC,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAC1C,qFAAqF;IACrF,QAAQ,EAAE,MAAM,CAAC;IACjB,2GAA2G;IAC3G,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;mGAEmG;AACnG,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,aAAa,EAAE,EAAE,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsB7I;AAED,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,WAAY,MAAM,KAAG,MAAkC,CAAC"}
@@ -0,0 +1,95 @@
1
+ // MEASURING A RUN — spec 414 §7 / 415 A2. Numbers about a run, computed from its trace alone: whether it completed,
2
+ // how many steps were planned and ran, the authority verdicts, the approvals it waited on, the replans admission
3
+ // forced, the steps a resume replayed, latency, model calls, provider-reported tokens, vault calls, confirmed effects
4
+ // and harness-capability engagements — per run and, where a number belongs to a step, per step.
5
+ //
6
+ // DESCRIPTIVE, NOT JUDGED. Nothing here says whether an answer was right; that is a judgment (spec 414 §3.4) with a
7
+ // named criterion and judge, recorded separately. EVIDENCE, NEVER AUTHORITY: no gate reads a measurement. NO WORDS: a
8
+ // measurement is a metric (by notation), a value and a unit. MECHANICAL: the same input yields the same measurements,
9
+ // in the same order.
10
+ //
11
+ // STRUCTURAL INPUT (this package imports nothing): the fields the provenance view already carries, handed in by the
12
+ // app. A token count is measured only when a provider reported one — an estimate is not a measurement.
13
+ const ms = (a, b) => {
14
+ if (!a || !b)
15
+ return undefined;
16
+ const d = Date.parse(b) - Date.parse(a);
17
+ return Number.isFinite(d) && d >= 0 ? d : undefined;
18
+ };
19
+ /** The run's measurements: run-level first (in a fixed order), then each step's, in step order. */
20
+ export function measureRun(input) {
21
+ const out = [];
22
+ const put = (metric, value, unit, stepRef) => {
23
+ if (value === undefined || !Number.isFinite(value))
24
+ return;
25
+ out.push({ metric, value, unit, ...(stepRef ? { stepRef } : {}) });
26
+ };
27
+ const steps = input.steps;
28
+ const count = (f) => steps.filter(f).length;
29
+ const executed = (s) => !s.replayed && (s.status === 'executed' || s.status === 'completed');
30
+ put('completed', input.outcome === 'completed' ? 1 : 0, '1');
31
+ put('steps-planned', input.stepsPlanned ?? steps.length, '{count}');
32
+ put('steps-run', count(executed), '{count}');
33
+ put('steps-refused', count((s) => s.status === 'refused' || s.status === 'denied' || s.authority?.decision === 'deny'), '{count}');
34
+ put('verdicts-allow', count((s) => s.authority?.decision === 'allow'), '{count}');
35
+ put('verdicts-deny', count((s) => s.authority?.decision === 'deny'), '{count}');
36
+ put('approvals-waited', count((s) => !!s.authority?.afterApproval), '{count}');
37
+ put('replans', input.replans ?? 0, '{count}');
38
+ put('resumed-steps', count((s) => !!s.replayed), '{count}');
39
+ put('latency-ms', ms(input.startedAt ?? steps.map((s) => s.startedAt).filter((x) => !!x).sort()[0], input.endedAt), 'ms');
40
+ put('model-calls', input.modelCalls?.length ?? 0, '{count}');
41
+ const tokens = (k) => {
42
+ const reported = (input.modelCalls ?? []).filter((m) => typeof m[k] === 'number');
43
+ return reported.length ? reported.reduce((n, m) => n + m[k], 0) : undefined;
44
+ };
45
+ put('tokens-in', tokens('tokensIn'), '{count}');
46
+ put('tokens-out', tokens('tokensOut'), '{count}');
47
+ put('vault-calls', input.vaultCalls, '{count}');
48
+ put('effects-confirmed', count((s) => s.observation?.outcome === 'confirmed'), '{count}');
49
+ put('engagements', input.engagements ?? 0, '{count}');
50
+ for (const s of steps) {
51
+ put('latency-ms', ms(s.startedAt, s.endedAt), 'ms', s.stepRef);
52
+ // Spec 417 §5 — what each step's OWN model calls cost (a skill's answer): tied by `stepRef`, never by time overlap.
53
+ const mine = (input.modelCalls ?? []).filter((m) => m.stepRef === s.stepRef);
54
+ if (!mine.length)
55
+ continue;
56
+ put('model-calls', mine.length, '{count}', s.stepRef);
57
+ const sum = (k) => { const r = mine.filter((m) => typeof m[k] === 'number'); return r.length ? r.reduce((n, m) => n + m[k], 0) : undefined; };
58
+ put('tokens-in', sum('tokensIn'), '{count}', s.stepRef);
59
+ put('tokens-out', sum('tokensOut'), '{count}', s.stepRef);
60
+ }
61
+ return out;
62
+ }
63
+ const APEVAL = 'https://agenticprimitives.dev/ns/evaluation#';
64
+ const camel = (n) => n.split(/[/-]/).filter(Boolean).map((w, i) => (i === 0 ? w : w[0].toUpperCase() + w.slice(1))).join('');
65
+ /** A metric's IRI, DERIVED from its notation (`latency-ms` → `apeval:m-latencyMs`) — the rule the T-box was written by. */
66
+ export const metricIri = (notation) => `${APEVAL}m-${camel(notation)}`;
67
+ /** One run's measurements as ONE JSON-LD record (`run.measures:<runRef>`): an `apeval:RunMeasures` bundle derived from
68
+ * the run's provenance bundle, a measuring activity that used it, and one `apeval:RunMeasurement` per number,
69
+ * computedOn the run's or the step's activity (the same IRIs the provenance graph gives them). */
70
+ export function measuresToJsonLd(runRef, measurements, opts) {
71
+ const run = `urn:ap:prov:act:${runRef}`;
72
+ const measuring = `urn:ap:prov:act:${runRef}:measuring`;
73
+ const ids = measurements.map((m) => `urn:ap:prov:measure:${runRef}:${m.metric}${m.stepRef ? `:${m.stepRef}` : ''}`);
74
+ const nodes = measurements.map((m, i) => ({
75
+ id: ids[i], type: ['Entity', 'QualityMeasurement', 'RunMeasurement'],
76
+ computedOn: m.stepRef ? `${run}:${m.stepRef}` : run,
77
+ isMeasurementOf: metricIri(m.metric),
78
+ value: m.value, unit: m.unit, wasGeneratedBy: measuring,
79
+ }));
80
+ return {
81
+ '@context': opts.context,
82
+ id: `urn:ap:prov:measures:${runRef}`,
83
+ type: ['Entity', 'Bundle', 'QualityMeasurementDataset', 'RunMeasures'],
84
+ wasDerivedFrom: `urn:ap:prov:bundle:${runRef}`,
85
+ wasAttributedTo: opts.agentIri,
86
+ hasMeasurement: ids,
87
+ graph: [
88
+ { id: measuring, type: ['Activity', 'Measuring'], used: [`urn:ap:prov:bundle:${runRef}`], wasAssociatedWith: opts.runtimeIri, generated: ids, startedAtTime: opts.at, endedAtTime: opts.at },
89
+ ...nodes,
90
+ ],
91
+ };
92
+ }
93
+ /** The vault record key a run's measurements live under, beside its provenance. */
94
+ export const runMeasuresRecordKey = (runRef) => `run.measures:${runRef}`;
95
+ //# sourceMappingURL=measure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"measure.js","sourceRoot":"","sources":["../src/measure.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,iHAAiH;AACjH,sHAAsH;AACtH,gGAAgG;AAChG,EAAE;AACF,oHAAoH;AACpH,sHAAsH;AACtH,sHAAsH;AACtH,qBAAqB;AACrB,EAAE;AACF,oHAAoH;AACpH,uGAAuG;AAsCvG,MAAM,EAAE,GAAG,CAAC,CAAU,EAAE,CAAU,EAAsB,EAAE;IACxD,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/B,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,C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AAwB,MAAM,EAAE;QACpC,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,2BAA2B,EAAE,aAAa,CAAC;QACtE,cAAc,EAAE,sBAAsB,MAAM,EAAE;QAC9C,eAAe,EAAE,IAAI,CAAC,QAAQ;QAC9B,cAAc,EAAE,GAAG;QACnB,KAAK,EAAE;YACL,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,sBAAsB,MAAM,EAAE,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;YAC5L,GAAG,KAAK;SACT;KACF,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,gBAAgB,MAAM,EAAE,CAAC"}
@@ -0,0 +1,58 @@
1
+ export type ReplayBucketV1 = 'explicit' | 'implicit' | 'contextual' | 'negative-near' | 'negative-scope' | 'negative-out'
2
+ /** Spec 416: no ONE skill is right — the right behaviour is to ask the person, or to hand the request on as several. */
3
+ | 'negative-clarify' | 'negative-several' | 'collision-a' | 'collision-b' | 'collision-ambiguous';
4
+ export interface ReplayIntentV1 {
5
+ id: string;
6
+ message: string;
7
+ /** development | held-out — held-out intents are pre-registered and never iterated against. */
8
+ split: 'development' | 'held-out';
9
+ bucket?: ReplayBucketV1;
10
+ /** The kind of slate it came from (per-skill, pair, ambiguous, out-of-library …). */
11
+ slateKind?: string;
12
+ /** The seeded records it runs from, when it needs any (a scenario's A-box). */
13
+ startingState?: {
14
+ domain: string;
15
+ scenarioId: string;
16
+ digest?: string;
17
+ };
18
+ provenance: 'authored' | 'harvested' | 'synthetic';
19
+ /** A paraphrase cluster (for cluster bootstrap). */
20
+ seedId?: string;
21
+ notes?: string;
22
+ }
23
+ export interface ReplaySetV1 {
24
+ type: 'ap.replay-set.v1';
25
+ id: string;
26
+ version: string;
27
+ title?: string;
28
+ /** The skill this set is about, by canonical id (absent for a library-wide set). */
29
+ skill?: string;
30
+ /** W4 (2026-10-14) — what the set IS FOR. `capability`: fresh, hard, written to find out what the harness can do — the
31
+ * number it gives is a capability number. `regression`: a saturated set kept to catch a step backwards — a 100% on it
32
+ * is expected, never published as a capability number. Absent ⇒ read as `capability` by the report (the safe reading:
33
+ * a regression number mistaken for a capability number flatters; the reverse only understates). */
34
+ suiteKind?: SuiteKindV1;
35
+ intents: ReplayIntentV1[];
36
+ }
37
+ export type SuiteKindV1 = 'capability' | 'regression';
38
+ /** The set's suite kind: declared, else inferred from its id (the imported routing strata are regression suites). */
39
+ export declare const suiteKindOf: (set: Pick<ReplaySetV1, "id" | "suiteKind">) => SuiteKindV1;
40
+ /** The set's identity: SHA-256 over its canonical JSON. A new digest is a new set, never an edit. */
41
+ export declare const replaySetDigest: (set: ReplaySetV1) => Promise<`sha256:${string}`>;
42
+ /** Validate a parsed set; every problem named. */
43
+ export declare function validateReplaySet(raw: unknown): {
44
+ ok: true;
45
+ set: ReplaySetV1;
46
+ } | {
47
+ ok: false;
48
+ errors: string[];
49
+ };
50
+ /** The set's two halves. */
51
+ export declare const splitOf: (set: ReplaySetV1, split: ReplayIntentV1["split"]) => ReplayIntentV1[];
52
+ /** The set as a W3C DCAT description (a dcat:Dataset, versioned, with its checksummed distribution and its intents as
53
+ * apeval:ReplayIntent entities — ids, splits and buckets only; the words stay in the distribution). */
54
+ export declare function replaySetToJsonLd(set: ReplaySetV1, opts: {
55
+ context: Record<string, unknown> | string;
56
+ downloadUrl?: string;
57
+ }): Promise<Record<string, unknown>>;
58
+ //# sourceMappingURL=replay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,cAAc,GAC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,CAA+B,CAAC;AAE7G,kDAAkD;AAClD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAmBhH;AAED,4BAA4B;AAC5B,eAAO,MAAM,OAAO,QAAS,WAAW,SAAS,cAAc,CAAC,OAAO,CAAC,KAAG,cAAc,EAAkD,CAAC;AAE5I;wGACwG;AACxG,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAYrK"}
package/dist/replay.js ADDED
@@ -0,0 +1,65 @@
1
+ // REPLAY SETS — spec 415 S0. A versioned set of intents to replay under variants, split into DEVELOPMENT and HELD-OUT,
2
+ // named by a digest (RFC 8785-style canonical JSON + SHA-256) so a comparison can refuse to compare runs of two
3
+ // different sets, and described in W3C DCAT for anyone else. The words of each intent live HERE, in the set's file —
4
+ // never in a run's graph, which cites an intent by id. Gold does NOT live here: a set says what to ask; a CRITERION
5
+ // (selection.ts) says what should happen, pre-registered separately so the same set can be judged against revised gold.
6
+ import { canonicalJson } from './canonical.js';
7
+ /** The set's suite kind: declared, else inferred from its id (the imported routing strata are regression suites). */
8
+ export const suiteKindOf = (set) => set.suiteKind ?? (/(^|-)(routing-stratum|regression)(-|$)/.test(set.id) ? 'regression' : 'capability');
9
+ const sha256 = async (s) => {
10
+ const b = new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(s)));
11
+ return `sha256:${Array.from(b, (x) => x.toString(16).padStart(2, '0')).join('')}`;
12
+ };
13
+ /** The set's identity: SHA-256 over its canonical JSON. A new digest is a new set, never an edit. */
14
+ export const replaySetDigest = (set) => sha256(canonicalJson(set));
15
+ /** Validate a parsed set; every problem named. */
16
+ export function validateReplaySet(raw) {
17
+ const errors = [];
18
+ const s = raw;
19
+ if (!s || s.type !== 'ap.replay-set.v1')
20
+ return { ok: false, errors: ['a replay set is { type: "ap.replay-set.v1", id, version, intents: [...] }'] };
21
+ if (typeof s.id !== 'string' || !s.id)
22
+ errors.push('id required');
23
+ if (typeof s.version !== 'string' || !s.version)
24
+ errors.push('version required');
25
+ if (!Array.isArray(s.intents) || !s.intents.length)
26
+ errors.push('at least one intent required');
27
+ if (s.suiteKind !== undefined && s.suiteKind !== 'capability' && s.suiteKind !== 'regression')
28
+ errors.push('suiteKind must be capability or regression');
29
+ const ids = new Set();
30
+ for (const [i, it] of (s.intents ?? []).entries()) {
31
+ const at = `intents[${i}]${it?.id ? ` (${it.id})` : ''}`;
32
+ if (!it || typeof it.id !== 'string' || !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(it.id)) {
33
+ errors.push(`${at}: id must be ASCII, ≤128 chars, starting alphanumeric`);
34
+ continue;
35
+ }
36
+ if (ids.has(it.id))
37
+ errors.push(`${at}: listed twice`);
38
+ ids.add(it.id);
39
+ if (typeof it.message !== 'string' || it.message.length < 3 || it.message.length > 2000)
40
+ errors.push(`${at}: message must be 3–2000 chars`);
41
+ if (it.split !== 'development' && it.split !== 'held-out')
42
+ errors.push(`${at}: split must be development or held-out`);
43
+ if (!['authored', 'harvested', 'synthetic'].includes(String(it.provenance)))
44
+ errors.push(`${at}: provenance must be authored, harvested or synthetic`);
45
+ }
46
+ return errors.length ? { ok: false, errors } : { ok: true, set: s };
47
+ }
48
+ /** The set's two halves. */
49
+ export const splitOf = (set, split) => set.intents.filter((i) => i.split === split);
50
+ /** The set as a W3C DCAT description (a dcat:Dataset, versioned, with its checksummed distribution and its intents as
51
+ * apeval:ReplayIntent entities — ids, splits and buckets only; the words stay in the distribution). */
52
+ export async function replaySetToJsonLd(set, opts) {
53
+ const digest = await replaySetDigest(set);
54
+ const base = `urn:ap:replay-set:${set.id}@${set.version}`;
55
+ return {
56
+ '@context': opts.context,
57
+ id: base,
58
+ type: ['Dataset', 'ReplaySet'],
59
+ version: set.version,
60
+ setDigest: digest,
61
+ distribution: { id: `${base}#file`, type: ['Distribution'], ...(opts.downloadUrl ? { downloadURL: opts.downloadUrl } : {}) },
62
+ hasIntent: set.intents.map((i) => ({ id: `${base}#${i.id}`, type: ['Entity', 'ReplayIntent'], split: i.split, ...(i.bucket ? { bucket: i.bucket } : {}) })),
63
+ };
64
+ }
65
+ //# sourceMappingURL=replay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay.js","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,gHAAgH;AAChH,qHAAqH;AACrH,oHAAoH;AACpH,wHAAwH;AACxH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAwC/C,qHAAqH;AACrH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAA0C,EAAe,EAAE,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,wCAAwC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;AAE/L,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,CAAC,CAAC,QAAQ,CAAC,CAAC,EAA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EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KAC5J,CAAC;AACJ,CAAC"}
@@ -0,0 +1,249 @@
1
+ import { type OutcomeGoldV1, type OutcomePlanScoreV1 } from './selection-gates.js';
2
+ import { type ExperimentRecordV1, type FailureCauseV1 } from './experiment.js';
3
+ import { type ReplaySetV1, type SuiteKindV1 } from './replay.js';
4
+ import type { SelectionCriterionV1, SelectionOutcomeV1 } from './selection.js';
5
+ export declare const CAUSE_WORDS: Record<FailureCauseV1 | 'isolation', string>;
6
+ export declare const SUITE_WORDS: Record<SuiteKindV1, string>;
7
+ /** A capability set that passes this many consecutive experiments at or above this accuracy is flagged for graduation. */
8
+ export declare const GRADUATION: {
9
+ readonly consecutive: 3;
10
+ readonly accuracy: 0.95;
11
+ };
12
+ export declare const OUTCOME_WORDS: Record<SelectionOutcomeV1, {
13
+ label: string;
14
+ ok: boolean | null;
15
+ explain: string;
16
+ }>;
17
+ export declare const VARIANT_WORDS: Record<string, string>;
18
+ export interface ReportIntentRowV1 {
19
+ intentId: string;
20
+ message: string;
21
+ split: string;
22
+ bucket?: string;
23
+ /** This test sentence nearly repeats an example a skill declares — its result measures the example, not selection. */
24
+ contaminated?: {
25
+ skill: string;
26
+ overlap: number;
27
+ isNot: boolean;
28
+ };
29
+ expected: string | null;
30
+ chosen: string | null;
31
+ outcome: SelectionOutcomeV1;
32
+ label: string;
33
+ ok: boolean | null;
34
+ why?: string;
35
+ ms?: number;
36
+ /** Spec 418 §3 — how the case's turn went: the ask's own time, the time and tokens to pick, the whole run's tokens,
37
+ * where the time went (stage → ms), and — for a chain — the skills run, in order, and the inputs named missing. */
38
+ askMs?: number;
39
+ selectionMs?: number;
40
+ tokens?: {
41
+ pickIn?: number;
42
+ pickOut?: number;
43
+ totalIn?: number;
44
+ totalOut?: number;
45
+ calls?: number;
46
+ };
47
+ stages?: Record<string, number>;
48
+ chain?: string[];
49
+ missing?: string[];
50
+ quality?: number;
51
+ /** W1 — why this case has no verdict (absent when it has one). */
52
+ failureCause?: FailureCauseV1 | 'isolation';
53
+ /** W4 — pass^k: every repeat of this case was right (null when the case ran once or no repeat was scored). */
54
+ passK?: boolean | null;
55
+ /** Spec 418 A2 / W2 — the outcome judge's score (`delivered`, against the GOLD plan when `deliveredBasis` says so),
56
+ * and the agent-plan number beside it. (`outcome` above is the SELECTION outcome — a different question.) */
57
+ delivered?: number;
58
+ deliveredBasis?: 'gold-plan' | 'agent-plan';
59
+ deliveredAgentPlan?: number;
60
+ cantTell?: number;
61
+ /** W3 — the state check: every gold-plan class exists in the vault and validates against its shape. */
62
+ stateCheck?: boolean;
63
+ }
64
+ export interface ReportVariantV1 {
65
+ name: string;
66
+ how: string;
67
+ runs: number;
68
+ /** W1 — the denominator, explained: runs dispatched, runs with a verdict, and the runs without one BY CAUSE. */
69
+ n: {
70
+ runs: number;
71
+ scored: number;
72
+ agent: number;
73
+ grader: number;
74
+ environment: number;
75
+ isolation: number;
76
+ };
77
+ /** W4 — pass^k over the cases that ran more than once: all repeats right / cases with repeats. */
78
+ passK?: {
79
+ passed: number;
80
+ of: number;
81
+ k: number;
82
+ };
83
+ /** THE OUTCOME, FIRST (W3/W4): the state check (records exist and validate) then the judge (mean, over the runs it
84
+ * scored; cantTell classes counted and out of the denominator). The plan metrics come after, as diagnostics. */
85
+ stateCheck?: {
86
+ pass: number;
87
+ n: number;
88
+ };
89
+ outcome?: {
90
+ mean: number;
91
+ n: number;
92
+ cantTell: number;
93
+ basis: 'gold-plan' | 'agent-plan' | 'mixed';
94
+ agentPlanMean?: number;
95
+ };
96
+ /** DIAGNOSTIC — how the plan compared with the gold plan (exact · needless · short · stepsScore). Never pass/fail. */
97
+ planMetrics?: Omit<OutcomePlanScoreV1, 'variant'>;
98
+ macroTa: number | null;
99
+ macroCi: [number, number] | null;
100
+ microTa: number | null;
101
+ holdRate: number | null;
102
+ holdNum?: number;
103
+ holdDen?: number;
104
+ routingPurity: number | null;
105
+ collisionContainment: number | null;
106
+ right: number;
107
+ wrong: number;
108
+ declinedCorrectly: number;
109
+ firedWrongly: number;
110
+ gate: {
111
+ status: string;
112
+ reason: string;
113
+ } | null;
114
+ intents: ReportIntentRowV1[];
115
+ /** Spec 416 W3 — selective prediction for a variant whose runs carry a judge's distribution: answering only its most
116
+ * confident runs, the error rate among those answered. Absent when no run recorded a distribution. */
117
+ riskCoverage?: {
118
+ n: number;
119
+ aurc: number | null;
120
+ points: Array<{
121
+ coverage: number;
122
+ risk: number;
123
+ threshold: number;
124
+ }>;
125
+ };
126
+ /** What an answer COST: the median run time, and the tokens providers reported — for the selection alone (the model
127
+ * planner's or the judge's calls) and for the whole run. `tokenRuns` says how many runs reported any; absent when
128
+ * none did (older experiments recorded no tokens). */
129
+ cost?: {
130
+ medianMs: number | null;
131
+ medianSelectionMs: number | null;
132
+ tokenRuns: number;
133
+ meanSelectionIn: number | null;
134
+ meanSelectionOut: number | null;
135
+ meanTotalIn: number | null;
136
+ meanTotalOut: number | null;
137
+ unreportedCalls: number;
138
+ };
139
+ perSkill: Array<{
140
+ skill: string;
141
+ asked: number;
142
+ right: number;
143
+ accuracy: number | null;
144
+ ci: [number, number] | null;
145
+ wronglyChosen: number;
146
+ confusedWith: Array<{
147
+ skill: string;
148
+ times: number;
149
+ }>;
150
+ }>;
151
+ }
152
+ export interface ReportExperimentV1 {
153
+ id: string;
154
+ slate: string;
155
+ split: string;
156
+ repeats: number;
157
+ startedAt: string;
158
+ finishedAt: string;
159
+ /** W4 — capability | regression (declared on the set, else inferred from its id). */
160
+ suiteKind: SuiteKindV1;
161
+ variants: ReportVariantV1[];
162
+ comparisons: Array<{
163
+ a: string;
164
+ b: string;
165
+ changed: string[];
166
+ confounded: boolean;
167
+ words: string;
168
+ deltaMacro: number | null;
169
+ fixed: number;
170
+ broken: number;
171
+ p: number | null;
172
+ }>;
173
+ }
174
+ export interface ReportRecommendationV1 {
175
+ rule: string;
176
+ severity: 'act' | 'watch' | 'info';
177
+ title: string;
178
+ detail: string;
179
+ change: string;
180
+ skill?: string;
181
+ experiment: string;
182
+ variant?: string;
183
+ evidence: {
184
+ intents: string[];
185
+ numbers: Record<string, number | string>;
186
+ };
187
+ }
188
+ export interface SkillAssessmentReportV1 {
189
+ type: 'ap.skill-assessment-report.v1';
190
+ builtAt: string;
191
+ experiments: ReportExperimentV1[];
192
+ /** One entry per skill: its latest numbers per slate, and the recommendations that name it. */
193
+ skillContracts: Array<{
194
+ skill: string;
195
+ slates: Array<{
196
+ experiment: string;
197
+ variant: string;
198
+ asked: number;
199
+ right: number;
200
+ accuracy: number | null;
201
+ wronglyChosen: number;
202
+ confusedWith: Array<{
203
+ skill: string;
204
+ times: number;
205
+ }>;
206
+ }>;
207
+ recommendations: number;
208
+ }>;
209
+ recommendations: ReportRecommendationV1[];
210
+ /** The comparison the program is working toward, in one sentence each (the headline) — capability slates first,
211
+ * regression slates after, each line saying which it is. */
212
+ headline: string[];
213
+ /** W4 — the same, split by suite kind, so a renderer never pools them. */
214
+ byKind: Record<SuiteKindV1, string[]>;
215
+ /** What each outcome, approach, failure cause and suite kind means, so every renderer says it the same way. */
216
+ glossary: {
217
+ outcomes: typeof OUTCOME_WORDS;
218
+ approaches: typeof VARIANT_WORDS;
219
+ causes: typeof CAUSE_WORDS;
220
+ suites: typeof SUITE_WORDS;
221
+ };
222
+ }
223
+ /** Share of the test sentence's content words that one example also has — 1 is the sentence itself. */
224
+ export declare function exampleOverlap(test: string, example: string): number;
225
+ /** The threshold above which a test sentence counts as carried by the skills it tests (default 0.6). */
226
+ export declare const CONTAMINATION_THRESHOLD = 0.6;
227
+ /** Build the report. `sets` and `criteria` are keyed by the replay-set digest the experiments pre-registered. `examples`
228
+ * are the example sentences the skills under test declare (their `utterances`, as the playbook carries them) — when
229
+ * given, every test sentence that nearly repeats one is flagged, and so is any number resting on it. */
230
+ export declare function skillAssessmentReportOf(input: {
231
+ experiments: readonly ExperimentRecordV1[];
232
+ sets: Record<string, ReplaySetV1>;
233
+ criteria: Record<string, SelectionCriterionV1>;
234
+ examples?: ReadonlyArray<{
235
+ skill: string;
236
+ says: string;
237
+ isNot?: boolean;
238
+ }>;
239
+ now?: string;
240
+ /** Rename a variant IN THE REPORT for one experiment (`{ [experimentId]: { judgment: 'framed-judgment' } }`) — when a
241
+ * knob value's meaning changed after an experiment ran, the report says what actually ran; the record is never edited. */
242
+ aliases?: Record<string, Record<string, string>>;
243
+ /** Tool id → canonical skill id (the playbook's `source`), for reading judges' distributions (risk–coverage). */
244
+ toolToSkill?: Record<string, string>;
245
+ /** The outcome gold per replay-set digest (`ap.outcome-gold.v1` cases) — when given, the PLAN METRICS are computed and
246
+ * reported as diagnostics under the outcome. */
247
+ outcomeGold?: Record<string, Record<string, OutcomeGoldV1>>;
248
+ }): SkillAssessmentReportV1;
249
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAcA,OAAO,EAAwC,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACzH,OAAO,EAAkB,KAAK,kBAAkB,EAAwB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACrH,OAAO,EAAe,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAS/E,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,cAAc,GAAG,WAAW,EAAE,MAAM,CAKpE,CAAC;AACF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAGnD,CAAC;AACF,0HAA0H;AAC1H,eAAO,MAAM,UAAU;;;CAA8C,CAAC;AAEtE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,kBAAkB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,GAAG,IA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