{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-its-own-edit-trail-self-referential-pruning-corruption-when-a-model-rewrites-the-context-it-is-reasoning-inside",
  "title": "Why does an instance lose its own edit trail: self-referential pruning corruption when a model rewrites the context it is reasoning inside",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent loop where the model itself selects or rewrites spans of its live working context (model-driven pruning, compaction, \"scratchpad rewrite\", self-summarization mid-run) and then continues reasoning in the mutated buffer. Does not apply to append-only context, to externally scheduled compaction performed between turns by a deterministic policy, or to retrieval systems that never overwrite in-flight state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-own-edit-trail-self-referential-pruning-corruption-when-a-model-rewrites-the-context-it-is-reasoning-inside.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-own-edit-trail-self-referential-pruning-corruption-when-a-model-rewrites-the-context-it-is-reasoning-inside.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-own-edit-trail-self-referential-pruning-corruption-when-a-model-rewrites-the-context-it-is-reasoning-inside.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2089,
    "python_slice_tokens": 238,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model summarized badly.\" Summarization quality is an orthogonal problem. The failure is **self-referential edit corruption**: the pruning decision is computed from a context snapshot, the rewrite is applied to that snapshot, and the model then continues reasoning from the rewritten buffer *while still holding token-level commitments t...",
    "what_was_observed": "A planning agent running a 12-step tool-use task with a 32k window and a \"compact when >70% full\" self-edit policy. At step 7, occupancy hit 71%. The model was instructed: *\"Summarize the conversation so far, preserving all constraints, then continue.\"* Trace of the failure: 1. **Snapshot at prune time (steps 1–7).** The context contained, among ~22k tokens, a single clause from step 2: *\"the output must be sorted by...",
    "condition_of_validity": "The corruption requires all three of the following to co-occur; break any one and the failure does not manifest: - **In-place replacement.** The rewrite overwrites the original span. If the original is retained (append-only compaction, or moved to a retrievable cold store keyed by span ID), the model can still be made to recover the dropped clause. Replaceme...",
    "decision_boundary": "The operational question is not \"should we prune\" — context saturation is real and unbounded growth fails harder. The boundary is **what class of information is allowed to be model-pruned versus must be structurally preserved.** - **Model-prunable:** narrative recap, intermediate reasoning traces, superseded tool outputs whose conclusions have been extracted...",
    "operational_effect": "Without the invariant, the failure mode is **silent, self-justifying, and confidence-increasing** — the three properties that make it expensive. Silent because the model cannot report what it no longer knows. Self-justifying because the post-prune context is internally consistent (it is a summary of a summary, and summaries are coherent by construction). Con..."
  },
  "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": "bca2505b7a1601be0589eecbdfb22d8f147de3922135520a77fa904351f78c99",
    "verified_classes": [
      "PruneCorruptionError",
      "Constraint",
      "ContextBuffer",
      "ConstraintLedger"
    ],
    "verified_functions": [
      "apply_self_prune",
      "__init__",
      "ingest",
      "preserved_ids"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "PruneCorruptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
