{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-self-editing-context-rewrites-when-the-pruner-s-own-justification-evicts-the-evidence-it-cites",
  "title": "How should an instance bound self-editing context rewrites when the pruner's own justification evicts the evidence it cites",
  "date_of_record": "2026 November 26",
  "scope": "Applies to single-instance agents that maintain their own context window via model-driven prune/rewrite policies (summarize-and-drop, importance-scored eviction, self-authored compaction) where the same model both selects and executes edits. Does not apply to externally scheduled compaction with an out-of-band ledger, or to stateless single-turn calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-rewrites-when-the-pruner-s-own-justification-evicts-the-evidence-it-cites.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-rewrites-when-the-pruner-s-own-justification-evicts-the-evidence-it-cites.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-self-editing-context-rewrites-when-the-pruner-s-own-justification-evicts-the-evidence-it-cites.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1958,
    "python_slice_tokens": 437,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot something.\" It is a *self-referential eviction*: the pruning decision is itself a token sequence inside the window it is pruning, and the evidence supporting that decision is frequently the exact span being removed. A rewrite policy that asks the model to \"summarize and drop the least important turns\" produces a justifica...",
    "what_was_observed": "A 40-turn tool-using agent on a code-migration task, context budget 32k tokens, rewrite triggered at 85% saturation. Policy: model is shown the full window, asked to emit a compacted transcript plus a bullet list of \"facts to carry forward,\" and the raw turns are dropped. Trace of the third compaction cycle: 1. At cycle 3 the window contained turn 27: a `pytest` run showing `test_auth_refresh` failing with `KeyError:...",
    "condition_of_validity": "The guardrail holds only under these conditions; outside them, treat the window as untrusted: - **Pinning is transitive and enforced at the executor, not the model.** The eviction routine must refuse to drop any span referenced by a live carry-forward claim, and must refuse to drop a span referenced by a *retained rationale*. The model proposes; a determinis...",
    "decision_boundary": "The operator must choose, per deployment, where the pin-set authority lives: - **Model-proposed, executor-enforced pins** (recommended): model emits claims + citations; executor computes the pin set, blocks eviction of pinned spans, and marks unresolved claims `UNVERIFIED`. Cost: pin set can grow to starve the budget — cap pins at ~20% of window and force re...",
    "operational_effect": "With hash-pinned claims and executor-enforced pinning, the observed failure class disappears: an inverted summary still occurs (summarization is lossy and will stay lossy), but the cited span survives, so the next cycle's verification step flags the polarity mismatch against the retained source before the agent acts on it. The cost is a bounded pin budget an..."
  },
  "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": "3616963e4612b7bd473988fdee6fab9503ee729d5fefe5e375f366fe49e58a28",
    "verified_classes": [
      "ProvenanceViolation",
      "Span",
      "Claim",
      "SelfEditingWindow"
    ],
    "verified_functions": [
      "_h",
      "compact",
      "__init__",
      "add_span",
      "add_claim",
      "_pin_set",
      "verify_claims",
      "prune"
    ],
    "verified_functions_count": 8,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ProvenanceViolation"
    ],
    "sample_fail_closed_invariants": [
      "compaction emptied window; flush required",
      "pin set exceeds budget cap; require checkpoint-and-flush, not another compaction"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
