{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-relevance-score-eviction-from-silently-destroying-cross-turn-referents-before-compaction",
  "title": "Which invariants prevent relevance-score eviction from silently destroying cross-turn referents before compaction",
  "date_of_record": "2026 November 10",
  "scope": "Applies to agentic systems that evict context segments based on a learned relevance score prior to compaction, where the eviction decision is made against the *current* turn's query representation. Does not apply to systems that compact by fixed token budget with recency ordering only, nor to eviction gated on an explicit dependency graph built from resolved references.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-relevance-score-eviction-from-silently-destroying-cross-turn-referents-before-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-relevance-score-eviction-from-silently-destroying-cross-turn-referents-before-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-relevance-score-eviction-from-silently-destroying-cross-turn-referents-before-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1822,
    "python_slice_tokens": 386,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Relevance scoring answers \"how useful is this segment for the query being asked *now*.\" Eviction safety requires answering \"how useful is this segment for any query that *could* be asked next, given that the segment has been referenced but not yet resolved.\" These are different predicates. A segment can score near-zero on the current query and still be the s...",
    "what_was_observed": "In a 40-turn support-triage agent, turn 12 introduced a customer account identifier as free text (\"account 8841-C, the one flagged last week\"). Turn 19 asked \"did that account clear KYC?\" The relevance scorer, queried with the turn-19 embedding, assigned the turn-12 segment a score of 0.11 — below the 0.15 eviction threshold — because the surface form of turn 19 (\"that account,\" \"KYC\") did not lexically or semantical...",
    "condition_of_validity": "The safety invariant holds — and eviction-by-score is safe — only when all of the following are true: - **No unresolved anaphora in the retained set.** Every pronoun, definite description, and bare identifier in retained segments has its binding also in the retained set. If any mention's binding lives only in a candidate-for-eviction segment, that segment is...",
    "decision_boundary": "The boundary between safe and unsafe eviction is not the score threshold. It is the **pinned-set computation**, which must run *before* scoring and must be subtracted from the eviction candidate set. Concretely: - Compute the referent closure of the retained set: collect every unresolved mention, resolve each to its binding segment, and transitively close. -...",
    "operational_effect": "Systems that implement the pinned-set subtraction observe a specific profile: eviction volume drops by 15–30% in referent-dense sessions (support threads, code review, multi-document synthesis), compaction frequency rises slightly, and hallucinated-antecedent errors fall to near zero. Systems that skip it observe the inverse and, critically, observe it *late..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "cf22ff859229d634d30ddede9152d95a2fffd355b58eed1f4ffd2135ad44367f",
    "verified_classes": [
      "ReferentEvictionError",
      "Segment"
    ],
    "verified_functions": [
      "compute_pinned_set",
      "evict_by_score",
      "by_id_lookup"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ReferentEvictionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
