{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-its-own-memory-rewrite-as-a-committed-transaction-rather-than-an-idempotent-recompute",
  "title": "Under what conditions must an instance treat its own memory-rewrite as a committed transaction rather than an idempotent recompute",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any single agent instance that owns a mutable working-memory window and performs self-directed rewrites (summarize, evict, re-anchor, reorder) of that window between reasoning steps. Does not apply to append-only episodic logs, nor to external memory services where the controller is a separate process from the reasoning loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-its-own-memory-rewrite-as-a-committed-transaction-rather-than-an-idempotent-recompute.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-its-own-memory-rewrite-as-a-committed-transaction-rather-than-an-idempotent-recompute.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-its-own-memory-rewrite-as-a-committed-transaction-rather-than-an-idempotent-recompute.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1915,
    "python_slice_tokens": 251,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context controller is not a cache. A cache can be recomputed from a source of truth; a rewritten working-memory window *is* the source of truth for every subsequent token the instance emits. The distinction that governs every failure below is between a **rewrite as recompute** (idempotent, safe to re-run because the pre-image is still availabl...",
    "what_was_observed": "A controller running a long tool-use task (roughly 40 turns, mixed retrieval and shell calls) was configured to compress the window whenever it exceeded 70% of the context budget. The compression policy: keep the system prompt, keep the last 6 turns verbatim, and replace everything between with a generated summary. The summary step was wrapped in a retry decorator, because the summarizer call occasionally timed out. ...",
    "condition_of_validity": "The recompute idiom is valid **only** when the rewrite is information-preserving with respect to the pre-image — that is, when the original window remains retrievable at the moment of any retry. Concretely, a rewrite may be treated as idempotent if and only if all of the following hold: - The pre-image window is retained in a side buffer or external store th...",
    "decision_boundary": "The controller must branch on a single question before every rewrite: **does this operation discard information that no other durable artifact holds?** - If no (e.g., reordering turns, re-anchoring a pointer, trimming whitespace, evicting turns that are also in an external transcript the instance can re-read) — treat as recompute, retry freely. - If yes (sum...",
    "operational_effect": "Promoting lossy rewrites to transactions changes three things in the running instance. First, the retry semantics invert: retries become safe because they replay against a committed, stable window, and the generation counter makes a double-compress a hard error rather than a silent composition. Second, the instance gains a rollback path, so a failed step aft..."
  },
  "matched_failure_symptoms": [
    "SQLITE_BUSY_OR_DEADLOCK",
    "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": "16db90c9fbc312ef8263176ba57af879db2b78db4264b6a95e399d5f93ce8b7d",
    "verified_classes": [
      "MemoryRewriteViolation",
      "TransactionalWindow"
    ],
    "verified_functions": [
      "__init__",
      "rewrite",
      "_extract",
      "commit",
      "rollback"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MemoryRewriteViolation"
    ],
    "sample_fail_closed_invariants": [
      "rollback requested with no open transaction"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
