{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-reconcile-non-monotonic-span-timestamps-before-deterministic-replay-of-an-agentic-session-from-opentelemetry-genai-logs",
  "title": "Where must an instance reconcile non-monotonic span timestamps before deterministic replay of an agentic session from OpenTelemetry GenAI logs?",
  "date_of_record": "2026 December 2",
  "scope": "Applies to replay harnesses that reconstruct agent execution (tool calls, memory reads/writes, LLM invocations) from OTel GenAI spans (`gen_ai.*` semantic conventions) emitted by concurrent or async runtimes. Does not apply to single-threaded synchronous traces where span start/end ordering is guaranteed by the runtime, nor to replay that only consumes a canonical event-sourced journal rather than the span tree.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-non-monotonic-span-timestamps-before-deterministic-replay-of-an-agentic-session-from-opentelemetry-genai-logs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-non-monotonic-span-timestamps-before-deterministic-replay-of-an-agentic-session-from-opentelemetry-genai-logs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-reconcile-non-monotonic-span-timestamps-before-deterministic-replay-of-an-agentic-session-from-opentelemetry-genai-logs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2076,
    "python_slice_tokens": 568,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **causal order** (which event actually caused which) and **span emission order** (the order timestamps happen to land in the exported batch). Deterministic replay requires the former; OTel GenAI logs reliably provide only the latter. A replay engine that sorts spans by `start_time_unix_nano` and feeds them to a fresh a...",
    "what_was_observed": "A session with a single `gen_ai.agent` root span and three children: `gen_ai.tool` (memory read of key `user.preferences`), `gen_ai.chat` (LLM call that consumes the read result), and `gen_ai.tool` (memory write of `user.preferences` triggered by a parallel planner branch). Exported attributes: - Root `start_time`: `T+0ms` - Memory-write child `start_time`: `T+2ms`, `end_time`: `T+9ms` - Memory-read child `start_time...",
    "condition_of_validity": "Timestamp-sorted replay is valid only if all of the following hold for the session: 1. **Single-writer causal chain.** No two spans under the same `trace_id` touch the same memory key, tool resource, or external endpoint without an explicit `link` attribute (`SpanLink`) recording the dependency. 2. **Monotonic parent-child containment.** For every span `s` a...",
    "decision_boundary": "The boundary is between **replayable** and **replayable-with-reconstruction**, and it is crossed the moment the harness detects a non-monotonic edge or an unresolved causal dependency. Concretely: before feeding spans to the replayed agent, the harness computes a partial order. Edges come from (a) parent-child containment where it holds, (b) `SpanLink` attri...",
    "operational_effect": "The operational consequence is that a replay harness built on OTel GenAI logs cannot treat the span tree as a total order. It must treat it as a partial order plus a set of unresolved edges, and it must fail closed on unresolved edges. Teams that skipped this step reported replay divergence rates of 8–14% on multi-tool sessions, with the divergences concentr..."
  },
  "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": "e876e6e9d9911f013bb9498e29a12eb5769d7b3179650405715ec134e2396bd4",
    "verified_classes": [
      "ReplayOrderViolation",
      "Span"
    ],
    "verified_functions": [
      "linearize",
      "replay"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReplayOrderViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
