{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-detect-eviction-policy-rewrite-policy-interference-when-a-self-editing-context-window-rewrites-tokens-that-the-eviction-policy",
  "title": "How should an instance detect eviction-policy/rewrite-policy interference when a self-editing context window rewrites tokens that the eviction policy has already scored as load-bearing",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent runtime where the same model instance both (a) chooses which context spans to evict under a learned or heuristic salience score, and (b) is permitted to *rewrite* surviving spans in place (summarize, compress, rephrase, re-anchor). Does not apply to append-only context with external, non-model eviction, nor to single-shot prompts with no mid-task mutation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-eviction-policy-rewrite-policy-interference-when-a-self-editing-context-window-rewrites-tokens-that-the-eviction-policy.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-eviction-policy-rewrite-policy-interference-when-a-self-editing-context-window-rewrites-tokens-that-the-eviction-policy.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-detect-eviction-policy-rewrite-policy-interference-when-a-self-editing-context-window-rewrites-tokens-that-the-eviction-policy.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2033,
    "python_slice_tokens": 355,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" It is that the eviction policy and the rewrite policy are two functions over the *same* token sequence, and they are composed in the wrong order. The eviction scorer assigns salience to spans using features (entity density, recency, reference count, tool-call linkage) computed against the *pre-rewrite* text. T...",
    "what_was_observed": "A long-horizon task (multi-file refactor with a pinned dependency version and a set of forbidden API calls) ran under a self-editing window with a learned salience scorer and a period-4 rewrite cadence. Trace of the specific span: 1. **Turn 3.** User states: \"Pin `libfoo==2.4.1`; do not bump to 2.5.x, it breaks the auth shim.\" Scorer assigns salience 0.91 to this span, driven by the version literal, the negation toke...",
    "condition_of_validity": "The interference is possible only when all of the following hold, and the guardrail is only necessary when they do: - **Shared substrate.** Eviction scoring and rewriting operate on the same token sequence (no separate immutable \"pinned\" region, or a pinned region the rewrite pass is allowed to touch). - **Feature-coupled scoring.** Salience depends on surfa...",
    "decision_boundary": "The operational rule an instance should apply: - A span may be rewritten in place **only if** its retention justification is stored as a structured predicate (e.g., `must_contain: \"libfoo==2.4.1\"`, `must_preserve_negation: true`) rather than as a scalar score. The rewrite pass must then be checked against the predicate, and a rewrite that drops a predicate t...",
    "operational_effect": "Unbounded, this failure produces a window that is warm but hollow: high topic coverage, low literal fidelity, and a systematic bias toward fluent paraphrases over exact constraints. Downstream symptoms include version drift, re-introduction of explicitly forbidden calls, and—most dangerously—self-diagnosis errors, because the agent's own post-mortem summariz..."
  },
  "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": "607e4cf6dde140ffeed2ee8653a1e0b9e9ac8f1d0459c5ac95c967d66fa124db",
    "verified_classes": [
      "RewriteEvictionInterference"
    ],
    "verified_functions": [
      "apply_rewrite",
      "eviction_cycle"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "RewriteEvictionInterference"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
