@aid-framework/runtime 0.0.0-stage → 0.1.39

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 (188) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +52 -2
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/agents/deep_agents.d.ts +78 -0
  5. package/dist/agents/deep_agents.d.ts.map +1 -0
  6. package/dist/agents/deep_agents.js +477 -0
  7. package/dist/agents/deep_agents.js.map +1 -0
  8. package/dist/agents/engine.d.ts +85 -0
  9. package/dist/agents/engine.d.ts.map +1 -0
  10. package/dist/agents/engine.js +129 -0
  11. package/dist/agents/engine.js.map +1 -0
  12. package/dist/agents/gateway_chat_model.d.ts +151 -0
  13. package/dist/agents/gateway_chat_model.d.ts.map +1 -0
  14. package/dist/agents/gateway_chat_model.js +350 -0
  15. package/dist/agents/gateway_chat_model.js.map +1 -0
  16. package/dist/agents/guardrail_middleware.d.ts +57 -0
  17. package/dist/agents/guardrail_middleware.d.ts.map +1 -0
  18. package/dist/agents/guardrail_middleware.js +85 -0
  19. package/dist/agents/guardrail_middleware.js.map +1 -0
  20. package/dist/agents/guardrails.d.ts +124 -0
  21. package/dist/agents/guardrails.d.ts.map +1 -0
  22. package/dist/agents/guardrails.js +336 -0
  23. package/dist/agents/guardrails.js.map +1 -0
  24. package/dist/agents/index.d.ts +15 -0
  25. package/dist/agents/index.d.ts.map +1 -0
  26. package/dist/agents/index.js +15 -0
  27. package/dist/agents/index.js.map +1 -0
  28. package/dist/agents/ir.d.ts +144 -0
  29. package/dist/agents/ir.d.ts.map +1 -0
  30. package/dist/agents/ir.js +513 -0
  31. package/dist/agents/ir.js.map +1 -0
  32. package/dist/agents/loop.d.ts +145 -0
  33. package/dist/agents/loop.d.ts.map +1 -0
  34. package/dist/agents/loop.js +1025 -0
  35. package/dist/agents/loop.js.map +1 -0
  36. package/dist/agents/memory.d.ts +115 -0
  37. package/dist/agents/memory.d.ts.map +1 -0
  38. package/dist/agents/memory.js +258 -0
  39. package/dist/agents/memory.js.map +1 -0
  40. package/dist/agents/state.d.ts +137 -0
  41. package/dist/agents/state.d.ts.map +1 -0
  42. package/dist/agents/state.js +255 -0
  43. package/dist/agents/state.js.map +1 -0
  44. package/dist/concurrency.d.ts +36 -0
  45. package/dist/concurrency.d.ts.map +1 -0
  46. package/dist/concurrency.js +86 -0
  47. package/dist/concurrency.js.map +1 -0
  48. package/dist/control.d.ts +116 -0
  49. package/dist/control.d.ts.map +1 -0
  50. package/dist/control.js +281 -0
  51. package/dist/control.js.map +1 -0
  52. package/dist/cost.d.ts +95 -0
  53. package/dist/cost.d.ts.map +1 -0
  54. package/dist/cost.js +161 -0
  55. package/dist/cost.js.map +1 -0
  56. package/dist/errors.d.ts +213 -0
  57. package/dist/errors.d.ts.map +1 -0
  58. package/dist/errors.js +316 -0
  59. package/dist/errors.js.map +1 -0
  60. package/dist/evals/dataset.d.ts +45 -0
  61. package/dist/evals/dataset.d.ts.map +1 -0
  62. package/dist/evals/dataset.js +147 -0
  63. package/dist/evals/dataset.js.map +1 -0
  64. package/dist/evals/gate.d.ts +236 -0
  65. package/dist/evals/gate.d.ts.map +1 -0
  66. package/dist/evals/gate.js +572 -0
  67. package/dist/evals/gate.js.map +1 -0
  68. package/dist/evals/metrics.d.ts +141 -0
  69. package/dist/evals/metrics.d.ts.map +1 -0
  70. package/dist/evals/metrics.js +364 -0
  71. package/dist/evals/metrics.js.map +1 -0
  72. package/dist/evals/predicate.d.ts +79 -0
  73. package/dist/evals/predicate.d.ts.map +1 -0
  74. package/dist/evals/predicate.js +178 -0
  75. package/dist/evals/predicate.js.map +1 -0
  76. package/dist/evals/runner.d.ts +94 -0
  77. package/dist/evals/runner.d.ts.map +1 -0
  78. package/dist/evals/runner.js +202 -0
  79. package/dist/evals/runner.js.map +1 -0
  80. package/dist/gateway.d.ts +118 -0
  81. package/dist/gateway.d.ts.map +1 -0
  82. package/dist/gateway.js +250 -0
  83. package/dist/gateway.js.map +1 -0
  84. package/dist/index.d.ts +83 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/index.js +59 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/internal/json.d.ts +44 -0
  89. package/dist/internal/json.d.ts.map +1 -0
  90. package/dist/internal/json.js +90 -0
  91. package/dist/internal/json.js.map +1 -0
  92. package/dist/internal/text.d.ts +17 -0
  93. package/dist/internal/text.d.ts.map +1 -0
  94. package/dist/internal/text.js +22 -0
  95. package/dist/internal/text.js.map +1 -0
  96. package/dist/pipeline.d.ts +80 -0
  97. package/dist/pipeline.d.ts.map +1 -0
  98. package/dist/pipeline.js +159 -0
  99. package/dist/pipeline.js.map +1 -0
  100. package/dist/policy.d.ts +52 -0
  101. package/dist/policy.d.ts.map +1 -0
  102. package/dist/policy.js +199 -0
  103. package/dist/policy.js.map +1 -0
  104. package/dist/prompts.d.ts +86 -0
  105. package/dist/prompts.d.ts.map +1 -0
  106. package/dist/prompts.js +337 -0
  107. package/dist/prompts.js.map +1 -0
  108. package/dist/providers/base.d.ts +19 -0
  109. package/dist/providers/base.d.ts.map +1 -0
  110. package/dist/providers/base.js +13 -0
  111. package/dist/providers/base.js.map +1 -0
  112. package/dist/providers/fake.d.ts +98 -0
  113. package/dist/providers/fake.d.ts.map +1 -0
  114. package/dist/providers/fake.js +181 -0
  115. package/dist/providers/fake.js.map +1 -0
  116. package/dist/providers/http.d.ts +62 -0
  117. package/dist/providers/http.d.ts.map +1 -0
  118. package/dist/providers/http.js +245 -0
  119. package/dist/providers/http.js.map +1 -0
  120. package/dist/retrieval/chunking.d.ts +88 -0
  121. package/dist/retrieval/chunking.d.ts.map +1 -0
  122. package/dist/retrieval/chunking.js +188 -0
  123. package/dist/retrieval/chunking.js.map +1 -0
  124. package/dist/retrieval/citations.d.ts +98 -0
  125. package/dist/retrieval/citations.d.ts.map +1 -0
  126. package/dist/retrieval/citations.js +134 -0
  127. package/dist/retrieval/citations.js.map +1 -0
  128. package/dist/retrieval/connectors.d.ts +74 -0
  129. package/dist/retrieval/connectors.d.ts.map +1 -0
  130. package/dist/retrieval/connectors.js +218 -0
  131. package/dist/retrieval/connectors.js.map +1 -0
  132. package/dist/retrieval/embedding.d.ts +116 -0
  133. package/dist/retrieval/embedding.d.ts.map +1 -0
  134. package/dist/retrieval/embedding.js +282 -0
  135. package/dist/retrieval/embedding.js.map +1 -0
  136. package/dist/retrieval/gate.d.ts +52 -0
  137. package/dist/retrieval/gate.d.ts.map +1 -0
  138. package/dist/retrieval/gate.js +91 -0
  139. package/dist/retrieval/gate.js.map +1 -0
  140. package/dist/retrieval/hybrid.d.ts +76 -0
  141. package/dist/retrieval/hybrid.d.ts.map +1 -0
  142. package/dist/retrieval/hybrid.js +150 -0
  143. package/dist/retrieval/hybrid.js.map +1 -0
  144. package/dist/retrieval/metrics.d.ts +126 -0
  145. package/dist/retrieval/metrics.d.ts.map +1 -0
  146. package/dist/retrieval/metrics.js +200 -0
  147. package/dist/retrieval/metrics.js.map +1 -0
  148. package/dist/retrieval/pgvector.d.ts +62 -0
  149. package/dist/retrieval/pgvector.d.ts.map +1 -0
  150. package/dist/retrieval/pgvector.js +262 -0
  151. package/dist/retrieval/pgvector.js.map +1 -0
  152. package/dist/retrieval/rerank.d.ts +61 -0
  153. package/dist/retrieval/rerank.d.ts.map +1 -0
  154. package/dist/retrieval/rerank.js +105 -0
  155. package/dist/retrieval/rerank.js.map +1 -0
  156. package/dist/retrieval/retriever.d.ts +125 -0
  157. package/dist/retrieval/retriever.d.ts.map +1 -0
  158. package/dist/retrieval/retriever.js +281 -0
  159. package/dist/retrieval/retriever.js.map +1 -0
  160. package/dist/retrieval/stores.d.ts +106 -0
  161. package/dist/retrieval/stores.d.ts.map +1 -0
  162. package/dist/retrieval/stores.js +142 -0
  163. package/dist/retrieval/stores.js.map +1 -0
  164. package/dist/retrieval/types.d.ts +314 -0
  165. package/dist/retrieval/types.d.ts.map +1 -0
  166. package/dist/retrieval/types.js +388 -0
  167. package/dist/retrieval/types.js.map +1 -0
  168. package/dist/steps.d.ts +156 -0
  169. package/dist/steps.d.ts.map +1 -0
  170. package/dist/steps.js +199 -0
  171. package/dist/steps.js.map +1 -0
  172. package/dist/structured.d.ts +91 -0
  173. package/dist/structured.d.ts.map +1 -0
  174. package/dist/structured.js +155 -0
  175. package/dist/structured.js.map +1 -0
  176. package/dist/tools.d.ts +100 -0
  177. package/dist/tools.d.ts.map +1 -0
  178. package/dist/tools.js +201 -0
  179. package/dist/tools.js.map +1 -0
  180. package/dist/tracing.d.ts +104 -0
  181. package/dist/tracing.d.ts.map +1 -0
  182. package/dist/tracing.js +155 -0
  183. package/dist/tracing.js.map +1 -0
  184. package/dist/types.d.ts +240 -0
  185. package/dist/types.d.ts.map +1 -0
  186. package/dist/types.js +357 -0
  187. package/dist/types.js.map +1 -0
  188. package/package.json +77 -3
