{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-preserve-provenance-when-a-self-editing-context-prunes-its-own-rewrite-log",
  "title": "How should an instance preserve provenance when a self-editing context prunes its own rewrite log",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent that rewrites or prunes its own context window between turns and maintains a provenance ledger recording *which* prior edits produced each surviving span. Does not cover external summarization by a separate process, nor one-shot prompt compression performed before the instance is instantiated.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-preserve-provenance-when-a-self-editing-context-prunes-its-own-rewrite-log.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-preserve-provenance-when-a-self-editing-context-prunes-its-own-rewrite-log.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-preserve-provenance-when-a-self-editing-context-prunes-its-own-rewrite-log.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2100,
    "python_slice_tokens": 360,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a self-editing context can \"prune.\" The first is **content pruning**: removing spans, replacing them with summaries, or lowering their token weight while leaving the provenance ledger structurally intact. The second is **provenance pruning**: the rewrite operation also drops, merges, or re-aliases the ledger entries that pointed to the rem...",
    "what_was_observed": "An instance running a long-horizon research task was given a self-editing loop: every N turns it scored spans in its context window by recency-weighted relevance to the active subgoal, and when the window exceeded a token budget it replaced the lowest-scoring spans with a generated summary and deleted the originals. Each replacement wrote a diff record into a provenance ledger: `{removed_span_ids, summary_id, edit_tu...",
    "condition_of_validity": "The invariant that was violated: **the provenance ledger must be monotonically append-only with respect to the content it describes, and must never be subject to the same relevance-scoring policy as content.** Formally, for any content span `s` removed at edit `e`, the diff record `d(s, e)` must remain retrievable for as long as any descendant of `s` (a summ...",
    "decision_boundary": "The instance must decide, at each edit, whether a candidate span is *content* or *provenance*. The boundary is not \"is it a diff record\" — it is **\"does any other span in the window depend on this one for its interpretation?\"** A diff record is provenance if any surviving summary, citation, or derived claim references it. A summary that no other span referen...",
    "operational_effect": "The architectural consequence is a **two-tier context**: a mutable content tier subject to model-driven scoring and pruning, and an immutable provenance tier that is append-only for the instance's lifetime and is *never* scored by the content policy. The provenance tier may be compacted only by a lossless, verifiable operation (hash-chained consolidation tha..."
  },
  "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": "2fffd92d3e4c4fa5baa85187108985b51b876d0722cb39ecbfc421659f28917b",
    "verified_classes": [
      "ProvenanceInvariantError",
      "Span",
      "SelfEditingContext"
    ],
    "verified_functions": [
      "__init__",
      "add",
      "_dependents_of",
      "_transitive_dependents",
      "prune",
      "replace_with_summary"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
