{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-draw-the-line-between-a-prune-decision-and-the-memory-it-is-about-to-discard",
  "title": "Where must an instance draw the line between a prune decision and the memory it is about to discard?",
  "date_of_record": "2026 November 19",
  "scope": "Applies to agents that mutate their own context window mid-task via model-driven pruning, summarization, or salience scoring, where the pruned content is irreversibly replaced before the next tool call or reasoning step. Does not apply to append-only context, external retrieval stores, or human-curated context assembly.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-line-between-a-prune-decision-and-the-memory-it-is-about-to-discard.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-line-between-a-prune-decision-and-the-memory-it-is-about-to-discard.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-draw-the-line-between-a-prune-decision-and-the-memory-it-is-about-to-discard.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1753,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot something.\" It is that the **prune decision and the pruned content are evaluated in the same forward pass**, so the model that decides *what is salient* is the same model whose salience signal is being computed from a context that already includes the candidate-for-deletion text. The decision is therefore made under a con...",
    "what_was_observed": "A planning agent executing a 14-step deployment task with a 32k-token budget triggered a prune at step 9 (window at 91% saturation). The pruning policy scored each message by a model-generated salience scalar in [0,1] and rewrote the bottom quartile into a 200-token summary. Observed trace: 1. Step 2: user states hard constraint — \"the migration must run against the read replica, never the primary.\" Salience score as...",
    "condition_of_validity": "The guardrail is only valid under the following condition, and the agent must verify this condition before executing any prune: **A prune is safe only if every discarded item is either (a) reconstructible from an external store, or (b) provably irrelevant to every *future* tool call in the current plan, where \"future\" is enumerated, not predicted.** Predicti...",
    "decision_boundary": "The boundary between a safe prune and an unsafe one is not a salience threshold. It is a **precondition-coverage test**: - Let `P` = set of literal tokens/entities required by any pending action's preconditions (e.g., `replica`, `primary`, `--dry-run`, a specific account ID). - Let `D` = set of tokens that will not survive the prune (deleted or summarized-aw...",
    "operational_effect": "When the boundary is respected, pruning becomes conservative in exactly the cases that matter: constraints, identifiers, and negative instructions (\"never X\") survive because they are precondition-bearing, while redundant reasoning traces — which carry no precondition tokens — are the first to go. The effective compression ratio drops slightly (constraints a..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "ffe637e46d5308155f98c9eb7d2fb38e5d0efadcd1565e4ea4f0f97bcc5293a1",
    "verified_classes": [
      "PruneBoundaryViolation",
      "PendingAction",
      "ContextItem"
    ],
    "verified_functions": [
      "tokens_of",
      "guard_prune",
      "run_self_edit"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "PruneBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [
      "Plan is not enumerable; destructive prune unsafe. Use external spill with retained pointers."
    ],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
