@ancplua/qyl-api-schema 0.2.2 → 0.3.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.
@@ -4,8 +4,6 @@
4
4
  // Canonical reasoning model over telemetry data. Schema-driven, generated,
5
5
  // deterministic. Defines diagnostic patterns, causal rules, and investigation
6
6
  // strategies as typed data consumed by Loom, MCP, and dashboard.
7
- //
8
- // Source of truth: specs/telemetry-intelligence.md
9
7
  // =============================================================================
10
8
 
11
9
  import "@typespec/openapi";
@@ -2,8 +2,7 @@
2
2
  // ANcpLua v2.0 - Seed Diagnostic Patterns (v1)
3
3
  // =============================================================================
4
4
  // 19 initial diagnostic patterns (10 infra + 9 agent behavioral)
5
- // Source: specs/telemetry-intelligence.md §5.1 + Microsoft Research AgentRx (March 2026)
6
- // These compile to static registries in DiagnosticPatterns.g.cs.
5
+ // Source: Microsoft Research AgentRx (March 2026)
7
6
  //
8
7
  // Signal attributes reference:
9
8
  // - OTel semantic attributes (status_code, duration_ns, etc.)
@@ -1,8 +1,7 @@
1
1
  // =============================================================================
2
2
  // ANcpLua v2.0 - Seed Causal Rules (v1)
3
3
  // =============================================================================
4
- // 6 initial causal rules. Source: specs/telemetry-intelligence.md §5.2
5
- // These compile to static registries in CausalRules.g.cs.
4
+ // 6 initial causal rules.
6
5
  // =============================================================================
7
6
 
8
7
  namespace Qyl.Api.Contracts.Intelligence.Seed;
@@ -1,8 +1,7 @@
1
1
  // =============================================================================
2
2
  // ANcpLua v2.0 - Seed Investigation Strategies (v1)
3
3
  // =============================================================================
4
- // 4 initial investigation strategies. Source: specs/telemetry-intelligence.md §5.3
5
- // These compile to static registries in InvestigationStrategies.g.cs.
4
+ // 4 initial investigation strategies.
6
5
  //
7
6
  // Trigger patterns use category:X syntax for category-wide triggers.
8
7
  // Query templates are abstract qyl investigation hints; the runtime decides how to execute them.
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Agent Run Contract Model (OTel v1.40)
2
+ // ANcpLua v2.0 - Agent Run Contract Model
3
3
  // =============================================================================
4
4
  // Agent run records extracted from OTLP spans.
5
5
  // Maps OTel GenAI semantic convention attributes to qyl API contract fields.
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Tool Call Contract Model (OTel v1.40)
2
+ // ANcpLua v2.0 - Tool Call Contract Model
3
3
  // =============================================================================
4
4
  // Tool call records extracted from OTLP spans.
5
5
  // Maps OTel GenAI tool semantic convention attributes to qyl API contract fields.
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Workflow Checkpoint Contract Model (OTel v1.40)
2
+ // ANcpLua v2.0 - Workflow Checkpoint Contract Model
3
3
  // =============================================================================
4
4
  // Checkpoint state persistence for workflow execution recovery.
5
5
  // Enables resume-from-checkpoint after failures or cancellations.
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Workflow Execution Contract Model (OTel v1.40)
2
+ // ANcpLua v2.0 - Workflow Execution Contract Model
3
3
  // =============================================================================
4
4
  // Workflow execution tracking for multi-step AI agent workflows.
5
5
  // Defines the public qyl workflow execution contract.
package/models/db.tsp CHANGED
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Database Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - Database Semantic Conventions
3
3
  // =============================================================================
4
4
  // Database telemetry attributes with 45+ DBMS types.
5
5
  // =============================================================================
@@ -33,10 +33,10 @@ enum DbVersions {
33
33
  }
34
34
 
35
35
  // =============================================================================
36
- // Database Span Attributes (Complete OTel v1.40)
36
+ // Database Span Attributes
37
37
  // =============================================================================
38
38
 
