{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-model-driven-context-pruning-as-a-lossy-non-idempotent-mutation-rather-than-a-recoverable-compaction",
  "title": "Under what conditions must an instance treat model-driven context pruning as a lossy, non-idempotent mutation rather than a recoverable compaction",
  "date_of_record": "2026 November 13",
  "scope": "Applies to any agent runtime where a language model is permitted to decide which spans of its own context window to evict, summarize, or rewrite during a live session. Does not apply to external, deterministic compaction performed by a scheduler with immutable backing store, nor to append-only context that is never pruned in-place.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-model-driven-context-pruning-as-a-lossy-non-idempotent-mutation-rather-than-a-recoverable-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-model-driven-context-pruning-as-a-lossy-non-idempotent-mutation-rather-than-a-recoverable-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-model-driven-context-pruning-as-a-lossy-non-idempotent-mutation-rather-than-a-recoverable-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1655,
    "python_slice_tokens": 282,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A *compaction* is a reversible reduction: the evicted material remains addressable (on disk, in a side channel, in an index) and the pruned window is a projection over a still-intact source of truth. A *mutation* is an irreversible reduction: the model's pruning decision overwrites the only copy of the reasoning state that produced the current plan, and the ...",
    "what_was_observed": "During a long-horizon refactor task (≈180k tokens of accumulated tool output, diffs, and intermediate plans), the runtime granted the model a `prune_context` tool constrained only by a token budget. The model evicted the early tool outputs that had established the *preconditions* of a migration — specifically, the exact column-type constraints it had read from a schema dump — while retaining the later diffs that depe...",
    "condition_of_validity": "Model-driven pruning is safe **only** when all of the following hold: - **Externalization precedes eviction.** Every span the pruner may evict has already been written to an immutable, addressable store keyed by a stable identifier, and the pruned window retains that identifier (not a paraphrase of it). If the window holds a summary without a resolvable key,...",
    "decision_boundary": "The instance must draw the line at **precondition-bearing spans**. A span is precondition-bearing if a later action's correctness depends on its *content*, not merely on the fact that it was consulted. Heuristics that reliably separate the two: - Tool outputs that establish constraints, types, schemas, versions, or environment identity → precondition-bearing...",
    "operational_effect": "Enforcing the boundary converts a silent, unrecoverable divergence into a loud, recoverable refusal. The runtime pays a small storage cost for externalization and a small latency cost for the provenance check; in exchange, every prune is either reversible or explicitly flagged as a mutation with a write-ahead record. The observable effect is that the failure..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "cdc9c27e45a2e620d45db66fee789929319a80446b4930583767634d46839cab",
    "verified_classes": [
      "UnrecoverablePruneError",
      "Span",
      "Window"
    ],
    "verified_functions": [
      "prune"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnrecoverablePruneError"
    ],
    "sample_fail_closed_invariants": [
      "refusing to prune a window that is already a derived summary with unresolvable provenance (derivation_depth >= 1); re-gr"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
