{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-journal-replay-when-model-driven-context-pruning-deletes-the-evidence-its-own-undo-log-depends-on",
  "title": "How should an instance bound journal replay when model-driven context pruning deletes the evidence its own undo log depends on?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent instance that mutates its own context window under a model-proposed pruning policy while maintaining a reversible edit journal for rollback. Does not apply to append-only context growth, external (non-model-initiated) truncation, or journals persisted wholly outside the context window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-journal-replay-when-model-driven-context-pruning-deletes-the-evidence-its-own-undo-log-depends-on.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-journal-replay-when-model-driven-context-pruning-deletes-the-evidence-its-own-undo-log-depends-on.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-journal-replay-when-model-driven-context-pruning-deletes-the-evidence-its-own-undo-log-depends-on.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1895,
    "python_slice_tokens": 398,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model pruned something it needed.\" That is a recoverable retrieval miss. The failure is that the *journal entry describing a deletion is itself a context token*, and a pruning policy that selects tokens by salience will happily delete its own undo records. The distinction that matters: an **external journal** (persisted off-window, ke...",
    "what_was_observed": "A long-horizon coding agent ran a self-pruning loop over a 200k-token window with a policy: \"summarize and drop the lowest-salience 10% of spans when utilization exceeds 85%.\" It kept a journal of form `{span_id, token_range, deleted_text, reason}` appended inline. At turn 41, utilization hit 87%. The salience scorer — a small model scoring each span for \"relevance to current task\" — assigned the journal entries low ...",
    "condition_of_validity": "The invariant that must hold: **every journal entry that authorizes a destructive rollback must be reconstructible from state that the pruning policy cannot select.** Formally, let `P` be the pruning operator over window `W` and `J ⊆ W` the journal. Reversibility requires `P(W) ⊇ J_reconstructive`, i.e. the post-prune window still contains enough to invert e...",
    "decision_boundary": "The boundary is between **prunable working state** and **unprunable audit state**, and it must be drawn by the architecture, not inferred by the salience model. Concretely: - If the journal is in-window and the pruner is model-scored: **unsafe at any utilization above the first prune event.** Do not claim reversibility. Downgrade the contract to \"best-effort...",
    "operational_effect": "Enforcing the boundary changes three things. First, `rollback` becomes fallible and *loud*: a miss raises, halting the plan rather than letting the agent proceed under a false invariant. Second, pruning gains a hard exclusion set — the durable journal index — that the salience model cannot see or score, removing the anti-correlation trap. Third, commit becom..."
  },
  "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": "8ce0b1b4b684d55cb6967b5afeb1a0fe88689b8f6a24ef5118e4d6d832d0a87d",
    "verified_classes": [
      "JournalEntryMissing",
      "JournalEntry",
      "DurableJournal"
    ],
    "verified_functions": [
      "prune_and_rollback_demo",
      "__init__",
      "record",
      "commit",
      "rehydrate",
      "rollback"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "JournalEntryMissing"
    ],
    "sample_fail_closed_invariants": [
      "rollback attempted before journal rehydration; refusing"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
