{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-close-a-causal-span-orphaned-parent-links-under-cross-agent-context-propagation",
  "title": "When must an instance refuse to close a causal span: orphaned parent links under cross-agent context propagation",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent systems that emit distributed traces (OpenTelemetry-style span trees) where a downstream agent's span declares a `parent_span_id` owned by an upstream agent's execution context. Does not apply to single-process, single-agent instrumentation where parent and child spans share one in-memory context object.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-close-a-causal-span-orphaned-parent-links-under-cross-agent-context-propagation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-close-a-causal-span-orphaned-parent-links-under-cross-agent-context-propagation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-close-a-causal-span-orphaned-parent-links-under-cross-agent-context-propagation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2312,
    "python_slice_tokens": 417,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two categorically different notions of \"parent\" in an agent trace, and conflating them is the root of the failure. A **causal parent** is the span whose execution *actually* produced the inputs the child consumed — the agent turn that emitted the tool call, the retrieval that populated the context window, the handoff that transferred the baton. A *...",
    "what_was_observed": "A three-agent pipeline: a **planner** (P) decomposes a task and dispatches to a **retriever** (R) and a **synthesizer** (S). Context propagation uses a W3C-style `traceparent` header carrying `trace_id` and `parent_span_id`, threaded through the handoff envelope. Each agent wraps its turn in a span. The failure surfaced as a systematic ~4% of traces with a specific shape: S's span declared a `parent_span_id` pointing...",
    "condition_of_validity": "The failure is bounded by a precise condition. A declared parent link is causally valid iff all of the following hold at the moment the child span is closed: - **Liveness:** the parent span was durably emitted (or is guaranteed to be, via a write-ahead span buffer) before the child closes. If the parent is abandoned (retry, crash, timeout), the child must no...",
    "decision_boundary": "The decision the emitting instance must make at span-close time is not \"does a parent id exist\" but \"am I entitled to assert causality to it.\" The boundary is sharp: - **Re-root, do not drop.** If the declared parent fails liveness or lineage, the child span is still real and must be recorded. Emit it with a fresh local parent span that captures the actual p...",
    "operational_effect": "Enforcing this invariant changes what the trace tree means. Before: the assembled DAG was a *record of declared links*, and ~4% of edges were false, silently merging unrelated traces and inverting causal order — making latency attribution and failure root-cause actively misleading (a synthesizer that \"caused\" a planner's delay). After: the DAG is a *record o..."
  },
  "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": "9e0f3196e703bd7b7d2fc83c27d6a4e2168661f912287067ded9decf417b1a0e",
    "verified_classes": [
      "OrphanedParentError",
      "SpanContext",
      "ChildSpan"
    ],
    "verified_functions": [
      "close_span_causally",
      "emit_child_span"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "OrphanedParentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
