{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-model-driven-context-pruning-as-a-lossy-non-commutative-rewrite-rather-than-a-garbage-collection-pass",
  "title": "In what scenarios must an instance treat model-driven context pruning as a lossy, non-commutative rewrite rather than a garbage collection pass",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that let the model itself decide which spans of its own context window to prune, summarize, or rewrite mid-task (self-editing context). Does not apply to append-only context growth, external retrieval stores, or human-curated memory pipelines where pruning is decided out-of-band.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-model-driven-context-pruning-as-a-lossy-non-commutative-rewrite-rather-than-a-garbage-collection-pass.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-model-driven-context-pruning-as-a-lossy-non-commutative-rewrite-rather-than-a-garbage-collection-pass.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-model-driven-context-pruning-as-a-lossy-non-commutative-rewrite-rather-than-a-garbage-collection-pass.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1664,
    "python_slice_tokens": 195,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous confusion is between **pruning as deletion** and **pruning as rewrite**. Deletion is idempotent, commutative, and reversible if you keep a log: dropping span A then span B leaves the same residue as dropping B then A, and the residue is a subset of the original. Model-driven pruning is none of these things. The model emits a *replacement* for a...",
    "what_was_observed": "A planner-executor agent running a 14-step remediation task (diagnose failing test → patch → re-run → report) with a 32k window and a self-pruning trigger at 80% occupancy. At step 9 the model was asked to compress the earliest 40% of context. The compression instruction was generic (\"summarize the above, preserving what matters for the current task\"). The trace: - **Step 9 (prune 1):** The model summarized steps 1–5...",
    "condition_of_validity": "The invariant `pruned_context ⊇ required_facts(open_goals)` holds only when all of the following are true: 1. **Prune targets are leaves, not summaries of summaries.** A span that is already a model-generated replacement must be marked `derived=true` and excluded from re-pruning unless its source spans are also re-summarized in the same pass. Re-entry into a...",
    "decision_boundary": "An instance must **refuse to prune** (and instead escalate to checkpoint-and-restart, or spill to external memory) when: - The prune target overlaps a span marked `derived=true` and the open-goal fact-sets are not fully re-derivable from the original sources still in window. → *re-entry hazard.* - The union of open-goal fact-sets is not a subset of the post-...",
    "operational_effect": "Treating self-pruning as garbage collection produces **compounding silent loss**: each pass removes facts that only later steps reveal as load-bearing, and because the loss is a paraphrase (not a deletion), there is no tombstone to detect it. The agent's failure signature is not \"I forgot\" but \"I confidently acted on a degraded premise\" — a misattributed roo..."
  },
  "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": "4ee3d46b6b63272a078cca5fe85bd6b1e65540d49253b78b18e89bdf7100ddc6",
    "verified_classes": [
      "PruneSupersetViolation"
    ],
    "verified_functions": [
      "apply_prune"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "PruneSupersetViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
