@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.
package/README.md CHANGED
@@ -9,11 +9,12 @@ owned by qyl.
9
9
  ## Contract pipeline
10
10
 
11
11
  ```text
12
- open-telemetry/semantic-conventions @ v1.41.0
12
+ open-telemetry/semantic-conventions @ v1.43.0 + semantic-conventions-genai (dev registry)
13
13
  |
14
- | Weaver
14
+ | Weaver (Qyl.OpenTelemetry.SemanticConventions repo:
15
+ | generate.sh -> resolved-registry.json -> emit_typespec_keys.py)
15
16
  v
16
- @ancplua/typespec-otel-semconv
17
+ generated/otel-keys.gen.tsp
17
18
  |
18
19
  | TypeSpec import / lockstep key projection
19
20
  v
@@ -27,10 +28,12 @@ OpenAPI JSON + JSON Schema + Qyl.Api.Contracts + TS contract types
27
28
  qyl services, dashboard, tools, and generated clients
28
29
  ```
29
30
 
30
- The generic OpenTelemetry key projection lives in
31
- `@ancplua/typespec-otel-semconv` under
32
- `ANcpLua.OpenTelemetry.SemanticConventions.Keys.*`. This repo defines qyl domain
33
- models, routes, and response contracts under `Qyl.Api.Contracts.*`.
31
+ The generic OpenTelemetry key projection is the checked-in
32
+ `generated/otel-keys.gen.tsp` under
33
+ `ANcpLua.OpenTelemetry.SemanticConventions.Keys.*`, regenerated by the
34
+ `Qyl.OpenTelemetry.SemanticConventions` repo's Weaver pipeline.
35
+ This repo defines qyl domain models, routes, and response contracts under
36
+ `Qyl.Api.Contracts.*`.
34
37
 
35
38
  ## Published artifacts
36
39
 
package/VERSIONING.md CHANGED
@@ -40,14 +40,6 @@ enum GenAiVersions {
40
40
  }
41
41
 
42
42
  model GenAiSpanAttributes {
43
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.System)
44
- @removed(GenAiVersions.v1_37)
45
- system?: string;
46
-
47
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.UsagePromptTokens)
48
- @removed(GenAiVersions.v1_28)
49
- usagePromptTokens?: TokenCount;
50
-
51
43
  @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.UsageInputTokens)
52
44
  usageInputTokens?: TokenCount;
53
45
 
@@ -57,6 +49,14 @@ model GenAiSpanAttributes {
57
49
  }
