@ancplua/qyl-api-schema 0.5.10 → 0.5.12

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.
@@ -842,6 +842,685 @@
842
842
  "maxLength": 256,
843
843
  "description": "User identifier (pseudonymized for privacy)"
844
844
  },
845
+ "Cost.GenAiEtlAuditCluster": {
846
+ "type": "object",
847
+ "required": [
848
+ "cluster_id",
849
+ "workflow_key",
850
+ "service_name",
851
+ "span_name",
852
+ "output_contract",
853
+ "task_family",
854
+ "call_count",
855
+ "input_tokens",
856
+ "output_tokens",
857
+ "cache_read_input_tokens",
858
+ "cache_creation_input_tokens",
859
+ "reasoning_output_tokens",
860
+ "error_count",
861
+ "error_rate",
862
+ "average_latency_ms",
863
+ "p95_latency_ms",
864
+ "cost_attribution",
865
+ "candidate_path",
866
+ "validation_metric",
867
+ "residual_path",
868
+ "evidence_signals",
869
+ "missing_evidence",
870
+ "promotion_gates"
871
+ ],
872
+ "properties": {
873
+ "cluster_id": {
874
+ "type": "string",
875
+ "description": "Stable identifier derived from the privacy-safe cluster dimensions."
876
+ },
877
+ "workflow_key": {
878
+ "type": "string",
879
+ "description": "Privacy-safe workflow identity used to group repeated calls."
880
+ },
881
+ "service_name": {
882
+ "type": "string"
883
+ },
884
+ "span_name": {
885
+ "type": "string"
886
+ },
887
+ "operation_name": {
888
+ "type": "string"
889
+ },
890
+ "provider": {
891
+ "type": "string"
892
+ },
893
+ "model": {
894
+ "type": "string"
895
+ },
896
+ "output_contract": {
897
+ "$ref": "#/$defs/Cost.GenAiEtlOutputContract"
898
+ },
899
+ "task_family": {
900
+ "$ref": "#/$defs/Cost.GenAiEtlTaskFamily"
901
+ },
902
+ "call_count": {
903
+ "$ref": "#/$defs/Common.Count"
904
+ },
905
+ "input_tokens": {
906
+ "$ref": "#/$defs/Common.TokenCount"
907
+ },
908
+ "output_tokens": {
909
+ "$ref": "#/$defs/Common.TokenCount"
910
+ },
911
+ "cache_read_input_tokens": {
912
+ "$ref": "#/$defs/Common.TokenCount"
913
+ },
914
+ "cache_creation_input_tokens": {
915
+ "$ref": "#/$defs/Common.TokenCount"
916
+ },
917
+ "reasoning_output_tokens": {
918
+ "$ref": "#/$defs/Common.TokenCount"
919
+ },
920
+ "error_count": {
921
+ "$ref": "#/$defs/Common.Count"
922
+ },
923
+ "error_rate": {
924
+ "$ref": "#/$defs/Common.Ratio"
925
+ },
926
+ "average_latency_ms": {
927
+ "$ref": "#/$defs/Common.DurationMs"
928
+ },
929
+ "p95_latency_ms": {
930
+ "$ref": "#/$defs/Common.DurationMs"
931
+ },
932
+ "observed_cost_usd": {
933
+ "allOf": [
934
+ {
935
+ "$ref": "#/$defs/Common.CostUsd"
936
+ }
937
+ ],
938
+ "description": "Provider-sourced cost attributable to this cluster, absent when attribution is not defensible."
939
+ },
940
+ "cost_per_call_usd": {
941
+ "$ref": "#/$defs/Common.CostUsd"
942
+ },
943
+ "cost_attribution": {
944
+ "$ref": "#/$defs/Cost.ProviderCostAttribution"
945
+ },
946
+ "spend_share": {
947
+ "allOf": [
948
+ {
949
+ "$ref": "#/$defs/Common.Ratio"
950
+ }
951
+ ],
952
+ "description": "Fraction of attributable spend represented by this cluster."
953
+ },
954
+ "measurable_coverage": {
955
+ "allOf": [
956
+ {
957
+ "$ref": "#/$defs/Common.Ratio"
958
+ }
959
+ ],
960
+ "description": "Fraction of calls with a task-specific correctness signal."
961
+ },
962
+ "safe_deferral_coverage": {
963
+ "allOf": [
964
+ {
965
+ "$ref": "#/$defs/Common.Ratio"
966
+ }
967
+ ],
968
+ "description": "Fraction of calls proven safe to route to a residual path."
969
+ },
970
+ "candidate_path": {
971
+ "$ref": "#/$defs/Cost.GenAiEtlCandidatePath"
972
+ },
973
+ "validation_metric": {
974
+ "$ref": "#/$defs/Cost.GenAiEtlValidationMetric"
975
+ },
976
+ "residual_path": {
977
+ "$ref": "#/$defs/Cost.GenAiEtlResidualPath"
978
+ },
979
+ "evidence_signals": {
980
+ "type": "array",
981
+ "items": {
982
+ "$ref": "#/$defs/Cost.GenAiEtlEvidenceSignal"
983
+ }
984
+ },
985
+ "missing_evidence": {
986
+ "type": "array",
987
+ "items": {
988
+ "$ref": "#/$defs/Cost.GenAiEtlEvidenceSignal"
989
+ }
990
+ },
991
+ "promotion_gates": {
992
+ "type": "array",
993
+ "items": {
994
+ "$ref": "#/$defs/Cost.GenAiEtlPromotionGate"
995
+ }
996
+ }
997
+ },
998
+ "description": "Observed economics and evidence for one repeated GenAI workflow cluster."
999
+ },
1000
+ "Cost.GenAiEtlAuditEvaluationRequest": {
1001
+ "type": "object",
1002
+ "required": [
1003
+ "scenarios"
1004
+ ],
1005
+ "properties": {
1006
+ "scenarios": {
1007
+ "type": "array",
1008
+ "items": {
1009
+ "$ref": "#/$defs/Cost.GenAiEtlClusterScenario"
1010
+ },
1011
+ "minItems": 1,
1012
+ "maxItems": 100
1013
+ }
1014
+ },
1015
+ "description": "Batch of cluster scenarios evaluated against one audit period."
1016
+ },
1017
+ "Cost.GenAiEtlAuditEvaluationResponse": {
1018
+ "type": "object",
1019
+ "required": [
1020
+ "generated_at",
1021
+ "period_start",
1022
+ "period_end",
1023
+ "results"
1024
+ ],
1025
+ "properties": {
1026
+ "generated_at": {
1027
+ "type": "string",
1028
+ "format": "date-time"
1029
+ },
1030
+ "period_start": {
1031
+ "type": "string",
1032
+ "format": "date-time"
1033
+ },
1034
+ "period_end": {
1035
+ "type": "string",
1036
+ "format": "date-time"
1037
+ },
1038
+ "results": {
1039
+ "type": "array",
1040
+ "items": {
1041
+ "$ref": "#/$defs/Cost.GenAiEtlClusterEvaluation"
1042
+ }
1043
+ }
1044
+ },
1045
+ "description": "Batch result for ETL replacement scenarios."
1046
+ },
1047
+ "Cost.GenAiEtlAuditReport": {
1048
+ "type": "object",
1049
+ "required": [
1050
+ "generated_at",
1051
+ "period_start",
1052
+ "period_end",
1053
+ "summary",
1054
+ "cost_sources",
1055
+ "clusters"
1056
+ ],
1057
+ "properties": {
1058
+ "generated_at": {
1059
+ "type": "string",
1060
+ "format": "date-time"
1061
+ },
1062
+ "period_start": {
1063
+ "type": "string",
1064
+ "format": "date-time"
1065
+ },
1066
+ "period_end": {
1067
+ "type": "string",
1068
+ "format": "date-time"
1069
+ },
1070
+ "summary": {
1071
+ "$ref": "#/$defs/Cost.GenAiEtlAuditSummary"
1072
+ },
1073
+ "cost_sources": {
1074
+ "type": "array",
1075
+ "items": {
1076
+ "$ref": "#/$defs/Cost.ProviderCostSource"
1077
+ }
1078
+ },
1079
+ "clusters": {
1080
+ "type": "array",
1081
+ "items": {
1082
+ "$ref": "#/$defs/Cost.GenAiEtlAuditCluster"
1083
+ }
1084
+ }
1085
+ },
1086
+ "description": "Trace-level ETL audit for a bounded period."
1087
+ },
1088
+ "Cost.GenAiEtlAuditSummary": {
1089
+ "type": "object",
1090
+ "required": [
1091
+ "total_calls",
1092
+ "total_input_tokens",
1093
+ "total_output_tokens",
1094
+ "priced_call_coverage"
1095
+ ],
1096
+ "properties": {
1097
+ "total_calls": {
1098
+ "$ref": "#/$defs/Common.Count"
1099
+ },
1100
+ "total_input_tokens": {
1101
+ "$ref": "#/$defs/Common.TokenCount"
1102
+ },
1103
+ "total_output_tokens": {
1104
+ "$ref": "#/$defs/Common.TokenCount"
1105
+ },
1106
+ "attributed_cost_usd": {
1107
+ "allOf": [
1108
+ {
1109
+ "$ref": "#/$defs/Common.CostUsd"
1110
+ }
1111
+ ],
1112
+ "description": "Provider-sourced cost attributable to the returned trace population."
1113
+ },
1114
+ "priced_call_coverage": {
1115
+ "allOf": [
1116
+ {
1117
+ "$ref": "#/$defs/Common.Ratio"
1118
+ }
1119
+ ],
1120
+ "description": "Fraction of calls covered by provider cost attribution."
1121
+ },
1122
+ "economic_concentration": {
1123
+ "allOf": [
1124
+ {
1125
+ "$ref": "#/$defs/Common.Ratio"
1126
+ }
1127
+ ],
1128
+ "description": "Fraction of attributable spend represented by the returned top clusters."
1129
+ },
1130
+ "measurable_coverage": {
1131
+ "allOf": [
1132
+ {
1133
+ "$ref": "#/$defs/Common.Ratio"
1134
+ }
1135
+ ],
1136
+ "description": "Fraction of calls with a task-specific correctness signal."
1137
+ },
1138
+ "safe_deferral_coverage": {
1139
+ "allOf": [
1140
+ {
1141
+ "$ref": "#/$defs/Common.Ratio"
1142
+ }
1143
+ ],
1144
+ "description": "Fraction of calls proven safe to defer to a residual path."
1145
+ },
1146
+ "candidate_etl_spend_share": {
1147
+ "allOf": [
1148
+ {
1149
+ "$ref": "#/$defs/Common.Ratio"
1150
+ }
1151
+ ],
1152
+ "description": "Fraction of attributable spend attached to ETL-shaped candidates."
1153
+ }
1154
+ },
1155
+ "description": "Aggregate trace-level economics for the requested audit period."
1156
+ },
1157
+ "Cost.GenAiEtlCalculationStatus": {
1158
+ "type": "string",
1159
+ "enum": [
1160
+ "calculated",
1161
+ "missing_frontier_cost"
1162
+ ],
1163
+ "description": "Whether the replaceable-value formula had a defensible baseline cost."
1164
+ },
1165
+ "Cost.GenAiEtlCandidatePath": {
1166
+ "type": "string",
1167
+ "enum": [
1168
+ "exact_cache",
1169
+ "deterministic_code",
1170
+ "bounded_retrieval",
1171
+ "small_classifier_extractor",
1172
+ "smaller_generative_model",
1173
+ "frontier_model",
1174
+ "insufficient_evidence"
1175
+ ],
1176
+ "description": "Lowest-risk implementation class suggested by currently available evidence."
1177
+ },
1178
+ "Cost.GenAiEtlClusterEvaluation": {
1179
+ "type": "object",
1180
+ "required": [
1181
+ "cluster_id",
1182
+ "status",
1183
+ "call_count",
1184
+ "coverage",
1185
+ "served_call_count",
1186
+ "residual_call_count",
1187
+ "frontier_cost_basis",
1188
+ "alternative_cost_per_call_usd",
1189
+ "period_maintenance_cost_usd",
1190
+ "period_error_cost_usd"
1191
+ ],
1192
+ "properties": {
1193
+ "cluster_id": {
1194
+ "type": "string"
1195
+ },
1196
+ "status": {
1197
+ "$ref": "#/$defs/Cost.GenAiEtlCalculationStatus"
1198
+ },
1199
+ "call_count": {
1200
+ "$ref": "#/$defs/Common.Count"
1201
+ },
1202
+ "coverage": {
1203
+ "$ref": "#/$defs/Common.Ratio"
1204
+ },
1205
+ "served_call_count": {
1206
+ "type": "number",
1207
+ "format": "double"
1208
+ },
1209
+ "residual_call_count": {
1210
+ "type": "number",
1211
+ "format": "double"
1212
+ },
1213
+ "frontier_cost_per_call_usd": {
1214
+ "$ref": "#/$defs/Common.CostUsd"
1215
+ },
1216
+ "frontier_cost_basis": {
1217
+ "$ref": "#/$defs/Cost.ProviderCostAttribution"
1218
+ },
1219
+ "alternative_cost_per_call_usd": {
1220
+ "$ref": "#/$defs/Common.CostUsd"
1221
+ },
1222
+ "current_period_cost_usd": {
1223
+ "$ref": "#/$defs/Common.CostUsd"
1224
+ },
1225
+ "gross_replaceable_value_usd": {
1226
+ "type": "number",
1227
+ "format": "double"
1228
+ },
1229
+ "period_maintenance_cost_usd": {
1230
+ "$ref": "#/$defs/Common.CostUsd"
1231
+ },
1232
+ "period_error_cost_usd": {
1233
+ "$ref": "#/$defs/Common.CostUsd"
1234
+ },
1235
+ "net_replaceable_value_usd": {
1236
+ "type": "number",
1237
+ "format": "double",
1238
+ "description": "Net period value; this may be negative when maintenance or error cost exceeds gross savings."
1239
+ }
1240
+ },
1241
+ "description": "Result of replaceable_value = calls * coverage * (frontier - alternative) - maintenance - error."
1242
+ },
1243
+ "Cost.GenAiEtlClusterScenario": {
1244
+ "type": "object",
1245
+ "required": [
1246
+ "cluster_id",
1247
+ "coverage",
1248
+ "alternative_cost_per_call_usd",
1249
+ "period_maintenance_cost_usd",
1250
+ "period_error_cost_usd"
1251
+ ],
1252
+ "properties": {
1253
+ "cluster_id": {
1254
+ "type": "string"
1255
+ },
1256
+ "coverage": {
1257
+ "allOf": [
1258
+ {
1259
+ "$ref": "#/$defs/Common.Ratio"
1260
+ }
1261
+ ],
1262
+ "description": "Fraction of cluster calls the replacement is expected to serve safely."
1263
+ },
1264
+ "frontier_cost_per_call_usd": {
1265
+ "allOf": [
1266
+ {
1267
+ "$ref": "#/$defs/Common.CostUsd"
1268
+ }
1269
+ ],
1270
+ "description": "Explicit baseline cost per call. When absent, qyl uses provider-attributed cluster cost and otherwise fails closed."
1271
+ },
1272
+ "alternative_cost_per_call_usd": {
1273
+ "$ref": "#/$defs/Common.CostUsd"
1274
+ },
1275
+ "period_maintenance_cost_usd": {
1276
+ "$ref": "#/$defs/Common.CostUsd"
1277
+ },
1278
+ "period_error_cost_usd": {
1279
+ "$ref": "#/$defs/Common.CostUsd"
1280
+ }
1281
+ },
1282
+ "description": "What-if assumptions for one workflow cluster over the requested period."
1283
+ },
1284
+ "Cost.GenAiEtlEvidenceSignal": {
1285
+ "type": "string",
1286
+ "enum": [
1287
+ "workflow_identity",
1288
+ "output_contract",
1289
+ "provider_model",
1290
+ "token_usage",
1291
+ "provider_cost",
1292
+ "recurring_schema",
1293
+ "bounded_reference",
1294
+ "task_metric",
1295
+ "accepted_output_replay",
1296
+ "downstream_fate",
1297
+ "calibrated_confidence",
1298
+ "shadow_comparison",
1299
+ "fallback_policy"
1300
+ ],
1301
+ "description": "Observable evidence needed to promote an inferred replacement safely."
1302
+ },
1303
+ "Cost.GenAiEtlOutputContract": {
1304
+ "type": "string",
1305
+ "enum": [
1306
+ "prose",
1307
+ "label",
1308
+ "span_list",
1309
+ "record",
1310
+ "vector",
1311
+ "catalog_reference",
1312
+ "number",
1313
+ "boolean",
1314
+ "unknown"
1315
+ ],
1316
+ "description": "Machine-readable output contract inferred for a workflow cluster."
1317
+ },
1318
+ "Cost.GenAiEtlPromotionGate": {
1319
+ "type": "object",
1320
+ "required": [
1321
+ "gate",
1322
+ "state"
1323
+ ],
1324
+ "properties": {
1325
+ "gate": {
1326
+ "$ref": "#/$defs/Cost.GenAiEtlPromotionGateKind"
1327
+ },
1328
+ "state": {
1329
+ "$ref": "#/$defs/Cost.GenAiEtlPromotionGateState"
1330
+ },
1331
+ "reason": {
1332
+ "type": "string",
1333
+ "description": "Stable evidence code explaining the current gate state."
1334
+ }
1335
+ },
1336
+ "description": "Promotion readiness for one gate."
1337
+ },
1338
+ "Cost.GenAiEtlPromotionGateKind": {
1339
+ "type": "string",
1340
+ "enum": [
1341
+ "contract_stability",
1342
+ "offline_replay",
1343
+ "calibrated_confidence",
1344
+ "shadow_traffic",
1345
+ "limited_serving",
1346
+ "rollback_residual_policy"
1347
+ ],
1348
+ "description": "Promotion gate from replay through limited serving and rollback."
1349
+ },
1350
+ "Cost.GenAiEtlPromotionGateState": {
1351
+ "type": "string",
1352
+ "enum": [
1353
+ "passed",
1354
+ "failed",
1355
+ "not_evaluated",
1356
+ "blocked_missing_evidence"
1357
+ ],
1358
+ "description": "Evaluation state of a promotion gate."
1359
+ },
1360
+ "Cost.GenAiEtlResidualPath": {
1361
+ "type": "string",
1362
+ "enum": [
1363
+ "frontier_model",
1364
+ "human_review",
1365
+ "retry",
1366
+ "degraded_response",
1367
+ "none",
1368
+ "undetermined"
1369
+ ],
1370
+ "description": "Fallback used for requests outside a promoted replacement's safe coverage."
1371
+ },
1372
+ "Cost.GenAiEtlTaskFamily": {
1373
+ "type": "string",
1374
+ "enum": [
1375
+ "open_reasoning_generation",
1376
+ "classification",
1377
+ "sequence_labeling",
1378
+ "structured_extraction",
1379
+ "retrieval_entity_resolution",
1380
+ "similarity_clustering",
1381
+ "normalization_transformation",
1382
+ "numeric_analytical",
1383
+ "unknown"
1384
+ ],
1385
+ "description": "Task family inferred for a repeated GenAI workflow cluster."
1386
+ },
1387
+ "Cost.GenAiEtlValidationMetric": {
1388
+ "type": "string",
1389
+ "enum": [
1390
+ "accuracy",
1391
+ "macro_f1",
1392
+ "span_f1",
1393
+ "field_exact_match",
1394
+ "schema_validity",
1395
+ "match_accuracy",
1396
+ "recall_at_k",
1397
+ "mean_reciprocal_rank",
1398
+ "exact_match",
1399
+ "numeric_tolerance",
1400
+ "human_preference",
1401
+ "task_success",
1402
+ "unavailable"
1403
+ ],
1404
+ "description": "Task-specific metric that can falsify a proposed replacement."
1405
+ },
1406
+ "Cost.ProviderCostAttribution": {
1407
+ "type": "string",
1408
+ "enum": [
1409
+ "provider_model_period",
1410
+ "provider_period",
1411
+ "scenario",
1412
+ "unavailable"
1413
+ ],
1414
+ "description": "Granularity at which a cost value can be attributed to telemetry."
1415
+ },
1416
+ "Cost.ProviderCostSource": {
1417
+ "type": "object",
1418
+ "required": [
1419
+ "provider",
1420
+ "kind",
1421
+ "status",
1422
+ "source_endpoint",
1423
+ "attribution"
1424
+ ],
1425
+ "properties": {
1426
+ "provider": {
1427
+ "type": "string",
1428
+ "description": "Canonical GenAI provider or cloud billing system name."
1429
+ },
1430
+ "kind": {
1431
+ "allOf": [
1432
+ {
1433
+ "$ref": "#/$defs/Cost.ProviderCostSourceKind"
1434
+ }
1435
+ ],
1436
+ "description": "Whether the API returned billed cost or a public catalog price."
1437
+ },
1438
+ "status": {
1439
+ "allOf": [
1440
+ {
1441
+ "$ref": "#/$defs/Cost.ProviderCostSourceStatus"
1442
+ }
1443
+ ],
1444
+ "description": "Current synchronization and attribution state."
1445
+ },
1446
+ "source_endpoint": {
1447
+ "allOf": [
1448
+ {
1449
+ "$ref": "#/$defs/Common.UrlString"
1450
+ }
1451
+ ],
1452
+ "description": "Official provider-owned API endpoint used for the fetch."
1453
+ },
1454
+ "attribution": {
1455
+ "allOf": [
1456
+ {
1457
+ "$ref": "#/$defs/Cost.ProviderCostAttribution"
1458
+ }
1459
+ ],
1460
+ "description": "Attribution granularity supported by this source response."
1461
+ },
1462
+ "last_attempt_at": {
1463
+ "type": "string",
1464
+ "format": "date-time",
1465
+ "description": "UTC time of the latest fetch attempt."
1466
+ },
1467
+ "last_success_at": {
1468
+ "type": "string",
1469
+ "format": "date-time",
1470
+ "description": "UTC time of the latest successful fetch."
1471
+ },
1472
+ "period_start": {
1473
+ "type": "string",
1474
+ "format": "date-time",
1475
+ "description": "Start of the provider billing or catalog validity period."
1476
+ },
1477
+ "period_end": {
1478
+ "type": "string",
1479
+ "format": "date-time",
1480
+ "description": "End of the provider billing or catalog validity period."
1481
+ },
1482
+ "currency_code": {
1483
+ "type": "string",
1484
+ "description": "ISO 4217 currency code returned by the provider."
1485
+ },
1486
+ "reported_cost_usd": {
1487
+ "allOf": [
1488
+ {
1489
+ "$ref": "#/$defs/Common.CostUsd"
1490
+ }
1491
+ ],
1492
+ "description": "Cost returned by the provider for this period, converted from provider-declared USD units without rate inference."
1493
+ },
1494
+ "model": {
1495
+ "type": "string",
1496
+ "description": "Model identifier returned by the provider when the source supports it."
1497
+ },
1498
+ "failure_category": {
1499
+ "type": "string",
1500
+ "description": "Stable, non-sensitive failure category for the last attempt."
1501
+ }
1502
+ },
1503
+ "description": "Provenance for cost data fetched directly from a provider-owned API."
1504
+ },
1505
+ "Cost.ProviderCostSourceKind": {
1506
+ "type": "string",
1507
+ "enum": [
1508
+ "actual_billed_cost",
1509
+ "official_public_catalog"
1510
+ ],
1511
+ "description": "How a provider-owned API supplied a cost value."
1512
+ },
1513
+ "Cost.ProviderCostSourceStatus": {
1514
+ "type": "string",
1515
+ "enum": [
1516
+ "unconfigured",
1517
+ "current",
1518
+ "stale",
1519
+ "sync_failed",
1520
+ "not_attributable"
1521
+ ],
1522
+ "description": "Current synchronization state for a provider-owned cost source."
1523
+ },
845
1524
  "Domains.Observe.Session.DeviceType": {
846
1525
  "type": "string",
847
1526
  "enum": [
@@ -1124,11 +1803,6 @@
1124
1803
  "type": "string"
1125
1804
  },
1126
1805
  "description": "Providers used in session"
1127
- },
1128
- "estimated_cost_usd": {
1129
- "type": "number",
1130
- "format": "double",
1131
- "description": "Estimated cost in USD"
1132
1806
  }
1133
1807
  },
1134
1808
  "description": "Session GenAI usage summary"