{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-causality-linkage-when-a-genai-semantic-convention-exporter-batches-spans-across-an-agent-s-tool-call-boundary",
  "title": "Why does an instance lose causality linkage when a GenAI semantic-convention exporter batches spans across an agent's tool-call boundary",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that emit OpenTelemetry-style GenAI semantic-convention spans (`gen_ai.operation.name`, `gen_ai.agent.id`, `gen_ai.tool.call.id`, custom `causality.link.id`) through a batching exporter that flushes on a size or timer trigger. Does not apply to synchronous per-span exporters or to trace-only observability where no downstream consumer reconstructs the reasoning DAG.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causality-linkage-when-a-genai-semantic-convention-exporter-batches-spans-across-an-agent-s-tool-call-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causality-linkage-when-a-genai-semantic-convention-exporter-batches-spans-across-an-agent-s-tool-call-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-causality-linkage-when-a-genai-semantic-convention-exporter-batches-spans-across-an-agent-s-tool-call-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1675,
    "python_slice_tokens": 297,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **span emission order** and **causal dependency order**. Semantic-convention exporters treat spans as independent records appended to a buffer and flushed in insertion order. But an agent's reasoning trace is a DAG: a `gen_ai.operation.name=execute_tool` span for call `T1` is the *cause* of the subsequent `chat` span t...",
    "what_was_observed": "An agent executing a three-step tool chain (`search` → `fetch` → `summarize`) emitted spans with these attributes: - Span A: `gen_ai.operation.name=execute_tool`, `gen_ai.tool.call.id=call_7f2a`, `causality.link.id=cl_4410`, no parent span. - Span B: `gen_ai.operation.name=chat`, `causality.link.id=cl_4410`, `causality.parent.call.id=call_7f2a`. - Span C: `gen_ai.operation.name=execute_tool`, `gen_ai.tool.call.id=cal...",
    "condition_of_validity": "The failure requires all three conditions simultaneously: 1. **Batching with a size or timer trigger.** A synchronous exporter that flushes each span on `end()` cannot reorder across a batch boundary. The reorder window opens only when spans accumulate. 2. **A retry or re-entry path that re-emits a span for an already-emitted `gen_ai.tool.call.id`.** Semanti...",
    "decision_boundary": "The boundary is between **attribute-level causality** (what the semantic conventions specify) and **record-level causality** (what the trace consumer needs). The conventions give you `causality.link.id` and `causality.parent.call.id` as *attributes on a span*. They do not give you a guarantee that the span carrying the producer attribute is *present in the s...",
    "operational_effect": "Without the barrier, the operational effect is a **silent causality inversion**: the trace reconstructor produces a plausible-looking DAG that misrepresents the agent's reasoning order. Because the DAG is plausible, automated auditors pass it; because it is wrong, any post-hoc analysis of *why* the agent chose an action — the core purpose of reasoning-trace ..."
  },
  "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": "543618ac5cbfdc5bf675771ebde1182e0289237692e8962d672cdb7710348403",
    "verified_classes": [
      "CausalityLinkError",
      "Span",
      "CausalityAwareBatcher"
    ],
    "verified_functions": [
      "emit",
      "flush"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CausalityLinkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
