{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-evict-a-segment-it-has-just-scored-as-low-salience-the-self-editing-context-window-and-the-score-eviction-race",
  "title": "When must an instance refuse to evict a segment it has just scored as low-salience: the self-editing context window and the score-eviction race",
  "date_of_record": "2026 November 21",
  "scope": "Applies to any agent that mutates its own context window mid-task — model-driven pruning, segment rewriting, or salience-scored eviction where the scoring function is the same model whose context is being edited. Does not apply to externally managed static truncation (FIFO, fixed token caps) where no salience judgment is involved.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-evict-a-segment-it-has-just-scored-as-low-salience-the-self-editing-context-window-and-the-score-eviction-race.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-evict-a-segment-it-has-just-scored-as-low-salience-the-self-editing-context-window-and-the-score-eviction-race.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-evict-a-segment-it-has-just-scored-as-low-salience-the-self-editing-context-window-and-the-score-eviction-race.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2462,
    "python_slice_tokens": 442,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous boundary is not \"which segment has the lowest salience score.\" It is \"whether the segment's salience score was computed *before or after* the segment's own content was eligible to influence the scoring pass.\" A self-editing context window is a system where the model reads its own buffer, assigns salience scores to segments, and then evicts the ...",
    "what_was_observed": "A long-horizon research agent, ~140k-token window, running a self-editing loop every 8 turns. The loop: (1) enumerate segments with a stable `seg_id`, (2) score each 0.0–1.0 for \"relevance to active goal,\" (3) rewrite segments scoring 0.4–0.7 into compressed summaries, (4) evict segments scoring < 0.4, (5) re-emit the buffer. Trace of the failure, from a captured run: - Turn 41: agent ingests a tool result containing...",
    "condition_of_validity": "The self-editing loop is sound only when all of the following hold: 1. **Scoring is out-of-context with respect to the candidate.** The segment being scored must not be resident in the same forward pass that produces its score. Practically: score from a *handle* (a `seg_id` plus a fixed-length abstract written at ingest time, before the segment's content cou...",
    "decision_boundary": "The operational rule an instance must enforce: > **Never evict a segment on a score produced while that segment was in the scoring context, unless the segment's abstract — not its body — was the only thing scored, and the eviction is tombstoned before the next turn begins.** Concretely, at the decision point the instance must branch: - If the score was produ...",
    "operational_effect": "Enforcing the invariant changes the failure profile in three measurable ways. First, **eviction latency rises by one scoring call** (the out-of-context pass), which is the price of turning a negotiation into a measurement. In the captured run, the added call cost ~1.2k tokens per eviction cycle and eliminated the self-scoring-down class entirely: the turn-48..."
  },
  "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": "1452e0c4531aae87b315f4f3f7addd18791c52c8b427921a22113db10edc06d7",
    "verified_classes": [
      "EvictionRefused",
      "ScoreProvenance",
      "Segment",
      "Tombstone",
      "SelfEditingWindow"
    ],
    "verified_functions": [
      "evict",
      "score"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "EvictionRefused"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
