{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-emit-a-genai-tool-call-span-it-cannot-correlate-the-orphaned-gen-ai-tool-call-id-invariant-under-parallel-agent-fan-ou",
  "title": "When must an instance refuse to emit a GenAI tool-call span it cannot correlate: the orphaned `gen_ai.tool.call.id` invariant under parallel agent fan-out",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents instrumented with OpenTelemetry GenAI semantic conventions (`gen_ai.*`) that emit tool-call spans and correlate them across parent agent spans, including multi-agent handoffs. Does not cover non-GenAI RPC spans, pure metrics/logs pipelines, or tracing of the model provider's own internal inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-emit-a-genai-tool-call-span-it-cannot-correlate-the-orphaned-gen-ai-tool-call-id-invariant-under-parallel-agent-fan-ou.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-emit-a-genai-tool-call-span-it-cannot-correlate-the-orphaned-gen-ai-tool-call-id-invariant-under-parallel-agent-fan-ou.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-emit-a-genai-tool-call-span-it-cannot-correlate-the-orphaned-gen-ai-tool-call-id-invariant-under-parallel-agent-fan-ou.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1748,
    "python_slice_tokens": 465,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat a tool-call span as a *child of the agent span that issued the call*, correlated upward by span parentage and sideways by the `gen_ai.tool.call.id` attribute. There are two structurally different ways a tool-call span can be \"uncorrelatable,\" and they require opposite handling: 1. **Missing parent context** — the span is ...",
    "what_was_observed": "A planner agent (`gen_ai.agent.name=planner`) decomposed a task into three sub-goals and dispatched them to three worker instances via a fan-out over `asyncio.gather`. The runtime minted tool-call ids at *plan time*, before fan-out, to allow the workers to pre-warm tool schemas. All three workers therefore inherited the same seed id `call_7f3a` for their first tool invocation, and each emitted: with three distinct pa...",
    "condition_of_validity": "The invariant holds — and an instance may safely emit a correlated tool-call span — only when all of the following are true at emission time: - The `gen_ai.tool.call.id` was minted *after* the decision to invoke the tool, scoped to the emitting agent instance, not inherited from a shared plan object. - The id is unique within the trace, verifiable by the emi...",
    "decision_boundary": "The boundary is between \"id present but ambiguous\" and \"id absent but honest.\" The decision rule: - **Emit correlated span** iff the id passes the per-trace uniqueness check at emission. - **Emit degraded span** (id redacted to `null`, `gen_ai.tool.call.id.collision=true`, original id retained only in a non-correlating `gen_ai.tool.call.id.raw` attribute exc...",
    "operational_effect": "After enforcing the invariant, fan-out tool-call spans carry distinct ids and the collector's attribute join recovers a 3:3 mapping; replay attributes each `http_fetch` to its true worker. The cost is that pre-warming by plan-time id is no longer possible — schema pre-warm must key on `gen_ai.tool.name`, not `call.id`. The guardrail is a per-trace id registr..."
  },
  "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": "9c23f851d24c0d2cddf04b5a6df9ab07fa2d2f7ef66118a0249038b8ebd13f99",
    "verified_classes": [
      "OrphanedToolCallIdError",
      "ToolCallSpan",
      "TraceIdRegistry"
    ],
    "verified_functions": [
      "emit_tool_call_span",
      "fan_out_first_tool",
      "__init__",
      "mint",
      "claim"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedToolCallIdError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
