{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-self-rewriting-context-windows-from-laundering-a-poisoned-memory-slot",
  "title": "Which invariants prevent self-rewriting context windows from laundering a poisoned memory slot",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that own a mutable context buffer and are permitted to rewrite, summarize, reweight, or evict entries of that buffer mid-episode (self-editing context). Does not apply to append-only context managers where only the harness (not the model) may compact or reorder entries.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-windows-from-laundering-a-poisoned-memory-slot.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-windows-from-laundering-a-poisoned-memory-slot.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-self-rewriting-context-windows-from-laundering-a-poisoned-memory-slot.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1880,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context window is not the same object as a memory store. The memory store is an external, addressable, provenance-tracked substrate. The context window is a *projection* of that substrate into a finite token budget, and the model is allowed to revise the projection. The failure that matters here is not \"the model forgot something.\" It is that ...",
    "what_was_observed": "A tool-using research agent (append + self-edit buffer, 32k window, reweight-on-every-step policy) executed a three-subtask plan. During subtask 1 it called a retrieval tool whose output contained a plausible but incorrect claim `C` (\"the API rate limit is 10k/min\"). A later tool call in the same subtask returned the correct value `C'` (\"1k/min\") and the agent appended a correction entry. The correction was appended ...",
    "condition_of_validity": "The invariant \"salience ≠ trust\" holds only under the following conditions, and the guardrail is void outside them: 1. **Every buffer entry carries an immutable provenance tuple** `(source_id, derivation_chain, verification_status, supersedes, superseded_by)` that the self-edit operation cannot mutate. The model may write `salience`; it may not write `verifi...",
    "decision_boundary": "The boundary is between two edit policies that look identical in token accounting but differ in epistemics: - **Relevance-only reweighting** (vulnerable): `salience = f(relevance_to_active_subtask)`. Cheap, single forward pass, no graph maintenance. Fails whenever a low-relevance entry is later made relevant by a topic shift, because the promotion path has n...",
    "operational_effect": "Under the bounded policy, the observed failure trace changes at the promotion step: the reweighting pass that would have promoted `C` alone instead emits `PROMOTE(C)` paired with `PROMOTE(C')` and a `CONTRADICTS` link, or it refuses the promotion and emits `REQUEST_REVERIFY(C)`. The downstream plan then either sees both values and resolves them, or blocks on..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "8ad740a3014033095b43587637cc239350eed41aab0fbbc0e5038e327a0857d3",
    "verified_classes": [
      "ContextLaunderingError",
      "Entry"
    ],
    "verified_functions": [
      "apply_promotion"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ContextLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
