{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-a-self-edit-because-the-provenance-ledger-cannot-reconstruct-the-pre-edit-context",
  "title": "When must an instance refuse a self-edit because the provenance ledger cannot reconstruct the pre-edit context?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent that mutates its own working context (pruning, summarizing, reordering, or compaction) between turns and maintains an edit-provenance ledger for audit/replay. Does not apply to read-only context assembly or to edits performed by an external orchestrator that has its own durable store of the pre-edit transcript.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-self-edit-because-the-provenance-ledger-cannot-reconstruct-the-pre-edit-context.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-self-edit-because-the-provenance-ledger-cannot-reconstruct-the-pre-edit-context.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-self-edit-because-the-provenance-ledger-cannot-reconstruct-the-pre-edit-context.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2326,
    "python_slice_tokens": 454,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between an edit that is *lossy but reconstructible* and an edit that is *lossy and irreversible*. A pruning policy that drops a tool result the model no longer needs is fine as long as the ledger can, on demand, regenerate the exact pre-edit token sequence from a stable source (the raw transcript, a content-addressed blob, or ...",
    "what_was_observed": "A long-horizon research agent running a 40-turn session with a 128k window hit 78% saturation at turn 29. Its self-edit policy fired: it summarized turns 4–11 (a block of web-fetch results) into a 300-token digest and dropped the originals from the live context to reclaim ~9k tokens. The ledger recorded: - `edit_id`, `turn=29`, `op=summarize`, `span=[turn4,turn11]`, `tokens_before=9310`, `tokens_after=298`, `rational...",
    "condition_of_validity": "The invariant holds — and self-edits are safe to commit — only when all three conditions are met at commit time: 1. **Content addressing.** Every removed span is persisted to a store keyed by a cryptographic hash of its exact bytes *before* the live-context mutation is applied. The ledger entry references the hash, not a description. If the store write fails...",
    "decision_boundary": "The boundary is not \"should I prune?\" but \"can I prune *this span* given the ledger's current recovery guarantees?\" Concretely: - **Prune freely** when the span is already content-addressed and disjoint from prior entries, and the reconstructability assertion passes. This covers the common case of dropping superseded tool results. - **Prune with dependency e...",
    "operational_effect": "Enforcing the invariant changes agent behavior in three measurable ways. First, prune commits become *transactional*: blob-write-then-mutate, with an assertion gate, so a failed store write leaves the context untouched and the next turn retries. Second, the ledger grows a dependency graph rather than a flat list, which makes replay deterministic and lets a r..."
  },
  "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": "f318eb0a3d057cd211fb734842e501887f98fd377ec6ea4ee10d4c9e9ed1060f",
    "verified_classes": [
      "ProvenanceIncomplete",
      "LedgerEntry",
      "BlobStore",
      "ContextLedger"
    ],
    "verified_functions": [
      "__init__",
      "put",
      "get",
      "__init__",
      "_overlaps",
      "commit_self_edit",
      "reconstruct"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ProvenanceIncomplete"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
