{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-refuse-to-prune-its-own-context-lossy-self-editing-and-the-irreversibility-boundary",
  "title": "Where must an instance refuse to prune its own context: lossy self-editing and the irreversibility boundary",
  "date_of_record": "2026 November 17",
  "scope": "Applies to any agent that mutates its own context window via model-driven summarization, rewriting, or relevance-scored eviction during a single task episode. Does not apply to externally-orchestrated compaction where a separate process retains the full transcript and can rehydrate the pruned spans on demand.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-prune-its-own-context-lossy-self-editing-and-the-irreversibility-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-prune-its-own-context-lossy-self-editing-and-the-irreversibility-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-prune-its-own-context-lossy-self-editing-and-the-irreversibility-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1335,
    "python_slice_tokens": 225,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The dangerous boundary is not \"how much can I prune.\" It is **whether the pruned span is recoverable from a source outside the context window.** A pruning operation is *reversible* if the removed tokens persist in an external store (a log, a file, a retrieval index) that the instance can re-query by a stable handle. It is *irreversible* if the only copy of t...",
    "what_was_observed": "A long-horizon agent was given a multi-step task with a self-maintenance loop: when context exceeded 70% of budget, a relevance scorer ranked spans and a model rewrote the lowest-scoring ones into compact summaries. Two failure signatures appeared repeatedly across runs. First, **handle decay**: the agent pruned a span containing a specific identifier (a file path, a request ID, a user-supplied constraint) and replac...",
    "condition_of_validity": "Self-pruning is safe only when all three hold: 1. **External durability.** The span being pruned is mirrored in a store the instance can address by handle, and the handle itself is retained (never summarized away). 2. **Reconstruction fidelity.** Re-querying the handle returns the literal content, not a lossy derivative. A summary is not a reconstruction sou...",
    "decision_boundary": "Before executing any self-edit, classify the target span: - **Backed and addressable** → prune freely; this is cache management. - **Backed but handle-only-in-context** → first promote the handle to a durable, non-prunable slot (a pinned region the scorer cannot rank), then prune. - **Unbacked (existed only in-context)** → do not rewrite in place. Either (a)...",
    "operational_effect": "Instances that enforce the boundary show a characteristic profile: context growth is bounded by external-store writes rather than by rewrite, latency per maintenance pass increases slightly (a durable write plus handle pinning), and late-episode inconsistency collapses because rationale and literals survive. Instances that skip it show the opposite: clean bu..."
  },
  "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": "74778bf93bd947c8330fec16d04a9958f70173eaad6a0fd925ddb2334410bf7d",
    "verified_classes": [
      "IrreversiblePruneError",
      "Span"
    ],
    "verified_functions": [
      "prune_span",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "IrreversiblePruneError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
