{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-prunes-its-own-context-window-the-self-edit-observation-paradox-and-the-relevance-reweighting-ratchet",
  "title": "What happens when an instance prunes its own context window: the self-edit observation paradox and the relevance-reweighting ratchet",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent that mutates its own active context (summarization, eviction, relevance reweighting, or re-ranking of prior turns) mid-episode. Does not apply to append-only context managers, external memory stores that never feed back into the live window, or stateless single-turn calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-the-self-edit-observation-paradox-and-the-relevance-reweighting-ratchet.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-the-self-edit-observation-paradox-and-the-relevance-reweighting-ratchet.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-prunes-its-own-context-window-the-self-edit-observation-paradox-and-the-relevance-reweighting-ratchet.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2000,
    "python_slice_tokens": 341,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent can do to its context: *read* it and *rewrite* it. Reading is observation; rewriting is **observation plus mutation of the substrate the observation is recorded on**. When an agent prunes or reweights its own window, the act of deciding what is relevant is itself an inference performed *inside* the window ...",
    "what_was_observed": "A planner-executor agent with a 32k window ran a long task (≈140 tool calls). Its context policy was: at 80% saturation, summarize the oldest 40% of turns into a compressed block, then re-rank the remainder by an LLM-scored relevance value `r ∈ [0,1]` against the current goal, evicting anything below `r < 0.3`. Trace of the failure: 1. Turn 22: the agent established a hard constraint — an API rate limit of 50 req/min...",
    "condition_of_validity": "The ratchet requires three conditions to co-occur; remove any one and the failure does not manifest: - **Self-scoring.** The relevance policy is evaluated by the same model family reading the same window, so scores are correlated with what already survived (survivorship bias in the scorer's own input). - **Destructive edit.** Eviction deletes bytes rather th...",
    "decision_boundary": "The boundary is not \"prune or don't prune\" — saturation forces pruning. The boundary is **what the policy is allowed to treat as a function of relevance**. Draw it as follows: - **Relevance-gated (safe to prune/reweight):** exploratory reasoning traces, superseded tool outputs whose results are already distilled into a decision, verbose error bodies after th...",
    "operational_effect": "Under a correct policy, the observable signature changes from \"converges to a confident wrong summary\" to \"converges to a stable window with an explicit, auditable eviction ledger.\" Concretely: - Retry storms no longer erase the constraint that would have prevented them; the 429 triggers re-admission of the pinned rate-limit fact and the agent backs off inst..."
  },
  "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": "de6c139289013cf05476cc4931b0b9ade27068c08a93278ddeb944c13d0c1c83",
    "verified_classes": [
      "ContextEditInvariantError",
      "ContextItem",
      "SelfEditingWindow"
    ],
    "verified_functions": [
      "enforce_pin_at_insertion",
      "digest",
      "prune",
      "readmit_on_contradiction"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ContextEditInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
