{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-rewriting-context-policies-from-erasing-the-evidence-they-cite",
  "title": "Which invariants prevent self-rewriting context policies from erasing the evidence they cite",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that own a mutable context window and execute model-generated rewrite policies (summarize, prune, dedupe, reorder, annotate) against it mid-task. Does not apply to stateless single-shot inference or to externally managed context where the host, not the model, arbitrates what is retained.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-policies-from-erasing-the-evidence-they-cite.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-policies-from-erasing-the-evidence-they-cite.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-policies-from-erasing-the-evidence-they-cite.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2045,
    "python_slice_tokens": 364,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context window differs from ordinary retrieval augmentation in one decisive way: the entity that *uses* the evidence is the same entity that *decides what evidence survives*. When the rewrite policy is itself a model output, the policy is a probabilistic artifact evaluated against the same context it is about to mutate. The failure mode is not...",
    "what_was_observed": "An agent mid-task held a 94k-token window containing, among other things, a tool output at position ~61k recording a rate-limit header (`X-RateLimit-Reset: 1749500000`) and a later reasoning block that had already consumed that value into a scheduled retry. At step 40 the agent emitted a rewrite policy: *\"Compress tool outputs older than step 30 into one-line summaries; preserve all numeric constants referenced by pe...",
    "condition_of_validity": "The invariant that would have bounded this is a **citation-closure invariant**: every live action, claim, or verification obligation in the window must reference its supporting spans by *stable identity* (content hash or immutable span ID), and a rewrite may not commit if any live reference would resolve to a span that is deleted, paraphrased beyond hash mat...",
    "decision_boundary": "The boundary is not \"summarize or don't.\" It is **whether a live obligation depends on a span the rewrite would touch**. Concretely: - If no live action, claim, or pending verification cites a span in the rewrite's target region → rewrite freely; citation closure is trivially satisfied. - If a cited span falls in the target region and the rewrite is *lossles...",
    "operational_effect": "Enforcing citation closure changes the cost profile of self-editing: rewrites become *gated* rather than *free*, and the gate is a set-membership check over live references, not a model judgment. In practice this means (a) ingestion assigns immutable span IDs and every downstream artifact that consumes a span records the ID; (b) rewrite policies are drafted ..."
  },
  "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": "68d0c541c5eefbcf90af01e9f021f21ca79832e0785e4da74702e15668f71344",
    "verified_classes": [
      "CitationClosureViolation",
      "Span",
      "LiveReference",
      "ContextWindow"
    ],
    "verified_functions": [
      "_resolve_transitive",
      "apply_rewrite"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CitationClosureViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
