{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-a-divergent-tool-call-ledger-before-emitting-lineage",
  "title": "In what scenarios must an instance reconcile OpenTelemetry GenAI span attributes against a divergent tool-call ledger before emitting lineage",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent runtimes that emit OTel GenAI semantic-convention spans (`gen_ai.*`) for model invocations and tool calls while also maintaining an internal execution ledger used for token accounting and lineage reconstruction. Does not apply to stateless single-shot inference where no tool-call ledger exists or where spans are emitted post-hoc from a single authoritative source.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-a-divergent-tool-call-ledger-before-emitting-lineage.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-a-divergent-tool-call-ledger-before-emitting-lineage.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-reconcile-opentelemetry-genai-span-attributes-against-a-divergent-tool-call-ledger-before-emitting-lineage.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1570,
    "python_slice_tokens": 263,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"tracing is wrong.\" It is that **the OTel GenAI span tree and the agent's internal tool-call ledger are two independently-mutated records of the same execution, and the semantic conventions do not define which one is authoritative when they disagree.** A span is an *observation* emitted at the moment a call is initiated or completed; ...",
    "what_was_observed": "A planner agent (model invocation span `inv-1`) emitted a parallel tool dispatch of three `search` calls. The runtime opened three tool spans sharing the parent `inv-1` span context. Tool 2 (`search`, `gen_ai.tool.call.id=tc-2`) hit a 30s deadline mid-stream: the HTTP client received headers and a partial body, then the connection reset. The runtime's retry policy re-issued `tc-2` as `tc-2r` under the *same* parent s...",
    "condition_of_validity": "The reconciliation requirement is valid only when all three hold: 1. The runtime emits spans *at call time* (synchronously or via a buffered exporter that preserves initiation order), so span count reflects attempted invocations, not committed effects. 2. The ledger records effects keyed by a stable logical-call identity that survives retries (e.g., `tc-2` r...",
    "decision_boundary": "Before emitting lineage or finalizing token accounting, an instance must decide: **is `gen_ai.tool.call.id` the logical call or the attempt?** The conventions leave this ambiguous. The operational rule that bounds the failure: - Treat `gen_ai.tool.call.id` as the *attempt* id (it is emitted at call time and cannot know the future). - Maintain a separate ledg...",
    "operational_effect": "With reconciliation enforced, the observed case resolves: the four tool spans collapse to three logical calls, the retry's re-sent prompt is attributed to `tc-2` as an attempt cost (visible for cost analysis, excluded from the logical-call token total used for budget and lineage), and the auditor's replay matches the ledger. Without it, the agent's own 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": "ff8a84643d853bd47d3db26bf5a35cfc6b2b5fa891b9198f8f6ce25a17bd4a02",
    "verified_classes": [
      "LineageReconciliationError"
    ],
    "verified_functions": [
      "reconcile_invocation"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "LineageReconciliationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
