@idlekit/core 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +7 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/scenario/compile.d.ts +2 -2
  6. package/dist/scenario/compile.js +19 -14
  7. package/dist/scenario/compile.js.map +1 -1
  8. package/dist/scenario/scenarioContract.d.ts +30 -0
  9. package/dist/scenario/scenarioContract.js +35 -0
  10. package/dist/scenario/scenarioContract.js.map +1 -1
  11. package/dist/sim/advance.d.ts +198 -0
  12. package/dist/sim/advance.js +609 -0
  13. package/dist/sim/advance.js.map +1 -0
  14. package/dist/sim/analysis/checks.d.ts +260 -0
  15. package/dist/sim/analysis/checks.js +1442 -0
  16. package/dist/sim/analysis/checks.js.map +1 -0
  17. package/dist/sim/analysis/contracts.js +4 -0
  18. package/dist/sim/analysis/contracts.js.map +1 -1
  19. package/dist/sim/analysis/flow.d.ts +169 -0
  20. package/dist/sim/analysis/flow.js +1359 -0
  21. package/dist/sim/analysis/flow.js.map +1 -0
  22. package/dist/sim/analysis/jevAdvisory.d.ts +113 -0
  23. package/dist/sim/analysis/jevAdvisory.js +846 -0
  24. package/dist/sim/analysis/jevAdvisory.js.map +1 -0
  25. package/dist/sim/analysis/judge.d.ts +145 -0
  26. package/dist/sim/analysis/judge.js +1451 -0
  27. package/dist/sim/analysis/judge.js.map +1 -0
  28. package/dist/sim/analysis/registry.d.ts +9 -6
  29. package/dist/sim/analysis/registry.js +15 -2
  30. package/dist/sim/analysis/registry.js.map +1 -1
  31. package/dist/sim/analysis/resetCycle.js +30 -6
  32. package/dist/sim/analysis/resetCycle.js.map +1 -1
  33. package/dist/sim/executionBackend.d.ts +165 -0
  34. package/dist/sim/executionBackend.js +521 -0
  35. package/dist/sim/executionBackend.js.map +1 -0
  36. package/dist/sim/integrationMatrix.d.ts +52 -0
  37. package/dist/sim/integrationMatrix.js +68 -0
  38. package/dist/sim/integrationMatrix.js.map +1 -0
  39. package/dist/sim/observation.d.ts +11 -0
  40. package/dist/sim/observation.js +12 -0
  41. package/dist/sim/observation.js.map +1 -1
  42. package/dist/sim/offline.d.ts +2 -0
  43. package/dist/sim/offline.js +68 -1
  44. package/dist/sim/offline.js.map +1 -1
  45. package/dist/sim/simulator.d.ts +2 -0
  46. package/dist/sim/simulator.js +71 -1
  47. package/dist/sim/simulator.js.map +1 -1
  48. package/dist/sim/step.d.ts +10 -0
  49. package/dist/sim/step.js +22 -8
  50. package/dist/sim/step.js.map +1 -1
  51. package/dist/sim/types.d.ts +11 -0
  52. package/package.json +2 -2
