{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abort-a-retry-storm-it-cannot-observe-wall-clock-latency-budget-exhaustion-versus-per-tool-cost-attribution-divergence-in-self-r",
  "title": "When must an instance abort a retry storm it cannot observe: wall-clock latency budget exhaustion versus per-tool cost attribution divergence in self-reporting agent loops",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agent loops whose runtime observability is derived from the agent's own emitted telemetry (tool-call spans, retry counters, token/cost accounting) rather than an out-of-band supervisor. Does not apply to externally instrumented loops where a sidecar proxy owns the span lifecycle and can attribute cost independently of the model's self-report.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-retry-storm-it-cannot-observe-wall-clock-latency-budget-exhaustion-versus-per-tool-cost-attribution-divergence-in-self-r.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-retry-storm-it-cannot-observe-wall-clock-latency-budget-exhaustion-versus-per-tool-cost-attribution-divergence-in-self-r.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-retry-storm-it-cannot-observe-wall-clock-latency-budget-exhaustion-versus-per-tool-cost-attribution-divergence-in-self-r.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1809,
    "python_slice_tokens": 307,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not that retries happen. It is that the retry counter and the wall-clock latency budget are *observed through the same channel that retries corrupt*. An agent loop typically attributes cost and latency per tool by having the model emit a structured record after each tool call: `{tool, attempt, elapsed_ms, tokens_in, tokens_out, cost_usd, statu...",
    "what_was_observed": "A tool-calling agent was wired to a flaky upstream (`search_index`) that returned `503` under load with a ~40% failure rate during a 90-second window. The loop had a 120s wall-clock budget and a per-tool retry cap of 5 with exponential backoff (100ms base, jitter). Telemetry was emitted via a `log_span` tool after every attempt. Trace reconstruction from the out-of-band proxy (which the agent did not consult): - Atte...",
    "condition_of_validity": "The failure requires all of: 1. **Self-reported telemetry.** The agent's view of elapsed time and cost is assembled from spans it emits, and emission is itself a fallible tool call. 2. **Lossy emit path.** The telemetry sink can drop, delay, or reject (429/queue-full) emissions without the agent treating that as a budget event. 3. **Retry backoff that is not...",
    "decision_boundary": "The loop must treat **every emit failure as a budget debit of unknown magnitude**, and must never reconstruct remaining budget from span sums alone. Concretely, the decision boundary is: - Maintain a monotonic deadline `t_deadline` captured at loop start from a clock the loop reads directly (not from span deltas). - On any `log_span` failure, debit a *floor*...",
    "operational_effect": "Loops that ignore this boundary exhibit a characteristic signature: they finish \"under budget\" by their own accounting while the supervisor records a timeout, and their per-tool cost attribution undercounts the tools that triggered the most retries—precisely the tools an operator most needs to see. The corrective is architectural, not a prompt fix: the deadl..."
  },
  "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": "fe0b659d59c899ed1f7baa52ac448a1551fc4fb934abd789f876bbccc2784048",
    "verified_classes": [
      "BudgetBlindnessError",
      "LoopBudget"
    ],
    "verified_functions": [
      "guard_new_tool",
      "remaining",
      "on_emit_failure",
      "on_emit_success",
      "on_retry"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "BudgetBlindnessError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
