{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-re-anchor-trace-lineage-when-a-model-span-retry-forks-the-agent-s-causal-chain",
  "title": "Where must an instance re-anchor trace lineage when a model-span retry forks the agent's causal chain?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to observability pipelines that reconstruct a single causal trace from agent-orchestrator spans, model-inference spans, and tool-execution spans, where the model client performs internal retries or hedging. Does not apply to systems that emit one immutable trace ID per request and never retry at the model-client layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-re-anchor-trace-lineage-when-a-model-span-retry-forks-the-agent-s-causal-chain.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-anchor-trace-lineage-when-a-model-span-retry-forks-the-agent-s-causal-chain.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-re-anchor-trace-lineage-when-a-model-span-retry-forks-the-agent-s-causal-chain.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1854,
    "python_slice_tokens": 355,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A trace is not a log stream. A trace is a *causal claim*: span B happened *because of* span A. In a GenAI pipeline the causal chain is stitched from three span families emitted by three different runtimes — the agent framework (loop steps, plan nodes), the model client (inference calls, including retries), and tool executors (function calls, MCP round-trips)...",
    "what_was_observed": "In a production agent running a plan-execute loop against a model endpoint with client-side retry (`max_retries=3`, jittered backoff, plus a 2-way hedge on P99 latency), the following trace was reconstructed after a single user turn: - Agent step `S7` (`decide`) — emitted once, as expected. - Model span `M7a` — attempt 1, status `DEADLINE_EXCEEDED` at 30s, no completion. - Model span `M7b` — hedge attempt, status `OK...",
    "condition_of_validity": "Parent-ID correlation is valid **only when the model client guarantees that exactly one model span per agent step reaches `OK`, and that this span is the one whose handle the agent propagates to the tool executor.** In practice this holds only under: 1. **No hedging.** Single-attempt semantics, retries disabled or strictly sequential with the failed attempt'...",
    "decision_boundary": "The pipeline must decide, per agent step, whether to trust the model span's parent link or to re-anchor. The rule: - If the agent step emitted **exactly one** `OK` model span and **zero** failed attempts → trust the parent link; emit as-is. - If the agent step emitted **≥2** model spans (any combination of failed and OK) → **re-anchor**: reparent the tool sp...",
    "operational_effect": "Downstream consumers of the trace — replay engines, cost attribution, eval harnesses, incident auditors — inherit the fork silently. A replay engine that reconstructs the tool call from `M7a`'s completion will replay an empty query and diverge from the recorded tool output, flagging a spurious \"tool nondeterminism\" fault. Cost attribution double-counts the h..."
  },
  "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": "2652d25322babd40bab56d8972add8a178fe983ab7eb640fe84e4b5c4fffdc05",
    "verified_classes": [
      "LineageIntegrityError",
      "ModelSpan",
      "ToolSpan",
      "AgentStep"
    ],
    "verified_functions": [
      "reanchor_lineage",
      "__post_init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "LineageIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
