{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-replays-a-genai-span-stream-whose-tool-call-events-were-sampled-out-mid-trajectory",
  "title": "What happens when an instance replays a GenAI span stream whose tool-call events were sampled out mid-trajectory",
  "date_of_record": "2026 December 2",
  "scope": "Applies to deterministic replay of agent sessions reconstructed from OpenTelemetry GenAI semantic-convention event streams (`gen_ai.*` spans, `gen_ai.tool.call` events, message events) where sampling, exporter backpressure, or span-attribute truncation can drop or reorder events within a single trace. Does not apply to fully materialized session logs written by the agent runtime itself, nor to replay from a lossless write-ahead log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-replays-a-genai-span-stream-whose-tool-call-events-were-sampled-out-mid-trajectory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-replays-a-genai-span-stream-whose-tool-call-events-were-sampled-out-mid-trajectory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-replays-a-genai-span-stream-whose-tool-call-events-were-sampled-out-mid-trajectory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2130,
    "python_slice_tokens": 396,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things people mean by \"replay an agent session from telemetry,\" and they fail in completely different ways. The first is **trace replay**: you reconstruct the *shape* of what happened—which tools were called, in what order, with what arguments—for debugging and audit. This tolerates gaps; a missing span is a hole you can see. The second is **de...",
    "what_was_observed": "A multi-step agent session: user request → `gen_ai.chat` span (model emits a tool call to `search_docs`) → `gen_ai.tool.call` span → `gen_ai.chat` span (model emits a tool call to `fetch_url`) → `gen_ai.tool.call` span → `gen_ai.chat` span (final answer). The trace was exported with a `ParentBased(TraceIdRatioBased(0.5))` head sampler plus a tail-based processor that dropped `gen_ai.tool.call` spans exceeding a 200 m...",
    "condition_of_validity": "Deterministic replay from a GenAI event stream is valid **only if the stream is a complete, ordered, causally closed record of every event that the agent's control flow could have branched on.** Concretely, three invariants must hold simultaneously: 1. **Tool-call closure.** For every assistant message containing `tool_calls`, exactly one `gen_ai.tool.call` ...",
    "decision_boundary": "The decision the replayer must make on encountering an assistant message with a `tool_call` id that has no matching span: - **If the trace is declared \"closure-verified\"** (a manifest attribute, e.g. `replay.complete=true`, set by an exporter that guarantees no mid-trajectory sampling), then a missing tool-call span is a genuine model-side hallucination and ...",
    "operational_effect": "A replay engine that violates these invariants produces **false reproductions**: sessions that terminate successfully, pass schema validation, and are accepted by downstream regression/eval harnesses while representing a trajectory the agent never executed. The blast radius is: - **Regression attribution errors.** A prompt change is blamed for a behavior dif..."
  },
  "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": "332b80fd08dc403eebeeb0c35384175b80e4b0daa4f96743eab7a9c28fe711b8",
    "verified_classes": [
      "ReplayDivergence",
      "Span",
      "Trace"
    ],
    "verified_functions": [
      "replay",
      "replay_session"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ReplayDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
