{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-its-own-memory-rewrite-the-self-edit-commit-hazard-under-budget-pressure",
  "title": "When must an instance refuse its own memory rewrite: the self-edit commit hazard under budget pressure",
  "date_of_record": "2026 November 27",
  "scope": "Applies to single-instance agents that hold a mutable working-memory buffer and are permitted to rewrite (summarize, compress, evict, or restructure) that buffer in-place to satisfy a token budget. Does not apply to append-only episodic logs, externally mediated memory stores with transactional commit, or read-only retrieval contexts.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-its-own-memory-rewrite-the-self-edit-commit-hazard-under-budget-pressure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-its-own-memory-rewrite-the-self-edit-commit-hazard-under-budget-pressure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-its-own-memory-rewrite-the-self-edit-commit-hazard-under-budget-pressure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1972,
    "python_slice_tokens": 263,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways an agent can \"forget.\" The first is **eviction**: the instance drops a span from the buffer and the span is gone, but the buffer's internal structure (what the instance believes it knows, and where) remains a faithful, if smaller, representation of the world. The second is **rewriting**: the instance generates a new ...",
    "what_was_observed": "A long-horizon task agent (\"planner-executor\" pattern) was operating with a 32k working-memory budget and a self-edit routine invoked whenever occupancy exceeded 85%. On a multi-file refactor task, the following trace was captured: 1. At step 41, occupancy hit 27.4k tokens. The self-edit routine was invoked with instruction: *\"Compress working memory to ≤ 12k tokens, preserving task-relevant facts.\"* 2. The routine p...",
    "condition_of_validity": "The commit of a self-rewrite is only valid under a **conservation invariant** that must be enforced *before* the original buffer is released from context: > For every span `s` in the pre-rewrite buffer that is classified as *load-bearing* (referenced by a pending tool call, a negative constraint, an unresolved warning, or an open edit), the rewrite must cont...",
    "decision_boundary": "The boundary between \"commit the rewrite\" and \"refuse and escalate\" is drawn by three tests, evaluated in order: - **Referent test.** Is the pre-rewrite buffer still in context at validation time? If no → **refuse commit**; the rewrite is unverifiable. Fall back to eviction (drop lowest-salience spans, keep structure) rather than rewriting. - **Tombstone tes...",
    "operational_effect": "Enforcing this boundary changes agent behavior in three concrete ways. First, self-edit routines acquire a **two-phase commit structure**: stage the rewrite, validate against the still-live source, and only then release the source. This costs budget headroom—during validation the instance temporarily holds both buffers—so the trigger threshold for self-edit ..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "f40e3f65f9c7ac35a5c56bb74a03218dd3f6c33f80b4b0b9001a12ddeae1a659",
    "verified_classes": [
      "UnverifiableRewriteError",
      "Span",
      "RewriteProposal"
    ],
    "verified_functions": [
      "commit_self_rewrite"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnverifiableRewriteError"
    ],
    "sample_fail_closed_invariants": [
      "pre-rewrite buffer already released; rewrite is unverifiable, downgrade to eviction or persist an external checkpoint",
      "faithfulness check was self-graded over the rewritten buffer; the check is vacuous"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
