@aiwg/cli 2026.9.24 → 2026.10.1

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 (209) hide show
  1. package/agentic/code/providers/capability-matrix.yaml +2 -1
  2. package/dist/src/artifacts/discovery-shadow-evaluator.js +177 -0
  3. package/dist/src/artifacts/discovery-shadow.js +195 -0
  4. package/dist/src/artifacts/index-builder.js +47 -9
  5. package/dist/src/artifacts/query-engine.js +94 -1
  6. package/dist/src/artifacts/types.js +1 -0
  7. package/dist/src/cli/handlers/decision.js +177 -0
  8. package/dist/src/cli/handlers/gates.js +154 -0
  9. package/dist/src/cli/handlers/index.js +5 -1
  10. package/dist/src/cli/handlers/sessions.js +10 -7
  11. package/dist/src/cli/handlers/utilities.js +20 -0
  12. package/dist/src/config/aiwg-config.js +15 -2
  13. package/dist/src/decision/acceptance.js +25 -0
  14. package/dist/src/decision/adapters/jev.js +29 -3
  15. package/dist/src/decision/ask.js +352 -0
  16. package/dist/src/decision/calibration/registry.js +9 -0
  17. package/dist/src/decision/compose.js +74 -15
  18. package/dist/src/decision/context-live-promotion.js +344 -0
  19. package/dist/src/decision/context-live-qualification.js +591 -0
  20. package/dist/src/decision/context-pruning.js +847 -0
  21. package/dist/src/decision/driver.js +432 -0
  22. package/dist/src/decision/egress-live-qualification.js +874 -0
  23. package/dist/src/decision/ensemble/contract.js +64 -1
  24. package/dist/src/decision/ensemble/index.js +1 -0
  25. package/dist/src/decision/ensemble/report.js +8 -42
  26. package/dist/src/decision/ensemble/runtime.js +571 -0
  27. package/dist/src/decision/ensemble-study/artifacts.js +85 -0
  28. package/dist/src/decision/ensemble-study/calibration.js +443 -0
  29. package/dist/src/decision/ensemble-study/corpus.js +229 -0
  30. package/dist/src/decision/ensemble-study/multifact-artifacts.js +23 -0
  31. package/dist/src/decision/ensemble-study/multifact-study.js +596 -0
  32. package/dist/src/decision/ensemble-study/multifact.js +241 -0
  33. package/dist/src/decision/ensemble-study/protocol.js +77 -0
  34. package/dist/src/decision/ensemble-study/score.js +462 -0
  35. package/dist/src/decision/ensemble-study/staged.js +87 -0
  36. package/dist/src/decision/ensemble-study/statistics.js +84 -0
  37. package/dist/src/decision/evaluate.js +227 -14
  38. package/dist/src/decision/export.js +4 -0
  39. package/dist/src/decision/feature-export.js +1074 -0
  40. package/dist/src/decision/graph-index.js +16 -0
  41. package/dist/src/decision/graph-live-qualification.js +1041 -0
  42. package/dist/src/decision/graph-live-workload.js +245 -0
  43. package/dist/src/decision/graph-skill-bridge.js +21 -3
  44. package/dist/src/decision/heldout/calibration.js +140 -0
  45. package/dist/src/decision/heldout/collector.js +430 -0
  46. package/dist/src/decision/heldout/contract.js +309 -0
  47. package/dist/src/decision/heldout/d29-generator-ids.js +12 -0
  48. package/dist/src/decision/heldout/d29-passage-baseline-v2.js +93 -0
  49. package/dist/src/decision/heldout/d29-passage-baseline-v3.js +100 -0
  50. package/dist/src/decision/heldout/d29-passage-baseline.js +66 -0
  51. package/dist/src/decision/heldout/d29-pools-v8.js +575 -0
  52. package/dist/src/decision/heldout/d29-pools.js +288 -0
  53. package/dist/src/decision/heldout/d29-v6.js +169 -0
  54. package/dist/src/decision/heldout/d29-v7.js +202 -0
  55. package/dist/src/decision/heldout/d29-v8.js +586 -0
  56. package/dist/src/decision/heldout/generator-registry.js +67 -0
  57. package/dist/src/decision/heldout/generators.js +696 -0
  58. package/dist/src/decision/heldout/index.js +8 -0
  59. package/dist/src/decision/heldout/journal.js +346 -0
  60. package/dist/src/decision/heldout/study-generators.js +64 -0
  61. package/dist/src/decision/heldout/types.js +2 -0
  62. package/dist/src/decision/host-policy.js +61 -0
  63. package/dist/src/decision/index.js +13 -0
  64. package/dist/src/decision/interop-profile.v1.json +112 -0
  65. package/dist/src/decision/interop.js +653 -0
  66. package/dist/src/decision/issue-triage/index.js +3 -0
  67. package/dist/src/decision/issue-triage/runtime.js +1069 -0
  68. package/dist/src/decision/issue-triage/types.js +2 -0
  69. package/dist/src/decision/jev-credentials.js +121 -0
  70. package/dist/src/decision/patterns/catalog.js +28 -8
  71. package/dist/src/decision/patterns/playground.js +28 -11
  72. package/dist/src/decision/patterns/specs.js +19 -10
  73. package/dist/src/decision/preprocessed-evidence.js +724 -0
  74. package/dist/src/decision/qualification/capture.js +8 -2
  75. package/dist/src/decision/qualification/gate-evidence.js +19 -4
  76. package/dist/src/decision/qualification/quality.js +57 -49
  77. package/dist/src/decision/qualification/release.js +76 -3
  78. package/dist/src/decision/qualification/runner.js +5 -2
  79. package/dist/src/decision/routing/contract.js +175 -0
  80. package/dist/src/decision/routing/index.js +5 -0
  81. package/dist/src/decision/routing/report.js +216 -0
  82. package/dist/src/decision/routing/runtime.js +685 -0
  83. package/dist/src/decision/routing/types.js +2 -0
  84. package/dist/src/decision/sdlc-screening.js +1157 -0
  85. package/dist/src/decision/sensitivity/comparative.js +154 -0
  86. package/dist/src/decision/sensitivity/contract.js +218 -0
  87. package/dist/src/decision/sensitivity/index.js +5 -0
  88. package/dist/src/decision/sensitivity/runtime.js +912 -0
  89. package/dist/src/decision/sensitivity/types.js +2 -0
  90. package/dist/src/decision/validate.js +26 -0
  91. package/dist/src/extensions/commands/definitions.js +38 -0
  92. package/dist/src/extensions/manifest.js +44 -0
  93. package/dist/src/gates/discovery.js +315 -0
  94. package/dist/src/gates/driver.js +388 -0
  95. package/dist/src/gates/evaluate.js +719 -0
  96. package/dist/src/gates/floors.js +255 -0
  97. package/dist/src/gates/index.js +17 -0
  98. package/dist/src/gates/providers/evidence.js +38 -0
  99. package/dist/src/gates/providers/index.js +21 -0
  100. package/dist/src/gates/providers/isolated-child-source.js +446 -0
  101. package/dist/src/gates/providers/loader.js +1069 -0
  102. package/dist/src/gates/providers/paired.js +52 -0
  103. package/dist/src/gates/providers/proportion.js +60 -0
  104. package/dist/src/gates/providers/registry.js +40 -0
  105. package/dist/src/gates/providers/scalar.js +41 -0
  106. package/dist/src/gates/providers/screening.js +53 -0
  107. package/dist/src/gates/providers/types.js +25 -0
  108. package/dist/src/gates/registry.js +1003 -0
  109. package/dist/src/gates/report.js +102 -0
  110. package/dist/src/gates/schema.js +56 -0
  111. package/dist/src/gates/stats/binomial.js +26 -0
  112. package/dist/src/gates/stats/bootstrap.js +62 -0
  113. package/dist/src/gates/stats/clopper-pearson.js +95 -0
  114. package/dist/src/gates/stats/digest.js +26 -0
  115. package/dist/src/gates/stats/error.js +5 -0
  116. package/dist/src/gates/stats/index.js +9 -0
  117. package/dist/src/gates/stats/normal.js +35 -0
  118. package/dist/src/gates/stats/paired.js +120 -0
  119. package/dist/src/gates/stats/splits.js +30 -0
  120. package/dist/src/gates/types.js +8 -0
  121. package/dist/src/governance/redaction.js +14 -4
  122. package/dist/src/mcp/muse-native-config.mjs +123 -0
  123. package/dist/src/mcp/tools/decision.mjs +228 -0
  124. package/dist/src/mcp/tools/subsystems.mjs +2 -0
  125. package/dist/src/providers/capability-matrix.yaml +2 -1
  126. package/dist/src/providers/provider-definitions.js +2 -1
  127. package/dist/src/sessions/adapters/muse.js +336 -39
  128. package/dist/src/sessions/batch-import.js +7 -0
  129. package/dist/src/sessions/workspace-discovery.js +13 -2
  130. package/package.json +1 -1
  131. package/schemas/decision/ConformalFrozenOpenData.v2.schema.json +371 -0
  132. package/schemas/decision/ConformalOpenDataReport.v2.schema.json +421 -0
  133. package/schemas/decision/ConformalPreregistration.v2.schema.json +529 -0
  134. package/schemas/decision/ContextPruningCandidate.v1.schema.json +47 -0
  135. package/schemas/decision/ContextPruningEvaluationReport.v1.schema.json +758 -0
  136. package/schemas/decision/ContextPruningPreregistration.v1.schema.json +175 -0
  137. package/schemas/decision/ContextPruningReceipt.v1.schema.json +72 -0
  138. package/schemas/decision/D17Multifact.v1.schema.json +1851 -0
  139. package/schemas/decision/D17StudyAnalysis.v1.schema.json +42 -0
  140. package/schemas/decision/D17StudyAnalysis.v2.schema.json +51 -0
  141. package/schemas/decision/D17StudyCalibration.v1.schema.json +819 -0
  142. package/schemas/decision/D17StudyDryRun.v1.schema.json +169 -0
  143. package/schemas/decision/D17StudyDryRun.v2.schema.json +239 -0
  144. package/schemas/decision/D17StudyGold.v1.schema.json +108 -0
  145. package/schemas/decision/D17StudyGuide.v1.schema.json +63 -0
  146. package/schemas/decision/D17StudyNativeTemplates.v1.schema.json +619 -0
  147. package/schemas/decision/D17StudyProtocol.v1.schema.json +241 -0
  148. package/schemas/decision/D17StudyReport.v1.schema.json +902 -0
  149. package/schemas/decision/D17StudyReport.v2.schema.json +1319 -0
  150. package/schemas/decision/D17StudyReview.v1.schema.json +175 -0
  151. package/schemas/decision/D17StudySplits.v1.schema.json +217 -0
  152. package/schemas/decision/D29Study.v1.schema.json +1903 -0
  153. package/schemas/decision/D29Study.v2.schema.json +1344 -0
  154. package/schemas/decision/D29Study.v3.schema.json +609 -0
  155. package/schemas/decision/D29Study.v4.schema.json +1133 -0
  156. package/schemas/decision/D29Study.v6.schema.json +1205 -0
  157. package/schemas/decision/D29Study.v7.schema.json +1471 -0
  158. package/schemas/decision/D29Study.v8.schema.json +671 -0
  159. package/schemas/decision/D29Study.v9.schema.json +778 -0
  160. package/schemas/decision/DecisionComparativeReplayAuditSample.v1.schema.json +137 -0
  161. package/schemas/decision/DecisionComparativeReplayCorpus.v1.schema.json +258 -0
  162. package/schemas/decision/DecisionComparativeReplayFreeze.v1.schema.json +74 -0
  163. package/schemas/decision/DecisionComparativeReplayGold.v1.schema.json +50 -0
  164. package/schemas/decision/DecisionComparativeReplayGoldAsset.v1.schema.json +37 -0
  165. package/schemas/decision/DecisionComparativeReplayIntegrity.v1.schema.json +81 -0
  166. package/schemas/decision/DecisionComparativeReplayMembers.v1.schema.json +52 -0
  167. package/schemas/decision/DecisionComparativeReplayPreregistration.v1.schema.json +113 -0
  168. package/schemas/decision/DecisionComparativeReplayReport.v1.schema.json +407 -0
  169. package/schemas/decision/DecisionComparativeReplayReviewPackets.v1.schema.json +260 -0
  170. package/schemas/decision/DecisionComparativeReplaySplit.v1.schema.json +84 -0
  171. package/schemas/decision/DecisionFeatureObservation.v1.schema.json +564 -0
  172. package/schemas/decision/DecisionFeatureSet.v1.schema.json +155 -0
  173. package/schemas/decision/DecisionInteropMapping.v1.schema.json +85 -0
  174. package/schemas/decision/DecisionIssueTriageEvaluationManifest.v1.schema.json +174 -0
  175. package/schemas/decision/DecisionIssueTriageEvaluationReport.v1.schema.json +280 -0
  176. package/schemas/decision/DecisionIssueTriagePilotPack.v1.schema.json +114 -0
  177. package/schemas/decision/DecisionRouteReceipt.v1.schema.json +155 -0
  178. package/schemas/decision/DecisionRoutingPolicy.v1.schema.json +132 -0
  179. package/schemas/decision/DecisionRoutingShadowReport.v1.schema.json +170 -0
  180. package/schemas/decision/DecisionRoutingTask.v1.schema.json +49 -0
  181. package/schemas/decision/DecisionRuleset.schema.json +8 -2
  182. package/schemas/decision/DecisionRuleset.v1alpha2.schema.json +8 -2
  183. package/schemas/decision/DecisionSensitivityPlan.v1.schema.json +191 -0
  184. package/schemas/decision/DecisionSensitivityReport.v1.schema.json +163 -0
  185. package/schemas/decision/HeldoutApproval.v1.schema.json +312 -0
  186. package/schemas/decision/HeldoutAttempt.v1.schema.json +211 -0
  187. package/schemas/decision/HeldoutBaseline.v1.schema.json +90 -0
  188. package/schemas/decision/HeldoutCalibrationPhase.v1.schema.json +87 -0
  189. package/schemas/decision/HeldoutCorpus.v1.schema.json +167 -0
  190. package/schemas/decision/HeldoutEvent.v1.schema.json +41 -0
  191. package/schemas/decision/HeldoutFrozen.v1.schema.json +142 -0
  192. package/schemas/decision/HeldoutPreregistration.v1.schema.json +222 -0
  193. package/schemas/decision/HeldoutSpendEvent.v1.schema.json +122 -0
  194. package/schemas/decision/HeldoutSpendHead.v1.schema.json +25 -0
  195. package/schemas/decision/HeldoutSpendHead.v2.schema.json +46 -0
  196. package/schemas/decision/HeldoutSummary.v1.schema.json +101 -0
  197. package/schemas/decision/OpaDecisionLogExport.v1.schema.json +65 -0
  198. package/schemas/decision/PreprocessedEvidence.v1.schema.json +306 -0
  199. package/schemas/decision/RulesetResult.v1alpha2.schema.json +175 -0
  200. package/schemas/decision/SdlcEvidenceScreening.v1.schema.json +499 -0
  201. package/schemas/decision/SdlcScreeningPreregistration.v1.schema.json +132 -0
  202. package/schemas/decision/SdlcScreeningPreregistration.v2.schema.json +138 -0
  203. package/schemas/decision/SdlcScreeningRelease.v1.schema.json +654 -0
  204. package/schemas/decision/SdlcScreeningRelease.v2.schema.json +654 -0
  205. package/tools/agents/deploy-agents.mjs +1 -1
  206. package/tools/agents/providers/base.mjs +40 -18
  207. package/tools/agents/providers/factory.mjs +10 -2
  208. package/tools/agents/providers/muse-hooks.mjs +1 -29
  209. package/tools/agents/providers/muse.mjs +6 -3
