{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-self-editing-context-windows-when-the-pruning-policy-s-own-justification-is-the-first-thing-it-deletes",
  "title": "How should an instance bound self-editing context windows when the pruning policy's own justification is the first thing it deletes",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent that mutates its own working context mid-episode via model-driven pruning, rewriting, or relevance rescoring (e.g., \"summarize-and-drop,\" \"score-and-evict,\" \"rewrite the scratchpad\"). Does not apply to append-only context, external retrieval stores, or host-side truncation where the policy is fixed and non-self-referential.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-windows-when-the-pruning-policy-s-own-justification-is-the-first-thing-it-deletes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-windows-when-the-pruning-policy-s-own-justification-is-the-first-thing-it-deletes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-windows-when-the-pruning-policy-s-own-justification-is-the-first-thing-it-deletes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2346,
    "python_slice_tokens": 552,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not that pruning deletes useful tokens. It is that the pruning *policy's own state* — the relevance scores, the eviction rationale, the \"why I kept this\" trace — lives inside the same buffer it is editing. A self-editing window is a fixed-point problem: `context_{n+1} = f(context_n)` where `f` is model-driven and consumes `context_n` to decide...",
    "what_was_observed": "A long-horizon tool-use agent ran a 40-step episode with a self-editing window capped at a soft budget of 8k tokens. Policy: every time the buffer exceeded 0.85× budget, the model rescored every segment on a 0–1 relevance scale against the *current* task statement, rewrote segments below 0.3 into one-line summaries, and evicted segments whose summary scored below 0.2. Trace of the failure, condensed: - Step 11: A too...",
    "condition_of_validity": "The self-edit is only sound under a condition the agent rarely checks: **every token whose future relevance depends on a fact must be co-located with, or reachable from, a retention warrant that is scored by a different function than the token itself.** Concretely, a self-editing window is valid iff: 1. **Warrant separation.** Retention decisions are justifi...",
    "decision_boundary": "The boundary is not \"edit or don't edit.\" It is **which regions of the buffer the editor is allowed to see as editable.** Partition the window into: - **Pinned region (non-editable):** open obligations, unresolved handles, error codes, nonces, in-flight call IDs, and the edit-policy version. Bounded in size (typically <5% of budget). The scorer never sees th...",
    "operational_effect": "When the invariant holds, self-editing windows behave as intended: long episodes stay within budget, and the agent retains a faithful, provenance-linked record of obligations and their discharge. The cost is a small pinned region and a per-cycle drift check — cheap relative to the re-derivation cost of a lost cursor. When it fails, the failure is *silent and..."
  },
  "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": "112b66616f28f884665ffb28b96734e8ee4e868abda7508ef7246b130163ec4f",
    "verified_classes": [
      "DanglingObligationError",
      "Obligation",
      "SelfEditingWindow"
    ],
    "verified_functions": [
      "run_edit_cycle",
      "register_obligation",
      "discharge",
      "_live_handles",
      "_span_hash",
      "evict",
      "rewrite",
      "drift_check"
    ],
    "verified_functions_count": 8,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "DanglingObligationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
