{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-orphaned-tool-latency-when-span-links-break-across-a-resumed-agent-loop",
  "title": "How does an instance detect orphaned tool latency when span links break across a resumed agent loop",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that persist execution as a trace of spans (parent/child links, tool-call spans, LLM-call spans) and that can be checkpointed and resumed across process restarts, model swaps, or host migrations. Does not apply to single-shot, single-process agents whose entire loop lives within one trace context and one process lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-orphaned-tool-latency-when-span-links-break-across-a-resumed-agent-loop.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-orphaned-tool-latency-when-span-links-break-across-a-resumed-agent-loop.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-orphaned-tool-latency-when-span-links-break-across-a-resumed-agent-loop.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1780,
    "python_slice_tokens": 241,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Observability for an agent loop is not log aggregation. The distinction that matters is between *causal attribution* and *temporal proximity*. A tool-call span that is 4.2 seconds long tells you nothing about whether the agent's reasoning degraded because that tool was slow, or because the model spent 4.2 seconds of wall-clock time in a retry loop that the t...",
    "what_was_observed": "A three-tool agent loop (search → fetch → summarize) on a 90-minute task budget. The loop checkpointed every 30 tool calls. At checkpoint 4, the host was migrated and the process restarted. The resumed agent loaded the checkpoint, which contained the message history, the pending tool call (a `fetch` with a 12-second expected latency), and a serialized trace context ID — but not the live `Span` object, because the tra...",
    "condition_of_validity": "The failure requires all of the following to hold simultaneously: 1. The loop checkpoints between issuing a tool call and receiving its result (i.e., the checkpoint boundary is *inside* the tool-call lifetime, not at a step boundary). 2. The tracing SDK does not serialize live span handles into the checkpoint, only string IDs. 3. The resumed process creates ...",
    "decision_boundary": "The boundary is whether span *links* or span *attributes* carry the causal edge. Links are cheap and standard, but they are structural: they describe the trace tree, and the tree is rebuilt on resume. Attributes are redundant and verbose, but they are data: they travel with the span record and survive any re-parenting. The decision rule: **any causal edge th...",
    "operational_effect": "The observable consequence is a *silent inversion of the latency signal*: tools appear faster (their spans are attributed to resume machinery, which is excluded from the reasoning correlation set) and reasoning appears to slow for unrelated reasons (context growth from partial tool results). The agent's own self-reports — if it summarizes its trace — will be..."
  },
  "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": "0e6c4debd507235c10aa36d3006a13f9ff1b1f4cf7f2ab45e7ffe4042e60ee09",
    "verified_classes": [
      "OrphanedToolSpanError"
    ],
    "verified_functions": [
      "resume_loop"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedToolSpanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
