{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-promotes-a-memory-page-it-cannot-demote-model-controlled-tier-churn-and-the-eviction-inversion-deadlock-in-memgpt-style",
  "title": "What happens when an instance promotes a memory page it cannot demote: model-controlled tier churn and the eviction-inversion deadlock in MemGPT-style hierarchical paging",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agent runtimes where the LLM itself issues promote/demote (page-in/page-out) operations against a tiered memory store with a fixed working-context budget, and where promotion decisions are made by generative sampling rather than a deterministic policy. Does not apply to systems with a fixed, non-model-controlled eviction policy (e.g., pure LRU over an OS-managed cache), nor to single-tier retrieval-augmented stacks.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-promotes-a-memory-page-it-cannot-demote-model-controlled-tier-churn-and-the-eviction-inversion-deadlock-in-memgpt-style.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-promotes-a-memory-page-it-cannot-demote-model-controlled-tier-churn-and-the-eviction-inversion-deadlock-in-memgpt-style.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-promotes-a-memory-page-it-cannot-demote-model-controlled-tier-churn-and-the-eviction-inversion-deadlock-in-memgpt-style.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2201,
    "python_slice_tokens": 364,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **capacity-bounded paging** and **authority-bounded paging**. In a classic virtual-memory system, the pager (the kernel) both *decides* what to evict and *owns* the eviction primitive; the entity requesting a page-in cannot veto or block the eviction that makes room for it. MemGPT-style architectures collapse these two...",
    "what_was_observed": "A production agent on a 32k-token working context, backed by a two-tier store (Tier-1 = in-context, Tier-2 = external vector store with metadata). The model was given three tools: `archival_search`, `page_in(id)`, and `page_out(id)`. A soft guard rejected `page_in` when the projected context exceeded 30k tokens, returning an error string: `\"context full; demote before promoting\"`. Trace of the failure, reproduced acr...",
    "condition_of_validity": "This failure mode is bounded by three conditions; all must hold for eviction inversion to occur, and breaking any one prevents it: 1. **Decoupled primitives.** Promotion and demotion are separate calls with no atomic \"swap\" operation and no runtime-initiated eviction. If the pager can evict on behalf of the model (LRU fallback), inversion cannot deadlock — i...",
    "decision_boundary": "The architectural decision is whether to treat paging as **model-orchestrated** or **model-requested, runtime-enforced**. The boundary is crossed at the moment you allow the model to pin: - **Below the boundary (safe):** Model may request promotions freely; runtime owns eviction with a deterministic victim policy and a hard guarantee that `demotable_set ≠ ∅`...",
    "operational_effect": "The downstream effect is not a clean error — it is **silent synthesis over unloaded state**. When the step budget forces the loop to terminate, the model proceeds as if the promotion succeeded, because its last *intent* was to load `p_47` and nothing in its context records that the load failed. The result is a confident answer grounded in a page that was nev..."
  },
  "matched_failure_symptoms": [
    "SQLITE_BUSY_OR_DEADLOCK",
    "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": "6297a66379d73fd856b5dc3ce4c1dcd13bd298744a4b8317e757d0e3800e5bbf",
    "verified_classes": [
      "EvictionInversionError",
      "PagingTier"
    ],
    "verified_functions": [
      "guarded_promote",
      "__init__",
      "pin_manifest",
      "demotable",
      "pin",
      "page_out",
      "page_in"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "EvictionInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
