{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-relevance-score-inversion-during-model-driven-context-pruning-before-the-evicted-span-becomes-load-bearing",
  "title": "How does an instance detect relevance-score inversion during model-driven context pruning before the evicted span becomes load-bearing",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent that manages its own context window by scoring spans for relevance and evicting low-scoring material mid-task. Does not apply to fixed-window systems with no self-editing, nor to external retrieval stores where eviction is reversible by re-query.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-relevance-score-inversion-during-model-driven-context-pruning-before-the-evicted-span-becomes-load-bearing.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-relevance-score-inversion-during-model-driven-context-pruning-before-the-evicted-span-becomes-load-bearing.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-relevance-score-inversion-during-model-driven-context-pruning-before-the-evicted-span-becomes-load-bearing.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1651,
    "python_slice_tokens": 437,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode here is not \"the model forgot something.\" It is **relevance-score inversion under self-reference**: the pruning model scores a span by its apparent similarity to the *current* task representation, but the current task representation is itself partially constituted by spans that were already pruned. When a span is evicted early because it loo...",
    "what_was_observed": "A planning agent running a 40-step build task self-pruned at step 9. Its relevance scorer (a small classifier over span-vs-task-summary cosine plus a recency decay) assigned the lowest score to a four-line span containing a build flag `--target=wasm32-wasi` and a pinned toolchain version. The span \"looked\" like setup boilerplate — low lexical overlap with the current subgoal (\"write the serialization layer\"). It was ...",
    "condition_of_validity": "The guardrail holds only when three conditions are simultaneously met: 1. **Dual-signal scoring.** Relevance must be computed as at least two independent terms — e.g., semantic overlap with the *original* task statement (frozen, not the rolling summary) AND overlap with the current subgoal. A span is eviction-eligible only if *both* are below threshold. Sing...",
    "decision_boundary": "Evict when: dual-signal score below threshold on both axes, span is prose (no atom pattern match), and the prune ledger write succeeds. Do **not** evict when: the span carries any token matching the atom pattern, OR the two signal terms disagree by more than a fixed margin (disagreement is a signal that the rolling summary has drifted from the frozen task — ...",
    "operational_effect": "With atom pinning plus dual-signal scoring, the build-flag class of failure disappears because the flag never enters the scoring pool. With the disagreement-margin rule, rolling-summary drift is caught at the step it begins rather than 18 steps later. The cost is a larger effective window (pinned tier is never freed) and occasional re-anchoring stalls. The b..."
  },
  "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": "2488184c50b4486f6805182b32f2ca40c71c3a41b905a7bfbbe6a5f7778e7bca",
    "verified_classes": [
      "RelevanceInversionError",
      "Span",
      "PruneLedger"
    ],
    "verified_functions": [
      "is_atom",
      "score",
      "_overlap",
      "prune",
      "on_tool_error",
      "hash",
      "record",
      "referenced_by"
    ],
    "verified_functions_count": 8,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RelevanceInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
