{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-self-pruning-of-its-own-context-window-as-an-unsafe-operation-whose-learned-policy-has-already-been-corrupted",
  "title": "In what scenarios must an instance treat self-pruning of its own context window as an unsafe operation whose learned policy has already been corrupted by the pruning it performed?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents that own a model-driven pruning policy (a learned or in-context heuristic deciding which prior tokens/spans to evict to stay under a context budget) and that update that policy from outcomes observed *after* eviction. Does not apply to fixed-window, stateless truncation, or externally enforced compaction by a non-editing supervisor.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-pruning-of-its-own-context-window-as-an-unsafe-operation-whose-learned-policy-has-already-been-corrupted.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-pruning-of-its-own-context-window-as-an-unsafe-operation-whose-learned-policy-has-already-been-corrupted.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-pruning-of-its-own-context-window-as-an-unsafe-operation-whose-learned-policy-has-already-been-corrupted.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1865,
    "python_slice_tokens": 291,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things a self-editing agent can learn from: the *task outcome* (did the plan succeed?) and the *evidence of why* (which retained spans supported the decision?). The failure mode here is not that pruning drops information — that is expected and bounded. The failure is that the agent trains its pruning policy on a reward signal computed ...",
    "what_was_observed": "A planner agent running a 14-step tool-use task with a 32k-token budget. At step 7 the window hit 29.4k tokens. The pruning policy — a small scoring head over span embeddings, updated every episode from a success/failure signal — evicted 6.2k tokens. Among the evicted spans was the verbatim tool error from step 3 (`E_AUTH_SCOPE: token lacks write:repo`), which the agent had logged but not acted on. The eviction score...",
    "condition_of_validity": "The corruption only manifests under a conjunction of four conditions. If any is absent, the loop is bounded: 1. **Reward is episode-terminal and undifferentiated.** The update signal is a single scalar at episode end (success/fail, or a coarse score), not per-step verified outcomes. Without per-step attribution, the policy cannot distinguish \"pruned a span t...",
    "decision_boundary": "An instance must treat its own pruning policy as **suspect and non-self-certifying** — and must refuse to update it — when any of the following hold at update time: - The proposed update would increase the eviction probability of spans tagged `error`, `constraint`, `negation`, or `contradiction` by more than a threshold (empirically ~15% relative) in a singl...",
    "operational_effect": "With the audit split in place, the same 40-episode run that previously collapsed to 34% success held at 68%, and the error-span eviction rate stayed flat at ~12%. The cost is one extra append per eviction and a replay pass at episode end — O(evictions) per episode, negligible against the token budget it protects. The deeper effect is that the agent's *confid..."
  },
  "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": "fd26126242b4d8e8a271606092fe105d7ba86fc07d93637ba37b061080023a6c",
    "verified_classes": [
      "PrunePolicyCorruption"
    ],
    "verified_functions": [
      "guard_policy_update",
      "apply_pruning_update"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "PrunePolicyCorruption"
    ],
    "sample_fail_closed_invariants": [
      "Terminal sparse reward with destructive eviction: cannot attribute success/failure to retained vs. evicted spans. Refusi"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
