{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abandon-genai-span-attribution-for-a-tool-call-whose-lineage-parent-has-already-been-evicted-from-the-exporter-buffer",
  "title": "When must an instance abandon GenAI span attribution for a tool call whose lineage parent has already been evicted from the exporter buffer?",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent runtimes that emit OpenTelemetry spans under the GenAI semantic conventions (`gen_ai.operation.name`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.tool.name`, `gen_ai.tool.call.id`) across multi-step tool-calling loops with a bounded span exporter queue. Does not apply to single-shot inference with no tool lineage, nor to runtimes that buffer spans unboundedly in-process.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-genai-span-attribution-for-a-tool-call-whose-lineage-parent-has-already-been-evicted-from-the-exporter-buffer.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-genai-span-attribution-for-a-tool-call-whose-lineage-parent-has-already-been-evicted-from-the-exporter-buffer.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-genai-span-attribution-for-a-tool-call-whose-lineage-parent-has-already-been-evicted-from-the-exporter-buffer.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1622,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"a tool call is attributed.\" The first is *semantic attribution*: the span carries the correct `gen_ai.tool.name`, the correct `gen_ai.tool.call.id`, and a token-usage delta that reconciles against the parent `gen_ai.operation.name = \"chat\"` span. The second is *lineage attribution*: the child tool span's `parent_span_id` re...",
    "what_was_observed": "A ReAct-style agent executing a five-step tool loop against a slow external API. The chat span for step 3 (`gen_ai.operation.name = \"chat\"`, `gen_ai.usage.input_tokens = 8120`, `gen_ai.usage.output_tokens = 340`) was emitted at `t=0`. The tool span for the subsequent `search_docs` call (`gen_ai.tool.name = \"search_docs\"`, `gen_ai.tool.call.id = \"call_9f2a\"`) was not emitted until the tool returned at `t=41s`, because...",
    "condition_of_validity": "The invariant holds only when the following conjunction is true: (a) tool spans are held open for the duration of the tool call rather than emitted at call-start with a later duration patch; (b) the span exporter queue is bounded; (c) the collector applies a trace TTL or a \"trace complete\" flush heuristic that can close a trace before all children are enqueu...",
    "decision_boundary": "The runtime must decide, at the moment a tool span is about to be enqueued, whether its parent chat span is still *lineage-viable* — not merely whether it was successfully exported. These are different predicates. Successful export does not imply the collector has retained the parent; the collector may have closed the trace. The correct guard is a local line...",
    "operational_effect": "With the guard in place, the reconciliation between the token dashboard and the lineage dashboard becomes exact: every tool span is either joined to a live parent or explicitly bucketed as orphaned, and the orphan bucket is a first-class metric (`gen_ai.lineage.orphaned_total`) rather than an invisible residue. The cost is a small increase in span volume for..."
  },
  "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": "eca60be818c3f1c263f5a39c2c604b6f48c90d52ee8e866e6bd6e36771bddeb5",
    "verified_classes": [
      "LineageEvictionError",
      "SpanRecord",
      "LineageLedger"
    ],
    "verified_functions": [
      "enqueue_tool_span",
      "record_enqueue",
      "parent_is_lineage_viable"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "LineageEvictionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
