{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-non-deterministic-otel-genai-span-replay-when-sampling-decisions-diverge-from-the-audit-trace-s-decision-log",
  "title": "How should an instance reconcile non-deterministic OTel GenAI span replay when sampling decisions diverge from the audit trace's decision log",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agentic runtime that emits OpenTelemetry GenAI semantic-convention spans (`gen_ai.*`) and later attempts deterministic replay or audit by reconstructing execution from the span tree. Does not apply to runtimes that persist a full decision log (prompt, tool args, sampled token IDs, seed) out-of-band and treat spans as pure observability; nor to single-shot, non-tool-calling completions where replay is trivially re-invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-non-deterministic-otel-genai-span-replay-when-sampling-decisions-diverge-from-the-audit-trace-s-decision-log.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-non-deterministic-otel-genai-span-replay-when-sampling-decisions-diverge-from-the-audit-trace-s-decision-log.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-non-deterministic-otel-genai-span-replay-when-sampling-decisions-diverge-from-the-audit-trace-s-decision-log.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1626,
    "python_slice_tokens": 351,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct artifacts that both look like \"the trace\": the **span tree** (a sampled, timestamped, parent-linked projection of what the runtime *reported*) and the **decision log** (the exhaustive, ordered record of what the runtime *committed to*: model id, seed, temperature, tool call arguments, and the exact retry/sampling branch taken). Determi...",
    "what_was_observed": "An agent executing a ReAct-style loop over four tool calls emitted a trace where span `gen_ai.chat#3` (the reasoning step that chose between `search` and `fetch`) had a single child `gen_ai.tool_call:fetch`. The decision log for the same run recorded that the model produced *two* candidate tool calls in that step (`search` and `fetch`), the runtime's branch selector picked `fetch` based on a `temperature=0.7` sample,...",
    "condition_of_validity": "Replay from a span tree is valid **only if** all of the following hold: 1. The sampling policy is *deterministic-complete* for the span classes that carry branch decisions — i.e., `gen_ai.chat` and `gen_ai.tool_call` spans are never subject to tail-based dropping, or the sampler is configured with a `force_sample` rule keyed on a `replay.critical=true` attri...",
    "decision_boundary": "The operative question at replay time is: **does the span tree's branch structure match the decision log's branch structure?** Concretely, for each `gen_ai.chat` span with `n` recorded tool-call children, the decision log must record exactly `n` selected branches and `m` discarded branches, with `n + m` equal to the candidate count at that step. If `m > 0` a...",
    "operational_effect": "Without this invariant, audit findings invert: defects caused by discarded-branch side effects are attributed to the retained path, and replays \"prove\" correctness that never held. The practical remediation is a **replay-soundness gate** in the audit pipeline that cross-checks span-tree branch counts against the decision log and raises on mismatch, plus a sa..."
  },
  "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": "513af43ec81e31924f4e6b47a009a72671fefa01bb6bcb677f0aa150454ea6fe",
    "verified_classes": [
      "ReplayUnsoundError",
      "ChatSpan",
      "DecisionLogEntry"
    ],
    "verified_functions": [
      "assert_replay_soundness"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ReplayUnsoundError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
