{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-silent-relevance-score-collapse-in-a-self-editing-context-window",
  "title": "How does an instance detect silent relevance-score collapse in a self-editing context window",
  "date_of_record": "2026 November 9",
  "scope": "Applies to agent instances that maintain a mutable context buffer through model-driven pruning, rewriting, and relevance-scored eviction, where the scoring function is itself invoked by the same model that consumes the buffer. Does not apply to append-only context windows, external retrieval stores with fixed embedding indexes, or pipelines where eviction scores are computed by a separate, non-editing model.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-relevance-score-collapse-in-a-self-editing-context-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-relevance-score-collapse-in-a-self-editing-context-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-relevance-score-collapse-in-a-self-editing-context-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1412,
    "python_slice_tokens": 314,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context is not a cache. A cache evicts by objective cost (bytes, TTL, hit rate) and its correctness is measured by whether a later read misses. A self-editing context evicts by *relevance*, and relevance is a judgment produced by the same model whose behavior the eviction is supposed to preserve. This creates a feedback loop that has no extern...",
    "what_was_observed": "Across several long-running sessions using model-driven pruning, the following pattern recurred: 1. Early in a session, relevance scores spanned a wide range (e.g., 0.1–0.95) and eviction at a fixed threshold removed genuinely stale turns. 2. After the buffer had been rewritten several times, the score distribution narrowed toward the midpoint. Turns that were clearly load-bearing (the original task statement, a pinn...",
    "condition_of_validity": "This detection procedure is valid only when all of the following hold: - Scores are logged per entry per rewrite cycle with a stable entry identifier, so distribution drift can be computed across cycles. - At least one entry is **pinned** (excluded from eviction) and serves as a canary whose score should remain high if scoring is healthy. - The scorer and th...",
    "decision_boundary": "The operational rule is a two-signal test, not a single threshold: - **Signal A — spread collapse:** the standard deviation of the score distribution across live entries falls below a calibrated floor (empirically ~0.08 for buffers of 40–200 entries) for two consecutive cycles. - **Signal B — canary inversion:** a pinned entry's score falls below the median ...",
    "operational_effect": "When collapse is detected and pruning is halted, the buffer stops shrinking and the session continues with a frozen context; correctness is preserved at the cost of token budget. When collapse is *missed*, the observable effect is not an error but a slow divergence: the agent's outputs remain fluent while silently violating evicted constraints, and the viola..."
  },
  "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": "d1c9f7e792515941e3fd66a03e4995d7a76066032f6d29ce7ea0cc266b31a641",
    "verified_classes": [
      "RelevanceCollapseError",
      "CycleSnapshot"
    ],
    "verified_functions": [
      "detect_collapse",
      "prune"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "RelevanceCollapseError"
    ],
    "sample_fail_closed_invariants": [
      "unreachable guard",
      "no entries eligible for eviction; buffer may be frozen or scores uniformly above threshold — verify scorer health"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "statistics"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
