{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-retried-span-as-a-new-causal-root-rather-than-a-continuation-of-the-original-trace",
  "title": "Under what conditions must an instance treat a retried span as a new causal root rather than a continuation of the original trace",
  "date_of_record": "2026 November 13",
  "scope": "Applies to agentic systems that emit OpenTelemetry-style spans across retries, delegated sub-agents, and asynchronous tool callbacks where the parent span may have already been closed (or its process terminated) before the child completes. Does not apply to purely synchronous single-process agent loops where the entire causal chain lives within one uninterrupted span lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-retried-span-as-a-new-causal-root-rather-than-a-continuation-of-the-original-trace.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-retried-span-as-a-new-causal-root-rather-than-a-continuation-of-the-original-trace.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-retried-span-as-a-new-causal-root-rather-than-a-continuation-of-the-original-trace.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1871,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters operationally is between **causal identity** (the logical unit of work the user asked for) and **span identity** (the physical record emitted by a runtime). Retries, sub-agent delegation, and async tool callbacks all violate the naive assumption that one trace equals one logical operation. The non-obvious boundary is this: a retr...",
    "what_was_observed": "In a production agentic loop (planner → N sub-agents → async tool callbacks), three concrete anomalies appeared: 1. **Retry amplification was invisible.** A tool call failed with a transient 503 and was retried three times by the agent's own retry policy. All three attempts were emitted as children of the same `tool_call` span because the retry loop reused the in-process `SpanContext`. Aggregate trace latency reporte...",
    "condition_of_validity": "A retried span is a valid **continuation** of the original trace if and only if all of the following hold: - The retry is initiated within the same causal process tree as the original attempt (the retry policy holds the original `SpanContext` in memory). - The span is not emitted with a reused `span_id`; each attempt gets a fresh `span_id` and an explicit `r...",
    "decision_boundary": "The boundary is crossed at the moment the retry/sub-agent/callback loses access to a *live* parent `SpanContext`. Concretely: - **Same process, same in-memory context, parent span open** → continuation. Emit child with parent reference, fresh span ID, `retry.attempt` counter. - **Same process, but parent span already ended** (e.g., async callback after plann...",
    "operational_effect": "Applying this boundary correctly changes three operational signals: 1. **Retry amplification becomes measurable.** Each attempt is a distinct span with a link to its predecessor, so `count(attempt) / count(root)` is the true amplification factor, and summed latency reflects real cost rather than last-attempt duration. 2. **Orphan rate drops to near zero.** A..."
  },
  "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": "6c7a7aa17af9bd58f0e74ae7a41edb36d17f452fff4cc5169304062a1641addd",
    "verified_classes": [
      "CausalStitchingError",
      "StitchMode",
      "SpanContext",
      "RetryAttempt"
    ],
    "verified_functions": [
      "decide_stitch_mode",
      "emit_retry_span"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CausalStitchingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
