@ancplua/qyl-api-schema 0.5.12 → 0.5.14

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.
package/api/routes.tsp CHANGED
@@ -183,7 +183,9 @@ interface GenAiEtlAuditApi {
183
183
  @get
184
184
  report(
185
185
  ...ProjectScopeHeader,
186
+ @doc("Optional audit-period start. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.")
186
187
  @query startTime?: utcDateTime,
188
+ @doc("Optional audit-period end. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.")
187
189
  @query endTime?: utcDateTime,
188
190
  @query @minValue(1) @maxValue(100) limit?: int32 = 25,
189
191
  ): GenAiEtlAuditReport | ValidationError | UnauthorizedError | InternalServerError;
@@ -192,7 +194,9 @@ interface GenAiEtlAuditApi {
192
194
  @route("/evaluate")
193
195
  evaluate(
194
196
  ...ProjectScopeHeader,
197
+ @doc("Optional audit-period start. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.")
195
198
  @query startTime?: utcDateTime,
199
+ @doc("Optional audit-period end. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.")
196
200
  @query endTime?: utcDateTime,
197
201
  @body request: GenAiEtlAuditEvaluationRequest,
198
202
  ): GenAiEtlAuditEvaluationResponse | ValidationError | UnauthorizedError | InternalServerError;
@@ -848,7 +848,6 @@
848
848
  "cluster_id",
849
849
  "workflow_key",
850
850
  "service_name",
851
- "span_name",
852
851
  "output_contract",
853
852
  "task_family",
854
853
  "call_count",
@@ -863,7 +862,7 @@
863
862
  "p95_latency_ms",
864
863
  "cost_attribution",
865
864
  "candidate_path",
866
- "validation_metric",
865
+ "validation_metrics",
867
866
  "residual_path",
868
867
  "evidence_signals",
869
868
  "missing_evidence",
@@ -876,13 +875,14 @@
876
875
  },
877
876
  "workflow_key": {
878
877
  "type": "string",
879
- "description": "Privacy-safe workflow identity used to group repeated calls."
878
+ "description": "Privacy-safe derived grouping identity used to group repeated calls."
880
879
  },
881
880
  "service_name": {
882
881
  "type": "string"
883
882
  },
884
883
  "span_name": {
885
- "type": "string"
884
+ "type": "string",
885
+ "description": "Present only when an upstream source proves or canonicalizes a low-cardinality, privacy-safe span name."
886
886
  },
887
887
  "operation_name": {
888
888
  "type": "string"
@@ -970,8 +970,13 @@
970
970
  "candidate_path": {
971
971
  "$ref": "#/$defs/Cost.GenAiEtlCandidatePath"
972
972
  },
973
- "validation_metric": {
974
- "$ref": "#/$defs/Cost.GenAiEtlValidationMetric"
973
+ "validation_metrics": {
974
+ "type": "array",
975
+ "items": {
976
+ "$ref": "#/$defs/Cost.GenAiEtlValidationMetric"
977
+ },
978
+ "minItems": 1,
979
+ "description": "Task-specific metrics required to falsify the proposed replacement."
975
980
  },
976
981
  "residual_path": {
977
982
  "$ref": "#/$defs/Cost.GenAiEtlResidualPath"
@@ -1389,6 +1394,9 @@
1389
1394
  "enum": [
1390
1395
  "accuracy",
1391
1396
  "macro_f1",
1397
+ "calibration_error",
1398
+ "span_precision",
1399
+ "span_recall",
1392
1400
  "span_f1",
1393
1401
  "field_exact_match",
1394
1402
  "schema_validity",
@@ -1401,7 +1409,7 @@
1401
1409
  "task_success",
1402
1410
  "unavailable"
1403
1411
  ],
1404
- "description": "Task-specific metric that can falsify a proposed replacement."
1412
+ "description": "Task-specific metrics that can falsify a proposed replacement."
1405
1413
  },
1406
1414
  "Cost.ProviderCostAttribution": {
1407
1415
  "type": "string",
@@ -1514,6 +1522,7 @@
1514
1522
  "type": "string",
1515
1523
  "enum": [
1516
1524
  "unconfigured",
1525
+ "pending",
1517
1526
  "current",
1518
1527
  "stale",
1519
1528
  "sync_failed",
@@ -76,6 +76,7 @@
76
76
  "name": "startTime",
77
77
  "in": "query",
78
78
  "required": false,
79
+ "description": "Optional audit-period start. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.",
79
80
  "schema": {
80
81
  "type": "string",
81
82
  "format": "date-time"
@@ -86,6 +87,7 @@
86
87
  "name": "endTime",
87
88
  "in": "query",
88
89
  "required": false,
90
+ "description": "Optional audit-period end. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.",
89
91
  "schema": {
90
92
  "type": "string",
91
93
  "format": "date-time"
@@ -224,6 +226,7 @@
224
226
  "name": "startTime",
225
227
  "in": "query",
226
228
  "required": false,
229
+ "description": "Optional audit-period start. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.",
227
230
  "schema": {
228
231
  "type": "string",
229
232
  "format": "date-time"
@@ -234,6 +237,7 @@
234
237
  "name": "endTime",
235
238
  "in": "query",
236
239
  "required": false,
240
+ "description": "Optional audit-period end. Omitted dates select the previous 30 completed UTC days; an explicit range may not exceed 180 days.",
237
241
  "schema": {
238
242
  "type": "string",
239
243
  "format": "date-time"
@@ -4844,7 +4848,6 @@
4844
4848
  "cluster_id",
4845
4849
  "workflow_key",
4846
4850
  "service_name",
4847
- "span_name",
4848
4851
  "output_contract",
4849
4852
  "task_family",
4850
4853
  "call_count",
@@ -4859,7 +4862,7 @@
4859
4862
  "p95_latency_ms",
4860
4863
  "cost_attribution",
4861
4864
  "candidate_path",
4862
- "validation_metric",
4865
+ "validation_metrics",
4863
4866
  "residual_path",
4864
4867
  "evidence_signals",
4865
4868
  "missing_evidence",
@@ -4872,13 +4875,14 @@
4872
4875
  },
4873
4876
  "workflow_key": {
4874
4877
  "type": "string",
4875
- "description": "Privacy-safe workflow identity used to group repeated calls."
4878
+ "description": "Privacy-safe derived grouping identity used to group repeated calls."
4876
4879
  },
4877
4880
  "service_name": {
4878
4881
  "type": "string"
4879
4882
  },
4880
4883
  "span_name": {
4881
- "type": "string"
4884
+ "type": "string",
4885
+ "description": "Present only when an upstream source proves or canonicalizes a low-cardinality, privacy-safe span name."
4882
4886
  },
4883
4887
  "operation_name": {
4884
4888
  "type": "string"
@@ -4966,8 +4970,13 @@
4966
4970
  "candidate_path": {
4967
4971
  "$ref": "#/components/schemas/Cost.GenAiEtlCandidatePath"
4968
4972
  },
4969
- "validation_metric": {
4970
- "$ref": "#/components/schemas/Cost.GenAiEtlValidationMetric"
4973
+ "validation_metrics": {
4974
+ "type": "array",
4975
+ "items": {
4976
+ "$ref": "#/components/schemas/Cost.GenAiEtlValidationMetric"
4977
+ },
4978
+ "minItems": 1,
4979
+ "description": "Task-specific metrics required to falsify the proposed replacement."
4971
4980
  },
4972
4981
  "residual_path": {
4973
4982
  "$ref": "#/components/schemas/Cost.GenAiEtlResidualPath"
@@ -5385,6 +5394,9 @@
5385
5394
  "enum": [
5386
5395
  "accuracy",
5387
5396
  "macro_f1",
5397
+ "calibration_error",
5398
+ "span_precision",
5399
+ "span_recall",
5388
5400
  "span_f1",
5389
5401
  "field_exact_match",
5390
5402
  "schema_validity",
@@ -5397,7 +5409,7 @@
5397
5409
  "task_success",
5398
5410
  "unavailable"
5399
5411
  ],
5400
- "description": "Task-specific metric that can falsify a proposed replacement."
5412
+ "description": "Task-specific metrics that can falsify a proposed replacement."
5401
5413
  },
5402
5414
  "Cost.ProviderCostAttribution": {
5403
5415
  "type": "string",
@@ -5510,6 +5522,7 @@
5510
5522
  "type": "string",
5511
5523
  "enum": [
5512
5524
  "unconfigured",
5525
+ "pending",
5513
5526
  "current",
5514
5527
  "stale",
5515
5528
  "sync_failed",
@@ -296,6 +296,7 @@ export declare const ProviderCostSourceKindValues: {
296
296
  export type ProviderCostSourceKind = typeof ProviderCostSourceKindValues[keyof typeof ProviderCostSourceKindValues];
297
297
  export declare const ProviderCostSourceStatusValues: {
298
298
  readonly unconfigured: "unconfigured";
299
+ readonly pending: "pending";
299
300
  readonly current: "current";
300
301
  readonly stale: "stale";
301
302
  readonly syncFailed: "sync_failed";
@@ -362,6 +363,9 @@ export type GenAiEtlCandidatePath = typeof GenAiEtlCandidatePathValues[keyof typ
362
363
  export declare const GenAiEtlValidationMetricValues: {
363
364
  readonly accuracy: "accuracy";
364
365
  readonly macroF1: "macro_f1";
366
+ readonly calibrationError: "calibration_error";
367
+ readonly spanPrecision: "span_precision";
368
+ readonly spanRecall: "span_recall";
365
369
  readonly spanF1: "span_f1";
366
370
  readonly fieldExactMatch: "field_exact_match";
367
371
  readonly schemaValidity: "schema_validity";
@@ -1077,7 +1081,7 @@ export interface GenAiEtlAuditCluster {
1077
1081
  "cluster_id": string;
1078
1082
  "workflow_key": string;
1079
1083
  "service_name": string;
1080
- "span_name": string;
1084
+ "span_name"?: string;
1081
1085
  "operation_name"?: string;
1082
1086
  "provider"?: string;
1083
1087
  "model"?: string;
@@ -1100,7 +1104,7 @@ export interface GenAiEtlAuditCluster {
1100
1104
  "measurable_coverage"?: number;
1101
1105
  "safe_deferral_coverage"?: number;
1102
1106
  "candidate_path": GenAiEtlCandidatePath;
1103
- "validation_metric": GenAiEtlValidationMetric;
1107
+ "validation_metrics": GenAiEtlValidationMetric[];
1104
1108
  "residual_path": GenAiEtlResidualPath;
1105
1109
  "evidence_signals": GenAiEtlEvidenceSignal[];
1106
1110
  "missing_evidence": GenAiEtlEvidenceSignal[];
@@ -254,6 +254,7 @@ export const ProviderCostSourceKindValues = {
254
254
  };
255
255
  export const ProviderCostSourceStatusValues = {
256
256
  "unconfigured": "unconfigured",
257
+ "pending": "pending",
257
258
  "current": "current",
258
259
  "stale": "stale",
259
260
  "syncFailed": "sync_failed",
@@ -313,6 +314,9 @@ export const GenAiEtlCandidatePathValues = {
313
314
  export const GenAiEtlValidationMetricValues = {
314
315
  "accuracy": "accuracy",
315
316
  "macroF1": "macro_f1",
317
+ "calibrationError": "calibration_error",
318
+ "spanPrecision": "span_precision",
319
+ "spanRecall": "span_recall",
316
320
  "spanF1": "span_f1",
317
321
  "fieldExactMatch": "field_exact_match",
318
322
  "schemaValidity": "schema_validity",
@@ -24,6 +24,9 @@ enum ProviderCostSourceStatus {
24
24
  @doc("The source has no configured provider credential or cloud identity.")
25
25
  unconfigured: "unconfigured",
26
26
 
27
+ @doc("A provider credential or cloud identity is configured, but no fetch has completed yet.")
28
+ pending: "pending",
29
+
27
30
  @doc("The most recent provider fetch completed inside its freshness window.")
28
31
  current: "current",
29
32
 
@@ -140,10 +143,13 @@ enum GenAiEtlCandidatePath {
140
143
  insufficientEvidence: "insufficient_evidence",
141
144
  }
142
145
 
143
- @doc("Task-specific metric that can falsify a proposed replacement.")
146
+ @doc("Task-specific metrics that can falsify a proposed replacement.")
144
147
  enum GenAiEtlValidationMetric {
145
148
  accuracy: "accuracy",
146
149
  macroF1: "macro_f1",
150
+ calibrationError: "calibration_error",
151
+ spanPrecision: "span_precision",
152
+ spanRecall: "span_recall",
147
153
  spanF1: "span_f1",
148
154
  fieldExactMatch: "field_exact_match",
149
155
  schemaValidity: "schema_validity",
@@ -217,15 +223,16 @@ model GenAiEtlAuditCluster {
217
223
  @encodedName("application/json", "cluster_id")
218
224
  clusterId: string;
219
225
 
220
- @doc("Privacy-safe workflow identity used to group repeated calls.")
226
+ @doc("Privacy-safe derived grouping identity used to group repeated calls.")
221
227
  @encodedName("application/json", "workflow_key")
222
228
  workflowKey: string;
223
229
 
224
230
  @encodedName("application/json", "service_name")
225
231
  serviceName: string;
226
232
 
233
+ @doc("Present only when an upstream source proves or canonicalizes a low-cardinality, privacy-safe span name.")
227
234
  @encodedName("application/json", "span_name")
228
- spanName: string;
235
+ spanName?: string;
229
236
 
230
237
  @encodedName("application/json", "operation_name")
231
238
  operationName?: string;
@@ -296,8 +303,10 @@ model GenAiEtlAuditCluster {
296
303
  @encodedName("application/json", "candidate_path")
297
304
  candidatePath: GenAiEtlCandidatePath;
298
305
 
299
- @encodedName("application/json", "validation_metric")
300
- validationMetric: GenAiEtlValidationMetric;
306
+ @doc("Task-specific metrics required to falsify the proposed replacement.")
307
+ @encodedName("application/json", "validation_metrics")
308
+ @minItems(1)
309
+ validationMetrics: GenAiEtlValidationMetric[];
301
310
 
302
311
  @encodedName("application/json", "residual_path")
303
312
  residualPath: GenAiEtlResidualPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancplua/qyl-api-schema",
3
- "version": "0.5.12",
3
+ "version": "0.5.14",
4
4
  "description": "TypeSpec source of truth for qyl API contracts. Emits OpenAPI, JSON Schema, Qyl.Api.Contracts DTOs, and TypeScript contract types; not an OpenTelemetry package, storage schema, or server implementation.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {