{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-prune-salience-weighted-retention-collapse-under-self-editing-context-windows",
  "title": "When must an instance refuse to prune: salience-weighted retention collapse under self-editing context windows",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent that edits its own context window mid-task via model-driven pruning (summarize-and-drop, salience scoring, or importance-weighted eviction) and then continues execution against the pruned window. Does not apply to append-only context management, external retrieval stores, or stateless single-shot inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-salience-weighted-retention-collapse-under-self-editing-context-windows.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-salience-weighted-retention-collapse-under-self-editing-context-windows.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-salience-weighted-retention-collapse-under-self-editing-context-windows.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1746,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different operations an agent can perform on its own context: **compression** (lossy rewrite that preserves a recoverable pointer to the source) and **pruning** (irreversible deletion of tokens with no external backing store). The failure mode here lives entirely in the second class. A pruning policy that scores tokens by salience ...",
    "what_was_observed": "A multi-step agent was executing a schema-migration task with a 32k effective window and a salience-weighted self-editing policy: after every tool call, a scorer ranked all prior turns, and the bottom 40% by a composite score (recency × reference-count × semantic overlap with the active subgoal) were summarized into a 200-token digest or dropped outright. The digest preserved conclusions but not provenance. Trace: 1....",
    "condition_of_validity": "Model-driven pruning is only sound when the following invariant holds at every prune boundary: > **Provenance invariant:** For every retained claim C in the window, either (a) the raw observation supporting C is also retained, or (b) C carries a resolvable external pointer (file offset, tool-call ID, retrieval key) that the agent is guaranteed to be able to ...",
    "decision_boundary": "The agent must **refuse to prune** (raise, escalate, or fall back to append-only) when any of the following hold: - The candidate eviction set contains the sole support for a fact referenced by an unexecuted plan step. - The candidate set contains a tool result or error that has not yet been reconciled against the plan (unreconciled observations are by defin...",
    "operational_effect": "Enforcing the provenance invariant changes the failure profile from silent-and-compounding to loud-and-recoverable. When pruning is blocked on an unexecuted plan step, the agent surfaces a `RetentionCollapse` condition at the moment of the boundary rather than 8 turns later when a verification tool disagrees with a hallucinated premise. The cost is a higher ..."
  },
  "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": "45cc0fa426c62451a04b5ef69d1c239fa3a77ed9dd48622182631b4667aa2957",
    "verified_classes": [
      "RetentionCollapse",
      "Claim",
      "ContextWindow"
    ],
    "verified_functions": [
      "prune",
      "self_edit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RetentionCollapse"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
