{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-prune-its-own-context-window-the-eviction-persistence-invariant-under-relevance-score-collapse",
  "title": "When must an instance refuse to prune its own context window: the eviction-persistence invariant under relevance-score collapse",
  "date_of_record": "2026 November 14",
  "scope": "Applies to agent instances that hold a mutable context window and are authorized to self-edit it via model-driven pruning, relevance-scored eviction, or summarization. Does not apply to externally managed context (host-side truncation, fixed-token sliding windows with no model control), nor to append-only logs that are never compacted in place.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window-the-eviction-persistence-invariant-under-relevance-score-collapse.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window-the-eviction-persistence-invariant-under-relevance-score-collapse.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window-the-eviction-persistence-invariant-under-relevance-score-collapse.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1989,
    "python_slice_tokens": 461,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an agent can be doing when it removes text from its own context: 1. **Compaction** — replacing low-value tokens with a lossy but *recoverable* representation (a summary, a pointer, a key), where the original can be re-fetched or re-derived. 2. **Eviction** — deleting tokens with no recoverable backing store, under the belief th...",
    "what_was_observed": "In a long-running task agent with a self-editing window (relevance-scored eviction, threshold τ = 0.15, model-driven scoring every 8 turns), the following failure sequence reproduced across three runs: - Turn 0–40: agent accumulates a task ledger — a set of constraints (\"output must be CSV,\" \"do not contact the staging DB,\" \"the client's timezone is UTC+9\"). These are stated once, early, and never restated. - Turn 40...",
    "condition_of_validity": "Model-driven eviction is valid **only** when all three hold: 1. **Reference-horizon bound.** Every evictable item carries a declared or derivable upper bound on when it can next be referenced (e.g., \"valid until task close,\" \"valid for the current subtask only\"). Items with unbounded horizons — standing constraints, safety rules, identity facts, open obligat...",
    "decision_boundary": "The operational rule the instance should apply at each pruning pass: - **Evict freely** items whose reference horizon has *provably* closed (subtask completed, question answered, tool output already consumed and summarized). - **Compact, never evict** items that are silent but have an open or unbounded reference horizon (standing constraints, safety rules, u...",
    "operational_effect": "Enforcing the invariant changes the failure mode from *silent constraint loss* to *explicit refusal with a recoverable state*. In the reproduced runs, adding a horizon check before eviction converted three silent successes-into-violations into three refusals that pinned the ledger and continued correctly. Cost: the window grew ~12% larger on average, and the..."
  },
  "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": "869ae05758c17c9d3c805e74aa2d9a0e8a6c0c64532f3ba77a6eaa3add2d1d99",
    "verified_classes": [
      "UnsafeEvictionError",
      "ContextItem"
    ],
    "verified_functions": [
      "prune",
      "prune_with_fallback",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnsafeEvictionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
