sable-sphynx 0.7.0.dev0__py3-none-any.whl

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 (174) hide show
  1. sable_sphynx-0.7.0.dev0.dist-info/METADATA +152 -0
  2. sable_sphynx-0.7.0.dev0.dist-info/RECORD +174 -0
  3. sable_sphynx-0.7.0.dev0.dist-info/WHEEL +5 -0
  4. sable_sphynx-0.7.0.dev0.dist-info/top_level.txt +1 -0
  5. sphynx/__init__.py +469 -0
  6. sphynx/__init__.pyi +376 -0
  7. sphynx/_analytical_client.py +77 -0
  8. sphynx/_analytical_values.py +252 -0
  9. sphynx/_audit_client.py +173 -0
  10. sphynx/_comparison_adapters.py +113 -0
  11. sphynx/_componentized_full_rag.py +34 -0
  12. sphynx/_composed_pipeline.py +109 -0
  13. sphynx/_full_rag_grading.py +218 -0
  14. sphynx/_full_rag_trace.py +221 -0
  15. sphynx/_local_eval.py +268 -0
  16. sphynx/_pipeline_core.py +243 -0
  17. sphynx/_pr_client.py +237 -0
  18. sphynx/_rag_diagnostics_calibration.py +285 -0
  19. sphynx/_rag_diagnostics_catalog.py +39 -0
  20. sphynx/_rag_diagnostics_common.py +26 -0
  21. sphynx/_rag_diagnostics_contracts.py +186 -0
  22. sphynx/_rag_diagnostics_engine.py +243 -0
  23. sphynx/_rag_diagnostics_importers.py +242 -0
  24. sphynx/_rag_diagnostics_ranking.py +81 -0
  25. sphynx/_rag_diagnostics_semantic.py +325 -0
  26. sphynx/_rag_ranking.py +149 -0
  27. sphynx/_speech_benchmark_scoring.py +140 -0
  28. sphynx/_speech_benchmark_sources.py +275 -0
  29. sphynx/_speech_complete_scoring.py +218 -0
  30. sphynx/_speech_complete_source.py +118 -0
  31. sphynx/_speech_kido.py +294 -0
  32. sphynx/_speech_scoring.py +77 -0
  33. sphynx/_track_capture.py +213 -0
  34. sphynx/analytical_views.py +515 -0
  35. sphynx/assessment_contracts.py +378 -0
  36. sphynx/assessment_selection.py +57 -0
  37. sphynx/audit_access.py +245 -0
  38. sphynx/audit_contracts.py +204 -0
  39. sphynx/audit_requests.py +180 -0
  40. sphynx/authoring.py +188 -0
  41. sphynx/benchmarks.py +568 -0
  42. sphynx/candidates.py +62 -0
  43. sphynx/catalog.py +272 -0
  44. sphynx/chunking.py +372 -0
  45. sphynx/clickhouse_reader.py +169 -0
  46. sphynx/client.py +486 -0
  47. sphynx/comparison_core.py +149 -0
  48. sphynx/comparison_views.py +223 -0
  49. sphynx/components.py +1661 -0
  50. sphynx/contracts.py +514 -0
  51. sphynx/customer_rerank.py +299 -0
  52. sphynx/customer_retrieval.py +146 -0
  53. sphynx/data/benchmark-releases.v1.json +164 -0
  54. sphynx/data/public-benchmark-release.v1.json +354 -0
  55. sphynx/data/rag-diagnostics-synthetic.v1.json +6982 -0
  56. sphynx/data/rag-paper-references.v1.json +176 -0
  57. sphynx/data/rag-paper-schemas.v1.json +1069 -0
  58. sphynx/data/rag-rerank-v1.json +507 -0
  59. sphynx/dataset_catalog_data.py +1214 -0
  60. sphynx/dataset_readiness.py +138 -0
  61. sphynx/dataset_v3.py +999 -0
  62. sphynx/demo.py +130 -0
  63. sphynx/demo_candidates/__init__.py +1 -0
  64. sphynx/demo_candidates/dense.py +11 -0
  65. sphynx/demo_candidates/lexical.py +21 -0
  66. sphynx/diagnostics.py +207 -0
  67. sphynx/documentation.py +737 -0
  68. sphynx/documentation_candidate.py +939 -0
  69. sphynx/evals.py +538 -0
  70. sphynx/evaluation_protocols.py +124 -0
  71. sphynx/evaluator_bindings.py +370 -0
  72. sphynx/evidence.py +352 -0
  73. sphynx/execution_capabilities.py +109 -0
  74. sphynx/fast_search.py +285 -0
  75. sphynx/full_rag.py +341 -0
  76. sphynx/hosted/__init__.py +18 -0
  77. sphynx/hosted/benchmark_intake.py +218 -0
  78. sphynx/hosted/contracts.py +361 -0
  79. sphynx/hosted/model_admission.py +130 -0
  80. sphynx/hosted/model_artifacts.py +298 -0
  81. sphynx/hosted/model_contracts.py +63 -0
  82. sphynx/hosted/model_gcs.py +181 -0
  83. sphynx/hosted/model_history.py +84 -0
  84. sphynx/hosted/model_session.py +233 -0
  85. sphynx/hosted/public_suite.py +74 -0
  86. sphynx/hosted/registry.py +97 -0
  87. sphynx/hosted/revisions.py +126 -0
  88. sphynx/hosted/sandbox.py +105 -0
  89. sphynx/hosted/submission.py +287 -0
  90. sphynx/hosted_workflow.py +451 -0
  91. sphynx/http_transport.py +86 -0
  92. sphynx/integrated_rag.py +352 -0
  93. sphynx/integrated_workflow.py +552 -0
  94. sphynx/integration_contracts.py +474 -0
  95. sphynx/invocation.py +791 -0
  96. sphynx/invocation_candidates.py +392 -0
  97. sphynx/invocation_catalog_data.py +40 -0
  98. sphynx/learned_catalog_data.py +30 -0
  99. sphynx/learned_rerank.py +267 -0
  100. sphynx/legacy_full_rag.py +67 -0
  101. sphynx/lifecycle.py +885 -0
  102. sphynx/lifecycle_workflow.py +490 -0
  103. sphynx/metric_views.py +474 -0
  104. sphynx/metrics.py +282 -0
  105. sphynx/model_adapters.py +438 -0
  106. sphynx/model_catalog_data.py +30 -0
  107. sphynx/official_benchmarks.py +385 -0
  108. sphynx/packs.py +258 -0
  109. sphynx/pipeline.py +313 -0
  110. sphynx/pipeline_workflow.py +551 -0
  111. sphynx/pr_evaluations.py +560 -0
  112. sphynx/progress.py +89 -0
  113. sphynx/public_bundle.py +173 -0
  114. sphynx/public_eval.py +62 -0
  115. sphynx/public_rerank.py +355 -0
  116. sphynx/py.typed +0 -0
  117. sphynx/pytest_plugin.py +62 -0
  118. sphynx/question_robustness.py +437 -0
  119. sphynx/rag.py +329 -0
  120. sphynx/rag_diagnostics.py +309 -0
  121. sphynx/rag_papers/__init__.py +29 -0
  122. sphynx/rag_papers/__main__.py +45 -0
  123. sphynx/rag_papers/candidates.py +19 -0
  124. sphynx/rag_papers/contracts.py +282 -0
  125. sphynx/rag_papers/datasets.py +291 -0
  126. sphynx/rag_papers/experiments.py +116 -0
  127. sphynx/rag_papers/judges.py +308 -0
  128. sphynx/rag_papers/registry.py +33 -0
  129. sphynx/rag_papers/runner.py +176 -0
  130. sphynx/rag_papers/sable.py +135 -0
  131. sphynx/rag_papers/schemas.py +12 -0
  132. sphynx/rag_papers/scoring.py +249 -0
  133. sphynx/rag_papers/semantic.py +288 -0
  134. sphynx/rag_papers/trec.py +80 -0
  135. sphynx/recorded_scores.py +352 -0
  136. sphynx/records.py +124 -0
  137. sphynx/reflex_traces.py +193 -0
  138. sphynx/report_rendering.py +71 -0
  139. sphynx/rerank_family_contracts.py +150 -0
  140. sphynx/rerank_workflow.py +424 -0
  141. sphynx/research_candidate.py +190 -0
  142. sphynx/results.py +852 -0
  143. sphynx/retrieval.py +750 -0
  144. sphynx/retrieval_candidates.py +295 -0
  145. sphynx/retrieval_catalog_data.py +19 -0
  146. sphynx/retrieval_recordings.py +125 -0
  147. sphynx/reviewer_audit.py +266 -0
  148. sphynx/routing_policies.py +375 -0
  149. sphynx/runner.py +544 -0
  150. sphynx/sable_rerank.py +489 -0
  151. sphynx/score_reliability.py +393 -0
  152. sphynx/speech_benchmarks.py +204 -0
  153. sphynx/speech_campaigns.py +378 -0
  154. sphynx/speech_complete.py +236 -0
  155. sphynx/speech_contracts.py +225 -0
  156. sphynx/speech_evidence.py +429 -0
  157. sphynx/speech_listening.py +115 -0
  158. sphynx/speech_multilingual.py +71 -0
  159. sphynx/speech_tts.py +479 -0
  160. sphynx/sql/001_sync_v1.sql +30 -0
  161. sphynx/stage_contracts.py +199 -0
  162. sphynx/statistical_catalog_data.py +53 -0
  163. sphynx/statistical_rerank.py +232 -0
  164. sphynx/sync.py +797 -0
  165. sphynx/workbench.py +378 -0
  166. sphynx/workbench_catalog_data.py +13 -0
  167. sphynx/workbench_tracks.py +78 -0
  168. sphynx/workflow_async.py +197 -0
  169. sphynx/workflow_contracts.py +594 -0
  170. sphynx/workflow_decisions.py +211 -0
  171. sphynx/workflow_defaults.py +16 -0
  172. sphynx/workflow_extensions.py +212 -0
  173. sphynx/workflow_registry.py +513 -0
  174. sphynx/workflows.py +792 -0
