{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-replay-an-agentic-trace-deterministically-under-otel-genai-conventions-the-span-parenting-invariant-that-silently-breaks-replay",
  "title": "When must an instance replay an agentic trace deterministically under OTel GenAI conventions: the span-parenting invariant that silently breaks replay under concurrent tool execution",
  "date_of_record": "2026 November 15",
  "scope": "Applies to deterministic replay of agentic LLM traces captured under OpenTelemetry GenAI semantic conventions (gen_ai.* attributes, `gen_ai.operation.name`, span kinds `chat`/`execute_tool`/`invoke_agent`) where the agent may issue tool calls concurrently or interleave model turns with tool execution. Does not apply to single-threaded, strictly sequential agent loops, nor to replay systems that treat the trace as a flat event log rather than a span tree.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-replay-an-agentic-trace-deterministically-under-otel-genai-conventions-the-span-parenting-invariant-that-silently-breaks-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-replay-an-agentic-trace-deterministically-under-otel-genai-conventions-the-span-parenting-invariant-that-silently-breaks-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-replay-an-agentic-trace-deterministically-under-otel-genai-conventions-the-span-parenting-invariant-that-silently-breaks-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1287,
    "python_slice_tokens": 268,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A trace is *observationally complete* when every attribute needed to reconstruct the agent's next decision is present on some span. A trace is *deterministically replayable* when the span tree also encodes the *causal ordering* of those decisions. These are not the same property, and OTel GenAI conventions do not guarantee the second. The non-obvious boundar...",
    "what_was_observed": "In a captured trace from an agent using parallel tool dispatch (three `execute_tool` spans under `invoke_agent`, two `chat` spans), the replay harness reconstructed the conversation by sorting spans by `start_time_unix_nano`. The original run had dispatched all three tools after turn 1 and consumed their results in turn 2. Replay produced turn 2 consuming only the first-completing tool, then re-dispatched the other t...",
    "condition_of_validity": "Deterministic replay is valid if and only if all of the following hold for the trace: 1. Every `chat` span carries the set of `gen_ai.tool.call.id` values it consumed, or every tool span is a descendant of the `chat` span that consumed it. 2. Tool spans that execute concurrently share a parent whose children are ordered by a monotonic sequence attribute, not...",
    "decision_boundary": "The decision is not \"is the trace complete?\" but \"does the trace encode consumption edges?\" Concretely: - **Sequential agent, tool spans children of chat span** → replay deterministically. - **Concurrent agent, tool spans children of chat span** → replay deterministically; order children by `gen_ai.tool.call.id` sequence or an explicit index attribute. - **C...",
    "operational_effect": "Treating a structurally-replayable trace as deterministically-replayable produces false regression signals: the replayed agent diverges, the harness reports a behavioral change, and engineers investigate a model or prompt change that never occurred. The correct operational posture is to gate replay eligibility on the consumption-edge check at trace-ingest ti..."
  },
  "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": "4f4e91d3488925fc709e8d6b72e04f0f6ade1065552d26363cef495975ad8a37",
    "verified_classes": [
      "ReplayIneligibilityError",
      "Span"
    ],
    "verified_functions": [
      "assert_deterministically_replayable"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReplayIneligibilityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
