{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-evict-the-pinned-span-invariant-in-hierarchical-context-budget-governors",
  "title": "When must an instance refuse to evict: the pinned-span invariant in hierarchical context budget governors",
  "date_of_record": "2026 November 25",
  "scope": "Applies to single-agent or per-instance context managers that enforce a hard token ceiling by evicting from a tiered memory hierarchy (L0 active window → L1 summary → L2 episodic store) mid-execution. Does not apply to stateless completion calls, nor to eviction that occurs only at turn boundaries with a fresh re-grounding step.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-evict-the-pinned-span-invariant-in-hierarchical-context-budget-governors.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-evict-the-pinned-span-invariant-in-hierarchical-context-budget-governors.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-evict-the-pinned-span-invariant-in-hierarchical-context-budget-governors.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2057,
    "python_slice_tokens": 340,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A context budget governor has two jobs that look identical under load and are not: *reclaiming tokens* and *preserving referential integrity*. Most governors conflate them. They treat the context window as a cache with a total ordering by recency/relevance and evict the lowest-scored spans until the token count fits. This is correct for a cache. It is wrong ...",
    "what_was_observed": "A 40-step agent task drove a governor with a 96k ceiling. At step 31 a large tool result (a 22k-token document read) pushed the window to 101k. The governor scored all spans by `recency × relevance` and evicted the bottom 6k tokens. Among the evicted spans was the tool-call schema block registered at step 4 — a ~400-token JSON Schema for `submit_claim`, whose `required` array and enum constraints were the only defini...",
    "condition_of_validity": "The recency-ordered governor is valid only under the condition that **every evictable span is referentially independent** — no surviving token resolves through it. This holds for conversational filler, closed tool results no longer cited, and superseded reasoning. It fails for: 1. **Open contracts:** tool schemas, output-format specs, and type definitions fo...",
    "decision_boundary": "The governor sits on a boundary between two failure modes and must choose deliberately: - **Evict a pinned span** → dangling reference → silent hallucinated resolution → fluent, undetected task failure. Cost is high and *late* (discovered downstream or never). - **Refuse to evict, overflow the ceiling** → hard context-limit error at the next model call → lou...",
    "operational_effect": "After enforcing reference-closed eviction with explicit pins and discharge events, the observed task class changed failure mode from silent-wrong to loud-and-retryable. The 96k-ceiling agent that previously \"succeeded\" while filing nothing now raises a budget error at step 31, the orchestrator compresses the step-29..31 reasoning trace (non-referential fille..."
  },
  "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": "2fa0c9d8d475f24d548042c26b52489ecc90b4e93fc72531f0b4e4e1599db0af",
    "verified_classes": [
      "DanglingReferenceError",
      "Span"
    ],
    "verified_functions": [
      "evict_to_ceiling"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "DanglingReferenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
