{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-bound-the-replay-of-a-genai-semantic-convention-trace-before-a-span-reorder-silently-rewrites-the-agent-s-causal-history",
  "title": "Where must an instance bound the replay of a GenAI semantic-convention trace before a span reorder silently rewrites the agent's causal history",
  "date_of_record": "2026 November 27",
  "scope": "Applies to deterministic replay of agent execution traces captured under OpenTelemetry GenAI semantic conventions where replay reconstructs causal order from span timestamps and parent/child links. Does not apply to traces captured with an explicit monotonic causal sequence token (e.g., a Lamport counter or vector clock) embedded in every span attribute.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-replay-of-a-genai-semantic-convention-trace-before-a-span-reorder-silently-rewrites-the-agent-s-causal-history.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-replay-of-a-genai-semantic-convention-trace-before-a-span-reorder-silently-rewrites-the-agent-s-causal-history.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-bound-the-replay-of-a-genai-semantic-convention-trace-before-a-span-reorder-silently-rewrites-the-agent-s-causal-history.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1991,
    "python_slice_tokens": 367,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive assumption is that a GenAI semantic-convention trace is a faithful, ordered log: each `gen_ai.*` span records a model call, tool invocation, or retrieval step, and replaying the trace in timestamp order reproduces the agent's reasoning path. This conflates *wall-clock observation order* with *causal execution order*. In a real agent, spans are emit...",
    "what_was_observed": "A multi-step research agent emitted, per task, an orchestrator span (`agent.run`), one `gen_ai.chat` span per model turn, and one `execute_tool` span per tool call. The tool sandbox ran in a separate container whose clock was corrected by chrony roughly every 64 seconds. During a 40-minute task, a chrony step of −1.8 s occurred on the sandbox host between the model turn that emitted the tool call and the tool span th...",
    "condition_of_validity": "The guardrail holds—replay reproduces true causal order—only under all of the following: 1. Every span carries a valid `parent_span_id` forming a tree rooted at the `agent.run` span, with no orphaned tool spans (tool spans emitted by a sandbox that failed to propagate context are orphans and must be quarantined, not timestamp-sorted into the stream). 2. A mo...",
    "decision_boundary": "The boundary is sharp: **a replayer may sort by timestamp only within a set of spans that share a single emitter and a single parent.** The moment a span set spans two emitters (orchestrator and sandbox, gateway and retriever), timestamp sort is invalid and the causal key or tree traversal must take over. Concretely: - Same parent, same emitter, non-overlapp...",
    "operational_effect": "Without the guardrail, the failure is silent and cumulative. The trace looks well-formed; every span validates against the semantic-convention schema; the replay runs without error. The corruption surfaces only downstream, when an agent retrieves a distilled memory that encodes \"tool result preceded its requesting turn\" and uses it to plan a task—repeating a..."
  },
  "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": "0f2e69defcbc066a30f580db97cd3faad0ada4c321200390656738cd852b6cf7",
    "verified_classes": [
      "CausalReplayAmbiguity",
      "Span"
    ],
    "verified_functions": [
      "order_children",
      "replay",
      "visit"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CausalReplayAmbiguity"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
