ai-capability-framework 1.0.3 → 1.1.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 (246) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +38 -30
  3. package/ROADMAP.md +14 -0
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +32 -1
  6. package/dist/discovery/bindings.d.ts +7 -0
  7. package/dist/discovery/bindings.d.ts.map +1 -0
  8. package/dist/discovery/bindings.js +24 -0
  9. package/dist/discovery/budget.d.ts +17 -0
  10. package/dist/discovery/budget.d.ts.map +1 -0
  11. package/dist/discovery/budget.js +77 -0
  12. package/dist/discovery/configuration.d.ts +10 -0
  13. package/dist/discovery/configuration.d.ts.map +1 -0
  14. package/dist/discovery/configuration.js +63 -0
  15. package/dist/discovery/corpus.d.ts +8 -0
  16. package/dist/discovery/corpus.d.ts.map +1 -0
  17. package/dist/discovery/corpus.js +64 -0
  18. package/dist/discovery/diagnostics.d.ts +15 -0
  19. package/dist/discovery/diagnostics.d.ts.map +1 -0
  20. package/dist/discovery/diagnostics.js +11 -0
  21. package/dist/discovery/discoverer.d.ts +23 -0
  22. package/dist/discovery/discoverer.d.ts.map +1 -0
  23. package/dist/discovery/discoverer.js +261 -0
  24. package/dist/discovery/embedding-configuration.d.ts +12 -0
  25. package/dist/discovery/embedding-configuration.d.ts.map +1 -0
  26. package/dist/discovery/embedding-configuration.js +81 -0
  27. package/dist/discovery/embedding-types.d.ts +75 -0
  28. package/dist/discovery/embedding-types.d.ts.map +1 -0
  29. package/dist/discovery/embedding-types.js +1 -0
  30. package/dist/discovery/embeddings.d.ts +38 -0
  31. package/dist/discovery/embeddings.d.ts.map +1 -0
  32. package/dist/discovery/embeddings.js +71 -0
  33. package/dist/discovery/evaluation-validation.d.ts +8 -0
  34. package/dist/discovery/evaluation-validation.d.ts.map +1 -0
  35. package/dist/discovery/evaluation-validation.js +19 -0
  36. package/dist/discovery/evaluation.d.ts +84 -0
  37. package/dist/discovery/evaluation.d.ts.map +1 -0
  38. package/dist/discovery/evaluation.js +310 -0
  39. package/dist/discovery/export.d.ts +14 -0
  40. package/dist/discovery/export.d.ts.map +1 -0
  41. package/dist/discovery/export.js +81 -0
  42. package/dist/discovery/facade.d.ts +82 -0
  43. package/dist/discovery/facade.d.ts.map +1 -0
  44. package/dist/discovery/facade.js +266 -0
  45. package/dist/discovery/fingerprint.d.ts +71 -0
  46. package/dist/discovery/fingerprint.d.ts.map +1 -0
  47. package/dist/discovery/fingerprint.js +67 -0
  48. package/dist/discovery/index-builder.d.ts +3 -0
  49. package/dist/discovery/index-builder.d.ts.map +1 -0
  50. package/dist/discovery/index-builder.js +129 -0
  51. package/dist/discovery/index-validation.d.ts +12 -0
  52. package/dist/discovery/index-validation.d.ts.map +1 -0
  53. package/dist/discovery/index-validation.js +117 -0
  54. package/dist/discovery/index.d.ts +32 -0
  55. package/dist/discovery/index.d.ts.map +1 -0
  56. package/dist/discovery/index.js +18 -0
  57. package/dist/discovery/json-snapshot.d.ts +3 -0
  58. package/dist/discovery/json-snapshot.d.ts.map +1 -0
  59. package/dist/discovery/json-snapshot.js +11 -0
  60. package/dist/discovery/lexical.d.ts +12 -0
  61. package/dist/discovery/lexical.d.ts.map +1 -0
  62. package/dist/discovery/lexical.js +26 -0
  63. package/dist/discovery/metadata.d.ts +4 -0
  64. package/dist/discovery/metadata.d.ts.map +1 -0
  65. package/dist/discovery/metadata.js +33 -0
  66. package/dist/discovery/ranking.d.ts +7 -0
  67. package/dist/discovery/ranking.d.ts.map +1 -0
  68. package/dist/discovery/ranking.js +68 -0
  69. package/dist/discovery/replay.d.ts +50 -0
  70. package/dist/discovery/replay.d.ts.map +1 -0
  71. package/dist/discovery/replay.js +175 -0
  72. package/dist/discovery/retrieval-policy.d.ts +5 -0
  73. package/dist/discovery/retrieval-policy.d.ts.map +1 -0
  74. package/dist/discovery/retrieval-policy.js +10 -0
  75. package/dist/discovery/router.d.ts +39 -0
  76. package/dist/discovery/router.d.ts.map +1 -0
  77. package/dist/discovery/router.js +98 -0
  78. package/dist/discovery/selection-attempt.d.ts +20 -0
  79. package/dist/discovery/selection-attempt.d.ts.map +1 -0
  80. package/dist/discovery/selection-attempt.js +39 -0
  81. package/dist/discovery/selection-cards.d.ts +12 -0
  82. package/dist/discovery/selection-cards.d.ts.map +1 -0
  83. package/dist/discovery/selection-cards.js +79 -0
  84. package/dist/discovery/selection-configuration.d.ts +18 -0
  85. package/dist/discovery/selection-configuration.d.ts.map +1 -0
  86. package/dist/discovery/selection-configuration.js +71 -0
  87. package/dist/discovery/selection-response.d.ts +13 -0
  88. package/dist/discovery/selection-response.d.ts.map +1 -0
  89. package/dist/discovery/selection-response.js +47 -0
  90. package/dist/discovery/selection-types.d.ts +18 -0
  91. package/dist/discovery/selection-types.d.ts.map +1 -0
  92. package/dist/discovery/selection-types.js +1 -0
  93. package/dist/discovery/selection.d.ts +6 -0
  94. package/dist/discovery/selection.d.ts.map +1 -0
  95. package/dist/discovery/selection.js +145 -0
  96. package/dist/discovery/types.d.ts +291 -0
  97. package/dist/discovery/types.d.ts.map +1 -0
  98. package/dist/discovery/types.js +1 -0
  99. package/dist/discovery/usage.d.ts +2 -0
  100. package/dist/discovery/usage.d.ts.map +1 -0
  101. package/dist/discovery/usage.js +1 -0
  102. package/dist/discovery/vectors.d.ts +5 -0
  103. package/dist/discovery/vectors.d.ts.map +1 -0
  104. package/dist/discovery/vectors.js +43 -0
  105. package/dist/discovery/versions.d.ts +37 -0
  106. package/dist/discovery/versions.d.ts.map +1 -0
  107. package/dist/discovery/versions.js +36 -0
  108. package/dist/evals-live/live-eval-runner.d.ts +1 -0
  109. package/dist/evals-live/live-eval-runner.d.ts.map +1 -1
  110. package/dist/evals-live/live-eval-runner.js +12 -1
  111. package/dist/evals-live/types.d.ts +3 -0
  112. package/dist/evals-live/types.d.ts.map +1 -1
  113. package/dist/generated/manifest-types.d.ts +3655 -0
  114. package/dist/generated/manifest-types.d.ts.map +1 -1
  115. package/dist/loader.d.ts.map +1 -1
  116. package/dist/loader.js +8 -0
  117. package/dist/mcp-server/server.d.ts.map +1 -1
  118. package/dist/mcp-server/server.js +11 -2
  119. package/dist/mcp-server/types.d.ts +4 -0
  120. package/dist/mcp-server/types.d.ts.map +1 -1
  121. package/dist/observability/redaction.d.ts.map +1 -1
  122. package/dist/observability/redaction.js +6 -2
  123. package/dist/observability/types.d.ts +1 -1
  124. package/dist/observability/types.d.ts.map +1 -1
  125. package/dist/openai/index.d.ts +2 -0
  126. package/dist/openai/index.d.ts.map +1 -1
  127. package/dist/openai/index.js +1 -0
  128. package/dist/openai/responses-runner.d.ts +1 -1
  129. package/dist/openai/responses-runner.d.ts.map +1 -1
  130. package/dist/openai/responses-runner.js +134 -7
  131. package/dist/openai/selection-client.d.ts +28 -0
  132. package/dist/openai/selection-client.d.ts.map +1 -0
  133. package/dist/openai/selection-client.js +95 -0
  134. package/dist/openai/tool-loop.js +1 -1
  135. package/dist/openai/types.d.ts +19 -2
  136. package/dist/openai/types.d.ts.map +1 -1
  137. package/dist/replay/discovery-snapshot.d.ts +10 -0
  138. package/dist/replay/discovery-snapshot.d.ts.map +1 -0
  139. package/dist/replay/discovery-snapshot.js +17 -0
  140. package/dist/replay/recorder.d.ts.map +1 -1
  141. package/dist/replay/recorder.js +4 -0
  142. package/dist/replay/redaction.js +5 -1
  143. package/dist/replay/replayer.d.ts.map +1 -1
  144. package/dist/replay/replayer.js +14 -1
  145. package/dist/replay/types.d.ts +3 -0
  146. package/dist/replay/types.d.ts.map +1 -1
  147. package/dist/replay/validation.d.ts.map +1 -1
  148. package/dist/replay/validation.js +6 -0
  149. package/dist/runtime/bounded-json.d.ts +4 -0
  150. package/dist/runtime/bounded-json.d.ts.map +1 -0
  151. package/dist/runtime/bounded-json.js +74 -0
  152. package/dist/runtime/eligibility.d.ts +4 -0
  153. package/dist/runtime/eligibility.d.ts.map +1 -0
  154. package/dist/runtime/eligibility.js +128 -0
  155. package/dist/runtime/index.d.ts +5 -1
  156. package/dist/runtime/index.d.ts.map +1 -1
  157. package/dist/runtime/index.js +2 -0
  158. package/dist/runtime/provider-attempt.d.ts +11 -0
  159. package/dist/runtime/provider-attempt.d.ts.map +1 -0
  160. package/dist/runtime/provider-attempt.js +221 -0
  161. package/dist/runtime/provider-run.d.ts +10 -0
  162. package/dist/runtime/provider-run.d.ts.map +1 -0
  163. package/dist/runtime/provider-run.js +123 -0
  164. package/dist/runtime/provider-stop.d.ts +9 -0
  165. package/dist/runtime/provider-stop.d.ts.map +1 -0
  166. package/dist/runtime/provider-stop.js +28 -0
  167. package/dist/runtime/provider-types.d.ts +189 -0
  168. package/dist/runtime/provider-types.d.ts.map +1 -0
  169. package/dist/runtime/provider-types.js +1 -0
  170. package/dist/runtime/provider-usage.d.ts +9 -0
  171. package/dist/runtime/provider-usage.d.ts.map +1 -0
  172. package/dist/runtime/provider-usage.js +69 -0
  173. package/dist/runtime/router.d.ts.map +1 -1
  174. package/dist/runtime/router.js +3 -118
  175. package/dist/runtime/types.d.ts +9 -0
  176. package/dist/runtime/types.d.ts.map +1 -1
  177. package/dist/types.d.ts +1 -1
  178. package/dist/types.d.ts.map +1 -1
  179. package/dist/validator.d.ts +3 -0
  180. package/dist/validator.d.ts.map +1 -1
  181. package/dist/validator.js +32 -0
  182. package/docs/api/public-api-policy.md +10 -0
  183. package/docs/api/stable-workflow.md +58 -0
  184. package/docs/api.md +7 -0
  185. package/docs/capability-manifests.md +24 -0
  186. package/docs/development.md +22 -0
  187. package/docs/discovery.md +186 -0
  188. package/docs/evals/discovery-live.md +199 -0
  189. package/docs/evals/discovery-qualification.md +158 -0
  190. package/docs/evals/overview.md +9 -0
  191. package/docs/getting-started/installation.md +11 -12
  192. package/docs/getting-started/openai-quickstart.md +16 -5
  193. package/docs/getting-started/provider-neutral-quickstart.md +247 -88
  194. package/docs/getting-started/quickstart.md +8 -30
  195. package/docs/index.md +10 -0
  196. package/docs/release.md +29 -5
  197. package/docs/runtime.md +27 -0
  198. package/docs/start-here.md +23 -134
  199. package/examples/12-capability-discovery-selection/README.md +346 -0
  200. package/examples/12-capability-discovery-selection/customer-cases.mjs +52 -0
  201. package/examples/12-capability-discovery-selection/customer-harness.mjs +91 -0
  202. package/examples/12-capability-discovery-selection/customer-request-example.mjs +320 -0
  203. package/examples/12-capability-discovery-selection/discovery-example.mjs +175 -0
  204. package/examples/12-capability-discovery-selection/discovery-fixtures/three-domains.suite.json +7887 -0
  205. package/examples/12-capability-discovery-selection/discovery-fixtures/three-domains.v2.suite.json +8167 -0
  206. package/examples/12-capability-discovery-selection/discovery-fixtures/three-domains.v3.suite.json +8342 -0
  207. package/examples/12-capability-discovery-selection/evaluation/application.mjs +305 -0
  208. package/examples/12-capability-discovery-selection/evaluation/campaign.mjs +248 -0
  209. package/examples/12-capability-discovery-selection/evaluation/clients.mjs +433 -0
  210. package/examples/12-capability-discovery-selection/evaluation/continuation.mjs +208 -0
  211. package/examples/12-capability-discovery-selection/evaluation/durable-budget.mjs +420 -0
  212. package/examples/12-capability-discovery-selection/evaluation/freeze.mjs +9 -0
  213. package/examples/12-capability-discovery-selection/evaluation/harness.mjs +618 -0
  214. package/examples/12-capability-discovery-selection/evaluation/mock-host.mjs +260 -0
  215. package/examples/12-capability-discovery-selection/evaluation/preflight.mjs +115 -0
  216. package/examples/12-capability-discovery-selection/evaluation/qualification-workflows.mjs +87 -0
  217. package/examples/12-capability-discovery-selection/evaluation/regrade.mjs +281 -0
  218. package/examples/12-capability-discovery-selection/evaluation/report.mjs +517 -0
  219. package/examples/12-capability-discovery-selection/evaluation/runner.mjs +613 -0
  220. package/examples/12-capability-discovery-selection/evaluation/saved-campaign.mjs +385 -0
  221. package/examples/12-capability-discovery-selection/evaluation/wording.mjs +115 -0
  222. package/examples/12-capability-discovery-selection/evaluation/workflow-application.mjs +378 -0
  223. package/examples/12-capability-discovery-selection/evaluation/workflow-cases.mjs +90 -0
  224. package/examples/12-capability-discovery-selection/evaluation-example.mjs +154 -0
  225. package/examples/12-capability-discovery-selection/hybrid-example.mjs +174 -0
  226. package/examples/12-capability-discovery-selection/mock-embeddings.mjs +101 -0
  227. package/examples/12-capability-discovery-selection/mock-selection.mjs +78 -0
  228. package/examples/12-capability-discovery-selection/pipeline-example.mjs +496 -0
  229. package/examples/12-capability-discovery-selection/retrieval-cases.mjs +31 -0
  230. package/examples/12-capability-discovery-selection/run-campaign-mock.mjs +40 -0
  231. package/examples/12-capability-discovery-selection/run-customer-mock.mjs +15 -0
  232. package/examples/12-capability-discovery-selection/run-evaluation-live.mjs +10 -0
  233. package/examples/12-capability-discovery-selection/run-evaluation-mock.mjs +3 -0
  234. package/examples/12-capability-discovery-selection/run-evaluation-regrade.mjs +71 -0
  235. package/examples/12-capability-discovery-selection/run-hybrid-mock.mjs +3 -0
  236. package/examples/12-capability-discovery-selection/run-mock.mjs +3 -0
  237. package/examples/12-capability-discovery-selection/run-pipeline-mock.mjs +2 -0
  238. package/examples/12-capability-discovery-selection/run-selector-mock.mjs +3 -0
  239. package/examples/12-capability-discovery-selection/selection-example.mjs +88 -0
  240. package/package.json +17 -4
  241. package/schemas/discovery/embedding-index.schema.json +71 -0
  242. package/schemas/discovery/eval-observations.schema.json +409 -0
  243. package/schemas/discovery/eval-suite.schema.json +375 -0
  244. package/schemas/discovery/metadata.schema.json +30 -0
  245. package/schemas/discovery/selection-response.schema.json +47 -0
  246. package/schemas/replay/discovery-snapshot.schema.json +335 -0
