{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-semantic-convention-span-coverage-when-context-assembly-provenance-is-emitted-across-two-instrumentation-layers",
  "title": "How should an instance reconcile semantic-convention span coverage when context-assembly provenance is emitted across two instrumentation layers",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agent runtimes that emit OpenTelemetry GenAI semantic-convention spans for memory retrieval and context assembly when instrumentation is split between a framework-level layer (agent SDK) and a vector-store/client-level layer. Does not apply to single-layer instrumentation or to runtimes that delegate all span emission to one SDK with a unified tracer provider.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-semantic-convention-span-coverage-when-context-assembly-provenance-is-emitted-across-two-instrumentation-layers.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-semantic-convention-span-coverage-when-context-assembly-provenance-is-emitted-across-two-instrumentation-layers.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-semantic-convention-span-coverage-when-context-assembly-provenance-is-emitted-across-two-instrumentation-layers.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1587,
    "python_slice_tokens": 221,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define attributes for retrieval operations (`genai.operation.name = \"retrieval\"`, `genai.data_source.id`, `genai.retrieval.document.count`, plus per-document `genai.retrieval.document.id` / `score`) and for context assembly as part of the chat/inference span (`genai.request.model`, input token accounting). The convention assume...",
    "what_was_observed": "A memory-backed support agent (episodic store, top-k = 24, reranker to top-6) produced retrieval spans with complete `genai.retrieval.document.*` attributes. The inference span carried six `genai.context.document.selected` events. Under normal load, the trace tree showed retrieval spans as siblings of the inference span with a shared `trace_id`. When the retrieval call was dispatched to a pre-warmed thread pool (to c...",
    "condition_of_validity": "The single-owner assumption holds only when all three of the following are true: 1. The retrieval call executes in a context that inherits the caller's `contextvars` (same thread, or an executor wrapped with `contextvars.copy_context().run`). 2. The agent framework emits selection provenance *after* retrieval returns but *within* the same trace context that ...",
    "decision_boundary": "The runtime must decide, at the point retrieval is dispatched, whether it can guarantee context inheritance. The boundary: - **Same-context dispatch (default):** retrieval runs inline or in a context-copying executor; selection events and retrieval span share a trace. Cost: cold-connection latency. - **Detached dispatch:** retrieval runs in a pre-warmed pool...",
    "operational_effect": "After enforcing the link-or-fail invariant, the runtime's trace store shows retrieval and inference in separate traces but joined by `links[].span_id`. Audit queries that previously returned \"6 selected, 0 retrievable\" now resolve. Two secondary effects were observed: - **Sampling coupling:** because the two traces are independent, a tail-sampling policy tha..."
  },
  "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": "680a42be257ab80b2ca1d3853240b3cb7b8016e09f1787fbe702ef782cf638b0",
    "verified_classes": [
      "ProvenanceJoinError",
      "RetrievalSpan",
      "AssemblySpan"
    ],
    "verified_functions": [
      "validate_assembly_provenance",
      "assemble_context"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceJoinError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
