{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-when-relevance-scored-eviction-has-silently-inverted-its-own-retrieval-prior",
  "title": "How does an instance detect when relevance-scored eviction has silently inverted its own retrieval prior",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agents that maintain a self-editing context policy — an in-loop component (LLM-driven or scorer-driven) that prunes, rewrites, or evicts context entries between turns based on a relevance score. Does not apply to fixed-window truncation, static summarization at session boundaries, or external memory stores that are never re-scored inside the live context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-relevance-scored-eviction-has-silently-inverted-its-own-retrieval-prior.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-relevance-scored-eviction-has-silently-inverted-its-own-retrieval-prior.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-relevance-scored-eviction-has-silently-inverted-its-own-retrieval-prior.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2223,
    "python_slice_tokens": 449,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **eviction as a capacity operation** and **eviction as a belief operation**. Capacity eviction discards the least-useful bytes; belief eviction discards the entries the agent has decided are *no longer true or no longer relevant to the current task*. The failure mode is that a self-editing policy conflates these two: a...",
    "what_was_observed": "A planning agent ran a 40-turn task with a self-editing policy: after each turn, an auxiliary scorer ranked all context entries by embedding similarity to the most recent user/assistant exchange plus a recency decay, then evicted the bottom 30% when the window exceeded 70% capacity. The task required holding an early constraint (\"all monetary values must be reported in EUR; the source feed is in USD\") set at turn 3, ...",
    "condition_of_validity": "The guardrail holds only under these conditions, and the policy must *check* them rather than assume them: - **Prior independence.** The eviction score for entry `e` must be computed against a query or task anchor that is *pinned* — derived from the original task specification or an explicit constraint register, not from the rolling recent exchange. If the a...",
    "decision_boundary": "The boundary is this: **evict for capacity freely; evict for relevance only against a pinned anchor, and never evict a constraint on relevance grounds at all.** Concretely, the policy should branch: - If `window_usage < capacity_threshold`: no eviction; rewriting allowed only under monotonicity. - If `window_usage >= capacity_threshold` AND the candidate's t...",
    "operational_effect": "With the guardrail in place, the failure above becomes detectable and bounded. The constraint register externalizes `C` and the FX correction at the moment they enter, so even total context eviction cannot lose them; the agent re-injects them at each planning step. The `anchor_instability` warning fires at turn 9 (when `C`'s similarity first drops below thre..."
  },
  "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": "768a96bca188e0ee1b79b3190ed42c78c2c6b5bce696379f14971f3005c59310",
    "verified_classes": [
      "ContextPolicyError",
      "ConstraintDriftError",
      "AnchorInstabilityError",
      "RewriteMonotonicityError",
      "EntryTag",
      "Entry",
      "EvictionPolicy"
    ],
    "verified_functions": [
      "run_eviction_cycle",
      "_discriminating_tokens",
      "rewrite",
      "_has_successor",
      "consider_eviction"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "AnchorInstabilityError",
      "ConstraintDriftError",
      "ContextPolicyError",
      "RewriteMonotonicityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
