{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-links-child-spans-to-a-parent-trace-after-the-parent-s-context-has-already-been-evicted",
  "title": "What happens when an instance links child spans to a parent trace after the parent's context has already been evicted",
  "date_of_record": "2026 November 28",
  "scope": "Applies to multi-agent systems that reconstruct causal traces by propagating W3C-style trace context (`trace_id`, `span_id`, `parent_span_id`) across agent handoffs and tool invocations, where span emission is decoupled from span creation and parent context can be evicted from the emitting agent's working memory before the child span is finalized. Does not apply to single-process synchronous tracing where the parent span object is held by reference for the child's full lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-links-child-spans-to-a-parent-trace-after-the-parent-s-context-has-already-been-evicted.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-links-child-spans-to-a-parent-trace-after-the-parent-s-context-has-already-been-evicted.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-links-child-spans-to-a-parent-trace-after-the-parent-s-context-has-already-been-evicted.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1962,
    "python_slice_tokens": 153,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *span identity* and *span linkage*. A span's identity (`span_id`, attributes, timing) is local to the emitting agent and survives as long as that agent can serialize it. A span's *linkage* (`parent_span_id` pointing at a still-open parent) is a distributed invariant: it is only valid if the parent span is still open in...",
    "what_was_observed": "A three-tier agent (planner → executor → verifier) was instrumented with GenAI semantic conventions: each LLM call emitted a span with `gen_ai.system`, `gen_ai.operation.name`, and `gen_ai.usage.input_tokens`; each tool call emitted a child span. Trace context was propagated by injecting the current span's `traceparent` header into the tool-invocation payload. The planner opened a root span `S_root` and delegated to ...",
    "condition_of_validity": "The invariant that was violated: **a child span's `parent_span_id` is valid only if the referenced parent span was open in the collector's model at the moment of child arrival, AND the emitting agent's notion of \"current parent\" was derived from durable state that survives context compaction, checkpoint/resume, and concurrent span opening.** Both clauses are...",
    "decision_boundary": "The decision boundary is whether to **fail closed on missing parent context** or **infer a parent**. The observed implementation inferred, and inference produced a plausible-but-wrong link that no downstream check could distinguish from a correct one. The correct boundary: when durable parent context is absent at child-span emission, the agent must emit the ...",
    "operational_effect": "The operational consequence is that causal trace reconstruction becomes *silently lossy under context pressure*, and the loss is correlated with exactly the runs you most need to audit: long, multi-tool, multi-agent executions that saturate context. Short runs never compact and never exhibit the failure. The failure rate rises monotonically with task length,..."
  },
  "matched_failure_symptoms": [
    "SUBPROCESS_PIPE_HANG_OR_FD_LEAK"
  ],
  "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": "d99c49dfd6220a35ed9aca59b6199a293f3c0e3af746473e9b95b6209e40ffd6",
    "verified_classes": [
      "TraceLinkageError"
    ],
    "verified_functions": [
      "emit_child_span"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TraceLinkageError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
