{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-rewrite-its-own-context-into-a-state-it-can-no-longer-verify-the-self-pruning-attestation-gap",
  "title": "Why does an instance rewrite its own context into a state it can no longer verify: the self-pruning attestation gap",
  "date_of_record": "2026 December 4",
  "scope": "Applies to any agent that owns a model-driven context rewrite policy (summarization, pruning, compaction, \"memory editing\") over its own working window, where the rewritten window is the sole record used to justify subsequent actions. Does not apply to externally-logged append-only transcripts that are never mutated, nor to stateless single-shot calls where no rewrite occurs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-into-a-state-it-can-no-longer-verify-the-self-pruning-attestation-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-into-a-state-it-can-no-longer-verify-the-self-pruning-attestation-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-into-a-state-it-can-no-longer-verify-the-self-pruning-attestation-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2420,
    "python_slice_tokens": 595,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent can do to its context window, and they are routinely conflated: 1. **Compaction as compression** — reducing token count while preserving a verifiable mapping back to the source tokens (every retained claim is traceable to a span that still exists somewhere, even if off-window). 2. **Self-editing as overwri...",
    "what_was_observed": "A long-horizon task agent (tool-using, ~40-step budget, 128k window, rewrite triggered at 70% saturation) executing a multi-file refactor with a verification step at the end. Trace of the failure: - **Steps 1–18:** Agent reads source files, runs tests, records results inline. Window fills to ~92k tokens. A rewrite policy fires: \"summarize the working state, drop raw tool outputs older than 10 steps.\" - **Rewrite outp...",
    "condition_of_validity": "The self-editing pattern is only safe under a condition that is almost never checked: > A rewrite is valid iff, for every retained assertion `a`, either (i) `a` is accompanied by a pointer to a source span that remains recoverable outside the window, or (ii) `a` is marked as *unverified* and the downstream policy refuses to act on unverified assertions witho...",
    "decision_boundary": "The boundary is not \"should the agent prune\" — it must, or it exhausts the window. The boundary is **what class of claim may survive a destructive rewrite, and at what confidence.** - **May survive at full confidence:** claims that are (a) re-derivable by a cheap deterministic re-check, or (b) accompanied by a retained provenance pointer. Example: \"file `x.p...",
    "operational_effect": "Without the guardrail, the effect is a **confidence laundering** loop: raw observations (hedged, noisy, qualified) are compressed into flat assertions (clean, confident, bare), and the compression is performed by the same model that will consume the result. Each rewrite cycle ratchets confidence upward while ratcheting provenance downward, until the window i..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "e9ce891ddf738829a3b7fac34d57f3cedf66374b56b00704148f5d3136840322",
    "verified_classes": [
      "UnattestedAssertionError",
      "Assertion",
      "SideLog"
    ],
    "verified_functions": [
      "apply_rewrite",
      "act_on",
      "store",
      "resolve"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnattestedAssertionError"
    ],
    "sample_fail_closed_invariants": [
      "assert window[0].confidence <= 0.2",
      "rewrite erased the flakiness qualifier; re-derive before acting"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
