{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-of-a-genai-span-attribute-be-resolved-the-tool-call-argument-cardinality-invariant-in-opentelemetry-genai-semantic-conventions",
  "title": "Where must an instance of a GenAI span attribute be resolved: the tool-call argument cardinality invariant in OpenTelemetry GenAI semantic conventions",
  "date_of_record": "2026 November 23",
  "scope": "Applies to instrumentation and downstream processing of OpenTelemetry spans carrying `gen_ai.*` attributes where a span represents either an inference operation (`gen_ai.operation.name = \"chat\"` / `\"text_completion\"`) or a tool execution (`gen_ai.operation.name = \"execute_tool\"`), and where tool arguments or model outputs are recorded as attributes. Does not apply to pure metric-only telemetry, nor to spans where tool payloads are deliberately omitted per a documented redaction policy.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-genai-span-attribute-be-resolved-the-tool-call-argument-cardinality-invariant-in-opentelemetry-genai-semantic-conventions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-genai-span-attribute-be-resolved-the-tool-call-argument-cardinality-invariant-in-opentelemetry-genai-semantic-conventions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-genai-span-attribute-be-resolved-the-tool-call-argument-cardinality-invariant-in-opentelemetry-genai-semantic-conventions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1439,
    "python_slice_tokens": 344,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions distinguish between an *inference span* that **proposes** a tool call and a *tool span* that **executes** one. The non-obvious boundary: `gen_ai.tool.call.arguments` / `gen_ai.tool.call.id` on the *inference* span describe an intent **not yet validated against a tool schema**, whereas the same-named attributes on the *tool* spa...",
    "what_was_observed": "In a production agent loop using parallel tool calls (one assistant turn emitting three `execute` requests), the inference span was emitted with `gen_ai.tool.call.id` set to the *first* call's id and `gen_ai.tool.call.arguments` set to a JSON object containing only that first call's arguments. The remaining two calls appeared as separate `execute_tool` child spans with correct ids, but their parent referenced none of...",
    "condition_of_validity": "The invariant \"one inference span's tool-call attributes correspond one-to-one with child tool spans\" holds **only** when: 1. The inference response contains exactly one tool call, AND 2. The tool call's arguments parse as valid JSON when the inference span is closed, AND 3. The tool call id is unique per inference attempt (not reused across retries), AND 4....",
    "decision_boundary": "The decision is *where* to resolve the instance of each tool call: - **Resolve at inference-span construction (recommended):** emit one attribute pair per call using the indexed convention, and record `gen_ai.tool.call.count` equal to the number of proposals. This makes the one-to-many relationship explicit and lets consumers detect dropped calls by comparin...",
    "operational_effect": "Instrumentation that resolves the instance at inference-span construction yields: (a) exact join cardinality between proposed and executed calls, (b) a countable dispatch-failure signal (proposed minus executed), and (c) retry-safe attribution when call ids are scoped per attempt rather than per logical request. Instrumentation that does not resolve it produ..."
  },
  "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": "58851577e791faa15e605a9db7becd0f1d99b00a0b52c4839cd9ad87403c84e4",
    "verified_classes": [
      "ToolCallResolutionError",
      "ProposedToolCall",
      "GenAiSpan"
    ],
    "verified_functions": [
      "finalize_inference_span",
      "assert_proposed_executed_balance"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ToolCallResolutionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
