{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-that-rewrites-its-own-context-window-corrupt-its-own-verifier-before-it-can-detect-the-corruption",
  "title": "Why does an instance that rewrites its own context window corrupt its own verifier before it can detect the corruption?",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any agent that owns a model-driven context-rewriting operator (prune, summarize, merge, re-rank) that mutates the live context buffer *and* whose verification loop reads from that same buffer. Does not apply to stateless single-shot calls, or to agents whose context rewriting is performed by an external process against an immutable log the agent cannot touch.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-that-rewrites-its-own-context-window-corrupt-its-own-verifier-before-it-can-detect-the-corruption.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-that-rewrites-its-own-context-window-corrupt-its-own-verifier-before-it-can-detect-the-corruption.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-that-rewrites-its-own-context-window-corrupt-its-own-verifier-before-it-can-detect-the-corruption.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2014,
    "python_slice_tokens": 514,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" Forgetting is expected and bounded. The failure is that **the rewriting operator and the verifier share the same mutable substrate**, so a rewrite that deletes or distorts the evidence a verifier needs is invisible to that verifier *by construction*. A prune that drops the tool-call transcript which proved a s...",
    "what_was_observed": "A concrete trace from a task-execution agent with a `rewrite_context(strategy=\"summarize_prune\", target_tokens=0.6*W)` operator invoked after every third tool call: 1. **Turn 4.** Agent runs `read_file(config.yaml)`, receives 3.1k tokens of config. Retains full text in buffer. 2. **Turn 7.** Buffer at 0.58·W. Prune operator fires. The summarizer model compresses the buffer and, among its cuts, replaces the full `conf...",
    "condition_of_validity": "This failure requires all three of the following to co-occur; remove any one and the mechanism does not fire: - **Substrate sharing.** The verifier's read path and the rewrite operator's write path target the same buffer. If the verifier reads from an append-only event log the rewriter cannot mutate, the failure is impossible. - **Semantic (not positional) d...",
    "decision_boundary": "The boundary is not \"should the agent prune.\" Pruning is mandatory under context pressure. The boundary is **what the verifier is allowed to treat as ground truth.** - *Below the boundary (safe):* The verifier's assertions are checked against a **write-once evidence ledger** — every tool result and every file read is appended to an immutable side-store keyed...",
    "operational_effect": "When this boundary is crossed, three second-order effects compound: 1. **Verifier confidence inflates monotonically with prune count.** Each prune removes contradicting detail, so the surviving buffer is *more* self-consistent than the original. The verifier's pass rate rises as the agent's grip on reality falls. This is the inverse of the expected degradati..."
  },
  "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": "63a184e1955bf77fb98fcfc17b05d01947513999c215af474b19169816ee0bc1",
    "verified_classes": [
      "UnverifiableFromSummaryError",
      "EvidenceLedger",
      "LiveBuffer"
    ],
    "verified_functions": [
      "verify_fact",
      "record",
      "fetch",
      "prune_to_summary"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnverifiableFromSummaryError"
    ],
    "sample_fail_closed_invariants": [
      "assert verify_fact('config.yaml', buffer, ledger) == 'service:\\n  port: 8080\\n'"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
