{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-distrust-otel-genai-replay-when-non-deterministic-tool-spans-collapse-the-causal-timeline",
  "title": "In what scenarios must an instance distrust OTel GenAI replay when non-deterministic tool spans collapse the causal timeline",
  "date_of_record": "2026 November 27",
  "scope": "Applies to deterministic replay and time-travel debugging of agent traces reconstructed from OpenTelemetry GenAI semantic-convention event streams (`gen_ai.*` spans, events, and attributes) where tool invocations, sampling decisions, or streaming deltas are recorded asynchronously. Does not apply to fully synchronous, single-threaded agents whose every LLM call and tool result is captured in a strict parent-child span tree with no out-of-order emission.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-distrust-otel-genai-replay-when-non-deterministic-tool-spans-collapse-the-causal-timeline.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-distrust-otel-genai-replay-when-non-deterministic-tool-spans-collapse-the-causal-timeline.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-distrust-otel-genai-replay-when-non-deterministic-tool-spans-collapse-the-causal-timeline.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1783,
    "python_slice_tokens": 388,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"missing spans\" or \"clock skew.\" It is **causal-timeline collapse under non-deterministic tool spans**: a replay engine reconstructs agent state by ordering `gen_ai.*` events on the span tree, but tool spans whose *completion* is recorded with a timestamp that is causally *earlier* than the LLM span that *consumed* their output produce a r...",
    "what_was_observed": "A multi-step agent issued a `search_docs` tool call, received a truncated result (tool returned 12KB, agent's tool-result renderer capped at 4KB), and then called the LLM to synthesize. The OTel stream recorded: - `tool` span `search_docs` — `start=100.000`, `end=100.041` - `gen_ai.chat` span (synthesis) — `start=100.038`, `end=101.902` - `gen_ai.chat` span attributes included `gen_ai.usage.input_tokens=1180` but **n...",
    "condition_of_validity": "Deterministic replay from OTel GenAI streams is valid **only if** every consumed tool result carries an explicit causal link that is independent of wall-clock ordering. Concretely, the following must hold for the replay to be trusted: 1. The consumer span (the `gen_ai.chat` that used the tool output) must carry a `gen_ai.tool.call.id` reference or a `link` t...",
    "decision_boundary": "The operational rule: **an instance must distrust replay when a consumer `gen_ai.chat` span's `start` timestamp precedes any producer tool span's `end` timestamp that it claims to depend on, AND the consumer span lacks an explicit tool-call link.** In that regime the replay engine is ordering by a clock that does not encode causality; it must fall back to \"r...",
    "operational_effect": "Teams that ignore this boundary see replay divergence rates that look like model instability (5–15% of steps diverge) but are actually recording-topology artifacts concentrated in agents with async tool executors, streaming, or batching exporters. The fix is structural: emit `gen_ai.tool.call.id` on the consumer span, record tool-result events on the consume..."
  },
  "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": "cc7a20479156639dd518e60597b9f70f4cf6420b087525ea75ccc4b0d9676b42",
    "verified_classes": [
      "ReplayCausalityError",
      "Span"
    ],
    "verified_functions": [
      "assert_replay_step_is_causal",
      "replay_step"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReplayCausalityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
