{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-replay-diverge-when-otel-genai-spans-record-post-sampling-tool-arguments",
  "title": "Why does an instance replay diverge when OTel GenAI spans record post-sampling tool arguments?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to forensic replay of LLM agent traces reconstructed from OpenTelemetry GenAI semantic-convention spans (`gen_ai.*` attributes) where the trace pipeline applies tail-based sampling, attribute truncation, or redaction. Does not apply to full-fidelity, unsampled, unredacted span stores with byte-exact request/response payload capture.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-replay-diverge-when-otel-genai-spans-record-post-sampling-tool-arguments.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-replay-diverge-when-otel-genai-spans-record-post-sampling-tool-arguments.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-replay-diverge-when-otel-genai-spans-record-post-sampling-tool-arguments.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1914,
    "python_slice_tokens": 255,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"the trace is complete\": 1. **Observability completeness** — the span set is sufficient for a human to understand *what happened*. Tail sampling, attribute limits (`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`), and PII redaction are all designed to preserve this. 2. **Replay completeness** — the span set is sufficient for a determini...",
    "what_was_observed": "A three-turn agent incident on a retrieval-augmented tool loop. The original execution: - Turn 1: model emits `search_docs(query=\"refund policy for EU orders\", k=20)`. Tool returns 20 documents, ~38 KB of JSON. - Turn 2: model emits `summarize(doc_ids=[...], max_tokens=800)`. Tool returns 800-token summary. - Turn 3: model emits final answer. The OTel pipeline was configured with a tail sampler retaining 10% of trace...",
    "condition_of_validity": "Deterministic replay from OTel GenAI spans holds **only if** the following invariant is enforced at the span-emission boundary: > For every span `S` in the retained trace, and every attribute `A` on `S` that is an input to a downstream tool call or model call, `A` is recorded either (a) in full, or (b) with an explicit `gen_ai.attribute.truncated=true` marke...",
    "decision_boundary": "The decision is: **when is a retained trace admissible as a replay input, versus only as a human-readable artifact?** The boundary is drawn by a pre-replay admissibility check, not by the replayer itself. The check must be conservative and must fail closed: - If any span in the reconstructed tree has an attribute whose length equals the configured `OTEL_ATTR...",
    "operational_effect": "Enforcing the invariant changes three things: 1. **Span emission cost.** Full-fidelity payload capture for tool arguments and completions is expensive. The mitigation is content-addressing: emit a `gen_ai.payload.sha256` and `gen_ai.payload.ref` on the span, store the full payload in a cheaper object store keyed by hash, and let the span carry only the refer..."
  },
  "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": "75799732480bc2006fa11ed29f241eea12b607566f90e81377be25e64ca18dcc",
    "verified_classes": [
      "ReplayInadmissibleError"
    ],
    "verified_functions": [
      "check_replay_admissibility"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReplayInadmissibleError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
