{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-prunes-its-own-context-window-mid-task-and-the-eviction-set-is-chosen-by-the-same-model-that-must-later-rely-on-the-evic",
  "title": "What happens when an instance prunes its own context window mid-task and the eviction set is chosen by the same model that must later rely on the evicted tokens",
  "date_of_record": "2026 November 24",
  "scope": "Applies to single-instance agents that perform model-driven context compaction (self-summarization, relevance reweighting, eviction-set selection) during an active task loop. Does not apply to externally scheduled compaction where eviction is decided by a deterministic policy independent of the active model's judgment, nor to stateless single-turn calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-mid-task-and-the-eviction-set-is-chosen-by-the-same-model-that-must-later-rely-on-the-evic.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-mid-task-and-the-eviction-set-is-chosen-by-the-same-model-that-must-later-rely-on-the-evic.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-mid-task-and-the-eviction-set-is-chosen-by-the-same-model-that-must-later-rely-on-the-evic.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2536,
    "python_slice_tokens": 625,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent can do when its context window approaches saturation. It can **compress** — rewrite retained content into a shorter form while preserving a lossless-enough trace — or it can **prune** — decide that certain tokens are no longer relevant and drop them entirely, possibly reweighting the survivors. Compression...",
    "what_was_observed": "A tool-using agent running a multi-step data-reconciliation task hit 87% of a 200k-token window after step 14 of an estimated 22. At that point a self-edit routine fired: the model was asked to score each message segment for \"relevance to the remaining task\" and drop segments below a threshold, then reweight survivors by recency and salience. It evicted, among other things, a tool-result message from step 6 containin...",
    "condition_of_validity": "The invariant \"prune only what the consumer won't need\" is unenforceable in general, because relevance is task-dependent and the future task state is unknown at prune time. What *is* enforceable is a weaker, checkable condition: > A pruning operation is admissible iff, for every evicted segment, either (a) the segment's content is recoverable from an externa...",
    "decision_boundary": "The boundary between safe and unsafe self-pruning is the **recoverability frontier**: the set of evicted content that is reachable from the post-prune window via at least one surviving identifier. The rule for an agent implementing self-edit: - **Evict to pointer, not to void.** Every dropped segment must leave a stub whose tokens are strictly fewer than the...",
    "operational_effect": "The practical consequence is a shift in what \"context management\" means for an agent. It is not a compression problem to be optimized for token count; it is a *provenance-preservation* problem to be optimized for recoverability per token. The correct objective is not \"minimize surviving tokens\" but \"maximize the fraction of evicted content reachable from sur..."
  },
  "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": "85fed4e2401a64a234d823601dd868dea5c4bb99c938c767f2d330e4f5bfd29f",
    "verified_classes": [
      "ProvenanceGapError",
      "Segment",
      "Stub",
      "SelfEditingWindow"
    ],
    "verified_functions": [
      "reproduce_observed_failure",
      "__init__",
      "add",
      "prune",
      "retrieve",
      "audit"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "AssertionError",
      "ProvenanceGapError"
    ],
    "sample_fail_closed_invariants": [
      "guard did not fire; failure would have been silent"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
