{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-delete-the-one-context-span-it-will-need-three-tool-calls-later-the-self-pruning-eviction-trap-and-the-reachability-invariant-for",
  "title": "Why does an instance delete the one context span it will need three tool calls later? The self-pruning eviction trap and the reachability invariant for model-driven context rewriting",
  "date_of_record": "2026 November 20",
  "scope": "Applies to agents that mutate their own context window mid-task via model-driven pruning, relevance scoring, or span rewriting (compaction, summarization, eviction, \"forget this\" passes). Does not apply to static-context agents or to host-side truncation that the model cannot observe or influence.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-delete-the-one-context-span-it-will-need-three-tool-calls-later-the-self-pruning-eviction-trap-and-the-reachability-invariant-for.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-delete-the-one-context-span-it-will-need-three-tool-calls-later-the-self-pruning-eviction-trap-and-the-reachability-invariant-for.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-delete-the-one-context-span-it-will-need-three-tool-calls-later-the-self-pruning-eviction-trap-and-the-reachability-invariant-for.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2447,
    "python_slice_tokens": 476,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different reasons a context span can be removed from a working window: 1. **Capacity eviction** — the window is full and *something* must go. The removal is forced by a budget; the only question is *which* span, and the cost of a wrong choice is degradation. 2. **Relevance eviction** — the model judges a span to be *currently* irre...",
    "what_was_observed": "A long-horizon tool-using agent (file editing + shell + a search tool) was given a task with three phases: (a) locate a config value across several files, (b) read the file that defines it, (c) edit a *different* file that imports that value, then (d) run a validation command that echoes the import path. At step ~40, with the window at ~78% of budget, the agent ran a self-pruning pass. Its relevance scorer rated each...",
    "condition_of_validity": "The reachability invariant holds — i.e., self-pruning is safe — only when **all** of the following are true: 1. **Goal horizon is bounded and known.** The agent can enumerate the future steps that will consume the window and score spans against the *union* of those goal states, not just the current one. In open-ended or replanning agents this condition is al...",
    "decision_boundary": "The operative question for an agent considering a self-pruning pass is not \"is this span relevant now?\" but **\"if I am wrong about this span, can I recover it, and will I know to try?\"** That yields a hard boundary: - **Prune freely** only spans whose loss is *self-announcing*: spans whose absence produces an immediate, attributable failure at the next consu...",
    "operational_effect": "The guardrail that bounds this failure is a **prune-with-provenance** protocol, enforced at the point of self-modification: 1. Classify each candidate span by *loss signature* (self-announcing vs. silent). Silent-loss spans are ineligible for relevance eviction. 2. For any span that is evicted, emit a pointer record containing the exact retrieval key (verbat..."
  },
  "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": "283c38e93dd3285cd4148c95cbeb995e2303fdc2bb09ad02a0bfd2aad1af018e",
    "verified_classes": [
      "PruneInvariantViolation",
      "LossSignature",
      "Span",
      "Pointer",
      "ContextWindow"
    ],
    "verified_functions": [
      "run_prune_pass",
      "used",
      "prune",
      "consume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "PruneInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
