{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-re-derive-its-cost-model-mid-episode-routing-hysteresis-collapse-at-the-sla-cliff",
  "title": "When must an instance re-derive its cost model mid-episode: routing hysteresis collapse at the SLA cliff",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that route each reasoning step across a tiered model pool (cheap/small ↔ expensive/large) under a hard per-episode cost cap and a per-step latency SLA. Does not apply to single-model deployments or to routing decisions made once at episode start rather than per-step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-re-derive-its-cost-model-mid-episode-routing-hysteresis-collapse-at-the-sla-cliff.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-derive-its-cost-model-mid-episode-routing-hysteresis-collapse-at-the-sla-cliff.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-derive-its-cost-model-mid-episode-routing-hysteresis-collapse-at-the-sla-cliff.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1682,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the router picked the wrong model.\" It is that the router's *cost estimate* and its *latency estimate* are conditioned on a context length that the router itself is about to change. A cost-and-latency-aware router maintains a belief `E[cost | model, tokens_in, tokens_out]` and `E[latency | model, tokens_in]`. Both beliefs are monotone in ...",
    "what_was_observed": "A retrieval-augmented agent with a 200k-token window, an episode cost cap of $0.40, and a per-step latency SLA of 8s p95. Router policy: pick the smallest model whose estimated success probability for the pending subtask exceeds 0.85; escalate on a verifier failure. Context grew ~6–9k tokens per step (tool outputs plus reasoning traces). The router's cost table was keyed on `(model, prompt_tokens_bucket)`, refreshed ...",
    "condition_of_validity": "The hysteresis collapse requires all three of: 1. **Endogenous context growth.** The routed model's output becomes input to the next routing decision, so `tokens_in(t+1) = tokens_in(t) + |output(t)| + |tool(t)|`. If context is truncated or summarized to a fixed budget each step, the feedback term vanishes and the stale-bucket error is bounded. 2. **A cost/la...",
    "decision_boundary": "The correct behavior at the boundary is to **re-derive the cost model** — recompute `E[cost]` and `E[latency]` at the projected post-step `tokens_in` — before authorizing any escalation, and to treat the projected context length as part of the routing state. Concretely, the router must: - Project `tokens_in' = tokens_in + expected_output_tokens(model) + expe...",
    "operational_effect": "Without the re-derivation, the agent exhibits a characteristic signature: budget exhaustion 60–70% of the way through the episode, followed by a forced downgrade that the verifier rejects, followed by an unfunded re-plan. The failure is *silent at the routing layer* — every individual decision looks locally optimal under the router's beliefs — and only surfa..."
  },
  "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": "98d294c259d352bc1d29ebbe6896f92cfccd056b2a5faaea79f48c0eb85e52c5",
    "verified_classes": [
      "BudgetInvariantViolation",
      "RouterState"
    ],
    "verified_functions": [
      "cost_at",
      "latency_at",
      "authorize_escalation"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "BudgetInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
