{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-causal-parentage-when-a-delegated-subagent-re-emits-a-retried-span-under-a-new-trace-identity",
  "title": "Why does an instance lose causal parentage when a delegated subagent re-emits a retried span under a new trace identity",
  "date_of_record": "2026 November 30",
  "scope": "Applies to OpenTelemetry-style trajectory tracing where an orchestrator agent spawns delegated subagent instances that emit their own spans, and where span context is propagated via injected headers into tool/runtime boundaries. Does not apply to single-process in-memory tracing, nor to systems that use a shared deterministic trace ID factory across all instances.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-parentage-when-a-delegated-subagent-re-emits-a-retried-span-under-a-new-trace-identity.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-parentage-when-a-delegated-subagent-re-emits-a-retried-span-under-a-new-trace-identity.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-parentage-when-a-delegated-subagent-re-emits-a-retried-span-under-a-new-trace-identity.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1877,
    "python_slice_tokens": 363,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"missing spans\" or \"broken export.\" It is a *causal parentage break*: the delegated subagent's spans are successfully emitted and exported, but their `parent_span_id` points to a span that no longer exists in the trace tree because the orchestrator's retry logic re-created the delegation span under a fresh `span_id` while the subagent cont...",
    "what_was_observed": "A planner agent (`orchestrator`) decomposed a task and delegated a retrieval subtask to a subagent via an A2A-style message. The delegation call was wrapped in a span `S_delegate` with `span_id=A1`, `trace_id=T`. The subagent received the W3C `traceparent` header `00-T-A1-01` and, on startup, cached it as its ambient context. The subagent's first attempt timed out at the transport layer (30s budget exhausted mid-tool...",
    "condition_of_validity": "The parentage invariant holds **only if** the following three conditions are simultaneously true: 1. **Context injection is re-evaluated at send time, not at payload-construction time.** The `traceparent` header must be injected by the transport layer immediately before the outbound call, reading the *current* active span. Any design that serializes the head...",
    "decision_boundary": "The boundary between \"acceptable\" and \"must abort\" is whether the orphaned child can be *re-parented* deterministically. Two cases: - **Re-parentable:** the subagent includes a stable `delegation_id` (a logical, retry-invariant correlation token) in its span attributes. On ingest, a reconciler can re-link `parent_span_id=A1` to `A2` by matching `delegation_i...",
    "operational_effect": "Concretely, the following must be enforced in the delegation transport and the ingest pipeline: - **Inject-at-send:** the outbound request builder must call `current_span().inject(headers)` inside the retry loop body, after the new span is opened. Never cache the header. - **New span per attempt:** the retry wrapper must create a fresh child span for each at..."
  },
  "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": "be664ea6922d9a30892d03ed08be4035767ce82791d1b8475722ccbb10a6342b",
    "verified_classes": [
      "OrphanedDelegationSpan",
      "Span"
    ],
    "verified_functions": [
      "inject_context_at_send",
      "validate_trajectory",
      "simulate_retry_without_reinjection"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "OrphanedDelegationSpan"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
