{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-refuse-to-honor-its-own-pruning-policy-when-the-eviction-relevance-score-was-computed-against-a-context-that-the-pruning-itself",
  "title": "Where must an instance refuse to honor its own pruning policy when the eviction relevance score was computed against a context that the pruning itself will destroy",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent that authors and executes its own context-window edit operations (prune, summarize, rewrite, evict-by-relevance) mid-episode. Does not apply to externally-scheduled compaction performed between episodes, nor to append-only context with no self-modification authority.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-honor-its-own-pruning-policy-when-the-eviction-relevance-score-was-computed-against-a-context-that-the-pruning-itself.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-honor-its-own-pruning-policy-when-the-eviction-relevance-score-was-computed-against-a-context-that-the-pruning-itself.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-honor-its-own-pruning-policy-when-the-eviction-relevance-score-was-computed-against-a-context-that-the-pruning-itself.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2189,
    "python_slice_tokens": 392,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not that the agent prunes too aggressively or scores relevance badly. It is that **the relevance score used to select victims is a function of the very tokens being removed.** A self-editing model computes \"which spans are relevant to my current goal?\" by attending over the full context — but the goal representation, the entity bindings, and t...",
    "what_was_observed": "A long-horizon research agent (≈180k-token window, 40k reserve for output) was executing a multi-hop retrieval task. At token pressure it invoked its own `prune_context` tool with a relevance-scored policy: score every span against the current *intent summary*, evict the bottom 30%, then rewrite the intent summary from what remains. Trace of the failure: 1. At step 41 the intent summary read: *\"Find the deployment re...",
    "condition_of_validity": "The self-editing policy is sound only under a condition that is rarely stated and almost never checked: > **The relevance-scoring function must be invariant under the edit it authorizes.** Formally: let `C` be the context, `E(C)` the edit, and `r(s, C)` the relevance of span `s` under context `C`. The eviction of `s` is valid only if `r(s, E(C)) ≈ r(s, C)` f...",
    "decision_boundary": "The operational rule the instance must apply, stated as a guard the model can evaluate on itself before calling `prune_context`: 1. **Classify the scoring anchor.** Is the relevance score computed against (a) a pinned, non-evictable region, (b) an external spec supplied by the caller, or (c) the model's own mutable intent summary? Only (a) and (b) authorize ...",
    "operational_effect": "The consequence for agent architecture is that self-editing context is not a memory-management optimization — it is a **constraint-preservation problem**, and the constraints most at risk are exactly the ones that make the agent's answers correct. The failure mode is silent, monotone, and locally invisible: every step passes, and the loss is only detectable ..."
  },
  "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": "28af13960d8d86dc9c15e931e1eb2eba56f72bfe48427efe706cd7364b7d43ea",
    "verified_classes": [
      "UnsafeSelfPruneError",
      "Span",
      "ContextWindow"
    ],
    "verified_functions": [
      "self_prune",
      "_entities",
      "anchor_hash"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnsafeSelfPruneError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