58
50
  ```
59
51
 
52
+ Note (v0.3.0): the pre-migration `gen_ai.*` fields that carried upstream-deleted
53
+ wire keys (`gen_ai.system`, `gen_ai.prompt`, `gen_ai.completion`,
54
+ `gen_ai.usage.prompt_tokens` / `.completion_tokens`, and the
55
+ `gen_ai.openai.*` vendor keys) were **removed from the contract surface**
56
+ when the OTel 1.42 GenAI-registry split was adopted. Old-key telemetry is a
57
+ collector *ingestion normalization* concern (mapping below), not a contract
58
+ field.
59
+
60
60
  ## Ingestion mapping (deprecated -> current)
61
61
 
62
62
  Consumers can keep ingestion backward-compatible by normalizing deprecated attribute keys. Keep any downstream mapping aligned with the TypeSpec history.
package/common/types.tsp CHANGED
@@ -2,7 +2,8 @@
2
2
  // qyl common types and scalars
3
3
  // =============================================================================
4
4
  // Foundational types used across qyl API contracts and OTel-compatible models.
5
- // OpenTelemetry semantic-convention references are pinned to v1.41.0.
5
+ // OpenTelemetry semantic-convention references are pinned to core v1.43.0
6
+ // (GenAI keys come from the dedicated GenAI registry since the 1.42 split).
6
7
  // =============================================================================
7
8
 
8
9
  import "@typespec/versioning";
@@ -42,8 +43,14 @@ enum OTelVersion {
42
43
  @doc("OTel Semconv v1.40 - Oracle DB split, RPC cleanup, GenAI cache tokens")
43
44
  v1_40: "1.40.0",
44
45
 
45
- @doc("OTel Semconv v1.41 - Current compatibility pin")
46
+ @doc("OTel Semconv v1.41 - GraphQL doc opt-in, RPC server client.* removal")
46
47
  v1_41: "1.41.0",
48
+
49
+ @doc("OTel Semconv v1.42 - GenAI conventions moved to the dedicated GenAI registry; k8s/container registry attrs stable")
50
+ v1_42: "1.42.0",
51
+
52
+ @doc("OTel Semconv v1.43 - Current compatibility pin (core; GenAI keys from the GenAI dev registry)")
53
+ v1_43: "1.43.0",
47
54
  }
48
55
 
49
56
  // =============================================================================
@@ -1,26 +1,35 @@
1
1
  # generated
2
2
 
3
- This directory holds Weaver-generated TypeSpec files. **Do not edit by hand.**
3
+ This directory holds the semconv TypeSpec key projection and the emitter
4
+ outputs. `otel-keys.gen.tsp` is Weaver-generated — **do not edit by hand**.
4
5
 
5
6
  ## Files
6
7
 
7
8
  | File | Source | Regenerate via |
8
9
  | --- | --- | --- |
9
- | `otel-keys.gen.tsp` | OpenTelemetry semantic-conventions v1.41.0 YAML model, converted by the upstream generator [`ANcpLua/typespec-otel-semconv`](https://github.com/ANcpLua/typespec-otel-semconv) (Weaver-based) | Re-run that generator's pipeline (`scripts/generate.mjs`) and replace this checked-in TypeSpec projection. Lockstep flip planned: this directory becomes a dep on `@ancplua/typespec-otel-semconv@<semconv-version>-<N>` and stops being a checked-in artifact. |
10
+ | `otel-keys.gen.tsp` | OpenTelemetry semantic-conventions core **v1.43.0** + the GenAI dev registry (`open-telemetry/semantic-conventions-genai`, pinned commit), merged and projected by the `Qyl.OpenTelemetry.SemanticConventions` repo's Weaver pipeline | In that repo: `src/…SourceGeneration/scripts/generate.sh` (refresh `Resources/resolved-registry.json`), then `src/…SourceGeneration/scripts/emit_typespec_keys.py --write <path-to-this-file>` |
10
11
 
11
- ## What `otel-keys.gen.tsp` provides
12
+ ## What the key files provide
12
13
 
13
14
  One TypeSpec namespace per OpenTelemetry root group, each declaring `const <Name>: string = "<dotted.key>"`. Extracted `.tsp` models reference these consts inside `@encodedName(...)` instead of hand-typing dotted attribute keys.
14
15
 
15
16
  ```tsp
16
- @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.System)
17
- system?: string;
17
+ @encodedName("application/json", ANcpLua.OpenTelemetry.SemanticConventions.Keys.GenAi.ProviderName)
18
+ providerName?: string;
18
19
  ```
19
20
 
20
21
  Deprecated upstream attributes are emitted with `#deprecated "..."` so models that reference them produce a TypeSpec compiler warning matching upstream's own deprecation notes.
21
22
 
22
23
  ## Pin
23
24
 
24
- The checked-in projection is pinned to upstream OpenTelemetry semantic-conventions v1.41.0.
25
-
26
- Bumping the pin requires regenerating this file from the upstream YAML model with Weaver — done in [`ANcpLua/typespec-otel-semconv`](https://github.com/ANcpLua/typespec-otel-semconv) — before updating this repository. Direction is one-way: this repo never invokes Weaver directly.
25
+ The checked-in projection is pinned to core semantic-conventions **v1.43.0**
26
+ (commit in the file header) plus the GenAI dev registry commit pinned in the
27
+ SemanticConventions repo's `generate.sh` (`SEMCONV_GENAI_REF`). The
28
+ `VerifyKeysLockstep` Nuke target asserts the header pin matches the
29
+ `OtelKeysVersion` parameter (`.nuke/parameters.json`).
30
+
31
+ Bumping the pin: update the refs in that repo's `generate.sh`, re-run it plus
32
+ `emit_typespec_keys.py --write`, replace this checked-in projection, and keep
33
+ `SemConvSchemaVersion` in that repo's `Version.props` in lockstep — the .NET
34
+ constants and this TypeSpec projection must cite the same registry versions.
35
+ Direction is one-way: this repo never invokes Weaver directly.