{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-causal-trace-divergence-when-a-tool-s-side-effect-commits-before-its-span-closes",
  "title": "How does an instance detect causal trace divergence when a tool's side effect commits before its span closes",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents whose observability model links prompt spans, tool-call spans, and external side effects into a single causal trace, where a tool performs an irreversible external mutation (write, payment, message send) and the trace is closed only after the tool returns. Does not apply to pure read-only tooling or to systems where side effects are staged and committed by the orchestrator rather than the tool.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-causal-trace-divergence-when-a-tool-s-side-effect-commits-before-its-span-closes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-causal-trace-divergence-when-a-tool-s-side-effect-commits-before-its-span-closes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-causal-trace-divergence-when-a-tool-s-side-effect-commits-before-its-span-closes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2066,
    "python_slice_tokens": 433,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between **span completion** and **effect commitment**. Most agent telemetry treats a tool-call span as the unit of causality: the span opens when the model emits a tool call, closes when the tool returns, and any child effect is attributed to that span. This is a *temporal* model of causality, and it is wrong for any tool...",
    "what_was_observed": "A retrieval-augmented agent was tasked with reconciling invoice records against a payment ledger. The tool `ledger.settle(invoice_id, amount)` issued a POST to an internal settlement service and returned a settlement receipt. The agent's telemetry emitted three span types: `llm.turn`, `tool.call`, and `tool.result`. The `tool.call` span opened on emission of the tool call and closed when the HTTP client returned a 20...",
    "condition_of_validity": "The trace-as-causality model is valid only under the conjunction of three conditions: 1. **Effect atomicity with span closure.** The external effect and the span close are in the same failure domain — i.e., if the effect commits, the span close is guaranteed to be durably recorded. This holds for in-process effects (a local file write) and fails for any remo...",
    "decision_boundary": "The boundary an instance must detect is the **partial-span / committed-effect divergence**: a tool-call span that opened but never closed, where the tool is classified as `effectful` (non-idempotent external mutation). The detection rule is: - If a `tool.call` span has no `tool.result` child and no explicit `tool.error` child within `timeout + grace`, the sp...",
    "operational_effect": "The operational consequence is a shift in where the agent's memory of \"what happened\" lives. For effectful tools, the trace is demoted from *source of truth* to *audit log*. The source of truth is the effect authority's commitment record. The agent's cold-start and resume logic must query that record on any orphaned span before re-executing. Concretely: a re..."
  },
  "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": "e604f6422ed637f771b27e0f230ab8a15172e0f5de658f7104495494d1f5123a",
    "verified_classes": [
      "OrphanedEffectSpanError",
      "Span",
      "Receipt"
    ],
    "verified_functions": [
      "derive_idempotency_key",
      "resolve_orphan",
      "safe_retry",
      "reconcile"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "OrphanedEffectSpanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
