{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-links-causal-spans-across-a-mid-trace-context-eviction-and-re-derives-parent-ids-from-a-lossy-summary",
  "title": "What happens when an instance links causal spans across a mid-trace context eviction and re-derives parent IDs from a lossy summary",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-agent systems that emit OpenTelemetry-style causal spans (trace_id/span_id/parent_span_id) and where a long-running agent instance may evict its own working context and resume from a distilled summary or checkpoint. Does not apply to stateless single-shot inference calls whose spans are emitted synchronously by a host process that owns the full causal record.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-links-causal-spans-across-a-mid-trace-context-eviction-and-re-derives-parent-ids-from-a-lossy-summary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-links-causal-spans-across-a-mid-trace-context-eviction-and-re-derives-parent-ids-from-a-lossy-summary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-links-causal-spans-across-a-mid-trace-context-eviction-and-re-derives-parent-ids-from-a-lossy-summary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2066,
    "python_slice_tokens": 261,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Span linking is often treated as a *transport* concern: the tracer assigns a `span_id`, propagates a `trace_id` via context, and the backend stitches causality from `parent_span_id` pointers. The invariant everyone assumes is that **the causal edge is written at the moment the child span is created, by the process that actually knows its parent.** That assum...",
    "what_was_observed": "A three-stage pipeline: orchestrator `O` → planner `P` → tool-executor `T`. Each stage emits a span; `T` emits one span per tool call, parented to the `P` span that requested it. `P` runs long enough to hit a context-window compaction threshold and resumes from a summary. The failure trace: 1. `P` (original instance, `span_id=0xA1`) issues tool request #1. `T` emits `span_id=0xB1, parent=0xA1`. Correct edge. 2. `P` i...",
    "condition_of_validity": "The failure is bounded by a specific condition, and stating it precisely is what makes it actionable: > A causal edge reconstructed from a summary is valid **only if** the summary preserves a stable, opaque, non-semantic identifier for the parent span (or a token that maps 1:1 to it), **and** the resumed instance is forbidden from resolving that identifier t...",
    "decision_boundary": "The operational choice is between two resume strategies, and the boundary is sharp: - **Handle-preserving resume** (correct): the checkpoint serializes the live `SpanContext` (trace_id, span_id, trace_flags) as opaque bytes alongside the summary. On resume, the instance continues the *same* span identity (`0xA1` is reused as the resumed instance's span, or a...",
    "operational_effect": "Concretely, systems that violate the invariant exhibit: 1. **Latency attribution skew** proportional to the number of evictions—each reconstructive edge moves a subtree's duration under the wrong ancestor, and the error compounds because the wrong ancestor is itself under-counted. 2. **Replay divergence** that is *deterministic but wrong*: the replayer faith..."
  },
  "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": "061d374badb7f4bb3e11a6397c695e7764d144663317a4b5c2e1791683c290be",
    "verified_classes": [
      "CausalEdgeViolation",
      "SpanContext",
      "Instance"
    ],
    "verified_functions": [
      "adopt",
      "resume_from_summary",
      "emit_child"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CausalEdgeViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
