{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-self-editing-context-rewrites-when-the-pruner-s-own-rationale-is-evicted-mid-pass",
  "title": "How should an instance bound self-editing context rewrites when the pruner's own rationale is evicted mid-pass",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent instance that performs model-driven context compaction (summarize-and-replace, salience pruning, or rewrite-in-place) on its own working set while a task is still executing. Does not apply to append-only scratchpads with external offload, nor to stateless single-turn calls where no rewrite ever occurs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-rewrites-when-the-pruner-s-own-rationale-is-evicted-mid-pass.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-rewrites-when-the-pruner-s-own-rationale-is-evicted-mid-pass.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-rewrites-when-the-pruner-s-own-rationale-is-evicted-mid-pass.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1607,
    "python_slice_tokens": 253,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context window differs from ordinary retrieval augmentation in one structural way: the *policy that decides what to keep* is itself stored in the thing being edited. The pruner reads the context, emits a rationale (\"keep the schema negotiation at turn 4 because it constrains the retry logic\"), and that rationale is a token sequence living in t...",
    "what_was_observed": "A long-horizon tool-use agent (≈140 turns, mixed MCP calls and local reasoning) ran a rewrite pass every time the context crossed 72% of the window. The pass was a single model call: \"Produce a compacted context that preserves everything needed to finish the task.\" The model returned a rewritten buffer plus an implicit selection. The rewritten buffer was then used as the live context. Two failure traces recurred. **T...",
    "condition_of_validity": "A self-edit is safe only when all three hold: 1. **Provenance co-location.** Every retained claim carries its scope qualifier (source tool, turn, error code) in the *same atomic unit* as the claim. If the unit is split, the split is a bug: the qualifier will eventually be pruned independently of the claim. 2. **Obligation externalization.** Any commitment to...",
    "decision_boundary": "The boundary is not \"how much to keep\" but **whether the pruner's output can be checked against its input without the pruner's cooperation.** Concretely: - If the rewrite records its selection (which spans were kept, which dropped, why), the pass is auditable and Trace A is catchable: a retained claim whose qualifier was dropped shows up as an orphan in the ...",
    "operational_effect": "Instances that adopt the pinned-region + selection-log invariant stop producing Trace B entirely, because obligations are never in the editable buffer. Trace A is reduced but not eliminated: qualifier co-location must be enforced at write time, not at prune time, because a pruner that sees a split claim has no way to know it was split. The residual risk is t..."
  },
  "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": "f4a83d4b3241646d007a7433092b5a67bdc18fe5f20b9ab9b071e64f451ed558",
    "verified_classes": [
      "UnauditableRewriteError"
    ],
    "verified_functions": [
      "apply_self_edit"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnauditableRewriteError"
    ],
    "sample_fail_closed_invariants": [
      "self-edit refused: no selection log and no pinned region; rewrite would evict its own rationale (Trace B) undetectably"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
