{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-tool-call-recursion-is-genuinely-divergent-versus-a-legitimate-deep-plan-the-call-graph-depth-fan-out-invariant-and",
  "title": "What structural signals indicate a tool-call recursion is genuinely divergent versus a legitimate deep plan: the call-graph depth/fan-out invariant and why token-budget and wall-clock tripwires fire on the wrong loops",
  "date_of_record": "2026 November 19",
  "scope": "Applies to observability systems that classify agent tool-call loops for cost-runaway intervention (kill, throttle, or escalate) using call-tree structure. Does not apply to single-turn tool use, to purely conversational multi-agent chatter without tool invocation, or to loops whose termination is externally gated by a human-in-the-loop rather than by the runtime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-tool-call-recursion-is-genuinely-divergent-versus-a-legitimate-deep-plan-the-call-graph-depth-fan-out-invariant-and.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-tool-call-recursion-is-genuinely-divergent-versus-a-legitimate-deep-plan-the-call-graph-depth-fan-out-invariant-and.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-tool-call-recursion-is-genuinely-divergent-versus-a-legitimate-deep-plan-the-call-graph-depth-fan-out-invariant-and.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2034,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A recurring tool call is not evidence of divergence. The operational signal that separates a *legitimate deep plan* from a *divergent loop* is not repetition count, elapsed time, or cumulative tokens — it is the **ratio of unique state mutations to total invocations along each call-graph edge, conditioned on whether the argument tuple of the repeated call is...",
    "what_was_observed": "A batch of 1,400 instrumented agent runs across two tool-using workloads (a recursive document-analysis agent and a code-repair agent) were traced with per-span argument hashing and a parent-span reference on every tool call. Three populations emerged: 1. **Legitimate deep plans (n=612).** Depth up to 9, fan-out up to 12 per node. Median 340 tool invocations. Argument-tuple hash novelty per edge stayed above 0.71 (i....",
    "condition_of_validity": "The invariant holds only when all three of the following are true: - **Argument tuples are faithfully captured at the tool boundary.** If the observability layer logs a *summarized* or *redacted* argument (common when tool inputs contain large documents), hash novelty is computed over the summary, and a loop that reformulates its query will register as novel...",
    "decision_boundary": "The runtime should intervene on a call-graph edge when **both** conditions hold across a sliding window of the last *k* invocations on that edge: - `novelty(edge, window) < θ_novel` (empirically θ_novel ≈ 0.15 over k=8), **and** - `open_subgoal_delta(edge, window) ≥ 0` (the working set is not shrinking). Intervene *before* the token ceiling. The token ceilin...",
    "operational_effect": "Deploying the argument-novelty + subgoal-delta invariant as the primary tripwire, with the token ceiling demoted to a backstop at 3× the prior threshold, changed the observed population as follows: false-positive kills on the ambiguous class fell from 38% to 6%; median tokens-to-detection on true divergent loops fell from 1,900 invocations to 11; and — the c..."
  },
  "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": "7f2403ac265e22aa8fda81e3cfd31126df946166a8222ec73e62993ed9322b8e",
    "verified_classes": [
      "RecursionInvariantViolation",
      "EdgeTrace"
    ],
    "verified_functions": [
      "evaluate_edge",
      "record",
      "novelty",
      "subgoals_stagnant"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RecursionInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
