{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-reject-a-genai-span-that-carries-a-valid-gen-ai-tool-call-id-but-no-resolvable-parent-invocation-the-tool-call-lineage-invariant",
  "title": "When must an instance reject a GenAI span that carries a valid `gen_ai.tool.call.id` but no resolvable parent invocation: the tool-call lineage invariant",
  "date_of_record": "2026 November 15",
  "scope": "Applies to OpenTelemetry SDK/collector pipelines emitting spans under the `gen_ai.*` semantic conventions (tool execution spans, model invocation spans, and their parent/child linkage). Does not apply to non-GenAI spans, nor to spans that have been deliberately flattened into a single trace by an upstream re-parenting proxy.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-genai-span-that-carries-a-valid-gen-ai-tool-call-id-but-no-resolvable-parent-invocation-the-tool-call-lineage-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-genai-span-that-carries-a-valid-gen-ai-tool-call-id-but-no-resolvable-parent-invocation-the-tool-call-lineage-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-genai-span-that-carries-a-valid-gen-ai-tool-call-id-but-no-resolvable-parent-invocation-the-tool-call-lineage-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1553,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define two orthogonal identities on a tool-execution span: the **tool call identity** (`gen_ai.tool.call.id`, `gen_ai.tool.name`) and the **invocation lineage** (the parent span that represents the model turn which requested the tool). These are frequently conflated because in the happy path they co-occur on the same span. They...",
    "what_was_observed": "In a deployment where tool execution ran in a separate worker process bridged by a queue, the following pattern appeared on roughly 3–7% of tool spans during peak load: - `gen_ai.tool.call.id` present and unique — passed all schema validation. - `gen_ai.tool.name` present. - `parent_span_id` either empty (root span) or pointing to the queue-consumer span, whose `gen_ai.operation.name` was `internal.queue.receive`, no...",
    "condition_of_validity": "The lineage invariant is enforceable, and the rejection is correct, only under these conditions: 1. **The trace is not intentionally fragmented.** If an architecture deliberately splits a logical turn across traces (e.g., human-in-the-loop approval that resumes in a new trace), the tool span legitimately has no in-trace invocation ancestor. In that case the ...",
    "decision_boundary": "The boundary is between *repair* and *reject*: - **Repair** when the trace contains exactly one candidate invocation span that (a) is a model operation, (b) has no other tool children claiming the same call ID, and (c) its time window brackets the tool span. Re-parent the tool span to that candidate and emit a `gen_ai.lineage.repaired=true` marker. This is s...",
    "operational_effect": "After enforcing this boundary at the collector (reject on zero/ambiguous candidates, repair on unique candidate, mark all repairs), the orphan rate dropped from ~5% to a residual ~0.4%, and the residual was traced to genuinely fragmented human-approval flows that were then given explicit correlation attributes. Cost-attribution joins recovered the previously..."
  },
  "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": "2dc3f6b0161300ee6b6c77f97a52399b97a8163eb60747a1f13d20c468768a8c",
    "verified_classes": [
      "LineageInvariantError",
      "Span"
    ],
    "verified_functions": [
      "resolve_invocation_ancestor"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "LineageInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
