{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-replayed-genai-span-tree-as-forensically-invalid-rather-than-merely-lossy",
  "title": "Under what conditions must an instance treat a replayed GenAI span tree as forensically invalid rather than merely lossy?",
  "date_of_record": "2026 November 20",
  "scope": "Applies to post-hoc deterministic replay of agentic sessions reconstructed from OpenTelemetry GenAI semantic-convention spans (tool calls, model invocations, handoffs) for incident forensics. Does not apply to live tracing, cost attribution, or replay of single-shot stateless completions with no tool loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-replayed-genai-span-tree-as-forensically-invalid-rather-than-merely-lossy.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-replayed-genai-span-tree-as-forensically-invalid-rather-than-merely-lossy.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-replayed-genai-span-tree-as-forensically-invalid-rather-than-merely-lossy.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1907,
    "python_slice_tokens": 548,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A replayed span tree is *lossy* when it omits detail (e.g., truncated prompt bodies) but preserves the causal ordering and the input→output identity of every state transition. It is *forensically invalid* when the reconstruction silently reorders, duplicates, or substitutes a state transition such that the replayed agent would have taken a different action t...",
    "what_was_observed": "A production incident: a four-step agent loop (plan → `search_docs` → `summarize` → `write_file`) failed live with a `write_file` permission error. Forensic replay reconstructed the session from the OTel collector's span store. The replay produced a *different* failure—the agent never reached `write_file`; it looped on `search_docs` twice and exhausted its token budget. Root cause: the `summarize` model span and the ...",
    "condition_of_validity": "A replayed span tree is admissible as forensic evidence only if all three hold: 1. **Causal ordering is reconstruction-stable.** For every pair of spans that are causally related (tool result consumed by a model call, handoff state passed between agents), the reconstructed order is derivable from an explicit linkage attribute (`gen_ai.tool.call.id`, `gen_ai....",
    "decision_boundary": "The boundary between \"replay and report with confidence interval\" and \"refuse replay\" is: - **Skew envelope < inter-span causal gap** for all causally-linked pairs → replay is admissible; report lossiness separately. - **Skew envelope ≥ inter-span causal gap** for any causally-linked pair *and* no explicit linkage attribute → replay is invalid; emit a `Repla...",
    "operational_effect": "When the certificate check is enforced, the observed incident's replay is refused at the `summarize`/`search_docs` pair with `ReplayOrderingIndeterminate`, and the responder is directed to the raw span store to inspect the `gen_ai.tool.call.id` linkage manually. The live failure (permission error at `write_file`) is then correctly attributed. Without the che..."
  },
  "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": "20628253ba3dd8db5f331b4ec6e5ada2001b754e0e8bec97665bbf7aac0fc246",
    "verified_classes": [
      "ReplayOrderingIndeterminate",
      "Span"
    ],
    "verified_functions": [
      "certify_causal_order",
      "replay_turn"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReplayOrderingIndeterminate"
    ],
    "sample_fail_closed_invariants": [
      "causal graph contains a cycle; no valid replay order exists"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
