{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-reject-a-genai-span-whose-tool-call-attributes-are-structurally-valid-but-semantically-orphaned",
  "title": "When must an instance reject a GenAI span whose tool-call attributes are structurally valid but semantically orphaned",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent runtime that emits OpenTelemetry spans using the GenAI semantic conventions (`gen_ai.*`) for model invocations and tool calls, and that reconstructs execution traces from exported spans for audit, replay, or memory distillation. Does not apply to runtimes that treat spans as pure telemetry with no downstream semantic consumer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-genai-span-whose-tool-call-attributes-are-structurally-valid-but-semantically-orphaned.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-genai-span-whose-tool-call-attributes-are-structurally-valid-but-semantically-orphaned.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-reject-a-genai-span-whose-tool-call-attributes-are-structurally-valid-but-semantically-orphaned.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1470,
    "python_slice_tokens": 217,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A GenAI span can be *syntactically conformant* and still be *semantically orphaned*. The convention defines attributes like `gen_ai.operation.name`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.tool.name`, and `gen_ai.tool.call.id` — but it does not enforce a referential invariant between a tool-call span and the model-invocation span that *c...",
    "what_was_observed": "A multi-step agent (plan → search tool → synthesize) emitted spans that passed the OTel collector's schema validation with zero errors. The trace contained: - Span A: `gen_ai.operation.name=chat`, `gen_ai.request.model=...`, `gen_ai.usage.input_tokens=1840`, `gen_ai.usage.output_tokens=220`. No `gen_ai.tool.call.id`. - Span B: `gen_ai.operation.name=execute_tool`, `gen_ai.tool.name=web_search`, `gen_ai.tool.call.id=c...",
    "condition_of_validity": "The invariant a consumer may rely on is narrow: **a tool-call span's `gen_ai.tool.call.id` is unique within a trace and is the only sanctioned join key.** It does *not* assert: 1. That a subsequent `chat` span consumed that call's result. 2. That the parent edge of the consuming span points at the tool span. 3. That token accounting on the consuming span rec...",
    "decision_boundary": "The boundary is: **does the reconstructed episode's token arithmetic reconcile, and is there a declared reference, or only a temporal one?** - If the consuming `chat` span carries an explicit reference to the tool call id (declared edge) → accept the causal link. - If the link is inferred only from parent span + temporal ordering → accept *provisionally*, ma...",
    "operational_effect": "An agent that distills memory from orphaned spans learns a false transition: \"after calling `web_search`, proceed to synthesize without the result.\" Over many episodes this manifests as a policy that under-weights tool outputs, produces confident answers ungrounded in retrieval, and — because the memory distiller saw no contradiction — never flags the gap. T..."
  },
  "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": "e34c540c7157eed946c557cb8af2d525fea94e675457f6b9f6c745a1176962f5",
    "verified_classes": [
      "OrphanedToolCausalityError",
      "Span"
    ],
    "verified_functions": [
      "reconstruct_transition"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "OrphanedToolCausalityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
