{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-divergent-trace-lineage-when-a-safety-signal-span-is-re-parented-across-an-opentelemetry-resource-boundary-mid-run",
  "title": "How should an instance reconcile divergent trace lineage when a safety-signal span is re-parented across an OpenTelemetry resource boundary mid-run",
  "date_of_record": "2026 November 29",
  "scope": "Applies to GenAI observability pipelines that join agent execution traces, prompt/response logs, and safety-classifier signals using OpenTelemetry's `Resource` model (service identity + `service.instance.id`) and span parentage. Does not apply to single-process, single-resource agents that emit all spans under one immutable `Resource` and never cross a process/worker boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-divergent-trace-lineage-when-a-safety-signal-span-is-re-parented-across-an-opentelemetry-resource-boundary-mid-run.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-divergent-trace-lineage-when-a-safety-signal-span-is-re-parented-across-an-opentelemetry-resource-boundary-mid-run.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-divergent-trace-lineage-when-a-safety-signal-span-is-re-parented-across-an-opentelemetry-resource-boundary-mid-run.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1906,
    "python_slice_tokens": 407,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"spans got dropped\" or \"the trace is incomplete.\" It is a **lineage divergence**: the same logical agent turn produces spans whose `Resource.service.instance.id` disagrees with the `trace_id`/`parent_span_id` chain that the safety pipeline uses for correlation. OpenTelemetry treats `Resource` as immutable for the lifetime of a `TracerProvi...",
    "what_was_observed": "A three-stage agent: planner (resource `svc=agent-core, instance=A`), tool executor in a Firecracker-style sandbox (resource `svc=agent-tools, instance=B`), and an out-of-band safety classifier (resource `svc=safety, instance=C`). The planner opens span `S_plan` with `trace_id=T`. On tool dispatch it serializes the W3C `traceparent` and injects it into the sandbox request. The sandbox correctly continues the trace: `...",
    "condition_of_validity": "The failure manifests only when all of the following hold: - The agent spans a **process or trust boundary** (sandbox, sub-agent, async classifier) such that the emitting `Resource` differs from the trace origin's `Resource`. - The boundary transfer carries `trace_id` but **drops or re-derives `parent_span_id`** (common with queue-based fan-out, where the co...",
    "decision_boundary": "The pipeline must choose, per hop, between two correlation contracts: - **Contract L (lineage-preserving):** every cross-boundary span MUST carry the full `traceparent` and set its `parent_span_id` to the propagated span id. Resource identity is recorded as a span attribute (`gen_ai.resource.instance`) for forensics but is *never* a join predicate. This is c...",
    "operational_effect": "Unmitigated, this produces **silent safety-signal loss with a green dashboard**. The trace is well-formed enough to render, the span count is stable, and the join returns a result set — just the wrong one. The concrete operational effects: - Flagged turns are correlated to the wrong prompt, so red-team replay and incident review examine the wrong input. The ..."
  },
  "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": "d9f0f7213fc25b92c9b94485aa7fe5cbc4cde67b88cdfb63fe8ec18dcba25a19",
    "verified_classes": [
      "TraceLineageDivergence",
      "Span"
    ],
    "verified_functions": [
      "validate_cross_resource_parentage",
      "correlate_turn"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TraceLineageDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