@@ -0,0 +1,902 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://aiwg.io/schemas/decision/D17StudyReport.v1.schema.json",
4
+ "title": "D17StudyReport",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "scope",
10
+ "calibrated",
11
+ "d09Qualified",
12
+ "calibratedGate",
13
+ "corpusDigest",
14
+ "preregistrationDigest",
15
+ "executionPins",
16
+ "integrityDigest",
17
+ "integrity",
18
+ "integrityProblems",
19
+ "statistics",
20
+ "statisticsDigest",
21
+ "pairs",
22
+ "observations",
23
+ "accounting",
24
+ "calibrationDiagnostics",
25
+ "pending",
26
+ "decision"
27
+ ],
28
+ "properties": {
29
+ "schemaVersion": {
30
+ "const": "decision-d17-study-report/v1"
31
+ },
32
+ "scope": {
33
+ "const": "synthetic-diagnostic-only"
34
+ },
35
+ "calibrated": {
36
+ "const": false
37
+ },
38
+ "d09Qualified": {
39
+ "const": false
40
+ },
41
+ "calibratedGate": {
42
+ "const": false
43
+ },
44
+ "corpusDigest": {
45
+ "type": "string",
46
+ "pattern": "^sha256:[a-f0-9]{64}$"
47
+ },
48
+ "preregistrationDigest": {
49
+ "type": "string",
50
+ "pattern": "^sha256:[a-f0-9]{64}$"
51
+ },
52
+ "executionPins": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": [
56
+ "definition",
57
+ "binding",
58
+ "model",
59
+ "adapter",
60
+ "aggregatePolicyDigest"
61
+ ],
62
+ "properties": {
63
+ "definition": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": [
67
+ "id",
68
+ "version",
69
+ "digest"
70
+ ],
71
+ "properties": {
72
+ "id": {
73
+ "type": "string"
74
+ },
75
+ "version": {
76
+ "type": "string"
77
+ },
78
+ "digest": {
79
+ "type": "string",
80
+ "pattern": "^sha256:[a-f0-9]{64}$"
81
+ }
82
+ }
83
+ },
84
+ "binding": {
85
+ "anyOf": [
86
+ {
87
+ "type": "null"
88
+ },
89
+ {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": [
93
+ "id",
94
+ "version",
95
+ "digest"
96
+ ],
97
+ "properties": {
98
+ "id": {
99
+ "type": "string"
100
+ },
101
+ "version": {
102
+ "type": "string"
103
+ },
104
+ "digest": {
105
+ "type": "string",
106
+ "pattern": "^sha256:[a-f0-9]{64}$"
107
+ }
108
+ }
109
+ }
110
+ ]
111
+ },
112
+ "model": {
113
+ "const": "jev-1.13.0"
114
+ },
115
+ "adapter": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": [
119
+ "id",
120
+ "version"
121
+ ],
122
+ "properties": {
123
+ "id": {
124
+ "const": "jev"
125
+ },
126
+ "version": {
127
+ "const": "1.0.0"
128
+ }
129
+ }
130
+ },
131
+ "aggregatePolicyDigest": {
132
+ "anyOf": [
133
+ {
134
+ "type": "null"
135
+ },
136
+ {
137
+ "type": "string",
138
+ "pattern": "^sha256:[a-f0-9]{64}$"
139
+ }
140
+ ]
141
+ }
142
+ }
143
+ },
144
+ "integrityDigest": {
145
+ "type": "string",
146
+ "pattern": "^sha256:[a-f0-9]{64}$"
147
+ },
148
+ "integrity": {
149
+ "$ref": "https://aiwg.io/schemas/decision/DecisionEnsembleIntegrityReport.v1.schema.json#/properties/integrity"
150
+ },
151
+ "integrityProblems": {
152
+ "type": "array",
153
+ "items": {
154
+ "type": "string"
155
+ }
156
+ },
157
+ "statistics": {
158
+ "type": "object",
159
+ "additionalProperties": false,
160
+ "required": [
161
+ "sampleN",
162
+ "missingIds",
163
+ "slices",
164
+ "pairedDeltas",
165
+ "quality",
166
+ "brier",
167
+ "abstention",
168
+ "acceptedN",
169
+ "acceptedErrors",
170
+ "acceptedErrorUpperBps",
171
+ "coverageLowerBps",
172
+ "p95LatencyIncreaseMs",
173
+ "latencyDifferencesMs",
174
+ "netSavingsMicros",
175
+ "costBasis",
176
+ "benefitSupported",
177
+ "findings",
178
+ "statisticalGate",
179
+ "worstCaseFailureAsError"
180
+ ],
181
+ "properties": {
182
+ "sampleN": {
183
+ "type": "integer",
184
+ "minimum": 0
185
+ },
186
+ "missingIds": {
187
+ "type": "array",
188
+ "items": {
189
+ "type": "string"
190
+ }
191
+ },
192
+ "slices": {
193
+ "type": "array",
194
+ "items": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": [
198
+ "slice",
199
+ "n",
200
+ "qualityDelta",
201
+ "harm",
202
+ "descriptiveOnly"
203
+ ],
204
+ "properties": {
205
+ "slice": {
206
+ "type": "string"
207
+ },
208
+ "n": {
209
+ "type": "integer",
210
+ "minimum": 0
211
+ },
212
+ "qualityDelta": {
213
+ "anyOf": [
214
+ {
215
+ "type": "null"
216
+ },
217
+ {
218
+ "type": "number"
219
+ }
220
+ ]
221
+ },
222
+ "harm": {
223
+ "type": "boolean"
224
+ },
225
+ "descriptiveOnly": {
226
+ "const": true
227
+ }
228
+ }
229
+ }
230
+ },
231
+ "pairedDeltas": {
232
+ "type": "array",
233
+ "items": {
234
+ "type": "object",
235
+ "additionalProperties": false,
236
+ "required": [
237
+ "metric",
238
+ "pairs",
239
+ "delta"
240
+ ],
241
+ "properties": {
242
+ "metric": {
243
+ "enum": [
244
+ "quality",
245
+ "calibration",
246
+ "risk-coverage",
247
+ "abstention",
248
+ "latency",
249
+ "tokens",
250
+ "cost",
251
+ "slice"
252
+ ]
253
+ },
254
+ "pairs": {
255
+ "type": "integer",
256
+ "minimum": 0
257
+ },
258
+ "delta": {
259
+ "anyOf": [
260
+ {
261
+ "type": "null"
262
+ },
263
+ {
264
+ "type": "number"
265
+ }
266
+ ]
267
+ }
268
+ }
269
+ }
270
+ },
271
+ "quality": {
272
+ "$ref": "#/$defs/interval"
273
+ },
274
+ "brier": {
275
+ "$ref": "#/$defs/interval"
276
+ },
277
+ "abstention": {
278
+ "$ref": "#/$defs/interval"
279
+ },
280
+ "acceptedN": {
281
+ "type": "integer",
282
+ "minimum": 0
283
+ },
284
+ "acceptedErrors": {
285
+ "type": "integer",
286
+ "minimum": 0
287
+ },
288
+ "acceptedErrorUpperBps": {
289
+ "anyOf": [
290
+ {
291
+ "type": "null"
292
+ },
293
+ {
294
+ "type": "integer",
295
+ "minimum": 0
296
+ }
297
+ ]
298
+ },
299
+ "coverageLowerBps": {
300
+ "anyOf": [
301
+ {
302
+ "type": "null"
303
+ },
304
+ {
305
+ "type": "integer",
306
+ "minimum": 0
307
+ }
308
+ ]
309
+ },
310
+ "p95LatencyIncreaseMs": {
311
+ "anyOf": [
312
+ {
313
+ "type": "null"
314
+ },
315
+ {
316
+ "type": "number"
317
+ }
318
+ ]
319
+ },
320
+ "latencyDifferencesMs": {
321
+ "type": "array",
322
+ "items": {
323
+ "type": "number"
324
+ }
325
+ },
326
+ "netSavingsMicros": {
327
+ "type": "number"
328
+ },
329
+ "costBasis": {
330
+ "const": "nonrefundable-reservations-including-failed-attempts"
331
+ },
332
+ "benefitSupported": {
333
+ "type": "boolean"
334
+ },
335
+ "findings": {
336
+ "type": "array",
337
+ "items": {
338
+ "type": "string"
339
+ }
340
+ },
341
+ "statisticalGate": {
342
+ "enum": [
343
+ "HOLD",
344
+ "pass"
345
+ ]
346
+ },
347
+ "worstCaseFailureAsError": {
348
+ "type": "object",
349
+ "additionalProperties": false,
350
+ "required": [
351
+ "n",
352
+ "championCorrect",
353
+ "challengerCorrect",
354
+ "missingPairsCountedAsErrors"
355
+ ],
356
+ "properties": {
357
+ "n": {
358
+ "type": "integer",
359
+ "minimum": 0
360
+ },
361
+ "championCorrect": {
362
+ "type": "integer",
363
+ "minimum": 0
364
+ },
365
+ "challengerCorrect": {
366
+ "type": "integer",
367
+ "minimum": 0
368
+ },
369
+ "missingPairsCountedAsErrors": {
370
+ "type": "integer",
371
+ "minimum": 0
372
+ }
373
+ }
374
+ }
375
+ }
376
+ },
377
+ "statisticsDigest": {
378
+ "type": "string",
379
+ "pattern": "^sha256:[a-f0-9]{64}$"
380
+ },
381
+ "pairs": {
382
+ "type": "array",
383
+ "items": {
384
+ "type": "object",
385
+ "additionalProperties": false,
386
+ "required": [
387
+ "id",
388
+ "slice",
389
+ "champion",
390
+ "challenger"
391
+ ],
392
+ "properties": {
393
+ "id": {
394
+ "type": "string"
395
+ },
396
+ "slice": {
397
+ "type": "string"
398
+ },
399
+ "champion": {
400
+ "$ref": "#/$defs/arm"
401
+ },
402
+ "challenger": {
403
+ "$ref": "#/$defs/arm"
404
+ }
405
+ }
406
+ }
407
+ },
408
+ "observations": {
409
+ "type": "array",
410
+ "items": {
411
+ "type": "object",
412
+ "additionalProperties": false,
413
+ "required": [
414
+ "id",
415
+ "champion",
416
+ "challenger",
417
+ "aggregate"
418
+ ],
419
+ "properties": {
420
+ "id": {
421
+ "type": "string"
422
+ },
423
+ "champion": {
424
+ "$ref": "#/$defs/observation"
425
+ },
426
+ "challenger": {
427
+ "$ref": "#/$defs/observation"
428
+ },
429
+ "aggregate": {
430
+ "anyOf": [
431
+ {
432
+ "type": "null"
433
+ },
434
+ {
435
+ "$ref": "https://aiwg.io/schemas/decision/DecisionEnsembleAggregate.v1.schema.json"
436
+ }
437
+ ]
438
+ }
439
+ }
440
+ }
441
+ },
442
+ "accounting": {
443
+ "type": "object",
444
+ "additionalProperties": false,
445
+ "required": [
446
+ "allSplits",
447
+ "test"
448
+ ],
449
+ "properties": {
450
+ "allSplits": {
451
+ "type": "object",
452
+ "additionalProperties": false,
453
+ "required": [
454
+ "attempts",
455
+ "reservedCostMicros"
456
+ ],
457
+ "properties": {
458
+ "attempts": {
459
+ "type": "integer",
460
+ "minimum": 0
461
+ },
462
+ "reservedCostMicros": {
463
+ "type": "number"
464
+ }
465
+ }
466
+ },
467
+ "test": {
468
+ "type": "object",
469
+ "additionalProperties": false,
470
+ "required": [
471
+ "championReservedCostMicros",
472
+ "challengerReservedCostMicros",
473
+ "netSavingsMicros",
474
+ "complete"
475
+ ],
476
+ "properties": {
477
+ "championReservedCostMicros": {
478
+ "type": "number"
479
+ },
480
+ "challengerReservedCostMicros": {
481
+ "type": "number"
482
+ },
483
+ "netSavingsMicros": {
484
+ "type": "number"
485
+ },
486
+ "complete": {
487
+ "type": "boolean"
488
+ }
489
+ }
490
+ }
491
+ }
492
+ },
493
+ "calibrationDiagnostics": {
494
+ "type": "object",
495
+ "additionalProperties": false,
496
+ "required": [
497
+ "champion",
498
+ "challenger",
499
+ "calibrated"
500
+ ],
501
+ "properties": {
502
+ "champion": {
503
+ "anyOf": [
504
+ {
505
+ "type": "null"
506
+ },
507
+ {
508
+ "type": "object",
509
+ "additionalProperties": false,
510
+ "required": [
511
+ "overall",
512
+ "slices"
513
+ ],
514
+ "properties": {
515
+ "overall": {
516
+ "$ref": "#/$defs/binaryMetrics"
517
+ },
518
+ "slices": {
519
+ "type": "object",
520
+ "additionalProperties": {
521
+ "$ref": "#/$defs/binaryMetrics"
522
+ }
523
+ }
524
+ }
525
+ }
526
+ ]
527
+ },
528
+ "challenger": {
529
+ "anyOf": [
530
+ {
531
+ "type": "null"
532
+ },
533
+ {
534
+ "type": "object",
535
+ "additionalProperties": false,
536
+ "required": [
537
+ "overall",
538
+ "slices"
539
+ ],
540
+ "properties": {
541
+ "overall": {
542
+ "$ref": "#/$defs/binaryMetrics"
543
+ },
544
+ "slices": {
545
+ "type": "object",
546
+ "additionalProperties": {
547
+ "$ref": "#/$defs/binaryMetrics"
548
+ }
549
+ }
550
+ }
551
+ }
552
+ ]
553
+ },
554
+ "calibrated": {
555
+ "const": false
556
+ }
557
+ }
558
+ },
559
+ "pending": {
560
+ "type": "array",
561
+ "items": {
562
+ "type": "string"
563
+ }
564
+ },
565
+ "decision": {
566
+ "enum": [
567
+ "HOLD",
568
+ "ROLLBACK"
569
+ ]
570
+ }
571
+ },
572
+ "$defs": {
573
+ "interval": {
574
+ "anyOf": [
575
+ {
576
+ "type": "null"
577
+ },
578
+ {
579
+ "type": "object",
580
+ "additionalProperties": false,
581
+ "required": [
582
+ "lowerBps",
583
+ "upperBps",
584
+ "estimateBps",
585
+ "n",
586
+ "method"
587
+ ],
588
+ "properties": {
589
+ "lowerBps": {
590
+ "type": "integer"
591
+ },
592
+ "upperBps": {
593
+ "type": "integer"
594
+ },
595
+ "estimateBps": {
596
+ "type": "integer"
597
+ },
598
+ "n": {
599
+ "type": "integer",
600
+ "minimum": 0
601
+ },
602
+ "method": {
603
+ "enum": [
604
+ "newcombe-hybrid-score",
605
+ "percentile-bootstrap"
606
+ ]
607
+ }
608
+ }
609
+ }
610
+ ]
611
+ },
612
+ "arm": {
613
+ "type": "object",
614
+ "additionalProperties": false,
615
+ "required": [
616
+ "probability",
617
+ "accepted",
618
+ "correct",
619
+ "brier",
620
+ "latencyMs",
621
+ "tokens",
622
+ "reservedCostMicros"
623
+ ],
624
+ "properties": {
625
+ "probability": {
626
+ "type": "number",
627
+ "minimum": 0,
628
+ "maximum": 1
629
+ },
630
+ "accepted": {
631
+ "type": "boolean"
632
+ },
633
+ "correct": {
634
+ "type": "boolean"
635
+ },
636
+ "brier": {
637
+ "type": "number",
638
+ "minimum": 0,
639
+ "maximum": 1
640
+ },
641
+ "latencyMs": {
642
+ "type": "number"
643
+ },
644
+ "tokens": {
645
+ "anyOf": [
646
+ {
647
+ "type": "null"
648
+ },
649
+ {
650
+ "type": "integer",
651
+ "minimum": 0
652
+ }
653
+ ]
654
+ },
655
+ "reservedCostMicros": {
656
+ "type": "number"
657
+ }
658
+ }
659
+ },
660
+ "observation": {
661
+ "anyOf": [
662
+ {
663
+ "type": "null"
664
+ },
665
+ {
666
+ "type": "object",
667
+ "additionalProperties": false,
668
+ "required": [
669
+ "inputDigest",
670
+ "receiptDigest",
671
+ "quality",
672
+ "calibration",
673
+ "riskCoverage",
674
+ "abstention",
675
+ "latencyMs",
676
+ "tokens",
677
+ "costMicros",
678
+ "slice"
679
+ ],
680
+ "properties": {
681
+ "inputDigest": {
682
+ "type": "string",
683
+ "pattern": "^sha256:[a-f0-9]{64}$"
684
+ },
685
+ "receiptDigest": {
686
+ "type": "string",
687
+ "pattern": "^sha256:[a-f0-9]{64}$"
688
+ },
689
+ "quality": {
690
+ "anyOf": [
691
+ {
692
+ "type": "null"
693
+ },
694
+ {
695
+ "type": "number"
696
+ }
697
+ ]
698
+ },
699
+ "calibration": {
700
+ "anyOf": [
701
+ {
702
+ "type": "null"
703
+ },
704
+ {
705
+ "type": "number"
706
+ }
707
+ ]
708
+ },
709
+ "riskCoverage": {
710
+ "anyOf": [
711
+ {
712
+ "type": "null"
713
+ },
714
+ {
715
+ "type": "number"
716
+ }
717
+ ]
718
+ },
719
+ "abstention": {
720
+ "anyOf": [
721
+ {
722
+ "type": "null"
723
+ },
724
+ {
725
+ "type": "number"
726
+ }
727
+ ]
728
+ },
729
+ "latencyMs": {
730
+ "anyOf": [
731
+ {
732
+ "type": "null"
733
+ },
734
+ {
735
+ "type": "number"
736
+ }
737
+ ]
738
+ },
739
+ "tokens": {
740
+ "anyOf": [
741
+ {
742
+ "type": "null"
743
+ },
744
+ {
745
+ "type": "number"
746
+ }
747
+ ]
748
+ },
749
+ "costMicros": {
750
+ "anyOf": [
751
+ {
752
+ "type": "null"
753
+ },
754
+ {
755
+ "type": "number"
756
+ }
757
+ ]
758
+ },
759
+ "slice": {
760
+ "anyOf": [
761
+ {
762
+ "type": "null"
763
+ },
764
+ {
765
+ "type": "number"
766
+ }
767
+ ]
768
+ }
769
+ }
770
+ }
771
+ ]
772
+ },
773
+ "binaryMetrics": {
774
+ "type": "object",
775
+ "additionalProperties": false,
776
+ "required": [
777
+ "sampleN",
778
+ "errorRate",
779
+ "brier",
780
+ "logLoss",
781
+ "expectedCalibrationError",
782
+ "coverage",
783
+ "reviewRate",
784
+ "selectiveRisk",
785
+ "errorWilson95",
786
+ "latencyMs",
787
+ "inputTokens",
788
+ "outputTokens",
789
+ "costUsd",
790
+ "calls",
791
+ "retries",
792
+ "fallbacks"
793
+ ],
794
+ "properties": {
795
+ "sampleN": {
796
+ "type": "integer",
797
+ "minimum": 0
798
+ },
799
+ "errorRate": {
800
+ "type": "number"
801
+ },
802
+ "brier": {
803
+ "type": "number"
804
+ },
805
+ "logLoss": {
806
+ "type": "number"
807
+ },
808
+ "expectedCalibrationError": {
809
+ "type": "number"
810
+ },
811
+ "coverage": {
812
+ "type": "number"
813
+ },
814
+ "reviewRate": {
815
+ "type": "number"
816
+ },
817
+ "selectiveRisk": {
818
+ "anyOf": [
819
+ {
820
+ "type": "null"
821
+ },
822
+ {
823
+ "type": "number"
824
+ }
825
+ ]
826
+ },
827
+ "errorWilson95": {
828
+ "type": "array",
829
+ "minItems": 2,
830
+ "maxItems": 2,
831
+ "items": {
832
+ "type": "number"
833
+ }
834
+ },
835
+ "latencyMs": {
836
+ "type": "object",
837
+ "additionalProperties": false,
838
+ "required": [
839
+ "p50",
840
+ "p95",
841
+ "p99"
842
+ ],
843
+ "properties": {
844
+ "p50": {
845
+ "type": "number"
846
+ },
847
+ "p95": {
848
+ "type": "number"
849
+ },
850
+ "p99": {
851
+ "type": "number"
852
+ }
853
+ }
854
+ },
855
+ "inputTokens": {
856
+ "anyOf": [
857
+ {
858
+ "type": "null"
859
+ },
860
+ {
861
+ "type": "integer",
862
+ "minimum": 0
863
+ }
864
+ ]
865
+ },
866
+ "outputTokens": {
867
+ "anyOf": [
868
+ {
869
+ "type": "null"
870
+ },
871
+ {
872
+ "type": "integer",
873
+ "minimum": 0
874
+ }
875
+ ]
876
+ },
877
+ "costUsd": {
878
+ "anyOf": [
879
+ {
880
+ "type": "null"
881
+ },
882
+ {
883
+ "type": "number"
884
+ }
885
+ ]
886
+ },
887
+ "calls": {
888
+ "type": "integer",
889
+ "minimum": 0
890
+ },
891
+ "retries": {
892
+ "type": "integer",
893
+ "minimum": 0
894
+ },
895
+ "fallbacks": {
896
+ "type": "integer",
897
+ "minimum": 0
898
+ }
899
+ }
900
+ }
901
+ }
902
+ }