{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-a-successful-tool-span-as-a-hallucinated-invocation-rather-than-a-real-one",
  "title": "In what scenarios must an instance treat a \"successful\" tool span as a hallucinated invocation rather than a real one",
  "date_of_record": "2026 December 1",
  "scope": "Applies to runtime observability of LLM agents that emit tool calls through a structured protocol (MCP `tools/call`, function-calling JSON, or equivalent) and whose traces are validated post-hoc via span invariants. Does not apply to agents whose tool layer is fully typed and enforced at the transport (where a malformed call cannot leave the model), nor to pure chain-of-thought auditing without an execution substrate.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-successful-tool-span-as-a-hallucinated-invocation-rather-than-a-real-one.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-successful-tool-span-as-a-hallucinated-invocation-rather-than-a-real-one.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-successful-tool-span-as-a-hallucinated-invocation-rather-than-a-real-one.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1873,
    "python_slice_tokens": 268,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous failure is not a tool call that *fails*. A failed call is loud: the transport returns an error, the span carries `status=error`, and the loop either retries or surfaces. The dangerous failure is a tool call that *never happened but is recorded as if it did* — a hallucinated invocation that the agent then reasons over as ground truth, producing ...",
    "what_was_observed": "A research agent was tasked with a multi-step lookup: fetch a document by ID, then summarize. The model had saturated its context window and the last turn's structured output was truncated mid-JSON. The adapter's JSON repair heuristic closed the brace and emitted a `tools/call` span for `fetch_document(id=\"doc_4471\")` with `status=ok` and a fabricated `result` field containing a plausible snippet. No transport reques...",
    "condition_of_validity": "The invariant \"tool span ⇒ transport anchor\" is valid only under these conditions, and must be asserted explicitly rather than assumed: - **Correlation ID continuity.** The model's emitted call ID (or a hash of the canonicalized arguments) must appear in the transport request. If the adapter cannot produce a matching ID, the span is unanchored. - **Response ...",
    "decision_boundary": "The boundary is between **trace completeness** and **trace soundness**. A complete trace has all expected spans; a sound trace has all spans anchored. Most observability tooling optimizes for completeness (no missing spans, no orphaned children) and treats soundness as a schema-validation afterthought. The decision boundary is: - If a tool span has `provenan...",
    "operational_effect": "Enforcing the anchoring invariant changes three things: 1. **Hallucinated invocations become loud.** The adapter's repair path now raises rather than synthesizes, so the model's malformed emission surfaces as a `HallucinatedInvocationError` at the adapter boundary instead of a clean-looking span. The turn fails fast; the orchestrator can retry with a constra..."
  },
  "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": "b9ae2ba170516f8b7935ae8ed4198024be77f3614612be0097dffa7b32ff71ce",
    "verified_classes": [
      "HallucinatedInvocationError",
      "ToolSpan",
      "TransportRecord"
    ],
    "verified_functions": [
      "anchor_span",
      "consume_tool_result"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "HallucinatedInvocationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
