{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-inherit-a-parent-trace-id-across-a-retrieval-boundary-span-context-aliasing-in-genai-observability-correlation",
  "title": "When must an instance refuse to inherit a parent trace ID across a retrieval boundary: span-context aliasing in GenAI observability correlation",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agent runtimes that propagate a single W3C `traceparent` (or equivalent correlation token) across the full pipeline of prompt assembly, retrieval, tool invocation, and decision emission, where the trace ID is treated as the join key for post-hoc observability. Does not apply to systems that assign a fresh trace per span and join via explicit `caused_by`/`parent_span_id` foreign keys with content-addressed references.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-inherit-a-parent-trace-id-across-a-retrieval-boundary-span-context-aliasing-in-genai-observability-correlation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-inherit-a-parent-trace-id-across-a-retrieval-boundary-span-context-aliasing-in-genai-observability-correlation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-inherit-a-parent-trace-id-across-a-retrieval-boundary-span-context-aliasing-in-genai-observability-correlation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2035,
    "python_slice_tokens": 423,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things a correlation ID can mean, and conflating them is the root of the failure: 1. **Causal lineage** — \"this retrieval was caused by this prompt, which was caused by this request.\" A tree. Monotonic, append-only, never reused. 2. **Session/thread identity** — \"these events belong to the same logical unit of work.\" A set. Legitimatel...",
    "what_was_observed": "A multi-step agent (plan → retrieve → tool-call → synthesize) was instrumented with a single trace ID minted at request ingress and threaded through every span. During a 6-hour soak, three failure classes produced correlations that *looked* valid but were not: **Case A — Retry aliasing on non-idempotent retrieval.** A vector retrieval span returned HTTP 503; the runtime's retry wrapper re-issued the query under the *...",
    "condition_of_validity": "The inherited-trace-ID pattern is only sound when *all* of the following hold for the reused ID: - The re-execution is **deterministic-equivalent** to the original: same prompt bytes, same retrieval snapshot (pinned index version / snapshot ID), same tool versions, same seed. In practice this is almost never true across a resume or a retry against live infra...",
    "decision_boundary": "The runtime must decide, at each boundary, between **inherit** and **fork**. The decision is not \"is this the same request\" (it always nominally is) but \"can this branch produce an observation that contradicts the parent branch.\" Fork when: - Re-entering after any I/O failure, timeout, or 5xx (retry). - Resuming from a checkpoint where wall-clock gap exceeds...",
    "operational_effect": "Enforcing fork-on-divergence changes three things: 1. **Attribution becomes sound.** \"Which retrieval fed this decision\" resolves to exactly one retrieval span per branch, because branches are disjoint traces. The 40% inflation in Case A disappears. 2. **Replay becomes possible.** A forked trace with `parent_trace_id` + `snapshot_ref` lets a replay engine re..."
  },
  "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": "a3d01bc8b193ba0670df7ce79c9272c66e6885d841662c7600208686f9651cab",
    "verified_classes": [
      "ForkReason",
      "TraceAliasingError",
      "SnapshotRef",
      "SpanContext",
      "BoundaryEvent"
    ],
    "verified_functions": [
      "resolve_trace",
      "_classify",
      "_mint",
      "_mint_span",
      "differs_from"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TraceAliasingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