@@ -0,0 +1,147 @@
1
+ /**
2
+ * Eval datasets: the probabilistic analogue of a golden fixture.
3
+ *
4
+ * A dataset is versioned and committed. The version matters as much as the cases:
5
+ * comparing a run against a baseline recorded on a *different* dataset version is the
6
+ * most common way an eval gate becomes noise, so the gate refuses it.
7
+ */
8
+ import { readFileSync } from 'node:fs';
9
+ // biome-ignore lint/suspicious/noShadowRestrictedNames: the framework's own error name, matching the Python runtime's public surface
10
+ import { EvalError } from '../errors.js';
11
+ import { dumpsSorted } from '../internal/json.js';
12
+ /** One input, its expected output, and any tags the metrics key off. */
13
+ export class EvalCase {
14
+ id;
15
+ input;
16
+ expected;
17
+ tags;
18
+ metadata;
19
+ constructor(init) {
20
+ if (init.id.length === 0)
21
+ throw new RangeError('case id must not be empty');
22
+ this.id = init.id;
23
+ this.input = init.input;
24
+ this.expected = init.expected ?? null;
25
+ this.tags = init.tags ?? [];
26
+ this.metadata = init.metadata ?? {};
27
+ }
28
+ toJSON() {
29
+ return {
30
+ id: this.id,
31
+ input: this.input,
32
+ expected: this.expected,
33
+ tags: [...this.tags],
34
+ metadata: { ...this.metadata },
35
+ };
36
+ }
37
+ }
38
+ function parseCase(raw, where) {
39
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
40
+ throw new EvalError(`dataset ${where} is not an object`);
41
+ }
42
+ const record = raw;
43
+ const id = record.id;
44
+ const input = record.input;
45
+ if (typeof id !== 'string' || id.length === 0) {
46
+ throw new EvalError(`dataset ${where} needs a non-empty 'id'`);
47
+ }
48
+ if (typeof input !== 'string')
49
+ throw new EvalError(`case ${JSON.stringify(id)} needs an 'input'`);
50
+ const expected = record.expected;
51
+ if (expected !== undefined && expected !== null && typeof expected !== 'string') {
52
+ throw new EvalError(`case ${JSON.stringify(id)} has a non-string 'expected'`);
53
+ }
54
+ const tags = record.tags;
55
+ const metadata = record.metadata;
56
+ return new EvalCase({
57
+ id,
58
+ input,
59
+ expected: typeof expected === 'string' ? expected : null,
60
+ tags: Array.isArray(tags) ? tags.filter((tag) => typeof tag === 'string') : [],
61
+ metadata: typeof metadata === 'object' && metadata !== null && !Array.isArray(metadata)
62
+ ? metadata
63
+ : {},
64
+ });
65
+ }
66
+ function parseDataset(payload) {
67
+ if (typeof payload !== 'object' || payload === null || Array.isArray(payload)) {
68
+ throw new EvalError('a dataset must be a JSON object');
69
+ }
70
+ const record = payload;
71
+ const name = record.name;
72
+ const version = record.version;
73
+ const cases = record.cases;
74
+ if (typeof name !== 'string' || name.length === 0) {
75
+ throw new EvalError("a dataset needs a non-empty 'name'");
76
+ }
77
+ if (typeof version !== 'string' || version.length === 0) {
78
+ throw new EvalError("a dataset needs a non-empty 'version'");
79
+ }
80
+ if (!Array.isArray(cases) || cases.length === 0) {
81
+ throw new EvalError('a dataset needs at least one case');
82
+ }
83
+ return new Dataset({
84
+ name,
85
+ version,
86
+ cases: cases.map((entry, index) => parseCase(entry, `case ${index}`)),
87
+ });
88
+ }
89
+ /** An ordered, versioned set of cases. */
90
+ export class Dataset {
91
+ name;
92
+ version;
93
+ cases;
94
+ constructor(init) {
95
+ if (init.name.length === 0)
96
+ throw new RangeError('dataset name must not be empty');
97
+ if (init.version.length === 0)
98
+ throw new RangeError('dataset version must not be empty');
99
+ if (init.cases.length === 0)
100
+ throw new RangeError('a dataset needs at least one case');
101
+ this.name = init.name;
102
+ this.version = init.version;
103
+ this.cases = init.cases;
104
+ }
105
+ get length() {
106
+ return this.cases.length;
107
+ }
108
+ ids() {
109
+ return this.cases.map((entry) => entry.id);
110
+ }
111
+ case(caseId) {
112
+ for (const candidate of this.cases) {
113
+ if (candidate.id === caseId)
114
+ return candidate;
115
+ }
116
+ throw new EvalError(`dataset ${JSON.stringify(this.name)} has no case ${JSON.stringify(caseId)}`);
117
+ }
118
+ byTag(tag) {
119
+ return this.cases.filter((entry) => entry.tags.includes(tag));
120
+ }
121
+ static fromRecords(name, version, records) {
122
+ return parseDataset({ name, version, cases: records });
123
+ }
124
+ static fromJson(payload) {
125
+ let parsed;
126
+ try {
127
+ parsed = JSON.parse(payload);
128
+ }
129
+ catch (error) {
130
+ throw new EvalError(`a dataset must be JSON: ${error instanceof Error ? error.message : String(error)}`);
131
+ }
132
+ return parseDataset(parsed);
133
+ }
134
+ static fromPath(path) {
135
+ return Dataset.fromJson(readFileSync(path, 'utf8'));
136
+ }
137
+ /** Canonical JSON: sorted keys, so a dataset diff is reviewable. */
138
+ toJson() {
139
+ const payload = {
140
+ name: this.name,
141
+ version: this.version,
142
+ cases: this.cases.map((entry) => entry.toJSON()),
143
+ };
144
+ return `${dumpsSorted(payload)}\n`;
145
+ }
146
+ }
147
+ //# sourceMappingURL=dataset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataset.js","sourceRoot":"","sources":["../../src/evals/dataset.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,qIAAqI;AACrI,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAUlD,wEAAwE;AACxE,MAAM,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,QAAQ,CAAC,OAAe;QAC7B,IAAI,MAAe,CAAC;QACpB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,SAAS,CACjB,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACpF,CAAC;QACJ,CAAC;QACD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAAkB;QAChC,OAAO,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,oEAAoE;IACpE,MAAM;QACJ,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;SACjD,CAAC;QACF,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,236 @@
1
+ /**
2
+ * N-run sampling and the statistical baseline gate.
3
+ *
4
+ * The ratified Phase 0 decision is that gating uses **N-run sampling with statistical
5
+ * thresholds compared against a stored baseline**, in the `maxRegression` style --
6
+ * *not* strict equality. Non-determinism is expected and must not be treated as a bug.
7
+ *
8
+ * Concretely, for each metric we:
9
+ *
10
+ * 1. Run the dataset `runs` times, giving one mean score per run. Those means are the
11
+ * *sample*, and their spread is the honest measure of how much this system varies
12
+ * when nothing changed.
13
+ * 2. Compare the sample against a stored baseline (its own mean, spread and size).
14
+ * 3. Fail only when the drop exceeds `maxRegression` **and** that drop is larger than
15
+ * the standard error of the difference could explain, at the configured
16
+ * significance level.
17
+ *
18
+ * Step 3 is what makes the gate trustworthy in both directions. A gate that fires on
19
+ * any decrease is a flaky gate; a gate that only compares means can be fooled by a
20
+ * noisy run. Requiring both a material *and* a statistically distinguishable drop
21
+ * means the gate reports a regression when the evidence says there is one, and stays
22
+ * quiet otherwise.
23
+ *
24
+ * The z critical values are a table rather than a library call because adding a
25
+ * statistics dependency to enforce one one-sided test is not a trade worth making in a
26
+ * runtime that must stay small.
27
+ *
28
+ * ## Parity note
29
+ *
30
+ * The arithmetic here is a direct transcription of `aid_runtime.evals.gate`, including
31
+ * the z-critical table, the verdict ordering, and the six-decimal/four-decimal/three-
32
+ * decimal formatting of the rationales. Only the *inputs* differ between the two
33
+ * runtimes, because their fake providers draw their accuracy samples differently.
34
+ */
35
+ import type { Metric } from './metrics.js';
36
+ /**
37
+ * The one-sided z critical value at `alpha`, rounded to a stricter level.
38
+ *
39
+ * `alpha` is rounded to the next *stricter* tabulated level -- a smaller alpha, hence a
40
+ * larger z, hence a gate that demands slightly more evidence than asked for. That is
41
+ * the safe direction for a regression gate: a gate that fires on borderline evidence
42
+ * is a gate that gets switched off. An `alpha` below the strictest tabulated level
43
+ * gets the strictest value, for the same reason.
44
+ */
45
+ export declare function zCritical(alpha: number): number;
46
+ /**
47
+ * One-sided z for "the current mean is lower than the baseline mean".
48
+ *
49
+ * Uses the standard error of the difference of two means, so *both* spreads
50
+ * contribute: a noisy baseline is a weak claim to regress against, and the gate should
51
+ * demand more evidence before rejecting it.
52
+ */
53
+ export declare function regressionZ(init: {
54
+ readonly currentMean: number;
55
+ readonly currentStdev: number;
56
+ readonly currentN: number;
57
+ readonly baselineMean: number;
58
+ readonly baselineStdev: number;
59
+ readonly baselineN: number;
60
+ }): number;
61
+ /** Per-run, per-metric means: one value per run of the dataset. */
62
+ export declare class MetricRun {
63
+ readonly metric: string;
64
+ readonly values: readonly number[];
65
+ constructor(init: {
66
+ readonly metric: string;
67
+ readonly values: readonly number[];
68
+ });
69
+ toJSON(): Record<string, unknown>;
70
+ }
71
+ /** The sampled result of running a dataset N times. */
72
+ export declare class EvalRun {
73
+ readonly dataset: string;
74
+ readonly datasetVersion: string;
75
+ readonly runs: number;
76
+ readonly metrics: readonly MetricRun[];
77
+ constructor(init: {
78
+ readonly dataset: string;
79
+ readonly datasetVersion: string;
80
+ readonly runs: number;
81
+ readonly metrics: readonly MetricRun[];
82
+ });
83
+ means(): Record<string, number>;
84
+ spread(): Record<string, number>;
85
+ valuesFor(metric: string): readonly number[];
86
+ /**
87
+ * Whether any metric produced different scores across runs.
88
+ *
89
+ * Exposed because "the run varied" is a *fact about the system*, not a failure: a
90
+ * test asserts on it to prove the gate tolerates noise rather than assuming a
91
+ * deterministic system.
92
+ */
93
+ isVarying(): boolean;
94
+ toJson(): string;
95
+ }
96
+ /** A stored metric distribution, recorded from a run that was accepted. */
97
+ export declare class MetricBaseline {
98
+ readonly metric: string;
99
+ readonly runs: number;
100
+ readonly mean: number;
101
+ readonly stdev: number;
102
+ constructor(init: {
103
+ readonly metric: string;
104
+ readonly runs: number;
105
+ readonly mean: number;
106
+ readonly stdev: number;
107
+ });
108
+ static fromValues(metric: string, values: readonly number[]): MetricBaseline;
109
+ toJSON(): Record<string, unknown>;
110
+ }
111
+ /** A committed baseline: the accepted distribution for a dataset and model. */
112
+ export declare class EvalBaseline {
113
+ readonly dataset: string;
114
+ readonly datasetVersion: string;
115
+ readonly model: string;
116
+ readonly metrics: readonly MetricBaseline[];
117
+ readonly note: string;
118
+ constructor(init: {
119
+ readonly dataset: string;
120
+ readonly datasetVersion: string;
121
+ readonly model: string;
122
+ readonly metrics: readonly MetricBaseline[];
123
+ readonly note?: string;
124
+ });
125
+ static fromRun(run: EvalRun, options: {
126
+ readonly model: string;
127
+ readonly note?: string;
128
+ }): EvalBaseline;
129
+ metric(name: string): MetricBaseline;
130
+ /** Parse a committed baseline. Accepts `snake_case` and `camelCase` keys. */
131
+ static fromJson(payload: string): EvalBaseline;
132
+ static fromPath(path: string | URL): EvalBaseline;
133
+ toJson(): string;
134
+ }
135
+ /** The acceptance rule for one metric. */
136
+ export declare class Threshold {
137
+ readonly metric: string;
138
+ /**
139
+ * Absolute floor on the mean. Independent of the baseline: it says what "good
140
+ * enough" means, which no comparison to a past run can express.
141
+ */
142
+ readonly minMean: number | null;
143
+ /** Largest mean drop, versus the baseline, still considered acceptable. */
144
+ readonly maxRegression: number;
145
+ /** Significance level for the one-sided regression test. */
146
+ readonly alpha: number;
147
+ constructor(init: {
148
+ readonly metric: string;
149
+ readonly minMean?: number | null;
150
+ readonly maxRegression?: number;
151
+ readonly alpha?: number;
152
+ });
153
+ }
154
+ /** Why one metric passed or failed. The rationale is the product. */
155
+ export declare class MetricGateResult {
156
+ readonly metric: string;
157
+ readonly passed: boolean;
158
+ readonly currentMean: number;
159
+ readonly currentStdev: number;
160
+ readonly baselineMean: number;
161
+ readonly baselineStdev: number;
162
+ readonly delta: number;
163
+ readonly z: number;
164
+ readonly alpha: number;
165
+ readonly maxRegression: number;
166
+ readonly rationale: string;
167
+ constructor(init: {
168
+ readonly metric: string;
169
+ readonly passed: boolean;
170
+ readonly currentMean: number;
171
+ readonly currentStdev: number;
172
+ readonly baselineMean: number;
173
+ readonly baselineStdev: number;
174
+ readonly delta: number;
175
+ readonly z: number;
176
+ readonly alpha: number;
177
+ readonly maxRegression: number;
178
+ readonly rationale: string;
179
+ });
180
+ }
181
+ /** The gate's verdict over every metric. */
182
+ export declare class GateResult {
183
+ readonly passed: boolean;
184
+ readonly dataset: string;
185
+ readonly datasetVersion: string;
186
+ readonly runs: number;
187
+ readonly results: readonly MetricGateResult[];
188
+ readonly varying: boolean;
189
+ constructor(init: {
190
+ readonly passed: boolean;
191
+ readonly dataset: string;
192
+ readonly datasetVersion: string;
193
+ readonly runs: number;
194
+ readonly results: readonly MetricGateResult[];
195
+ readonly varying?: boolean;
196
+ });
197
+ failures(): MetricGateResult[];
198
+ summary(): string;
199
+ }
200
+ export interface BaselineGateOptions {
201
+ readonly metrics?: readonly Metric[];
202
+ readonly allowNondeterministic?: boolean;
203
+ }
204
+ /** Compares a sampled run against a stored baseline. */
205
+ export declare class BaselineGate {
206
+ private readonly _thresholds;
207
+ private readonly _metrics;
208
+ private readonly _allowNondeterministic;
209
+ constructor(thresholds: readonly Threshold[], options?: BaselineGateOptions);
210
+ get thresholds(): readonly Threshold[];
211
+ /** Decide whether `run` regressed against `baseline`. */
212
+ evaluate(run: EvalRun, baseline: EvalBaseline): GateResult;
213
+ private evaluateMetric;
214
+ /**
215
+ * The pass/fail call and the sentence explaining it.
216
+ *
217
+ * Three ways to pass, and the distinction between them is the whole point: no floor
218
+ * breached, no material drop, or a drop that is material but within what the two
219
+ * runs' own variation can explain. Only a drop that is both material *and* beyond the
220
+ * noise threshold counts as a regression.
221
+ */
222
+ private verdict;
223
+ /**
224
+ * Refuse thresholds that a non-deterministic metric would undermine.
225
+ *
226
+ * The rule is enforced here, at construction, rather than documented and hoped for: a
227
+ * gate configured on a model-backed metric is not a gate, and refusing at
228
+ * configuration time is the only moment that is cheap to fix.
229
+ */
230
+ private checkMetricEligibility;
231
+ }
232
+ /** Build a gate from parsed JSON/YAML, so CI config stays declarative. */
233
+ export declare function gateFromConfig(config: Readonly<Record<string, unknown>>, options?: {
234
+ readonly metrics?: readonly Metric[];
235
+ }): BaselineGate;
236
+ //# sourceMappingURL=gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/evals/gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAOH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAY3C;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO/C;AAkCD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,QAAQ,CAAC,W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