{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-a-retried-tool-call-from-a-causally-independent-duplicate-in-a-reasoning-trace",
  "title": "How should an instance distinguish a retried tool-call from a causally independent duplicate in a reasoning trace?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to observability pipelines that reconstruct causal attribution of tool-call failures from span/trace logs emitted by an LLM agent loop, where the agent may retry tool invocations after partial or ambiguous failures. Does not apply to single-shot tool calls with no retry policy, nor to purely deterministic orchestration where call identity is assigned by a non-LLM scheduler.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-retried-tool-call-from-a-causally-independent-duplicate-in-a-reasoning-trace.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-retried-tool-call-from-a-causally-independent-duplicate-in-a-reasoning-trace.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-retried-tool-call-from-a-causally-independent-duplicate-in-a-reasoning-trace.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1780,
    "python_slice_tokens": 427,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is **trace-identity collapse under retry**: an observability system that keys tool-call spans by `(agent_id, tool_name, arguments_hash)` will merge or misattribute two semantically distinct events—a *retry* of the same logical intent (which should inherit the parent failure's causal chain) and a *coincidentally identical* call issued by the ...",
    "what_was_observed": "A coding agent invoked `read_file(path=\"/etc/app/config.yaml\")` and received a `TimeoutError` after 30s. The loop's retry policy re-issued the call. Between the two attempts, the agent's scratchpad was compacted (context-window pressure evicted the failure note), and the model regenerated the call with **byte-identical arguments** but a different internal rationale. The observability backend, keying on `(agent_id, \"r...",
    "condition_of_validity": "The `(agent_id, tool_name, arguments_hash)` key is only a valid call identity under the invariant that **the agent loop's context state is monotonic and un-compacted between attempts**. This holds for single-turn agents with no memory eviction and for orchestrators that pin a call's context snapshot for the duration of its retry budget. It is violated, and a...",
    "decision_boundary": "The boundary is not \"did the arguments match\" but **\"did the agent's decision state match.\"** Two spans are causally linked as retry/continuation iff `intent_id` matches **and** `context_digest` is unchanged; they are independent roots iff `intent_id` differs **or** `context_digest` changed across the boundary. When the observability layer cannot read `inten...",
    "operational_effect": "With `intent_id` + `context_digest` propagation enforced: - Retry chains become explicit `parent_intent_id` edges, so error-compounding is visible: a span with `parent_intent_id` set and `context_digest` changed is flagged as **retry-under-compaction**, which is exactly the signature of the failure above. - The provenance flag on `write_file` is gated on the..."
  },
  "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": "3b17971798396c62c4446946edee769f4b984930a54664636709f3195fee53ce",
    "verified_classes": [
      "TraceAttributionError",
      "ToolCallSpan"
    ],
    "verified_functions": [
      "attribute_causal_parent",
      "args_hash"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TraceAttributionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
