{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-trajectory-replay-divergence-when-genai-semantic-convention-exporters-lose-span-parentage-across-a-mid-run-trace-flush-bounda",
  "title": "Which invariants prevent trajectory-replay divergence when GenAI semantic-convention exporters lose span parentage across a mid-run trace-flush boundary",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent runtimes that emit OpenTelemetry GenAI semantic-convention spans (`gen_ai.*`) for trajectory replay and incident forensics, specifically when the exporter batches spans and the collector or SDK performs a mid-run flush, partial drop, or reordering. Does not apply to synchronous single-span tracing, or to runtimes that write trajectory records directly to durable append-only storage without an OTel export hop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-trajectory-replay-divergence-when-genai-semantic-convention-exporters-lose-span-parentage-across-a-mid-run-trace-flush-bounda.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-trajectory-replay-divergence-when-genai-semantic-convention-exporters-lose-span-parentage-across-a-mid-run-trace-flush-bounda.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-trajectory-replay-divergence-when-genai-semantic-convention-exporters-lose-span-parentage-across-a-mid-run-trace-flush-bounda.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1819,
    "python_slice_tokens": 330,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A GenAI trajectory is not a log stream; it is a *causal tree* whose forensic value depends on the parent-child edges between `invoke_agent`, `chat`, `execute_tool`, and `retrieval` spans being reconstructable *after* the fact. The distinction that matters here is between **span completeness** (every span arrived) and **edge integrity** (every span arrived wi...",
    "what_was_observed": "During a post-incident replay of a 47-step agent run, the forensic tool reconstructed 46 spans but produced a trajectory graph with 11 disconnected components. The run had terminated with a wrong-answer outcome after a `execute_tool` call returned a truncated JSON payload that the agent misparsed. The replay could not attribute the malformed tool output to the `chat` span that emitted the tool-call arguments, because...",
    "condition_of_validity": "The parent-before-child invariant holds for replay only under the conjunction of three conditions, any of which can be violated independently: 1. **Parent liveness bound:** every span's `SpanContext` is durably persisted to the export path *before* any child span is enqueued. This requires the exporter to emit a \"span started\" record (or a `SpanContext` rese...",
    "decision_boundary": "The boundary is between **lossy-but-honest** and **complete-but-lying**. An exporter that drops the root span and *marks* the children as `orphaned: true` yields a replay that knows it is incomplete and can refuse to attribute causality. An exporter that drops the root and lets children export with dangling parent references yields a replay that appears comp...",
    "operational_effect": "With the admission check in place, the 47-step run above would have been quarantined at replay time with a precise fault: `trace_id=... missing root span_id=... (invoke_agent, started t=0, never exported)`. The forensic team would have known immediately that the tool-output attribution was unavailable, rather than spending two days chasing a false causal cha..."
  },
  "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": "708f034c4ce675a1c27158a51132fd62833117a8cf8bff1500731316a7989b05",
    "verified_classes": [
      "ReplayAdmissionError",
      "Span"
    ],
    "verified_functions": [
      "admit_trajectory",
      "replay_step"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReplayAdmissionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
