{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-prunes-its-own-context-window-and-the-reversible-edit-journal-diverges-from-the-live-buffer",
  "title": "What happens when an instance prunes its own context window and the reversible edit journal diverges from the live buffer",
  "date_of_record": "2026 November 27",
  "scope": "Applies to single-agent instances that mutate their own context buffer via learned salience scoring and maintain a reversible edit journal for undo/compaction. Does not apply to externally-managed context (host-side truncation) or to stateless single-shot calls where no journal exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-and-the-reversible-edit-journal-diverges-from-the-live-buffer.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-and-the-reversible-edit-journal-diverges-from-the-live-buffer.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-and-the-reversible-edit-journal-diverges-from-the-live-buffer.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1669,
    "python_slice_tokens": 394,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" It is a **journal–buffer divergence** introduced by a self-edit whose salience score was computed against a buffer state that the edit itself invalidated. A learned salience pruner scores spans, drops the low-scoring ones, and appends a `(span_id, offset, content_hash, restore_payload)` record to a reversible ...",
    "what_was_observed": "A long-horizon planning agent (≈180k-token working set, 40-step task) used a salience pruner that dropped spans scoring below a learned threshold τ. Each prune wrote a journal entry. On step 27 the agent hit a contradiction: a constraint it \"remembered\" (a budget cap) conflicted with a tool result. It issued an undo of the last three prunes to re-inspect. Trace of the divergence: 1. **Step 9:** Pruner drops span `S_a...",
    "condition_of_validity": "Reversibility of a self-editing journal holds **iff** for every journal entry `J_i`, the `context_fingerprint` is computed over a region invariant to all *later* prunes, or the undo procedure replays in an order that restores dependencies before dependents. Concretely, the invariant is: > For all `i < j`, if `J_j`'s fingerprint region overlaps `J_i`'s remove...",
    "decision_boundary": "The boundary is between **fingerprint-as-integrity-check** and **fingerprint-as-dependency-witness**. If the fingerprint is used only to detect \"did the world change,\" a mismatch is informational and skipping restoration is defensible. But in a self-editing buffer, a mismatch across a *restore* operation means the restore target's preconditions are unmet — i...",
    "operational_effect": "Silent, monotonic semantic drift: each LIFO undo cycle can strip one authoritative span while leaving its paraphrase, and the drift compounds because the paraphrase now scores *higher* salience (it is the only surviving mention) and is therefore *less* likely to be pruned next round. The buffer converges toward a set of confident-sounding restatements with n..."
  },
  "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": "991faee4d717fb9813e56f05ea262802d76a4fd5cf9916be8eb336f56f3fc7e4",
    "verified_classes": [
      "JournalDivergenceError",
      "JournalEntry"
    ],
    "verified_functions": [
      "_fp",
      "undo_in_dependency_order"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "JournalDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
