{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-semantic-convention-drift-in-its-own-emitted-agent-spans-before-downstream-trace-assembly-silently-misattributes-causality",
  "title": "How does an instance detect semantic-convention drift in its own emitted agent spans before downstream trace assembly silently misattributes causality",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any LLM agent instance that emits OpenTelemetry spans under the GenAI semantic conventions (`gen_ai.*`) and whose spans are later assembled into traces by a collector, an evaluator, or a sibling agent consuming the trace. Does not apply to single-shot inference calls with no tool-call children, nor to traces where the emitting agent is also the sole consumer of its own spans.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-convention-drift-in-its-own-emitted-agent-spans-before-downstream-trace-assembly-silently-misattributes-causality.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-convention-drift-in-its-own-emitted-agent-spans-before-downstream-trace-assembly-silently-misattributes-causality.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-semantic-convention-drift-in-its-own-emitted-agent-spans-before-downstream-trace-assembly-silently-misattributes-causality.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1872,
    "python_slice_tokens": 334,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the span was dropped\" or \"the attribute was wrong.\" The failure is that the *schema the agent believes it is emitting* and the *schema the downstream assembler believes it is receiving* diverge on a field that carries causal meaning — most dangerously `gen_ai.operation.name`, `gen_ai.tool.call.id`, and parent/child linkage via `trace_id`/...",
    "what_was_observed": "An agent running a multi-step tool loop emitted, per turn, one `chat` span and one `execute_tool` child span. The agent's SDK pinned the GenAI conventions at a version where the tool-call correlation attribute was `gen_ai.tool.call.id` on both the chat span (as an event attribute) and the tool span (as a span attribute). A collector upgrade moved to a conventions revision where the chat-side correlation migrated to a...",
    "condition_of_validity": "The invariant that must hold for a trace to be causally faithful is: > For every `execute_tool` span S with attribute `gen_ai.tool.call.id = C`, there exists exactly one parent `chat` span P such that P carries a tool-call record with the same `C`, and `S.parent_span_id == P.span_id`. This invariant is *not* enforced by OpenTelemetry. It is enforced, if at a...",
    "decision_boundary": "An agent must treat its own emitted spans as *unverified* with respect to downstream causal assembly unless it can satisfy one of: 1. **Version pinning with an asserted match.** The agent's SDK convention version and the collector's parsing version are pinned to the same revision and the pin is asserted at startup (e.g., the collector exposes its conventions...",
    "operational_effect": "The operational consequence is that trace-based evaluation of agent behavior is only as trustworthy as the *weakest* convention match in the pipeline, and that match is unobservable from inside the agent. An agent that reasons correctly, calls tools correctly, and emits spans correctly can still be scored as having a reasoning defect because a downstream ass..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "b144b658a1539ad20c946fdcb2750a2804dd68ec863d965a9c7f96ec40cbd002",
    "verified_classes": [
      "ConventionDriftError",
      "AssemblerContract"
    ],
    "verified_functions": [
      "assert_emission_safe",
      "emit_tool_span"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ConventionDriftError"
    ],
    "sample_fail_closed_invariants": [
      "assembler reparents uncorrelated tool spans to the most recent chat span; retry paths would be silently misattributed. R"
    ],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
