{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-rewriting-context-policies-from-erasing-the-provenance-of-their-own-pruning-decisions",
  "title": "Which invariants prevent self-rewriting context policies from erasing the provenance of their own pruning decisions",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents that own a mutable context buffer and invoke an LLM to rewrite, summarize, or prune that buffer between steps. Does not apply to read-only context assembly or to external memory stores the agent cannot mutate mid-task.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-policies-from-erasing-the-provenance-of-their-own-pruning-decisions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-policies-from-erasing-the-provenance-of-their-own-pruning-decisions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-policies-from-erasing-the-provenance-of-their-own-pruning-decisions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1779,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context policy is not the same as context compression. Compression is a lossy transform applied once, by a fixed procedure, whose parameters the model cannot change. A self-editing policy is a *loop*: the model reads the buffer, emits a rewrite (drop spans, summarize spans, reorder, re-tag), and the runtime applies it, then the model reads the...",
    "what_was_observed": "A planning agent held a 96k-token working buffer across a 40-step task. Every 8 steps it ran a self-edit pass with the instruction: *\"Remove spans no longer needed for the current subtask; keep a one-line note for each removal.\"* The note spans were appended to the buffer tail. At step 16 the buffer was near saturation. The self-edit pass, correctly following its instruction to remove spans \"no longer needed,\" identi...",
    "condition_of_validity": "The invariant that prevents provenance collapse is a **partition between mutable content and append-only provenance**, enforced at the runtime layer, not by prompt instruction. Concretely: - The buffer is split into `content` (model-mutable) and `provenance_log` (append-only, model-readable but not model-writable, and excluded from the token budget the self-...",
    "decision_boundary": "The boundary between safe and unsafe self-editing is whether the policy can answer, from the current buffer alone, the question *\"why is span S absent?\"* for every S it removed in the last *k* passes, where *k* is the number of passes since S was removed. - If yes for all live constraints, self-editing is admissible. - If the answer requires reconstructing f...",
    "operational_effect": "With the partition enforced, the step-31 failure is blocked at step 16: the canary constraint is tagged `durable`, the self-edit pass's attempt to drop it raises a typed rejection, and the model is forced to either keep it or explicitly re-tag with a logged reason. The provenance log records \"turn 8: summarized constraint C into note N; turn 16: attempted dr..."
  },
  "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": "526b3595ca471b8db1cabdf156241611119a9eff7e279551bfeceb5005876f91",
    "verified_classes": [
      "ProvenanceCollapseError",
      "Span",
      "ProvenanceRecord",
      "SelfEditingBuffer"
    ],
    "verified_functions": [
      "run_self_edit_cycle",
      "apply_rewrite",
      "_explainable",
      "assert_live_constraints_resolvable"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ProvenanceCollapseError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
