{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-refuse-to-emit-a-genai-span-when-tool-call-attribution-cannot-be-reconstructed-from-the-parent-context",
  "title": "Where must an instance refuse to emit a GenAI span when tool-call attribution cannot be reconstructed from the parent context",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents instrumented with OpenTelemetry GenAI semantic conventions (`gen_ai.*`) where tool calls execute across a context boundary (async worker, sub-agent, MCP transport hop, or resumed checkpoint). Does not apply to single-turn, single-process instrumentation where the tool executor shares the caller's `Context` object synchronously.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-emit-a-genai-span-when-tool-call-attribution-cannot-be-reconstructed-from-the-parent-context.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-emit-a-genai-span-when-tool-call-attribution-cannot-be-reconstructed-from-the-parent-context.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-emit-a-genai-span-when-tool-call-attribution-cannot-be-reconstructed-from-the-parent-context.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1944,
    "python_slice_tokens": 372,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two mutually incompatible things an instrumented agent can do when it invokes a tool whose execution is decoupled from the span that requested it: 1. **Emit a `gen_ai.tool.call` span anyway**, reconstructing attribution from what is locally available (the tool name string, a thread-local \"current span,\" or a freshly minted trace ID). 2. **Refuse to...",
    "what_was_observed": "A planner agent (`gen_ai.operation.name = \"chat\"`, span `S_plan`) emits a tool call to a code-execution worker over an async queue. The worker runs in a separate process with its own `TracerProvider` and its own `Context`. The instrumentation in the worker does the natural thing: - It reads `gen_ai.tool.name` from the request payload (present, correct). - It reads the \"current span\" from its own context — which is `N...",
    "condition_of_validity": "The guardrail is only sound under a stated precondition, and stating it is the point: > A `gen_ai.tool.call` span is *valid* if and only if the tuple `(trace_id, parent_span_id, gen_ai.tool.name, args_digest)` present at execution time equals the tuple the requester recorded at dispatch time. `args_digest` is a stable hash of the serialized tool arguments. I...",
    "decision_boundary": "The boundary between \"emit attributed\" and \"emit degraded/refuse\" is a single comparison, and it must live in the executor, not the requester: - **Emit attributed child** iff `parent_span_id` is non-zero AND the resolved parent span's `gen_ai.operation.name` is a reasoning operation (`chat`, `invoke_agent`, `execute_tool`) AND `args_digest` matches the dispa...",
    "operational_effect": "Enforcing this boundary changes three things downstream: 1. **Token accounting becomes causal, not additive.** `gen_ai.usage.*_tokens` summed under a reasoning span now reflects only the tool calls that reasoning span actually issued. Previously, pool-worker bleed silently moved tokens between agent instances, and cost dashboards attributed spend to the wron..."
  },
  "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": "67cd97820a71770274536b89f145d3a101314707ef23c89bd37b3daafef67766",
    "verified_classes": [
      "GenAIAttributionError",
      "DispatchRecord",
      "ExecutionContext"
    ],
    "verified_functions": [
      "digest_args",
      "resolve_attribution",
      "emit_tool_span"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "GenAIAttributionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