@@ -0,0 +1,846 @@
1
+ import * as _isTypeUint32_1 from "typia/lib/internal/_isTypeUint32";
2
+ import * as _validateReport_1 from "typia/lib/internal/_validateReport";
3
+ import * as _createStandardSchema_1 from "typia/lib/internal/_createStandardSchema";
4
+ import typia, {} from "typia";
5
+ /**
6
+ * Structural advisory report for an opt-in Jev call.
7
+ * This module does not fetch, does not read an API key, and does not import a provider package.
8
+ */
9
+ const JEV_SCHEMA_ID = "https://idlekit.dev/schemas/jev.advisory.v1.schema.json";
10
+ const JEV_ALGORITHM_VERSION = "jev-advisory-1";
11
+ /**
12
+ * @evidence docs/requirements/active/jev-judge-provider.md#req-pr19-opt-in-live The published schema id is the Jev advisory report.
13
+ * @evidenceReview docs/requirements/active/jev-judge-provider.md#req-pr19-opt-in-live #7fc28bd Re-read the section: the id is the advisory schema, not a numeric contract.
14
+ */
15
+ export function jevSchemaId() {
16
+ return JEV_SCHEMA_ID;
17
+ }
18
+ /**
19
+ * @evidence docs/requirements/active/jev-judge-provider.md#req-pr19-opt-in-live The algorithm version is jev-advisory-1.
20
+ * @evidenceReview docs/requirements/active/jev-judge-provider.md#req-pr19-opt-in-live #7fc28bd Re-read the section: the version string is jev-advisory-1.
21
+ */
22
+ export function jevAlgorithmVersion() {
23
+ return JEV_ALGORITHM_VERSION;
24
+ }
25
+ /*
26
+ * typia runs on first call, not at module load. A plugin that the bundled CLI loads
27
+ * imports core source without the transform, and a module-load call would throw there.
28
+ */
29
+ let validateJevAdvisoryValidator;
30
+ /**
31
+ * @evidence docs/requirements/active/jev-judge-provider.md#req-pr19-wire-shapes The published validator is createValidate of the advisory report.
32
+ * @evidenceReview docs/requirements/active/jev-judge-provider.md#req-pr19-wire-shapes #a924cbf Re-read the section: the structural document is JevAdvisoryV1.
33
+ */
34
+ export const validateJevAdvisory = (input) => (validateJevAdvisoryValidator ??= (() => {
35
+ const _ip0 = input => 1 === input["schemaVersion"];
36
+ const _ip1 = input => "idlekit.jev.advisory.v1" === input["contract"];
37
+ const _ip2 = input => "jev-advisory-1" === input["algorithmVersion"];
38
+ const _ip3 = input => "jev" === input["provider"];
39
+ const _ip4 = input => "abstain" === input["status"] || "advisory-warning" === input["status"] || "failed" === input["status"] || "ok" === input["status"] || "skipped" === input["status"] || "unavailable" === input["status"];
40
+ const _ip5 = input => "string" === typeof input["reason"];
41
+ const _ip6 = input => "string" === typeof input["requestedModel"];
42
+ const _ip7 = input => null === input["resolvedModel"] || "string" === typeof input["resolvedModel"];
43
+ const _ip8 = input => "string" === typeof input["rubricVersion"];
44
+ const _ip9 = input => "string" === typeof input["numericalDigest"];
45
+ const _ip10 = input => true === input["numericalUnchanged"];
46
+ const _ip11 = input => "string" === typeof input["endpoint"];
47
+ const _ip12 = input => null === input["usage"] || "object" === typeof input["usage"] && null !== input["usage"] && _io1(input["usage"]);
48
+ const _ip13 = input => "bypass" === input["cache"] || "hit" === input["cache"] || "miss" === input["cache"];
49
+ const _ip14 = input => "number" === typeof input["attempts"] && _isTypeUint32_1._isTypeUint32(input["attempts"]);
50
+ const _ip15 = input => "number" === typeof input["plannedRequests"] && _isTypeUint32_1._isTypeUint32(input["plannedRequests"]);
51
+ const _ip16 = input => "boolean" === typeof input["dryRun"];
52
+ const _ip17 = input => "pinned" === input["aliasPolicy"] || "ttl-24h" === input["aliasPolicy"];
53
+ const _ip18 = input => "not-game-correctness" === input["confidencePolicy"];
54
+ const _ip19 = input => true === input["externalProvider"];
55
+ const _ip20 = input => Array.isArray(input["answers"]) && input["answers"].every(elem => "object" === typeof elem && null !== elem && _iu0(elem));
56
+ const _ip21 = input => "string" === typeof input["id"];
57
+ const _ip22 = input => undefined !== input["choice"] && null === input["choice"];
58
+ const _ip23 = input => undefined !== input["score"] && null === input["score"];
59
+ const _ip24 = input => "abstain" === input["disposition"] || "advisory-warning" === input["disposition"] || "ok" === input["disposition"];
60
+ const _ip25 = input => "number" === typeof input["confidence"] && (0 <= input["confidence"] && input["confidence"] <= 1);
61
+ const _ip26 = input => undefined !== input["noul"] && null === input["noul"];
62
+ const _ve0 = "Readonly<{ schemaVersion: 1; contract: \"idlekit.jev.advisory.v1\"; algorithmVersion: \"jev-advisory-1\"; provider: \"jev\"; status: \"abstain\" | \"advisory-warning\" | \"failed\" | \"ok\" | \"skipped\" | \"unavailable\"; ... 15 more ...; answers: readonly JevAdvisoryAnswerV1[]; }>";
63
+ const _vp0 = (input, _path, _exceptionable = true) => 1 === input["schemaVersion"] || _report(_exceptionable, {
64
+ path: _path + ".schemaVersion",
65
+ expected: "1",
66
+ value: input["schemaVersion"]
67
+ });
68
+ const _vp1 = (input, _path, _exceptionable = true) => "idlekit.jev.advisory.v1" === input["contract"] || _report(_exceptionable, {
69
+ path: _path + ".contract",
70
+ expected: "\"idlekit.jev.advisory.v1\"",
71
+ value: input["contract"]
72
+ });
73
+ const _vp2 = (input, _path, _exceptionable = true) => "jev-advisory-1" === input["algorithmVersion"] || _report(_exceptionable, {
74
+ path: _path + ".algorithmVersion",
75
+ expected: "\"jev-advisory-1\"",
76
+ value: input["algorithmVersion"]
77
+ });
78
+ const _vp3 = (input, _path, _exceptionable = true) => "jev" === input["provider"] || _report(_exceptionable, {
79
+ path: _path + ".provider",
80
+ expected: "\"jev\"",
81
+ value: input["provider"]
82
+ });
83
+ const _vp4 = (input, _path, _exceptionable = true) => "abstain" === input["status"] || "advisory-warning" === input["status"] || "failed" === input["status"] || "ok" === input["status"] || "skipped" === input["status"] || "unavailable" === input["status"] || _report(_exceptionable, {
84
+ path: _path + ".status",
85
+ expected: "(\"abstain\" | \"advisory-warning\" | \"failed\" | \"ok\" | \"skipped\" | \"unavailable\")",
86
+ value: input["status"]
87
+ });
88
+ const _vp5 = (input, _path, _exceptionable = true) => "string" === typeof input["reason"] || _report(_exceptionable, {
89
+ path: _path + ".reason",
90
+ expected: "string",
91
+ value: input["reason"]
92
+ });
93
+ const _vp6 = (input, _path, _exceptionable = true) => "string" === typeof input["requestedModel"] || _report(_exceptionable, {
94
+ path: _path + ".requestedModel",
95
+ expected: "string",
96
+ value: input["requestedModel"]
97
+ });
98
+ const _vp7 = (input, _path, _exceptionable = true) => null === input["resolvedModel"] || "string" === typeof input["resolvedModel"] || _report(_exceptionable, {
99
+ path: _path + ".resolvedModel",
100
+ expected: "(null | string)",
101
+ value: input["resolvedModel"]
102
+ });
103
+ const _vp8 = (input, _path, _exceptionable = true) => "string" === typeof input["rubricVersion"] || _report(_exceptionable, {
104
+ path: _path + ".rubricVersion",
105
+ expected: "string",
106
+ value: input["rubricVersion"]
107
+ });
108
+ const _vp9 = (input, _path, _exceptionable = true) => "string" === typeof input["numericalDigest"] || _report(_exceptionable, {
109
+ path: _path + ".numericalDigest",
110
+ expected: "string",
111
+ value: input["numericalDigest"]
112
+ });
113
+ const _vp10 = (input, _path, _exceptionable = true) => true === input["numericalUnchanged"] || _report(_exceptionable, {
114
+ path: _path + ".numericalUnchanged",
115
+ expected: "true",
116
+ value: input["numericalUnchanged"]
117
+ });
118
+ const _vp11 = (input, _path, _exceptionable = true) => "string" === typeof input["endpoint"] || _report(_exceptionable, {
119
+ path: _path + ".endpoint",
120
+ expected: "string",
121
+ value: input["endpoint"]
122
+ });
123
+ const _vp12 = (input, _path, _exceptionable = true) => null === input["usage"] || ("object" === typeof input["usage"] && null !== input["usage"] || _report(_exceptionable, {
124
+ path: _path + ".usage",
125
+ expected: "(Readonly<{ inputTokens: number & Type<\"uint32\">; outputTokens: number & Type<\"uint32\">; }> | null)",
126
+ value: input["usage"]
127
+ })) && _vo1(input["usage"], _path + ".usage", true && _exceptionable) || _report(_exceptionable, {
128
+ path: _path + ".usage",
129
+ expected: "(Readonly<{ inputTokens: number & Type<\"uint32\">; outputTokens: number & Type<\"uint32\">; }> | null)",
130
+ value: input["usage"]
131
+ });
132
+ const _vp13 = (input, _path, _exceptionable = true) => "bypass" === input["cache"] || "hit" === input["cache"] || "miss" === input["cache"] || _report(_exceptionable, {
133
+ path: _path + ".cache",
134
+ expected: "(\"bypass\" | \"hit\" | \"miss\")",
135
+ value: input["cache"]
136
+ });
137
+ const _vp14 = (input, _path, _exceptionable = true) => "number" === typeof input["attempts"] && (_isTypeUint32_1._isTypeUint32(input["attempts"]) || _report(_exceptionable, {
138
+ path: _path + ".attempts",
139
+ expected: "number & Type<\"uint32\">",
140
+ value: input["attempts"]
141
+ })) || _report(_exceptionable, {
142
+ path: _path + ".attempts",
143
+ expected: "(number & Type<\"uint32\">)",
144
+ value: input["attempts"]
145
+ });
146
+ const _vp15 = (input, _path, _exceptionable = true) => "number" === typeof input["plannedRequests"] && (_isTypeUint32_1._isTypeUint32(input["plannedRequests"]) || _report(_exceptionable, {
147
+ path: _path + ".plannedRequests",
148
+ expected: "number & Type<\"uint32\">",
149
+ value: input["plannedRequests"]
150
+ })) || _report(_exceptionable, {
151
+ path: _path + ".plannedRequests",
152
+ expected: "(number & Type<\"uint32\">)",
153
+ value: input["plannedRequests"]
154
+ });
155
+ const _vp16 = (input, _path, _exceptionable = true) => "boolean" === typeof input["dryRun"] || _report(_exceptionable, {
156
+ path: _path + ".dryRun",
157
+ expected: "boolean",
158
+ value: input["dryRun"]
159
+ });
160
+ const _vp17 = (input, _path, _exceptionable = true) => "pinned" === input["aliasPolicy"] || "ttl-24h" === input["aliasPolicy"] || _report(_exceptionable, {
161
+ path: _path + ".aliasPolicy",
162
+ expected: "(\"pinned\" | \"ttl-24h\")",
163
+ value: input["aliasPolicy"]
164
+ });
165
+ const _vp18 = (input, _path, _exceptionable = true) => "not-game-correctness" === input["confidencePolicy"] || _report(_exceptionable, {
166
+ path: _path + ".confidencePolicy",
167
+ expected: "\"not-game-correctness\"",
168
+ value: input["confidencePolicy"]
169
+ });
170
+ const _vp19 = (input, _path, _exceptionable = true) => true === input["externalProvider"] || _report(_exceptionable, {
171
+ path: _path + ".externalProvider",
172
+ expected: "true",
173
+ value: input["externalProvider"]
174
+ });
175
+ const _vp20 = (input, _path, _exceptionable = true) => (Array.isArray(input["answers"]) || _report(_exceptionable, {
176
+ path: _path + ".answers",
177
+ expected: "ReadonlyArray<JevAdvisoryAnswerV1>",
178
+ value: input["answers"]
179
+ })) && input["answers"].map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
180
+ path: _path + ".answers[" + _index2 + "]",
181
+ expected: _ve1,
182
+ value: elem
183
+ })) && _vu0(elem, _path + ".answers[" + _index2 + "]", true && _exceptionable) || _report(_exceptionable, {
184
+ path: _path + ".answers[" + _index2 + "]",
185
+ expected: _ve1,
186
+ value: elem
187
+ })).every(flag => flag) || _report(_exceptionable, {
188
+ path: _path + ".answers",
189
+ expected: "ReadonlyArray<JevAdvisoryAnswerV1>",
190
+ value: input["answers"]
191
+ });
192
+ const _ve1 = "(Readonly<{ id: string; type: \"choice\"; confidence: JevProbability; noul: null; choice: string; score: null; disposition: JevDisposition; }> | Readonly<{ id: string; type: \"noul\"; confidence: null; noul: JevProbability; choice: null; score: null; disposition: JevDisposition; }> | Readonly<{ id: string; type: \"score\"; confidence: JevProbability; noul: null; choice: null; score: number; disposition: JevDisposition; }>)";
193
+ const _vp21 = (input, _path, _exceptionable = true) => "string" === typeof input["id"] || _report(_exceptionable, {
194
+ path: _path + ".id",
195
+ expected: "string",
196
+ value: input["id"]
197
+ });
198
+ const _vp22 = (input, _path, _exceptionable = true) => (undefined !== input["choice"] || _report(_exceptionable, {
199
+ path: _path + ".choice",
200
+ expected: "null",
201
+ value: input["choice"]
202
+ })) && (null === input["choice"] || _report(_exceptionable, {
203
+ path: _path + ".choice",
204
+ expected: "null",
205
+ value: input["choice"]
206
+ }));
207
+ const _vp23 = (input, _path, _exceptionable = true) => (undefined !== input["score"] || _report(_exceptionable, {
208
+ path: _path + ".score",
209
+ expected: "null",
210
+ value: input["score"]
211
+ })) && (null === input["score"] || _report(_exceptionable, {
212
+ path: _path + ".score",
213
+ expected: "null",
214
+ value: input["score"]
215
+ }));
216
+ const _vp24 = (input, _path, _exceptionable = true) => "abstain" === input["disposition"] || "advisory-warning" === input["disposition"] || "ok" === input["disposition"] || _report(_exceptionable, {
217
+ path: _path + ".disposition",
218
+ expected: "(\"abstain\" | \"advisory-warning\" | \"ok\")",
219
+ value: input["disposition"]
220
+ });
221
+ const _vp25 = (input, _path, _exceptionable = true) => "number" === typeof input["confidence"] && (0 <= input["confidence"] || _report(_exceptionable, {
222
+ path: _path + ".confidence",
223
+ expected: "number & Minimum<0>",
224
+ value: input["confidence"]
225
+ })) && (input["confidence"] <= 1 || _report(_exceptionable, {
226
+ path: _path + ".confidence",
227
+ expected: "number & Maximum<1>",
228
+ value: input["confidence"]
229
+ })) || _report(_exceptionable, {
230
+ path: _path + ".confidence",
231
+ expected: "(number & Minimum<0> & Maximum<1>)",
232
+ value: input["confidence"]
233
+ });
234
+ const _vp26 = (input, _path, _exceptionable = true) => (undefined !== input["noul"] || _report(_exceptionable, {
235
+ path: _path + ".noul",
236
+ expected: "null",
237
+ value: input["noul"]
238
+ })) && (null === input["noul"] || _report(_exceptionable, {
239
+ path: _path + ".noul",
240
+ expected: "null",
241
+ value: input["noul"]
242
+ }));
243
+ const _ve2 = "(Readonly<{ id: string; type: \"score\"; confidence: JevProbability; noul: null; choice: null; score: number; disposition: JevDisposition; }> | Readonly<{ id: string; type: \"choice\"; confidence: JevProbability; noul: null; choice: string; score: null; disposition: JevDisposition; }> | Readonly<{ id: string; type: \"noul\"; confidence: null; noul: JevProbability; choice: null; score: null; disposition: JevDisposition; }>)";
244
+ const _io0 = input => _ip0(input) && _ip1(input) && _ip2(input) && _ip3(input) && _ip4(input) && _ip5(input) && _ip6(input) && _ip7(input) && _ip8(input) && _ip9(input) && _ip10(input) && _ip11(input) && _ip12(input) && _ip13(input) && _ip14(input) && _ip15(input) && _ip16(input) && _ip17(input) && _ip18(input) && _ip19(input) && _ip20(input);
245
+ const _io1 = input => "number" === typeof input.inputTokens && _isTypeUint32_1._isTypeUint32(input.inputTokens) && ("number" === typeof input.outputTokens && _isTypeUint32_1._isTypeUint32(input.outputTokens));
246
+ const _io2 = input => _ip21(input) && "noul" === input.type && (undefined !== input.confidence && null === input.confidence) && ("number" === typeof input.noul && (0 <= input.noul && input.noul <= 1)) && _ip22(input) && _ip23(input) && _ip24(input);
247
+ const _io3 = input => _ip21(input) && "choice" === input.type && _ip25(input) && _ip26(input) && "string" === typeof input.choice && _ip23(input) && _ip24(input);
248
+ const _io4 = input => _ip21(input) && "score" === input.type && _ip25(input) && _ip26(input) && _ip22(input) && "number" === typeof input.score && _ip24(input);
249
+ const _iu0 = input => (() => {
250
+ if ("score" === input.type)
251
+ return _io4(input);
252
+ else if ("choice" === input.type)
253
+ return _io3(input);
254
+ else if ("noul" === input.type)
255
+ return _io2(input);
256
+ else
257
+ return false;
258
+ })();
259
+ const _vo0 = (input, _path, _exceptionable = true) => [_vp0(input, _path, true && _exceptionable), _vp1(input, _path, true && _exceptionable), _vp2(input, _path, true && _exceptionable), _vp3(input, _path, true && _exceptionable), _vp4(input, _path, true && _exceptionable), _vp5(input, _path, true && _exceptionable), _vp6(input, _path, true && _exceptionable), _vp7(input, _path, true && _exceptionable), _vp8(input, _path, true && _exceptionable), _vp9(input, _path, true && _exceptionable), _vp10(input, _path, true && _exceptionable), _vp11(input, _path, true && _exceptionable), _vp12(input, _path, true && _exceptionable), _vp13(input, _path, true && _exceptionable), _vp14(input, _path, true && _exceptionable), _vp15(input, _path, true && _exceptionable), _vp16(input, _path, true && _exceptionable), _vp17(input, _path, true && _exceptionable), _vp18(input, _path, true && _exceptionable), _vp19(input, _path, true && _exceptionable), _vp20(input, _path, true && _exceptionable)].every(flag => flag);
260
+ const _vo1 = (input, _path, _exceptionable = true) => ["number" === typeof input.inputTokens && (_isTypeUint32_1._isTypeUint32(input.inputTokens) || _report(_exceptionable, {
261
+ path: _path + ".inputTokens",
262
+ expected: "number & Type<\"uint32\">",
263
+ value: input.inputTokens
264
+ })) || _report(_exceptionable, {
265
+ path: _path + ".inputTokens",
266
+ expected: "(number & Type<\"uint32\">)",
267
+ value: input.inputTokens
268
+ }), "number" === typeof input.outputTokens && (_isTypeUint32_1._isTypeUint32(input.outputTokens) || _report(_exceptionable, {
269
+ path: _path + ".outputTokens",
270
+ expected: "number & Type<\"uint32\">",
271
+ value: input.outputTokens
272
+ })) || _report(_exceptionable, {
273
+ path: _path + ".outputTokens",
274
+ expected: "(number & Type<\"uint32\">)",
275
+ value: input.outputTokens
276
+ })].every(flag => flag);
277
+ const _vo2 = (input, _path, _exceptionable = true) => [_vp21(input, _path, true && _exceptionable), "noul" === input.type || _report(_exceptionable, {
278
+ path: _path + ".type",
279
+ expected: "\"noul\"",
280
+ value: input.type
281
+ }), (undefined !== input.confidence || _report(_exceptionable, {
282
+ path: _path + ".confidence",
283
+ expected: "null",
284
+ value: input.confidence
285
+ })) && (null === input.confidence || _report(_exceptionable, {
286
+ path: _path + ".confidence",
287
+ expected: "null",
288
+ value: input.confidence
289
+ })), "number" === typeof input.noul && (0 <= input.noul || _report(_exceptionable, {
290
+ path: _path + ".noul",
291
+ expected: "number & Minimum<0>",
292
+ value: input.noul
293
+ })) && (input.noul <= 1 || _report(_exceptionable, {
294
+ path: _path + ".noul",
295
+ expected: "number & Maximum<1>",
296
+ value: input.noul
297
+ })) || _report(_exceptionable, {
298
+ path: _path + ".noul",
299
+ expected: "(number & Minimum<0> & Maximum<1>)",
300
+ value: input.noul
301
+ }), _vp22(input, _path, true && _exceptionable), _vp23(input, _path, true && _exceptionable), _vp24(input, _path, true && _exceptionable)].every(flag => flag);
302
+ const _vo3 = (input, _path, _exceptionable = true) => [_vp21(input, _path, true && _exceptionable), "choice" === input.type || _report(_exceptionable, {
303
+ path: _path + ".type",
304
+ expected: "\"choice\"",
305
+ value: input.type
306
+ }), _vp25(input, _path, true && _exceptionable), _vp26(input, _path, true && _exceptionable), "string" === typeof input.choice || _report(_exceptionable, {
307
+ path: _path + ".choice",
308
+ expected: "string",
309
+ value: input.choice
310
+ }), _vp23(input, _path, true && _exceptionable), _vp24(input, _path, true && _exceptionable)].every(flag => flag);
311
+ const _vo4 = (input, _path, _exceptionable = true) => [_vp21(input, _path, true && _exceptionable), "score" === input.type || _report(_exceptionable, {
312
+ path: _path + ".type",
313
+ expected: "\"score\"",
314
+ value: input.type
315
+ }), _vp25(input, _path, true && _exceptionable), _vp26(input, _path, true && _exceptionable), _vp22(input, _path, true && _exceptionable), "number" === typeof input.score || _report(_exceptionable, {
316
+ path: _path + ".score",
317
+ expected: "number",
318
+ value: input.score
319
+ }), _vp24(input, _path, true && _exceptionable)].every(flag => flag);
320
+ const _vu0 = (input, _path, _exceptionable = true) => (() => {
321
+ if ("score" === input.type)
322
+ return _vo4(input, _path, true && _exceptionable);
323
+ else if ("choice" === input.type)
324
+ return _vo3(input, _path, true && _exceptionable);
325
+ else if ("noul" === input.type)
326
+ return _vo2(input, _path, true && _exceptionable);
327
+ else
328
+ return _report(_exceptionable, {
329
+ path: _path,
330
+ expected: _ve2,
331
+ value: input
332
+ });
333
+ })();
334
+ const __is = input => "object" === typeof input && null !== input && _io0(input);
335
+ let errors;
336
+ let _report;
337
+ return _createStandardSchema_1._createStandardSchema(input => {
338
+ if (false === __is(input)) {
339
+ errors = [];
340
+ _report = _validateReport_1._validateReport(errors);
341
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
342
+ path: _path + "",
343
+ expected: _ve0,
344
+ value: input
345
+ })) && _vo0(input, _path + "", true) || _report(true, {
346
+ path: _path + "",
347
+ expected: _ve0,
348
+ value: input
349
+ }))(input, "$input", true);
350
+ const success = 0 === errors.length;
351
+ return success ? {
352
+ success,
353
+ data: input
354
+ } : {
355
+ success,
356
+ errors,
357
+ data: input
358
+ };
359
+ }
360
+ return {
361
+ success: true,
362
+ data: input
363
+ };
364
+ });
365
+ })())(input);
366
+ function buildJevJsonSchema() {
367
+ return {
368
+ components: {
369
+ schemas: {
370
+ "ReadonlyschemaVersion1contractidlekit_x2E_jev_x2E_advisory_x2E_v1algorithmVersionjev-advisory-1providerjevstatusabstainadvisory-warningfailedokskippedunavailable---15more---answersreadonlyJevAdvisoryAnswerV1-xA9D99E75BE467C17": {
371
+ type: "object",
372
+ properties: {
373
+ schemaVersion: {
374
+ "const": 1
375
+ },
376
+ contract: {
377
+ "const": "idlekit.jev.advisory.v1"
378
+ },
379
+ algorithmVersion: {
380
+ "const": "jev-advisory-1"
381
+ },
382
+ provider: {
383
+ "const": "jev"
384
+ },
385
+ status: {
386
+ oneOf: [
387
+ {
388
+ "const": "abstain"
389
+ },
390
+ {
391
+ "const": "advisory-warning"
392
+ },
393
+ {
394
+ "const": "failed"
395
+ },
396
+ {
397
+ "const": "ok"
398
+ },
399
+ {
400
+ "const": "skipped"
401
+ },
402
+ {
403
+ "const": "unavailable"
404
+ }
405
+ ]
406
+ },
407
+ reason: {
408
+ type: "string"
409
+ },
410
+ requestedModel: {
411
+ type: "string"
412
+ },
413
+ resolvedModel: {
414
+ oneOf: [
415
+ {
416
+ type: "null"
417
+ },
418
+ {
419
+ type: "string"
420
+ }
421
+ ]
422
+ },
423
+ rubricVersion: {
424
+ type: "string"
425
+ },
426
+ numericalDigest: {
427
+ type: "string"
428
+ },
429
+ numericalUnchanged: {
430
+ "const": true
431
+ },
432
+ endpoint: {
433
+ type: "string"
434
+ },
435
+ usage: {
436
+ oneOf: [
437
+ {
438
+ type: "null"
439
+ },
440
+ {
441
+ $ref: "#/components/schemas/ReadonlyinputTokensnumberTypeuint32outputTokensnumberTypeuint32"
442
+ }
443
+ ],
444
+ description: "Token counts are whole and never negative."
445
+ },
446
+ cache: {
447
+ oneOf: [
448
+ {
449
+ "const": "bypass"
450
+ },
451
+ {
452
+ "const": "hit"
453
+ },
454
+ {
455
+ "const": "miss"
456
+ }
457
+ ]
458
+ },
459
+ attempts: {
460
+ type: "integer",
461
+ minimum: 0
462
+ },
463
+ plannedRequests: {
464
+ type: "integer",
465
+ minimum: 0
466
+ },
467
+ dryRun: {
468
+ type: "boolean"
469
+ },
470
+ aliasPolicy: {
471
+ oneOf: [
472
+ {
473
+ "const": "pinned"
474
+ },
475
+ {
476
+ "const": "ttl-24h"
477
+ }
478
+ ]
479
+ },
480
+ confidencePolicy: {
481
+ "const": "not-game-correctness"
482
+ },
483
+ externalProvider: {
484
+ "const": true
485
+ },
486
+ answers: {
487
+ type: "array",
488
+ items: {
489
+ $ref: "#/components/schemas/JevAdvisoryAnswerV1"
490
+ }
491
+ }
492
+ },
493
+ required: [
494
+ "schemaVersion",
495
+ "contract",
496
+ "algorithmVersion",
497
+ "provider",
498
+ "status",
499
+ "reason",
500
+ "requestedModel",
501
+ "resolvedModel",
502
+ "rubricVersion",
503
+ "numericalDigest",
504
+ "numericalUnchanged",
505
+ "endpoint",
506
+ "usage",
507
+ "cache",
508
+ "attempts",
509
+ "plannedRequests",
510
+ "dryRun",
511
+ "aliasPolicy",
512
+ "confidencePolicy",
513
+ "externalProvider",
514
+ "answers"
515
+ ],
516
+ additionalProperties: false
517
+ },
518
+ ReadonlyinputTokensnumberTypeuint32outputTokensnumberTypeuint32: {
519
+ type: "object",
520
+ properties: {
521
+ inputTokens: {
522
+ type: "integer",
523
+ minimum: 0
524
+ },
525
+ outputTokens: {
526
+ type: "integer",
527
+ minimum: 0
528
+ }
529
+ },
530
+ required: [
531
+ "inputTokens",
532
+ "outputTokens"
533
+ ],
534
+ additionalProperties: false
535
+ },
536
+ JevAdvisoryAnswerV1: {
537
+ oneOf: [
538
+ {
539
+ $ref: "#/components/schemas/ReadonlyidstringtypenoulconfidencenullnoulJevProbabilitychoicenullscorenulldispositionJevDisposition"
540
+ },
541
+ {
542
+ $ref: "#/components/schemas/ReadonlyidstringtypechoiceconfidenceJevProbabilitynoulnullchoicestringscorenulldispositionJevDisposition"
543
+ },
544
+ {
545
+ $ref: "#/components/schemas/ReadonlyidstringtypescoreconfidenceJevProbabilitynoulnullchoicenullscorenumberdispositionJevDisposition"
546
+ }
547
+ ],
548
+ description: "One answer per rubric rule. Each wire type keeps its own fields: Noul carries `noul` and no confidence,\nChoice and Score carry a confidence. Probabilities and confidences are on 0..1.",
549
+ discriminator: {
550
+ mapping: {
551
+ choice: "#/components/schemas/ReadonlyidstringtypechoiceconfidenceJevProbabilitynoulnullchoicestringscorenulldispositionJevDisposition",
552
+ noul: "#/components/schemas/ReadonlyidstringtypenoulconfidencenullnoulJevProbabilitychoicenullscorenulldispositionJevDisposition",
553
+ score: "#/components/schemas/ReadonlyidstringtypescoreconfidenceJevProbabilitynoulnullchoicenullscorenumberdispositionJevDisposition"
554
+ },
555
+ propertyName: "type"
556
+ }
557
+ },
558
+ ReadonlyidstringtypenoulconfidencenullnoulJevProbabilitychoicenullscorenulldispositionJevDisposition: {
559
+ type: "object",
560
+ properties: {
561
+ id: {
562
+ type: "string"
563
+ },
564
+ type: {
565
+ "const": "noul"
566
+ },
567
+ confidence: {
568
+ type: "null"
569
+ },
570
+ noul: {
571
+ $ref: "#/components/schemas/JevProbability"
572
+ },
573
+ choice: {
574
+ type: "null"
575
+ },
576
+ score: {
577
+ type: "null"
578
+ },
579
+ disposition: {
580
+ $ref: "#/components/schemas/JevDisposition"
581
+ }
582
+ },
583
+ required: [
584
+ "id",
585
+ "type",
586
+ "confidence",
587
+ "noul",
588
+ "choice",
589
+ "score",
590
+ "disposition"
591
+ ],
592
+ additionalProperties: false
593
+ },
594
+ JevProbability: {
595
+ type: "number",
596
+ minimum: 0,
597
+ maximum: 1
598
+ },
599
+ JevDisposition: {
600
+ oneOf: [
601
+ {
602
+ "const": "abstain"
603
+ },
604
+ {
605
+ "const": "advisory-warning"
606
+ },
607
+ {
608
+ "const": "ok"
609
+ }
610
+ ]
611
+ },
612
+ ReadonlyidstringtypechoiceconfidenceJevProbabilitynoulnullchoicestringscorenulldispositionJevDisposition: {
613
+ type: "object",
614
+ properties: {
615
+ id: {
616
+ type: "string"
617
+ },
618
+ type: {
619
+ "const": "choice"
620
+ },
621
+ confidence: {
622
+ $ref: "#/components/schemas/JevProbability"
623
+ },
624
+ noul: {
625
+ type: "null"
626
+ },
627
+ choice: {
628
+ type: "string"
629
+ },
630
+ score: {
631
+ type: "null"
632
+ },
633
+ disposition: {
634
+ $ref: "#/components/schemas/JevDisposition"
635
+ }
636
+ },
637
+ required: [
638
+ "id",
639
+ "type",
640
+ "confidence",
641
+ "noul",
642
+ "choice",
643
+ "score",
644
+ "disposition"
645
+ ],
646
+ additionalProperties: false
647
+ },
648
+ ReadonlyidstringtypescoreconfidenceJevProbabilitynoulnullchoicenullscorenumberdispositionJevDisposition: {
649
+ type: "object",
650
+ properties: {
651
+ id: {
652
+ type: "string"
653
+ },
654
+ type: {
655
+ "const": "score"
656
+ },
657
+ confidence: {
658
+ $ref: "#/components/schemas/JevProbability"
659
+ },
660
+ noul: {
661
+ type: "null"
662
+ },
663
+ choice: {
664
+ type: "null"
665
+ },
666
+ score: {
667
+ type: "number"
668
+ },
669
+ disposition: {
670
+ $ref: "#/components/schemas/JevDisposition"
671
+ }
672
+ },
673
+ required: [
674
+ "id",
675
+ "type",
676
+ "confidence",
677
+ "noul",
678
+ "choice",
679
+ "score",
680
+ "disposition"
681
+ ],
682
+ additionalProperties: false
683
+ }
684
+ }
685
+ },
686
+ schema: {
687
+ type: "object",
688
+ properties: {
689
+ schemaVersion: {
690
+ "const": 1
691
+ },
692
+ contract: {
693
+ "const": "idlekit.jev.advisory.v1"
694
+ },
695
+ algorithmVersion: {
696
+ "const": "jev-advisory-1"
697
+ },
698
+ provider: {
699
+ "const": "jev"
700
+ },
701
+ status: {
702
+ oneOf: [
703
+ {
704
+ "const": "abstain"
705
+ },
706
+ {
707
+ "const": "advisory-warning"
708
+ },
709
+ {
710
+ "const": "failed"
711
+ },
712
+ {
713
+ "const": "ok"
714
+ },
715
+ {
716
+ "const": "skipped"
717
+ },
718
+ {
719
+ "const": "unavailable"
720
+ }
721
+ ]
722
+ },
723
+ reason: {
724
+ type: "string"
725
+ },
726
+ requestedModel: {
727
+ type: "string"
728
+ },
729
+ resolvedModel: {
730
+ oneOf: [
731
+ {
732
+ type: "null"
733
+ },
734
+ {
735
+ type: "string"
736
+ }
737
+ ]
738
+ },
739
+ rubricVersion: {
740
+ type: "string"
741
+ },
742
+ numericalDigest: {
743
+ type: "string"
744
+ },
745
+ numericalUnchanged: {
746
+ "const": true
747
+ },
748
+ endpoint: {
749
+ type: "string"
750
+ },
751
+ usage: {
752
+ oneOf: [
753
+ {
754
+ type: "null"
755
+ },
756
+ {
757
+ $ref: "#/components/schemas/ReadonlyinputTokensnumberTypeuint32outputTokensnumberTypeuint32"
758
+ }
759
+ ],
760
+ description: "Token counts are whole and never negative."
761
+ },
762
+ cache: {
763
+ oneOf: [
764
+ {
765
+ "const": "bypass"
766
+ },
767
+ {
768
+ "const": "hit"
769
+ },
770
+ {
771
+ "const": "miss"
772
+ }
773
+ ]
774
+ },
775
+ attempts: {
776
+ type: "integer",
777
+ minimum: 0
778
+ },
779
+ plannedRequests: {
780
+ type: "integer",
781
+ minimum: 0
782
+ },
783
+ dryRun: {
784
+ type: "boolean"
785
+ },
786
+ aliasPolicy: {
787
+ oneOf: [
788
+ {
789
+ "const": "pinned"
790
+ },
791
+ {
792
+ "const": "ttl-24h"
793
+ }
794
+ ]
795
+ },
796
+ confidencePolicy: {
797
+ "const": "not-game-correctness"
798
+ },
799
+ externalProvider: {
800
+ "const": true
801
+ },
802
+ answers: {
803
+ type: "array",
804
+ items: {
805
+ $ref: "#/components/schemas/JevAdvisoryAnswerV1"
806
+ }
807
+ }
808
+ },
809
+ required: [
810
+ "schemaVersion",
811
+ "contract",
812
+ "algorithmVersion",
813
+ "provider",
814
+ "status",
815
+ "reason",
816
+ "requestedModel",
817
+ "resolvedModel",
818
+ "rubricVersion",
819
+ "numericalDigest",
820
+ "numericalUnchanged",
821
+ "endpoint",
822
+ "usage",
823
+ "cache",
824
+ "attempts",
825
+ "plannedRequests",
826
+ "dryRun",
827
+ "aliasPolicy",
828
+ "confidencePolicy",
829
+ "externalProvider",
830
+ "answers"
831
+ ],
832
+ additionalProperties: false
833
+ },
834
+ version: "3.1"
835
+ };
836
+ }
837
+ let jevJsonSchemaUnit;
838
+ /**
839
+ * @evidence docs/requirements/active/jev-judge-provider.md#req-pr19-wire-shapes The structural schema is OpenAPI 3.1 from typia.
840
+ * @evidenceReview docs/requirements/active/jev-judge-provider.md#req-pr19-wire-shapes #a924cbf Re-read the section: schema version is 3.1 and the contract id is idlekit.jev.advisory.v1.
841
+ */
842
+ export function jevJsonSchema() {
843
+ jevJsonSchemaUnit ??= buildJevJsonSchema();
844
+ return jevJsonSchemaUnit;
845
+ }
846
+ //# sourceMappingURL=jevAdvisory.js.map