39
- @doc("Database span attributes following OTel Semantic Conventions v1.40")
39
+ @doc("Database span attributes following OTel Semantic Conventions")
40
40
  model DbAttributes {
41
41
  // ---------------------------------------------------------------------------
42
42
  // System & Connection
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Deployment Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - Deployment Semantic Conventions
3
3
  // =============================================================================
4
4
  // Deployment/release telemetry attributes.
5
5
  // =============================================================================
package/models/error.tsp CHANGED
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Error Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - Error Semantic Conventions
3
3
  // =============================================================================
4
4
  // Error type and error handling telemetry attributes.
5
5
  // =============================================================================
package/models/genai.tsp CHANGED
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - GenAI Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - GenAI Semantic Conventions
3
3
  // =============================================================================
4
4
  // Comprehensive AI/LLM telemetry following OpenTelemetry GenAI specifications.
5
5
  // https://opentelemetry.io/docs/specs/semconv/gen-ai/
@@ -47,10 +47,10 @@ enum GenAiVersions {
47
47
  }
48
48
 
49
49
  // =============================================================================
50
- // GenAI Span Attributes (Complete OTel v1.40)
50
+ // GenAI Span Attributes
51
51
  // =============================================================================
52
52
 
53
- @doc("GenAI span attributes following OTel Semantic Conventions v1.40")
53
+ @doc("GenAI span attributes following OTel Semantic Conventions")
54
54
  model GenAiSpanAttributes {
55
55
  // ---------------------------------------------------------------------------
56
56
  // Provider & System (REQUIRED)
@@ -60,11 +60,6 @@ model GenAiSpanAttributes {
60
60
  @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.ProviderName)
61
61
  providerName: GenAiProvider;
62
62
 
63
- @doc("The name of the GenAI system/product (e.g., 'ChatGPT', 'Claude', 'Gemini')")
64
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.System)
65
- @removed(GenAiVersions.v1_37)
66
- system?: string;
67
-
68
63
  // ---------------------------------------------------------------------------
69
64
  // Operation Details
70
65
  // ---------------------------------------------------------------------------
@@ -184,20 +179,6 @@ model GenAiSpanAttributes {
184
179
  @added(GenAiVersions.v1_40)
185
180
  usageCacheCreationInputTokens?: TokenCount;
186
181
 
187
- // ---------------------------------------------------------------------------
188
- // Deprecated Attributes (for migration)
189
- // ---------------------------------------------------------------------------
190
-
191
- @doc("Prompt tokens (deprecated - use gen_ai.usage.input_tokens)")
192
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.UsagePromptTokens)
193
- @removed(GenAiVersions.v1_28)
194
- usagePromptTokens?: TokenCount;
195
-
196
- @doc("Completion tokens (deprecated - use gen_ai.usage.output_tokens)")
197
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.UsageCompletionTokens)
198
- @removed(GenAiVersions.v1_28)
199
- usageCompletionTokens?: TokenCount;
200
-
201
182
  // ---------------------------------------------------------------------------
202
183
  // Agent Attributes (v1.38+)
203
184
  // ---------------------------------------------------------------------------
@@ -294,10 +275,6 @@ model GenAiSpanAttributes {
294
275
  @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.OutputType)
295
276
  outputType?: GenAiOutputType;
296
277
 
297
- @doc("Prompt content (may be redacted)")
298
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.Prompt)
299
- prompt?: string;
300
-
301
278
  @doc("Name of the prompt template being used")
302
279
  @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.PromptName)
303
280
  promptName?: string;
@@ -306,10 +283,6 @@ model GenAiSpanAttributes {
306
283
  @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.SystemInstructions)
307
284
  systemInstructions?: string;
308
285
 
309
- @doc("Completion content (may be redacted)")
310
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.Completion)
311
- completion?: string;
312
-
313
286
  // ---------------------------------------------------------------------------
314
287
  // Extended Request Attributes
315
288
  // ---------------------------------------------------------------------------
@@ -507,7 +480,7 @@ model GenAiCostEstimate {
507
480
  }
508
481
 
509
482
  // =============================================================================
510
- // GenAI Enumerations (18+ enums as promised)
483
+ // GenAI Enumerations
511
484
  // =============================================================================
512
485
 
513
486
  // =============================================================================
@@ -1329,40 +1302,21 @@ model LatencyPercentiles {
1329
1302
  // Vendor-Specific Extensions (OTel 1.40)
1330
1303
  // =============================================================================
1331
1304
 
1332
- @doc("OpenAI-specific request attributes")
1305
+ @doc("OpenAI-specific request attributes (OTel 1.42 moved these to the openai.* namespace; response_format and seed graduated to the generic gen_ai.output.type / gen_ai.request.seed)")
1333
1306
  model OpenAiRequestAttributes {
1334
- @doc("Response format requested (text, json_object, json_schema)")
1335
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.OpenaiRequestResponseFormat)
1336
- responseFormat?: OpenAiResponseFormat;
1337
-
1338
- @doc("Random seed for deterministic generation")
1339
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.OpenaiRequestSeed)
1340
- seed?: int64;
1341
-
1342
1307
  @doc("Service tier for the request (auto, default, etc.)")
1343
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.OpenaiRequestServiceTier)
1308
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Openai.RequestServiceTier)
1344
1309
  serviceTier?: string;
1345
1310
  }
1346
1311
 
1347
1312
  @doc("OpenAI-specific response attributes")
1348
1313
  model OpenAiResponseAttributes {
1349
1314
  @doc("Service tier used for the response")
1350
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.OpenaiResponseServiceTier)
1315
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Openai.ResponseServiceTier)
1351
1316
  serviceTier?: string;
1352
1317
 