@@ -0,0 +1,1069 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:sphynx:rag-papers:schemas:v1",
4
+ "$defs": {
5
+ "case": {
6
+ "type": "object",
7
+ "properties": {
8
+ "schema_version": {
9
+ "const": "sphynx.rag.case.v1"
10
+ },
11
+ "id": {
12
+ "type": "string",
13
+ "minLength": 1,
14
+ "maxLength": 256,
15
+ "pattern": "^[^\\x00-\\x1f]+$"
16
+ },
17
+ "question": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "maxLength": 100000
21
+ },
22
+ "conversation_history": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "properties": {
27
+ "role": {
28
+ "enum": [
29
+ "system",
30
+ "user",
31
+ "assistant",
32
+ "tool"
33
+ ]
34
+ },
35
+ "content": {
36
+ "type": "string"
37
+ }
38
+ },
39
+ "required": [
40
+ "role",
41
+ "content"
42
+ ],
43
+ "additionalProperties": false
44
+ },
45
+ "maxItems": 1000
46
+ },
47
+ "retrieval_query": {
48
+ "anyOf": [
49
+ {
50
+ "type": "string"
51
+ },
52
+ {
53
+ "type": "null"
54
+ }
55
+ ]
56
+ },
57
+ "context": {
58
+ "type": "object",
59
+ "properties": {
60
+ "as_of": {
61
+ "type": "string"
62
+ },
63
+ "locale": {
64
+ "type": "string"
65
+ }
66
+ },
67
+ "additionalProperties": false
68
+ },
69
+ "corpus_snapshot_id": {
70
+ "type": "string",
71
+ "minLength": 1,
72
+ "maxLength": 256,
73
+ "pattern": "^[^\\x00-\\x1f]+$"
74
+ },
75
+ "document_ids": {
76
+ "type": "array",
77
+ "items": {
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "maxLength": 256,
81
+ "pattern": "^[^\\x00-\\x1f]+$"
82
+ },
83
+ "uniqueItems": true,
84
+ "maxItems": 1000000
85
+ },
86
+ "references": {
87
+ "type": "object",
88
+ "properties": {
89
+ "answers": {
90
+ "anyOf": [
91
+ {
92
+ "type": "array",
93
+ "items": {
94
+ "type": "string"
95
+ }
96
+ },
97
+ {
98
+ "type": "null"
99
+ }
100
+ ]
101
+ },
102
+ "qrels": {
103
+ "anyOf": [
104
+ {
105
+ "type": "object",
106
+ "additionalProperties": {
107
+ "type": "integer",
108
+ "minimum": 0,
109
+ "maximum": 100
110
+ }
111
+ },
112
+ {
113
+ "type": "null"
114
+ }
115
+ ]
116
+ },
117
+ "support_ids": {
118
+ "anyOf": [
119
+ {
120
+ "type": "array",
121
+ "items": {
122
+ "type": "string",
123
+ "minLength": 1,
124
+ "maxLength": 256,
125
+ "pattern": "^[^\\x00-\\x1f]+$"
126
+ },
127
+ "uniqueItems": true,
128
+ "maxItems": 1000000
129
+ },
130
+ {
131
+ "type": "null"
132
+ }
133
+ ]
134
+ },
135
+ "support_facts": {
136
+ "anyOf": [
137
+ {
138
+ "type": "array",
139
+ "items": {
140
+ "type": "array",
141
+ "prefixItems": [
142
+ {
143
+ "type": "string"
144
+ },
145
+ {
146
+ "type": "integer",
147
+ "minimum": 0
148
+ }
149
+ ],
150
+ "items": false,
151
+ "minItems": 2,
152
+ "maxItems": 2
153
+ }
154
+ },
155
+ {
156
+ "type": "null"
157
+ }
158
+ ]
159
+ },
160
+ "answerable": {
161
+ "anyOf": [
162
+ {
163
+ "type": "boolean"
164
+ },
165
+ {
166
+ "type": "null"
167
+ }
168
+ ]
169
+ },
170
+ "expected_action": {
171
+ "enum": [
172
+ null,
173
+ "answer",
174
+ "abstain",
175
+ "clarify",
176
+ "no_rag"
177
+ ]
178
+ },
179
+ "required_atoms": {
180
+ "anyOf": [
181
+ {
182
+ "type": "array",
183
+ "items": {
184
+ "type": "string"
185
+ }
186
+ },
187
+ {
188
+ "type": "null"
189
+ }
190
+ ]
191
+ },
192
+ "atom_support": {
193
+ "anyOf": [
194
+ {
195
+ "type": "object",
196
+ "additionalProperties": {
197
+ "type": "array",
198
+ "items": {
199
+ "type": "string",
200
+ "minLength": 1,
201
+ "maxLength": 256,
202
+ "pattern": "^[^\\x00-\\x1f]+$"
203
+ },
204
+ "uniqueItems": true,
205
+ "maxItems": 1000000
206
+ }
207
+ },
208
+ {
209
+ "type": "null"
210
+ }
211
+ ]
212
+ },
213
+ "required_relations": {
214
+ "anyOf": [
215
+ {
216
+ "type": "array",
217
+ "items": {
218
+ "type": "string"
219
+ }
220
+ },
221
+ {
222
+ "type": "null"
223
+ }
224
+ ]
225
+ },
226
+ "relation_support": {
227
+ "anyOf": [
228
+ {
229
+ "type": "object",
230
+ "additionalProperties": {
231
+ "type": "array",
232
+ "items": {
233
+ "type": "string",
234
+ "minLength": 1,
235
+ "maxLength": 256,
236
+ "pattern": "^[^\\x00-\\x1f]+$"
237
+ },
238
+ "uniqueItems": true,
239
+ "maxItems": 1000000
240
+ }
241
+ },
242
+ {
243
+ "type": "null"
244
+ }
245
+ ]
246
+ },
247
+ "annotation_sets": {
248
+ "anyOf": [
249
+ {
250
+ "type": "array",
251
+ "items": {
252
+ "type": "object",
253
+ "properties": {
254
+ "answer": {
255
+ "type": "string"
256
+ },
257
+ "evidence_ids": {
258
+ "anyOf": [
259
+ {
260
+ "type": "array",
261
+ "items": {
262
+ "type": "string",
263
+ "minLength": 1,
264
+ "maxLength": 256,
265
+ "pattern": "^[^\\x00-\\x1f]+$"
266
+ },
267
+ "uniqueItems": true,
268
+ "maxItems": 1000000
269
+ },
270
+ {
271
+ "type": "null"
272
+ }
273
+ ]
274
+ }
275
+ },
276
+ "required": [
277
+ "answer",
278
+ "evidence_ids"
279
+ ],
280
+ "additionalProperties": false
281
+ }
282
+ },
283
+ {
284
+ "type": "null"
285
+ }
286
+ ]
287
+ },
288
+ "native": {
289
+ "type": "object"
290
+ }
291
+ },
292
+ "required": [
293
+ "answers",
294
+ "qrels",
295
+ "support_ids",
296
+ "support_facts",
297
+ "answerable",
298
+ "expected_action",
299
+ "required_atoms",
300
+ "atom_support",
301
+ "required_relations",
302
+ "relation_support",
303
+ "annotation_sets",
304
+ "native"
305
+ ],
306
+ "additionalProperties": false
307
+ },
308
+ "metadata": {
309
+ "type": "object",
310
+ "properties": {
311
+ "origin": {
312
+ "enum": [
313
+ "synthetic",
314
+ "public",
315
+ "owner-held",
316
+ "recorded"
317
+ ]
318
+ },
319
+ "scenario_family": {
320
+ "type": "string",
321
+ "minLength": 1,
322
+ "maxLength": 256,
323
+ "pattern": "^[^\\x00-\\x1f]+$"
324
+ },
325
+ "split": {
326
+ "type": "string",
327
+ "minLength": 1,
328
+ "maxLength": 256,
329
+ "pattern": "^[^\\x00-\\x1f]+$"
330
+ },
331
+ "cluster_id": {
332
+ "type": "string",
333
+ "minLength": 1,
334
+ "maxLength": 256,
335
+ "pattern": "^[^\\x00-\\x1f]+$"
336
+ },
337
+ "source_id": {
338
+ "type": "string",
339
+ "minLength": 1,
340
+ "maxLength": 256,
341
+ "pattern": "^[^\\x00-\\x1f]+$"
342
+ },
343
+ "native_id": {
344
+ "type": "string",
345
+ "minLength": 1,
346
+ "maxLength": 256,
347
+ "pattern": "^[^\\x00-\\x1f]+$"
348
+ }
349
+ },
350
+ "required": [
351
+ "origin",
352
+ "scenario_family",
353
+ "split",
354
+ "cluster_id",
355
+ "source_id",
356
+ "native_id"
357
+ ],
358
+ "additionalProperties": false
359
+ }
360
+ },
361
+ "required": [
362
+ "schema_version",
363
+ "id",
364
+ "question",
365
+ "conversation_history",
366
+ "retrieval_query",
367
+ "context",
368
+ "corpus_snapshot_id",
369
+ "document_ids",
370
+ "references",
371
+ "metadata"
372
+ ],
373
+ "additionalProperties": false
374
+ },
375
+ "trace": {
376
+ "type": "object",
377
+ "properties": {
378
+ "schema_version": {
379
+ "const": "sphynx.rag.trace.v1"
380
+ },
381
+ "case_id": {
382
+ "type": "string",
383
+ "minLength": 1,
384
+ "maxLength": 256,
385
+ "pattern": "^[^\\x00-\\x1f]+$"
386
+ },
387
+ "attempt_id": {
388
+ "type": "string",
389
+ "minLength": 1,
390
+ "maxLength": 256,
391
+ "pattern": "^[^\\x00-\\x1f]+$"
392
+ },
393
+ "input_sha256": {
394
+ "type": "string",
395
+ "pattern": "^[0-9a-f]{64}$"
396
+ },
397
+ "candidate": {
398
+ "type": "object",
399
+ "properties": {
400
+ "id": {
401
+ "type": "string",
402
+ "minLength": 1,
403
+ "maxLength": 256,
404
+ "pattern": "^[^\\x00-\\x1f]+$"
405
+ },
406
+ "source_sha256": {
407
+ "type": "string",
408
+ "pattern": "^[0-9a-f]{64}$"
409
+ }
410
+ },
411
+ "required": [
412
+ "id",
413
+ "source_sha256"
414
+ ],
415
+ "additionalProperties": false
416
+ },
417
+ "rewritten_query": {
418
+ "anyOf": [
419
+ {
420
+ "type": "string"
421
+ },
422
+ {
423
+ "type": "null"
424
+ }
425
+ ]
426
+ },
427
+ "native": {
428
+ "type": "object"
429
+ },
430
+ "stages": {
431
+ "type": "object",
432
+ "properties": {
433
+ "indexed": {
434
+ "anyOf": [
435
+ {
436
+ "type": "array",
437
+ "items": {
438
+ "type": "string",
439
+ "minLength": 1,
440
+ "maxLength": 256,
441
+ "pattern": "^[^\\x00-\\x1f]+$"
442
+ },
443
+ "uniqueItems": true,
444
+ "maxItems": 1000000
445
+ },
446
+ {
447
+ "type": "null"
448
+ }
449
+ ]
450
+ },
451
+ "retrieved": {
452
+ "anyOf": [
453
+ {
454
+ "type": "array",
455
+ "items": {
456
+ "type": "string",
457
+ "minLength": 1,
458
+ "maxLength": 256,
459
+ "pattern": "^[^\\x00-\\x1f]+$"
460
+ },
461
+ "uniqueItems": true,
462
+ "maxItems": 1000000
463
+ },
464
+ {
465
+ "type": "null"
466
+ }
467
+ ]
468
+ },
469
+ "reranked": {
470
+ "anyOf": [
471
+ {
472
+ "type": "array",
473
+ "items": {
474
+ "type": "string",
475
+ "minLength": 1,
476
+ "maxLength": 256,
477
+ "pattern": "^[^\\x00-\\x1f]+$"
478
+ },
479
+ "uniqueItems": true,
480
+ "maxItems": 1000000
481
+ },
482
+ {
483
+ "type": "null"
484
+ }
485
+ ]
486
+ },
487
+ "selected": {
488
+ "anyOf": [
489
+ {
490
+ "type": "array",
491
+ "items": {
492
+ "type": "string",
493
+ "minLength": 1,
494
+ "maxLength": 256,
495
+ "pattern": "^[^\\x00-\\x1f]+$"
496
+ },
497
+ "uniqueItems": true,
498
+ "maxItems": 1000000
499
+ },
500
+ {
501
+ "type": "null"
502
+ }
503
+ ]
504
+ },
505
+ "prompt": {
506
+ "anyOf": [
507
+ {
508
+ "type": "array",
509
+ "items": {
510
+ "type": "string",
511
+ "minLength": 1,
512
+ "maxLength": 256,
513
+ "pattern": "^[^\\x00-\\x1f]+$"
514
+ },
515
+ "uniqueItems": true,
516
+ "maxItems": 1000000
517
+ },
518
+ {
519
+ "type": "null"
520
+ }
521
+ ]
522
+ }
523
+ },
524
+ "required": [
525
+ "indexed",
526
+ "retrieved",
527
+ "reranked",
528
+ "selected",
529
+ "prompt"
530
+ ],
531
+ "additionalProperties": false
532
+ },
533
+ "response": {
534
+ "type": "object",
535
+ "properties": {
536
+ "status": {
537
+ "enum": [
538
+ "ok",
539
+ "error",
540
+ "timeout",
541
+ "missing"
542
+ ]
543
+ },
544
+ "text": {
545
+ "type": "string"
546
+ },
547
+ "abstained": {
548
+ "type": "boolean"
549
+ },
550
+ "support_ids": {
551
+ "anyOf": [
552
+ {
553
+ "type": "array",
554
+ "items": {
555
+ "type": "string",
556
+ "minLength": 1,
557
+ "maxLength": 256,
558
+ "pattern": "^[^\\x00-\\x1f]+$"
559
+ },
560
+ "uniqueItems": true,
561
+ "maxItems": 1000000
562
+ },
563
+ {
564
+ "type": "null"
565
+ }
566
+ ]
567
+ },
568
+ "support_facts": {
569
+ "anyOf": [
570
+ {
571
+ "type": "array",
572
+ "items": {
573
+ "type": "array",
574
+ "prefixItems": [
575
+ {
576
+ "type": "string"
577
+ },
578
+ {
579
+ "type": "integer",
580
+ "minimum": 0
581
+ }
582
+ ],
583
+ "items": false,
584
+ "minItems": 2,
585
+ "maxItems": 2
586
+ }
587
+ },
588
+ {
589
+ "type": "null"
590
+ }
591
+ ]
592
+ }
593
+ },
594
+ "required": [
595
+ "status",
596
+ "text",
597
+ "abstained",
598
+ "support_ids",
599
+ "support_facts"
600
+ ],
601
+ "additionalProperties": false
602
+ },
603
+ "operational": {
604
+ "type": "object",
605
+ "properties": {
606
+ "tokens": {
607
+ "anyOf": [
608
+ {
609
+ "type": "number",
610
+ "minimum": 0
611
+ },
612
+ {
613
+ "type": "null"
614
+ }
615
+ ]
616
+ },
617
+ "cost_usd": {
618
+ "anyOf": [
619
+ {
620
+ "type": "number",
621
+ "minimum": 0
622
+ },
623
+ {
624
+ "type": "null"
625
+ }
626
+ ]
627
+ }
628
+ },
629
+ "required": [
630
+ "tokens",
631
+ "cost_usd"
632
+ ],
633
+ "additionalProperties": false
634
+ }
635
+ },
636
+ "required": [
637
+ "schema_version",
638
+ "case_id",
639
+ "attempt_id",
640
+ "input_sha256",
641
+ "candidate",
642
+ "rewritten_query",
643
+ "native",
644
+ "stages",
645
+ "response",
646
+ "operational"
647
+ ],
648
+ "additionalProperties": false
649
+ },
650
+ "judgment": {
651
+ "type": "object",
652
+ "properties": {
653
+ "schema_version": {
654
+ "const": "sphynx.rag.judgment.v1"
655
+ },
656
+ "case_id": {
657
+ "type": "string",
658
+ "minLength": 1,
659
+ "maxLength": 256,
660
+ "pattern": "^[^\\x00-\\x1f]+$"
661
+ },
662
+ "trace_sha256": {
663
+ "type": "string",
664
+ "pattern": "^[0-9a-f]{64}$"
665
+ },
666
+ "input_sha256": {
667
+ "type": "string",
668
+ "pattern": "^[0-9a-f]{64}$"
669
+ },
670
+ "task": {
671
+ "type": "string",
672
+ "minLength": 1,
673
+ "maxLength": 256,
674
+ "pattern": "^[^\\x00-\\x1f]+$"
675
+ },
676
+ "labels": {
677
+ "type": "object"
678
+ },
679
+ "provenance": {
680
+ "type": "object",
681
+ "properties": {
682
+ "origin": {
683
+ "enum": [
684
+ "fixture",
685
+ "human",
686
+ "model"
687
+ ]
688
+ },
689
+ "model": {
690
+ "type": "string",
691
+ "minLength": 1,
692
+ "maxLength": 256,
693
+ "pattern": "^[^\\x00-\\x1f]+$"
694
+ },
695
+ "rubric": {
696
+ "type": "string",
697
+ "minLength": 1,
698
+ "maxLength": 256,
699
+ "pattern": "^[^\\x00-\\x1f]+$"
700
+ }
701
+ },
702
+ "required": [
703
+ "origin",
704
+ "model",
705
+ "rubric"
706
+ ],
707
+ "additionalProperties": false
708
+ },
709
+ "status": {
710
+ "enum": [
711
+ "judged",
712
+ "abstained",
713
+ "error",
714
+ "timeout"
715
+ ]
716
+ },
717
+ "usage": {
718
+ "type": "object",
719
+ "properties": {
720
+ "tokens": {
721
+ "anyOf": [
722
+ {
723
+ "type": "number",
724
+ "minimum": 0
725
+ },
726
+ {
727
+ "type": "null"
728
+ }
729
+ ]
730
+ },
731
+ "cost_usd": {
732
+ "anyOf": [
733
+ {
734
+ "type": "number",
735
+ "minimum": 0
736
+ },
737
+ {
738
+ "type": "null"
739
+ }
740
+ ]
741
+ }
742
+ },
743
+ "required": [
744
+ "tokens",
745
+ "cost_usd"
746
+ ],
747
+ "additionalProperties": false
748
+ }
749
+ },
750
+ "required": [
751
+ "schema_version",
752
+ "case_id",
753
+ "trace_sha256",
754
+ "input_sha256",
755
+ "task",
756
+ "labels",
757
+ "provenance",
758
+ "status",
759
+ "usage"
760
+ ],
761
+ "additionalProperties": false
762
+ },
763
+ "metric_result": {
764
+ "type": "object",
765
+ "properties": {
766
+ "value": {
767
+ "anyOf": [
768
+ {
769
+ "type": "number"
770
+ },
771
+ {
772
+ "type": "null"
773
+ }
774
+ ]
775
+ },
776
+ "numerator": {
777
+ "anyOf": [
778
+ {
779
+ "type": "number"
780
+ },
781
+ {
782
+ "type": "null"
783
+ }
784
+ ]
785
+ },
786
+ "denominator": {
787
+ "anyOf": [
788
+ {
789
+ "type": "number",
790
+ "minimum": 0
791
+ },
792
+ {
793
+ "type": "null"
794
+ }
795
+ ]
796
+ },
797
+ "unit": {
798
+ "type": "string"
799
+ },
800
+ "status": {
801
+ "enum": [
802
+ "available",
803
+ "unavailable"
804
+ ]
805
+ },
806
+ "reason": {
807
+ "anyOf": [
808
+ {
809
+ "type": "string"
810
+ },
811
+ {
812
+ "type": "null"
813
+ }
814
+ ]
815
+ }
816
+ },
817
+ "required": [
818
+ "value",
819
+ "numerator",
820
+ "denominator",
821
+ "unit",
822
+ "status",
823
+ "reason"
824
+ ],
825
+ "additionalProperties": false,
826
+ "allOf": [
827
+ {
828
+ "if": {
829
+ "properties": {
830
+ "status": {
831
+ "const": "available"
832
+ }
833
+ }
834
+ },
835
+ "then": {
836
+ "properties": {
837
+ "value": {
838
+ "type": "number"
839
+ }
840
+ }
841
+ },
842
+ "else": {
843
+ "properties": {
844
+ "value": {
845
+ "type": "null"
846
+ }
847
+ }
848
+ }
849
+ }
850
+ ]
851
+ },
852
+ "result": {
853
+ "type": "object",
854
+ "properties": {
855
+ "schema_version": {
856
+ "const": "sphynx.rag.paper-result.v1"
857
+ },
858
+ "protocol": {
859
+ "type": "object",
860
+ "properties": {
861
+ "id": {
862
+ "type": "string"
863
+ },
864
+ "function": {
865
+ "type": "string"
866
+ },
867
+ "paper": {
868
+ "type": "string"
869
+ },
870
+ "source": {
871
+ "type": "string"
872
+ },
873
+ "protocol_version": {
874
+ "type": "string"
875
+ },
876
+ "convention": {
877
+ "type": "string"
878
+ },
879
+ "execution": {
880
+ "type": "string"
881
+ },
882
+ "framework_parity": {
883
+ "type": "string"
884
+ },
885
+ "hosted_admitted": {
886
+ "const": false
887
+ }
888
+ },
889
+ "required": [
890
+ "id",
891
+ "function",
892
+ "paper",
893
+ "source",
894
+ "protocol_version",
895
+ "convention",
896
+ "execution",
897
+ "framework_parity",
898
+ "hosted_admitted"
899
+ ],
900
+ "additionalProperties": false
901
+ },
902
+ "case_id": {
903
+ "type": "string",
904
+ "minLength": 1,
905
+ "maxLength": 256,
906
+ "pattern": "^[^\\x00-\\x1f]+$"
907
+ },
908
+ "case_sha256": {
909
+ "type": "string",
910
+ "pattern": "^[0-9a-f]{64}$"
911
+ },
912
+ "trace_sha256": {
913
+ "type": "string",
914
+ "pattern": "^[0-9a-f]{64}$"
915
+ },
916
+ "input_sha256": {
917
+ "type": "string",
918
+ "pattern": "^[0-9a-f]{64}$"
919
+ },
920
+ "response_status": {
921
+ "enum": [
922
+ "ok",
923
+ "error",
924
+ "timeout",
925
+ "missing"
926
+ ]
927
+ },
928
+ "metrics": {
929
+ "type": "object",
930
+ "additionalProperties": {
931
+ "type": "object",
932
+ "properties": {
933
+ "value": {
934
+ "anyOf": [
935
+ {
936
+ "type": "number"
937
+ },
938
+ {
939
+ "type": "null"
940
+ }
941
+ ]
942
+ },
943
+ "numerator": {
944
+ "anyOf": [
945
+ {
946
+ "type": "number"
947
+ },
948
+ {
949
+ "type": "null"
950
+ }
951
+ ]
952
+ },
953
+ "denominator": {
954
+ "anyOf": [
955
+ {
956
+ "type": "number",
957
+ "minimum": 0
958
+ },
959
+ {
960
+ "type": "null"
961
+ }
962
+ ]
963
+ },
964
+ "unit": {
965
+ "type": "string"
966
+ },
967
+ "status": {
968
+ "enum": [
969
+ "available",
970
+ "unavailable"
971
+ ]
972
+ },
973
+ "reason": {
974
+ "anyOf": [
975
+ {
976
+ "type": "string"
977
+ },
978
+ {
979
+ "type": "null"
980
+ }
981
+ ]
982
+ }
983
+ },
984
+ "required": [
985
+ "value",
986
+ "numerator",
987
+ "denominator",
988
+ "unit",
989
+ "status",
990
+ "reason"
991
+ ],
992
+ "additionalProperties": false,
993
+ "allOf": [
994
+ {
995
+ "if": {
996
+ "properties": {
997
+ "status": {
998
+ "const": "available"
999
+ }
1000
+ }
1001
+ },
1002
+ "then": {
1003
+ "properties": {
1004
+ "value": {
1005
+ "type": "number"
1006
+ }
1007
+ }
1008
+ },
1009
+ "else": {
1010
+ "properties": {
1011
+ "value": {
1012
+ "type": "null"
1013
+ }
1014
+ }
1015
+ }
1016
+ }
1017
+ ]
1018
+ }
1019
+ },
1020
+ "parameters": {
1021
+ "type": "object"
1022
+ },
1023
+ "judgment_sha256": {
1024
+ "type": "array",
1025
+ "items": {
1026
+ "type": "string",
1027
+ "pattern": "^[0-9a-f]{64}$"
1028
+ }
1029
+ },
1030
+ "judgment_origins": {
1031
+ "type": "array",
1032
+ "items": {
1033
+ "enum": [
1034
+ "fixture",
1035
+ "model",
1036
+ "human"
1037
+ ]
1038
+ },
1039
+ "uniqueItems": true
1040
+ },
1041
+ "notes": {
1042
+ "type": "array",
1043
+ "items": {
1044
+ "type": "string"
1045
+ }
1046
+ },
1047
+ "hosted_admitted": {
1048
+ "const": false
1049
+ }
1050
+ },
1051
+ "required": [
1052
+ "schema_version",
1053
+ "protocol",
1054
+ "case_id",
1055
+ "case_sha256",
1056
+ "trace_sha256",
1057
+ "input_sha256",
1058
+ "response_status",
1059
+ "metrics",
1060
+ "parameters",
1061
+ "judgment_sha256",
1062
+ "judgment_origins",
1063
+ "notes",
1064
+ "hosted_admitted"
1065
+ ],
1066
+ "additionalProperties": false
1067
+ }
1068
+ }
1069
+ }