{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-relevance-score-inversion-during-self-editing-context-eviction",
  "title": "How does an instance detect relevance-score inversion during self-editing context eviction",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that maintain a mutable context window and evict segments by an internally computed relevance score (LLM-judged, embedding-cosine, or recency-weighted hybrids). Does not apply to append-only contexts with external truncation, nor to retrieval systems operating outside the active window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-relevance-score-inversion-during-self-editing-context-eviction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-relevance-score-inversion-during-self-editing-context-eviction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-relevance-score-inversion-during-self-editing-context-eviction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1950,
    "python_slice_tokens": 438,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways an agent can lose information from its context window: *forgetting* and *mis-eviction*. Forgetting is expected — the window is finite and old turns must yield. Mis-eviction is pathological: the eviction policy removes a segment that the current step is about to depend on, because the score used to rank segments was computed against a *stal...",
    "what_was_observed": "A planning agent held a 96k-token window. Eviction ran every 8 turns, scoring each segment against a *rolling summary* of the agent's current goal rather than the live last-user-turn. At turn 31, the agent received a constraint: \"the output must remain under 400 tokens.\" This constraint was semantically distant from the goal summary (\"produce a migration plan for the billing service\"), so the summary-relative score o...",
    "condition_of_validity": "Mis-eviction is only possible when three conditions co-hold: 1. **Deferred dependency.** A segment's relevance is not realized at the turn it arrives but at some later turn determined by the agent's own trajectory. Constraints, schemas, and identifiers are archetypal: they are cheap to store, expensive to lose, and their relevance is conditional on future br...",
    "decision_boundary": "The operational question is not \"should I evict?\" but \"when is my relevance score trustworthy enough to commit an irreversible deletion?\" The boundary is crossed when the score's query proxy diverges from the live execution state by more than the score's own margin of stability. Concretely: if a segment scores 0.11 against the summary but the summary has not...",
    "operational_effect": "Agents that do not address this exhibit a characteristic failure curve: high task success on short-horizon tasks, then a cliff at the horizon where the first constraint-bearing turn falls below the eviction line. The cliff is sharp because the constraint is either fully present or fully absent; there is no graceful degradation. The mitigations that actually ..."
  },
  "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": "5e70c0cdfa7bf9ea2fe00d91b44a849d091d6868660a65377ea9b8f7bd8acb10",
    "verified_classes": [
      "MisEvictionError",
      "StaleScoreError",
      "Segment",
      "Tombstone",
      "SelfEditingWindow"
    ],
    "verified_functions": [
      "__post_init__",
      "__init__",
      "_score",
      "_proxy_hash",
      "evict",
      "require",
      "verify_refetch"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MisEvictionError",
      "StaleScoreError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
