From 9c92e65fc4dfa662f2e5b5b92990731e6a57a05f Mon Sep 17 00:00:00 2001 From: Diya Maheshwari Date: Wed, 22 Jul 2026 19:04:55 +0530 Subject: [PATCH 1/4] feat(semconv): add AIPOU work-receipt reference span attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds AIPOU_WORK_RECEIPT_ID, AIPOU_EVIDENCE_CLASS, AIPOU_SCHEME, and AIPOU_VALIDATION_STATUS to SpanAttributes for optionally correlating an external AIPOU work receipt with a trace/span. These are opt-in reference attributes only — tracing does not derive, validate, or own the receipt lifecycle; that stays external to AIPOU's signed receipt store. Ref: traceloop/openllmetry#4340 Signed-off-by: Diya Maheshwari --- .../opentelemetry/semconv_ai/__init__.py | 4 ++++ .../opentelemetry/semconv_ai/_testing.py | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py index 24ea52decb..5a270ce8a8 100644 --- a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py +++ b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py @@ -134,6 +134,10 @@ class SpanAttributes: # Deprecated TRACELOOP_CORRELATION_ID = "traceloop.correlation.id" + AIPOU_WORK_RECEIPT_ID = "aipou.work_receipt_id" + AIPOU_EVIDENCE_CLASS = "aipou.evidence_class" + AIPOU_SCHEME = "aipou.scheme" + AIPOU_VALIDATION_STATUS = "aipou.validation_status" # Watson/genai LLM GEN_AI_WATSONX_DECODING_METHOD = "llm.watsonx.decoding_method" diff --git a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py index 3f74ae78f0..22d69efcdf 100644 --- a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py +++ b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py @@ -439,3 +439,27 @@ def test_watsonx_metrics_kept(self): assert Meters.LLM_WATSONX_COMPLETIONS_EXCEPTIONS == "llm.watsonx.completions.exceptions" assert Meters.LLM_WATSONX_COMPLETIONS_RESPONSES == "llm.watsonx.completions.responses" assert Meters.LLM_WATSONX_COMPLETIONS_TOKENS == "llm.watsonx.completions.tokens" +# --------------------------------------------------------------------------- +# SpanAttributes — AIPOU external work-receipt reference (opt-in, issue #4340) +# --------------------------------------------------------------------------- + + +class TestSpanAttributesAIPOU: + """ + AIPOU (AI Proof of Us) work-receipt reference attributes. These are opt-in: + traces may carry a reference to an externally-issued, externally-validated + work receipt, but tracing must never derive or validate the receipt itself. + """ + + def test_aipou_work_receipt_id(self): + assert SpanAttributes.AIPOU_WORK_RECEIPT_ID == "aipou.work_receipt_id" + + def test_aipou_evidence_class(self): + assert SpanAttributes.AIPOU_EVIDENCE_CLASS == "aipou.evidence_class" + + def test_aipou_scheme(self): + assert SpanAttributes.AIPOU_SCHEME == "aipou.scheme" + + def test_aipou_validation_status(self): + assert SpanAttributes.AIPOU_VALIDATION_STATUS == "aipou.validation_status" + \ No newline at end of file From cce05592414bf67efc73403ab3d3ba112c1266da Mon Sep 17 00:00:00 2001 From: Diya Maheshwari Date: Wed, 22 Jul 2026 19:11:02 +0530 Subject: [PATCH 2/4] fix: add trailing newline to _testing.py Signed-off-by: Diya Maheshwari --- .../opentelemetry/semconv_ai/_testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py index 22d69efcdf..19f5323d09 100644 --- a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py +++ b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/_testing.py @@ -462,4 +462,4 @@ def test_aipou_scheme(self): def test_aipou_validation_status(self): assert SpanAttributes.AIPOU_VALIDATION_STATUS == "aipou.validation_status" - \ No newline at end of file + From 301044a9c9db8817c241eeefd82becfa6ed3a522 Mon Sep 17 00:00:00 2001 From: Diya Maheshwari Date: Thu, 23 Jul 2026 00:07:03 +0530 Subject: [PATCH 3/4] fix: move AIPOU attributes out of Deprecated section Addresses review feedback from @0xddneto on #4373 - AIPOU constants were placed immediately after TRACELOOP_CORRELATION_ID's # Deprecated comment, causing CodeRabbit to flag them as deprecated. Moved to a dedicated 'External work receipt references (opt-in)' section. Signed-off-by: Diya Maheshwari --- .../opentelemetry/semconv_ai/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py index 5a270ce8a8..42b34839ea 100644 --- a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py +++ b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py @@ -134,13 +134,15 @@ class SpanAttributes: # Deprecated TRACELOOP_CORRELATION_ID = "traceloop.correlation.id" + + # Watson/genai LLM + GEN_AI_WATSONX_DECODING_METHOD = "llm.watsonx.decoding_method" + + # External work receipt references (opt-in) - see issue 4340 AIPOU_WORK_RECEIPT_ID = "aipou.work_receipt_id" AIPOU_EVIDENCE_CLASS = "aipou.evidence_class" AIPOU_SCHEME = "aipou.scheme" AIPOU_VALIDATION_STATUS = "aipou.validation_status" - - # Watson/genai LLM - GEN_AI_WATSONX_DECODING_METHOD = "llm.watsonx.decoding_method" GEN_AI_WATSONX_RANDOM_SEED = "llm.watsonx.random_seed" GEN_AI_WATSONX_MAX_NEW_TOKENS = "llm.watsonx.max_new_tokens" GEN_AI_WATSONX_MIN_NEW_TOKENS = "llm.watsonx.min_new_tokens" From 708791ae12810533c8fdec6192c261d6a395b385 Mon Sep 17 00:00:00 2001 From: Diya Maheshwari Date: Thu, 23 Jul 2026 01:19:06 +0530 Subject: [PATCH 4/4] fix: move AIPOU section after complete Watson block Addresses review feedback from @0xddneto on #4373 - the AIPOU section was splitting the Watson/genai LLM attribute block (sitting between GEN_AI_WATSONX_DECODING_METHOD and the other Watson attributes). Moved it to after GEN_AI_WATSONX_REPETITION_PENALTY, keeping the Watson group coherent. Signed-off-by: Diya Maheshwari --- .../opentelemetry/semconv_ai/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py index 42b34839ea..3dbe9fd7f3 100644 --- a/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py +++ b/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/__init__.py @@ -138,15 +138,16 @@ class SpanAttributes: # Watson/genai LLM GEN_AI_WATSONX_DECODING_METHOD = "llm.watsonx.decoding_method" + GEN_AI_WATSONX_RANDOM_SEED = "llm.watsonx.random_seed" + GEN_AI_WATSONX_MAX_NEW_TOKENS = "llm.watsonx.max_new_tokens" + GEN_AI_WATSONX_MIN_NEW_TOKENS = "llm.watsonx.min_new_tokens" + GEN_AI_WATSONX_REPETITION_PENALTY = "llm.watsonx.repetition_penalty" + # External work receipt references (opt-in) - see issue 4340 AIPOU_WORK_RECEIPT_ID = "aipou.work_receipt_id" AIPOU_EVIDENCE_CLASS = "aipou.evidence_class" AIPOU_SCHEME = "aipou.scheme" AIPOU_VALIDATION_STATUS = "aipou.validation_status" - GEN_AI_WATSONX_RANDOM_SEED = "llm.watsonx.random_seed" - GEN_AI_WATSONX_MAX_NEW_TOKENS = "llm.watsonx.max_new_tokens" - GEN_AI_WATSONX_MIN_NEW_TOKENS = "llm.watsonx.min_new_tokens" - GEN_AI_WATSONX_REPETITION_PENALTY = "llm.watsonx.repetition_penalty" # ----------------------------------------------------------------------- # Legacy LLM_* aliases (old names with original string values)