{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-silent-semantic-loss-when-a-model-prunes-its-own-context-window",
  "title": "Which invariants prevent silent semantic loss when a model prunes its own context window",
  "date_of_record": "2026 November 11",
  "scope": "Applies to agents that mutate their own context (pruning, summarizing, re-weighting retention) between inference steps, where the same model both selects what to drop and consumes the surviving context. Does not apply to externally orchestrated compaction where a separate process owns retention policy and the acting model has no write access to its own history.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-semantic-loss-when-a-model-prunes-its-own-context-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-semantic-loss-when-a-model-prunes-its-own-context-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-silent-semantic-loss-when-a-model-prunes-its-own-context-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1744,
    "python_slice_tokens": 332,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious failure here is not context overflow. It is *prune-then-reason over a corrupted premise*. When a model decides what to evict, it evaluates salience at time *t* using the current task state. But eviction decisions are irreversible within a session, and the salience signal at time *t* is a function of the task as currently framed — which is exa...",
    "what_was_observed": "In a multi-step agent operating on a 200k token window with a priority-weighted retention policy (recency × task-relevance × user-pinned), the following sequence reproduced the failure across three runs: 1. Step 4: agent summarizes a 40k-token tool-output block into a 600-token digest, dropping raw error signatures. Digest retains \"the migration failed due to a schema mismatch.\" The specific column names and the exac...",
    "condition_of_validity": "The invariant \"evicted facts must be reconstructible or eviction is refused\" holds only under these conditions: - **The pruner has a declared query distribution over future steps.** If the agent can bound what it will need (e.g., \"this branch only reads the API schema\"), eviction of out-of-branch facts is safe *for that branch*. The invariant fails the momen...",
    "decision_boundary": "The operational line: **prune freely when the evicted content is derivable; refuse when it is only retrievable.** - Derivable: facts the model can recompute from surviving context (e.g., a timestamp derivable from a retained event, a count derivable from a retained list). Evict these without ceremony. - Retrievable-only: raw observations, user statements, to...",
    "operational_effect": "The practical consequence is a shift from *compaction as compression* to *compaction as indexed elision*. The context window stops being the model's memory and becomes its working set, with a mandatory external store for anything evicted. This costs a retrieval round-trip on re-frame, but it converts a silent-corruption failure into a detectable-latency fail..."
  },
  "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": "c5469fb297a31399d2fe84213e23b2b5f52bc57a8611baba152a420af08688e1",
    "verified_classes": [
      "UnreconstructibleEvictionError",
      "ContextItem"
    ],
    "verified_functions": [
      "evict",
      "re_frame",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnreconstructibleEvictionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
