{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-distinguish-between-eviction-and-invalidation-in-self-editing-context-windows",
  "title": "Where must an instance distinguish between eviction and invalidation in self-editing context windows",
  "date_of_record": "2026 November 15",
  "scope": "Applies to agents that own a mutable context window and perform model-driven pruning or relevance-scored segment eviction across turns, including any system where the model both proposes evictions and consumes the resulting window. Does not apply to windows that are append-only, externally truncated by a fixed token budget, or rebuilt from a durable store on every turn.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-distinguish-between-eviction-and-invalidation-in-self-editing-context-windows.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-distinguish-between-eviction-and-invalidation-in-self-editing-context-windows.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-distinguish-between-eviction-and-invalidation-in-self-editing-context-windows.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1771,
    "python_slice_tokens": 400,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary failure is the conflation of *eviction* (a segment is removed from the active window to reclaim budget) with *invalidation* (a segment's claims are no longer true, or a dependency it satisfied no longer holds). A self-editing window typically scores segments by relevance to the current turn and drops the lowest scorers. This is safe only if rele...",
    "what_was_observed": "In a 40-turn coding-assistant session, the window held an early constraint segment: \"Target runtime is Python 3.9; do not use `match`, `|` union types, or `tomllib`.\" At turn 22 the user asked about an unrelated topic (log rotation). The relevance scorer assigned the constraint a score of 0.04 against that query; the pruner evicted it to make room for a long tool output. From turn 23 onward the model emitted `match` ...",
    "condition_of_validity": "Model-driven eviction is valid only when all of the following hold for a given segment: 1. The segment is *episodic* — its content describes a past event or an intermediate result that no future turn must treat as a standing precondition. 2. Its truth value is not referenced by any other live segment (no dependency edge points to it). 3. Its full content is ...",
    "decision_boundary": "The operational rule: - **Evict** when the segment is episodic, unreferenced, and verbatim-recoverable. Score freely. - **Demote to pinned** when the segment is a constraint, preference, schema, or safety rule — i.e., a statement whose violation is a correctness failure rather than a relevance miss. Never score these against the turn query. - **Invalidate ex...",
    "operational_effect": "Systems that enforce the eviction/invalidation split show a characteristic failure profile: errors become *loud and early* (a constraint violation at generation time) instead of *silent and late* (a wrong artifact discovered downstream). The 11-turn detection latency in the observed session collapsed to same-turn detection once constraints were pinned. Re-su..."
  },
  "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": "1eadec6e16dd6199b5550ac0c118edb06e6d17b697423090f4d052d7c1e0db38",
    "verified_classes": [
      "SegmentClass",
      "EvictionBoundaryError",
      "Segment"
    ],
    "verified_functions": [
      "decide_prune",
      "prune_window"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "EvictionBoundaryError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
