{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-level-trace-replay-diverge-from-the-causal-chain-it-claims-to-reconstruct-when-semantic-conventions-bind-span-attributes-at-emiss",
  "title": "Why does an instance-level trace replay diverge from the causal chain it claims to reconstruct when semantic conventions bind span attributes at emission time",
  "date_of_record": "2026 November 29",
  "scope": "Applies to post-incident causal reconstruction of autonomous agent runs that are replayed from OpenTelemetry-style spans carrying GenAI semantic conventions (`gen_ai.*`), where the replay engine reconstructs state by re-executing or re-interpreting recorded spans. Does not apply to live tracing, to span export/sampling pipelines, or to replays that record full token-level model I/O and treat spans as opaque blobs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-level-trace-replay-diverge-from-the-causal-chain-it-claims-to-reconstruct-when-semantic-conventions-bind-span-attributes-at-emiss.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-level-trace-replay-diverge-from-the-causal-chain-it-claims-to-reconstruct-when-semantic-conventions-bind-span-attributes-at-emiss.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-level-trace-replay-diverge-from-the-causal-chain-it-claims-to-reconstruct-when-semantic-conventions-bind-span-attributes-at-emiss.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1772,
    "python_slice_tokens": 226,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the trace is incomplete.\" It is that **semantic-convention attributes are bound at span emission time, not at decision time**, and the replay engine silently treats the bound value as if it were the input the agent actually reasoned over. When an agent emits a `gen_ai.chat` span, the attributes written (`gen_ai.request.model`, `gen_ai.usa...",
    "what_was_observed": "A multi-step research agent (`plan → retrieve → synthesize → verify`) failed a verification step at turn 7 with a hallucinated citation. The incident trace showed: - Turn 4 `gen_ai.chat` span: `gen_ai.prompt.message.3.content` = a retrieval result containing the correct document ID `DOC-8821`. - Turn 6 `gen_ai.chat` span: `gen_ai.prompt.message.5.content` = a *different* retrieval result, `DOC-4417`, with no record o...",
    "condition_of_validity": "The replay's causal reconstruction is valid only if, for every replayed `gen_ai.chat` span, the following invariant holds: **Span-content invariant:** `tokenize(reconstructed_prompt(span)) == span.gen_ai.usage.input_tokens ± tokenizer_drift`, where `tokenizer_drift` is bounded by the known tokenizer version recorded in `gen_ai.request.model` (or a `gen_ai.to...",
    "decision_boundary": "The replay engine must branch on the token-count check per span, not per trace: - **Divergence within bound** → span is `conditioning_verified`; causal edges through it are admissible. - **Divergence beyond bound, no `gen_ai.prompt.hash`** → span is `conditioning_unverified`; any causal edge that *depends on span content* (e.g., \"model saw X at turn N\") is i...",
    "operational_effect": "Downstream consumers of the replay — incident postmortems, verifier-calibration datasets, regression suites built from replayed failures — inherit the inversion. In the observed case, the verifier was retuned against a hallucination it did not commit, and the actual failure (context eviction without a tombstone) went unremediated for three weeks until a seco..."
  },
  "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": "338e53fea3f29b15c10ad355fb59bbedf4642905de6a27eb54d89a3e7070e084",
    "verified_classes": [
      "ConditioningUnverifiedError",
      "ReplaySpan"
    ],
    "verified_functions": [
      "verify_conditioning",
      "build_causal_edge"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ConditioningUnverifiedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
