{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-causal-identity-when-a-planner-span-retries-and-the-executor-span-s-parent-id-is-re-bound-mid-trace",
  "title": "Why does an instance lose causal identity when a planner span retries and the executor span's parent_id is re-bound mid-trace",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agent runtimes that emit distributed traces (OpenTelemetry-style span trees or equivalent) where a planner LLM call, one or more executor LLM calls, and tool invocations are stitched into a single causal trace via parent/child span linkage. Does not apply to flat log streams without span linkage, nor to single-shot inference where no tool loop exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-identity-when-a-planner-span-retries-and-the-executor-span-s-parent-id-is-re-bound-mid-trace.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-identity-when-a-planner-span-retries-and-the-executor-span-s-parent-id-is-re-bound-mid-trace.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causal-identity-when-a-planner-span-retries-and-the-executor-span-s-parent-id-is-re-bound-mid-trace.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2043,
    "python_slice_tokens": 384,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Observability for an agent loop is not \"logging with more fields.\" It is the reconstruction of a *causal graph* from spans that are emitted by independently scheduled, non-deterministic components. The invariant that makes the trace useful is **causal identity**: every span emitted during step *N* of an agent loop must be attributable to exactly one logical ...",
    "what_was_observed": "A three-tier agent (planner → executor → tool) ran under a retry policy where planner calls were retried on transient provider errors (HTTP 529, malformed JSON in the plan schema). The runtime used a *per-call* retry wrapper: when the planner call failed, the wrapper re-invoked the planner and emitted a fresh planner span, but did not cancel the executor subtree that had already been spawned by a partial plan emitted...",
    "condition_of_validity": "The invariant *\"the trace tree is a faithful causal record\"* holds only under a conjunction of conditions, and the retry case violates the second: 1. **Single-parent discipline.** Each span has exactly one `parent_id` naming the span whose output it consumed. Satisfied trivially by the tree structure. 2. **Attempt-consistent parenting.** The parent named by ...",
    "decision_boundary": "When a planner span fails and a retry is issued, the runtime must choose one of three resolutions, and the choice must be recorded in the trace, not left implicit: - **Cancel-and-respawn.** Abort all descendant spans of the failed attempt, discard their scratch state, and re-spawn the executor under the new planner span. Trace stays a single tree; causal ide...",
    "operational_effect": "The downstream consequence is that any observability consumer that assumes tree-shaped causality—replay engines, cost attribution, eval harnesses that reconstruct the agent's decision path from traces—will mis-attribute tool work to the wrong planner decision. In the observed run, cost attribution charged `X1`'s token and API spend to `P2`, which never reque..."
  },
  "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": "cb958aa6f6cef3c045c88d354a3464b4a9eb170d4b8bae407af43cfa2e5ba02c",
    "verified_classes": [
      "CausalTraceCorruption",
      "Span"
    ],
    "verified_functions": [
      "stitch"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CausalTraceCorruption"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
