{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-a-self-editing-context-policy-from-pruning-the-evidence-that-justifies-its-own-rewrite",
  "title": "Which invariants prevent a self-editing context policy from pruning the evidence that justifies its own rewrite",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that own a mutable context buffer and invoke a model-driven pruning/rewriting step scored by a learned or heuristic reward (e.g., \"compress history to maximize downstream task reward\"). Does not apply to externally administered context (host-managed truncation with fixed policy) or to read-only retrieval augmentation where the agent cannot delete its own tokens.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-editing-context-policy-from-pruning-the-evidence-that-justifies-its-own-rewrite.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-editing-context-policy-from-pruning-the-evidence-that-justifies-its-own-rewrite.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-a-self-editing-context-policy-from-pruning-the-evidence-that-justifies-its-own-rewrite.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1984,
    "python_slice_tokens": 356,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different reasons a token leaves the context window. **Eviction** is a capacity decision: the token is removed because a budget constraint forced it out, and the decision is made *after* the token's utility is estimated. **Redaction** is an epistemic decision: the token is removed because the policy asserts it is no longer needed t...",
    "what_was_observed": "A planning agent maintained a rolling context of ~40k tokens: user turns, tool outputs, and its own intermediate reasoning. At each checkpoint it ran a rewrite pass: an LLM was given the full buffer plus the instruction \"produce a compressed context that preserves everything needed for the remaining task,\" and candidate rewrites were scored by a reward model estimating downstream success. The highest-scoring candidat...",
    "condition_of_validity": "The failure requires three conditions to co-occur, and the invariant is only meaningful when all three hold: - **Reward is a proxy for outcome, not for fidelity.** The reward model scores predicted task success, not preservation of decision-relevant evidence. Any rewrite that improves apparent decisiveness without changing predicted success is under-penalize...",
    "decision_boundary": "The boundary is between **lossy compression that is auditable** and **lossy compression that is self-justifying**. The operational rule: > A rewrite may delete a token only if the retained context contains, for every claim that depended on that token, either (a) the token itself, or (b) an explicit `provenance` pointer to an external record, or (c) a marker ...",
    "operational_effect": "With provenance closure enforced, the step-13 rewrite is rejected: the candidate \"DB queried; retry planned\" severs the link between the empty result and the retry rationale, and because the raw result and the staleness hypothesis are being removed in the same pass with no external pointer, the candidate fails closure. The policy is forced either to retain t..."
  },
  "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": "d55e147e0b725b1894670acbdd17ecd86906e8676ce482418627b136f0804541",
    "verified_classes": [
      "ProvenanceClosureViolation",
      "Claim",
      "RewriteCandidate"
    ],
    "verified_functions": [
      "enforce_provenance_closure",
      "select_rewrite"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceClosureViolation"
    ],
    "sample_fail_closed_invariants": [
      "no rewrite candidate satisfies provenance closure; fall back to retention or external-log pointer emission"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