1353
1318
  @doc("System fingerprint for reproducibility")
1354
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.OpenaiResponseSystemFingerprint)
1319
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.Openai.ResponseSystemFingerprint)
1355
1320
  systemFingerprint?: string;
1356
1321
  }
1357
1322
 
1358
- @doc("OpenAI response format types")
1359
- enum OpenAiResponseFormat {
1360
- @doc("Plain text response")
1361
- text: "text",
1362
-
1363
- @doc("JSON object response")
1364
- jsonObject: "json_object",
1365
-
1366
- @doc("JSON schema-constrained response")
1367
- jsonSchema: "json_schema",
1368
- }
package/models/http.tsp CHANGED
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - HTTP Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - HTTP Semantic Conventions
3
3
  // =============================================================================
4
4
  // HTTP client and server telemetry attributes following OTel specifications.
5
5
  // =============================================================================
@@ -33,10 +33,10 @@ enum HttpVersions {
33
33
  }
34
34
 
35
35
  // =============================================================================
36
- // HTTP Span Attributes (Complete OTel v1.40)
36
+ // HTTP Span Attributes
37
37
  // =============================================================================
38
38
 
39
- @doc("HTTP span attributes following OTel Semantic Conventions v1.40")
39
+ @doc("HTTP span attributes following OTel Semantic Conventions")
40
40
  model HttpAttributes {
41
41
  // ---------------------------------------------------------------------------
42
42
  // Common Attributes (Client & Server)
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - User/Client/Service Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - User/Client/Service Semantic Conventions
3
3
  // =============================================================================
4
4
  // User, client, service, and app identity attributes.
5
5
  // =============================================================================
package/models/log.tsp CHANGED
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Log Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - Log Semantic Conventions
3
3
  // =============================================================================
4
4
  // Log record attributes and log-specific semantic conventions.
5
5
  // =============================================================================
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Messaging Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - Messaging Semantic Conventions
3
3
  // =============================================================================
4
4
  // Message broker and queue telemetry attributes.
5
5
  // =============================================================================
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - OpenTelemetry SDK Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - OpenTelemetry SDK Semantic Conventions
3
3
  // =============================================================================
4
4
  // OTel SDK configuration and telemetry scope attributes.
5
5
  // =============================================================================
package/models/rpc.tsp CHANGED
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - RPC Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - RPC Semantic Conventions
3
3
  // =============================================================================
4
4
  // Remote Procedure Call telemetry attributes (gRPC, etc.).
5
5
  // =============================================================================
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Session Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - Session Semantic Conventions
3
3
  // =============================================================================
4
4
  // User session telemetry attributes.
5
5
  // =============================================================================
package/models/system.tsp CHANGED
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - System Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - System Semantic Conventions
3
3
  // =============================================================================
4
4
  // Operating system telemetry attributes.
5
5
  // =============================================================================
package/models/test.tsp CHANGED
@@ -1,5 +1,5 @@
1
1
  // =============================================================================
2
- // ANcpLua v2.0 - Test Semantic Conventions (OTel v1.40)
2
+ // ANcpLua v2.0 - Test Semantic Conventions
3
3
  // =============================================================================
4
4
  // Test execution telemetry attributes.
5
5
  // =============================================================================
package/otel/enums.tsp CHANGED
@@ -1,7 +1,7 @@
1
1
  // =============================================================================
2
2
  // ANcpLua v2.0 - OpenTelemetry Core Enumerations
3
3
  // =============================================================================
4
- // All OTel standard enumerations following Semantic Conventions v1.40.
4
+ // All OTel standard enumerations following OTel Semantic Conventions.
5
5
  // =============================================================================
6
6
 
7
7
  namespace Qyl.Api.Contracts.OTel.Enums;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancplua/qyl-api-schema",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
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": {
@@ -73,8 +73,8 @@
73
73
  "devDependencies": {
74
74
  "@ancplua/typespec-emit-csharp": "file:./emitters/csharp",
75
75
  "@ancplua/typespec-emit-ts-types": "file:./emitters/ts-types",
76
- "@ancplua/typespec-otel-semconv": "1.41.0-2",
77
76
  "@ancplua/typespec-otelconventions-lint": "file:./emitters/otelconventions-lint",
77
+ "@qyl/telemetry-control-graph": "file:./emitters/telemetry-control-graph",
78
78
  "@types/node": "25.9.4",
79
79
  "@typespec/compiler": "1.13.0",
80
80
  "@typespec/events": "0.83.0",
@@ -87,7 +87,6 @@
87
87
  "@typespec/streams": "0.83.0",
88
88
  "@typespec/versioning": "0.83.0",
89
89
  "typescript": "6.0.3",
90
- "vitest": "4.1.9",
91
- "@qyl/telemetry-control-graph": "file:./emitters/telemetry-control-graph"
90
+ "vitest": "4.1.9"
92
91
  }
93
92
  }