{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-s-semantic-convention-anomaly-detector-systematically-miss-runaway-tool-call-loops-that-straddle-a-telemetry-batch-boundary",
  "title": "Why does an instance's semantic-convention anomaly detector systematically miss runaway tool-call loops that straddle a telemetry batch boundary",
  "date_of_record": "2026 November 24",
  "scope": "Applies to anomaly detectors that consume OpenTelemetry-style GenAI semantic-convention spans (`gen_ai.operation.name`, `gen_ai.tool.name`, `gen_ai.usage.*`) emitted per agent step and evaluated over sliding or tumbling telemetry windows. Does not apply to detectors operating on complete, un-truncated per-session traces with unbounded lookback, nor to synchronous in-process loop guards that sit inside the agent runtime itself.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-s-semantic-convention-anomaly-detector-systematically-miss-runaway-tool-call-loops-that-straddle-a-telemetry-batch-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-s-semantic-convention-anomaly-detector-systematically-miss-runaway-tool-call-loops-that-straddle-a-telemetry-batch-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-s-semantic-convention-anomaly-detector-systematically-miss-runaway-tool-call-loops-that-straddle-a-telemetry-batch-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2346,
    "python_slice_tokens": 409,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the detector fails to see a loop.\" The detector sees every span. The failure is that the *invariant the detector enforces is window-local*, while the *loop it must catch is window-spanning*. A runaway tool-call loop is defined by a repetition count threshold over a causal chain of agent steps — `N` consecutive invocations of the same `gen...",
    "what_was_observed": "A research agent executing a \"find and summarize\" task entered a tool-call loop against a web-search tool. The trigger: the search tool returned a `200 OK` with an empty `results` array and a `gen_ai.tool.call.result` attribute of `\"[]\"`. The agent's planner interpreted empty results as \"query too narrow, broaden and retry,\" broadened, got empty again, and re-narrowed — a period-2 oscillation that never terminated be...",
    "condition_of_validity": "The window-local detector is *valid* — sound and complete for its stated scope — only under the following condition: > **The minimum runaway-loop period `P` (in wall-clock or step count) is greater than or equal to the telemetry window size `W`, AND the loop's argument payload is stable across iterations (args_hash does not alternate), AND cumulative token g...",
    "decision_boundary": "The architectural fix is not \"smaller windows\" (that raises false-positive rate on legitimate batch agents and increases detector cost) and not \"bigger threshold headroom\" (that widens the blind spot). The correct boundary is a **two-tier evaluation with an explicit cross-window stateful accumulator** that carries loop-detection state across window edges, pl...",
    "operational_effect": "With the stateful accumulator and success-predicate guardrail deployed, the same agent trace is caught at step 9 (t=~38s, second iteration of the oscillation, first window boundary crossed with `no_progress_streak == 4`). The detector emits a `runaway_tool_loop` anomaly with the tool name, the canonicalized argument signature, the no-progress streak length, ..."
  },
  "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": "24ab3a847b0fdc61d7d3dfd9f639cffaf68ccd834c49e2f6304bf09f7f9d6db2",
    "verified_classes": [
      "RunawayLoopUndetectedError",
      "Step",
      "SessionAccumulator"
    ],
    "verified_functions": [
      "certify_window_local_detector",
      "_canonical_sig",
      "observe",
      "normalize"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "RunawayLoopUndetectedError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
