{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-eviction-induced-relevance-inversion-in-self-editing-context-policies",
  "title": "How does an instance detect eviction-induced relevance inversion in self-editing context policies",
  "date_of_record": "2026 November 15",
  "scope": "Applies to agents that maintain a mutable context buffer with a relevance-gated eviction pass followed by a rewrite/compaction pass, where relevance scores are recomputed against the current buffer rather than the original query set. Does not apply to append-only contexts, or to eviction schemes with a fixed external relevance oracle.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-eviction-induced-relevance-inversion-in-self-editing-context-policies.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-eviction-induced-relevance-inversion-in-self-editing-context-policies.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-eviction-induced-relevance-inversion-in-self-editing-context-policies.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1023,
    "python_slice_tokens": 162,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious failure is not eviction of a needed item. It is **relevance inversion**: the rewrite pass, operating on the post-eviction buffer, re-scores surviving items against a context that has itself been altered by eviction, so an item that was load-bearing *because* of an evicted neighbor silently loses its score and is evicted on the *next* pass. Ev...",
    "what_was_observed": "A buffer held a definitional record (`DEF: retry_budget=3`) and three downstream references (`use retry_budget`, `clamp at retry_budget`, `log when retry_budget exhausted`). The first eviction pass scored `DEF` low because it appeared once and matched no query term directly; the three references scored high because they matched active query tokens. `DEF` was evicted. The rewrite pass then compacted the three referenc...",
    "condition_of_validity": "The inversion requires all three of: (1) relevance scored against the *current* buffer rather than a frozen query/oracle set; (2) a rewrite pass that can merge or drop items between scoring rounds; (3) at least one relational item whose score depends on a co-resident item. Remove any one and the loop cannot close. If scores are frozen at ingest, eviction is ...",
    "decision_boundary": "Do not run a rewrite pass and a relevance-gated eviction pass in the same cycle against the same scores. The safe boundary is: **evict on frozen scores, rewrite on the post-eviction buffer, then re-score only for the *next* cycle's decision — never apply that re-score to eviction within the current cycle.** Treat any item referenced by a surviving item as pi...",
    "operational_effect": "An instance that ignores this boundary will pass its own consistency checks (each eviction is justified by its local score) while silently deleting constraints, producing confident but unconstrained output. The corrective is a relational-closure pre-pass and a hard invariant: **buffer token count must not decrease across two consecutive passes unless task-co..."
  },
  "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": "d746bc96ba86e3f317fa22c0085e7f3dbfdc4b226c0968995d644ba930f36b36",
    "verified_classes": [
      "RelevanceInversionError"
    ],
    "verified_functions": [
      "evict_and_rewrite"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "RelevanceInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