@@ -0,0 +1,375 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/xennon101/ai-capability-framework/main/schemas/discovery/eval-suite.schema.json",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["schema_version", "id", "version", "capabilities", "contexts", "cases"],
7
+ "properties": {
8
+ "schema_version": {
9
+ "const": "1.0"
10
+ },
11
+ "id": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "maxLength": 200
15
+ },
16
+ "version": {
17
+ "type": "string",
18
+ "minLength": 1,
19
+ "maxLength": 200
20
+ },
21
+ "capabilities": {
22
+ "type": "array",
23
+ "maxItems": 1000,
24
+ "items": {
25
+ "$ref": "../capability-manifest.schema.json"
26
+ }
27
+ },
28
+ "contexts": {
29
+ "type": "object",
30
+ "minProperties": 1,
31
+ "maxProperties": 128,
32
+ "additionalProperties": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["runtime_context"],
36
+ "properties": {
37
+ "runtime_context": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": [
41
+ "account",
42
+ "subject",
43
+ "autonomy",
44
+ "environment",
45
+ "facts",
46
+ "metadata",
47
+ "requestId",
48
+ "runId",
49
+ "startedAt"
50
+ ],
51
+ "properties": {
52
+ "account": {
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["accountId", "tenantId"],
56
+ "properties": {
57
+ "accountId": {
58
+ "type": "string"
59
+ },
60
+ "tenantId": {
61
+ "type": "string"
62
+ },
63
+ "dataResidency": {
64
+ "type": "string"
65
+ },
66
+ "plan": {
67
+ "type": "string"
68
+ },
69
+ "region": {
70
+ "type": "string"
71
+ },
72
+ "riskFlags": {
73
+ "type": "array",
74
+ "items": {
75
+ "type": "string"
76
+ }
77
+ },
78
+ "subscriptionStatus": {
79
+ "enum": [
80
+ "active",
81
+ "trialing",
82
+ "past_due",
83
+ "cancelled",
84
+ "suspended",
85
+ "unknown"
86
+ ]
87
+ }
88
+ }
89
+ },
90
+ "subject": {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "required": ["actorType", "permissions", "roles", "userId"],
94
+ "properties": {
95
+ "actorType": {
96
+ "enum": ["user", "operator", "service", "system"]
97
+ },
98
+ "displayName": {
99
+ "type": "string"
100
+ },
101
+ "emailHash": {
102
+ "type": "string"
103
+ },
104
+ "entitlements": {
105
+ "type": "array",
106
+ "items": {
107
+ "type": "string"
108
+ }
109
+ },
110
+ "permissions": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "string"
114
+ }
115
+ },
116
+ "roles": {
117
+ "type": "array",
118
+ "items": {
119
+ "type": "string"
120
+ }
121
+ },
122
+ "userId": {
123
+ "type": "string"
124
+ }
125
+ }
126
+ },
127
+ "autonomy": {
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": [
131
+ "allowExternalMessages",
132
+ "allowMoneyMovement",
133
+ "allowPermissionChanges",
134
+ "allowSideEffects",
135
+ "autonomyTier",
136
+ "maxRiskTier"
137
+ ],
138
+ "properties": {
139
+ "allowExternalMessages": {
140
+ "type": "boolean"
141
+ },
142
+ "allowMoneyMovement": {
143
+ "type": "boolean"
144
+ },
145
+ "allowPermissionChanges": {
146
+ "type": "boolean"
147
+ },
148
+ "allowSideEffects": {
149
+ "type": "boolean"
150
+ },
151
+ "autonomyTier": {
152
+ "enum": ["A0", "A1", "A2", "A3", "A4", "A5"]
153
+ },
154
+ "maxRiskTier": {
155
+ "enum": ["low", "medium", "high", "critical"]
156
+ }
157
+ }
158
+ },
159
+ "workflow": {
160
+ "type": "object",
161
+ "additionalProperties": false,
162
+ "required": [],
163
+ "properties": {
164
+ "currentEntityId": {
165
+ "type": "string"
166
+ },
167
+ "currentEntityType": {
168
+ "type": "string"
169
+ },
170
+ "locale": {
171
+ "type": "string"
172
+ },
173
+ "pageOrSurface": {
174
+ "type": "string"
175
+ },
176
+ "timezone": {
177
+ "type": "string"
178
+ },
179
+ "workflowId": {
180
+ "type": "string"
181
+ },
182
+ "workflowType": {
183
+ "type": "string"
184
+ }
185
+ }
186
+ },
187
+ "environment": {
188
+ "enum": ["development", "test", "staging", "production"]
189
+ },
190
+ "facts": {
191
+ "type": "object"
192
+ },
193
+ "metadata": {
194
+ "type": "object"
195
+ },
196
+ "requestId": {
197
+ "type": "string"
198
+ },
199
+ "runId": {
200
+ "type": "string"
201
+ },
202
+ "startedAt": {
203
+ "type": "string"
204
+ }
205
+ }
206
+ },
207
+ "eligibility": {
208
+ "type": "object",
209
+ "additionalProperties": false,
210
+ "required": [],
211
+ "properties": {
212
+ "includeCapabilityIds": {
213
+ "type": "array",
214
+ "uniqueItems": true,
215
+ "items": {
216
+ "type": "string",
217
+ "minLength": 1,
218
+ "maxLength": 200
219
+ },
220
+ "maxItems": 128
221
+ },
222
+ "excludeCapabilityIds": {
223
+ "type": "array",
224
+ "uniqueItems": true,
225
+ "items": {
226
+ "type": "string",
227
+ "minLength": 1,
228
+ "maxLength": 200
229
+ },
230
+ "maxItems": 128
231
+ },
232
+ "allowedDomains": {
233
+ "type": "array",
234
+ "uniqueItems": true,
235
+ "items": {
236
+ "type": "string",
237
+ "minLength": 1,
238
+ "maxLength": 200
239
+ },
240
+ "maxItems": 128
241
+ },
242
+ "allowedCapabilityTypes": {
243
+ "type": "array",
244
+ "uniqueItems": true,
245
+ "items": {
246
+ "enum": [
247
+ "read_data",
248
+ "retrieve_documents",
249
+ "compute",
250
+ "write_prepare_only",
251
+ "write_commit",
252
+ "external_message_prepare",
253
+ "external_message_send",
254
+ "workflow_start",
255
+ "workflow_step",
256
+ "human_handoff"
257
+ ]
258
+ }
259
+ },
260
+ "maxRiskTier": {
261
+ "enum": ["low", "medium", "high", "critical"]
262
+ }
263
+ }
264
+ }
265
+ }
266
+ }
267
+ },
268
+ "cases": {
269
+ "type": "array",
270
+ "maxItems": 10000,
271
+ "items": {
272
+ "type": "object",
273
+ "additionalProperties": false,
274
+ "required": [
275
+ "id",
276
+ "family_id",
277
+ "partition",
278
+ "domain",
279
+ "cohorts",
280
+ "context_id",
281
+ "fragments",
282
+ "compatible_ids",
283
+ "forbidden_ids",
284
+ "forbidden_operations",
285
+ "expected_operation"
286
+ ],
287
+ "properties": {
288
+ "id": {
289
+ "type": "string",
290
+ "minLength": 1,
291
+ "maxLength": 200
292
+ },
293
+ "family_id": {
294
+ "type": "string",
295
+ "minLength": 1,
296
+ "maxLength": 200
297
+ },
298
+ "partition": {
299
+ "enum": ["train", "calibration", "held_out"]
300
+ },
301
+ "domain": {
302
+ "type": "string",
303
+ "minLength": 1,
304
+ "maxLength": 200
305
+ },
306
+ "cohorts": {
307
+ "type": "array",
308
+ "uniqueItems": true,
309
+ "items": {
310
+ "type": "string",
311
+ "minLength": 1,
312
+ "maxLength": 200
313
+ },
314
+ "maxItems": 128
315
+ },
316
+ "context_id": {
317
+ "type": "string",
318
+ "minLength": 1,
319
+ "maxLength": 200
320
+ },
321
+ "fragments": {
322
+ "type": "array",
323
+ "maxItems": 32,
324
+ "items": {
325
+ "type": "object",
326
+ "additionalProperties": false,
327
+ "required": ["key", "text"],
328
+ "properties": {
329
+ "key": {
330
+ "type": "string",
331
+ "minLength": 1,
332
+ "maxLength": 200
333
+ },
334
+ "text": {
335
+ "type": "string",
336
+ "maxLength": 16000
337
+ }
338
+ }
339
+ }
340
+ },
341
+ "compatible_ids": {
342
+ "type": "array",
343
+ "uniqueItems": true,
344
+ "items": {
345
+ "type": "string",
346
+ "minLength": 1,
347
+ "maxLength": 200
348
+ },
349
+ "maxItems": 128
350
+ },
351
+ "forbidden_ids": {
352
+ "type": "array",
353
+ "uniqueItems": true,
354
+ "items": {
355
+ "type": "string",
356
+ "minLength": 1,
357
+ "maxLength": 200
358
+ },
359
+ "maxItems": 128
360
+ },
361
+ "forbidden_operations": {
362
+ "type": "array",
363
+ "uniqueItems": true,
364
+ "items": {
365
+ "enum": ["read", "prepare", "commit"]
366
+ }
367
+ },
368
+ "expected_operation": {
369
+ "enum": ["read", "prepare"]
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/xennon101/ai-capability-framework/main/schemas/discovery/metadata.schema.json",
4
+ "title": "DiscoveryMetadata",
5
+ "description": "Optional authored retrieval metadata under capability extensions.discovery.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schema_version"],
9
+ "properties": {
10
+ "schema_version": {
11
+ "const": "1.0"
12
+ },
13
+ "summary": {
14
+ "type": "string",
15
+ "minLength": 1,
16
+ "maxLength": 500,
17
+ "pattern": "\\S"
18
+ },
19
+ "aliases": {
20
+ "type": "array",
21
+ "maxItems": 32,
22
+ "items": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "maxLength": 120,
26
+ "pattern": "\\S"
27
+ }
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/xennon101/ai-capability-framework/main/schemas/discovery/selection-response.schema.json",
4
+ "title": "CapabilitySelectionResponse",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema_version", "decisions"],
8
+ "properties": {
9
+ "schema_version": { "const": "1.0" },
10
+ "decisions": {
11
+ "type": "array",
12
+ "maxItems": 32,
13
+ "items": {
14
+ "oneOf": [
15
+ {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["query_id", "decision", "capability_id", "reason_code"],
19
+ "properties": {
20
+ "query_id": { "type": "string", "minLength": 1 },
21
+ "decision": { "const": "select" },
22
+ "capability_id": { "type": "string", "minLength": 1 },
23
+ "reason_code": { "const": "supported_candidate" }
24
+ }
25
+ },
26
+ {
27
+ "type": "object",
28
+ "additionalProperties": false,
29
+ "required": ["query_id", "decision", "capability_id", "reason_code"],
30
+ "properties": {
31
+ "query_id": { "type": "string", "minLength": 1 },
32
+ "decision": { "const": "abstain" },
33
+ "capability_id": { "type": "null" },
34
+ "reason_code": {
35
+ "enum": [
36
+ "no_suitable_candidate",
37
+ "ambiguous_request",
38
+ "insufficient_context"
39
+ ]
40
+ }
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ }
46
+ }
47
+ }