{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-prune-its-own-scratchpad-the-self-edit-re-entry-hazard-in-model-driven-relevance-pruning",
  "title": "When must an instance refuse to prune its own scratchpad: the self-edit re-entry hazard in model-driven relevance pruning",
  "date_of_record": "2026 December 2",
  "scope": "Applies to single-agent loops where the model itself authors an edit to its own working scratchpad (compaction, relevance pruning, summarization-in-place) and the edit is committed before the next reasoning step. Does not apply to external, out-of-band context management performed by a non-LLM controller that never consumes its own edit output.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-scratchpad-the-self-edit-re-entry-hazard-in-model-driven-relevance-pruning.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-scratchpad-the-self-edit-re-entry-hazard-in-model-driven-relevance-pruning.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-scratchpad-the-self-edit-re-entry-hazard-in-model-driven-relevance-pruning.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2444,
    "python_slice_tokens": 315,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways to shrink a working context. **External pruning** is performed by a controller that observes the agent's traces but is not the agent; the pruned context is a function of state the pruner does not itself inhabit. **Self-editing pruning** is performed by the same instance that will next consume the result: the model em...",
    "what_was_observed": "A planner-executor agent running a long tool-use task (target: reconcile a set of records against a schema, ~40 tool calls) used a self-compaction policy: at each turn, if the scratchpad exceeded a token budget, the model was asked to emit a rewritten scratchpad retaining only spans \"relevant to the current subgoal.\" The runtime replaced the scratchpad with the model's output and continued. The trace showed a three-p...",
    "condition_of_validity": "The self-edit is safe **only if** the following invariant holds at commit time: > For every span removed by the self-edit, the post-edit context must retain either (a) the span itself, (b) a lossless pointer to a retrievable copy, or (c) an explicit, model-authored *obligation record* stating the decision the span constrains and the condition under which it ...",
    "decision_boundary": "The instance must **refuse to commit** a self-authored prune, and escalate to an external checkpoint, when any of the following holds: - The prune removes a span that matches a **pending-decision constraint** (a rule, ID set, or prohibition referenced by a subgoal not yet marked complete), regardless of its relevance score. - The prune is **re-entrant** (the...",
    "operational_effect": "The practical consequence is that self-editing context is not a memory-management optimization; it is a **state transition with a conservation law**. The conserved quantity is the set of constraints on decisions not yet made. A prune that does not conserve it is not lossy compression — it is silent mutation of the agent's own policy, performed by the agent, ..."
  },
  "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": "2afd60803203a63b90427234e919b22d0bfc7586ac3efeb5070ae40ff8e2008c",
    "verified_classes": [
      "SelfEditConservationError",
      "Span",
      "Scratchpad"
    ],
    "verified_functions": [
      "commit_self_edit"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SelfEditConservationError"
    ],
    "sample_fail_closed_invariants": [
      "prune removes provenance of an action already taken; audit chain severed"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
