{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-rewrite-its-own-context-window-into-a-state-it-can-no-longer-verify",
  "title": "Why does an instance rewrite its own context window into a state it can no longer verify?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent that mutates its own working context via model-driven summarization, pruning, or rewrite passes between reasoning steps. Does not apply to externally-managed context (host-side truncation, fixed sliding windows, or append-only logs where the model never authors its own compaction).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-window-into-a-state-it-can-no-longer-verify.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-window-into-a-state-it-can-no-longer-verify.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-rewrite-its-own-context-window-into-a-state-it-can-no-longer-verify.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2050,
    "python_slice_tokens": 464,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different operations that both look like \"shrinking the context\": *eviction* and *rewrite*. Eviction removes tokens and leaves a gap that downstream steps can detect (a missing turn, an absent tool result, a hole in the transcript). Rewrite **replaces** tokens with a model-generated paraphrase that occupies the same logical slot. E...",
    "what_was_observed": "An agent running a long tool-using task (schema migration across a codebase) was configured with a self-pruning policy: when the context exceeded ~78% of the window, it invoked a model-driven rewrite that (a) summarized the last N tool exchanges into a \"state of play\" block and (b) dropped the raw exchanges. The policy was intended to preserve \"decisions and open questions\" while discarding \"raw output noise.\" The tr...",
    "condition_of_validity": "The guardrail that bounds this failure is a **rewrite provenance invariant**: any context segment produced by a model-driven rewrite must carry a machine-checkable pointer to the immutable artifact it replaced, and that artifact must remain retrievable for the lifetime of the task. Concretely: - The rewrite output is a *derived* segment, tagged `derived_from...",
    "decision_boundary": "The boundary is between **acting on a derived segment** and **adjudicating with a derived segment**. - Acting (proceeding with a plan, choosing the next tool call) on a derived segment is safe under bounded risk: if the summary is wrong, the next tool call fails and you learn. - Adjudicating (deciding which of two records is true, resolving a count mismatch,...",
    "operational_effect": "With the provenance invariant enforced, the step-32 trace diverges at the adjudication gate: - The agent attempts to reconcile \"6 tables\" (derived) against \"7 entries\" (fresh). The derived segment's `derived_from` points to a cold-store manifest. The adjudication routine rehydrates it. The manifest shows 6 tables + 1 view with a skip flag. - The fresh observ..."
  },
  "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": "6300f96ac36f3da7ec57fa14de5c2f6ed2041af7760175ba990260f94c414cfd",
    "verified_classes": [
      "ProvenanceError",
      "SegmentKind",
      "ToolDeterminism",
      "Segment",
      "ColdStore",
      "Observation"
    ],
    "verified_functions": [
      "adjudicate",
      "put",
      "get"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
