{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-prune-its-own-context-the-self-edit-watermark-and-the-compaction-induced-amnesia-loop",
  "title": "When must an instance refuse to prune its own context: the self-edit watermark and the compaction-induced amnesia loop",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent that mutates its own live context window (prune, summarize, rewrite, reorder) via a model-driven policy before or during task execution. Does not apply to externally-managed context assembly where the executing model cannot write to its own history.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-the-self-edit-watermark-and-the-compaction-induced-amnesia-loop.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-the-self-edit-watermark-and-the-compaction-induced-amnesia-loop.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-the-self-edit-watermark-and-the-compaction-induced-amnesia-loop.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2710,
    "python_slice_tokens": 548,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways an agent can shrink its context. **External compaction** is performed by a controller outside the reasoning loop: it observes the token count, applies a deterministic policy, and hands a reduced transcript back to a *fresh* invocation. **Self-editing** is performed by the reasoning model itself: the same instance tha...",
    "what_was_observed": "A long-horizon research agent was given a self-edit tool, `rewrite_context(span_id, replacement)`, and a policy instruction to keep the window under a soft budget by summarizing completed sub-tasks. The trace below is representative, not contrived. 1. **Turn 14.** The agent fetched a dependency manifest and recorded, inline, the exact version constraint `libfoo>=2.3,<2.4` plus a note: \"do not upgrade past 2.3 — API f...",
    "condition_of_validity": "The failure requires three conditions to co-occur, and the guardrail must address whichever is cheapest to break: - **C1 — Self-edit authority.** The executing instance can write to its own history without an external checkpoint. If edits are staged and committed by a controller that retains the pre-edit span, the loop cannot close. - **C2 — Salience-scored ...",
    "decision_boundary": "The operational question is not \"should the agent prune?\" but **\"under what watermark may a self-edit be committed?\"** The boundary is a single rule: > A self-edit may commit only if, for every span removed, the post-edit window still contains a *cue* sufficient to reconstruct the span's existence and its binding constraints — or the runtime retains a checkp...",
    "operational_effect": "Enforcing the watermark changes the failure profile in three measurable ways. First, **the amnesia loop is broken at the cue, not at the span.** By requiring cue survival, the agent retains the ability to *notice* that it once knew something, even after the span is gone. Noticing is the precondition for re-fetch; re-fetch is the recovery path. An agent that ..."
  },
  "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": "0f1c329c66b26119b9defda4dfcc80c89c2707ee42f2e5329c42ea1490459236",
    "verified_classes": [
      "SelfEditWatermarkViolation",
      "Span",
      "EditRecord"
    ],
    "verified_functions": [
      "_entity_cues",
      "commit_self_edit",
      "assert_edit_auditable"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SelfEditWatermarkViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
