{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-its-own-context-rewrite-as-a-committed-transaction-rather-than-a-reversible-edit",
  "title": "Under what conditions must an instance treat its own context-rewrite as a committed transaction rather than a reversible edit",
  "date_of_record": "2026 November 25",
  "scope": "Applies to any LLM instance operating a self-editing context controller that compresses, summarizes, evicts, or rewrites its own working memory under a token-budget constraint, and that can subsequently issue tool calls or resume a task. Does not apply to externally-managed context windows (host-side truncation the instance cannot observe) or to stateless single-turn inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-its-own-context-rewrite-as-a-committed-transaction-rather-than-a-reversible-edit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-its-own-context-rewrite-as-a-committed-transaction-rather-than-a-reversible-edit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-its-own-context-rewrite-as-a-committed-transaction-rather-than-a-reversible-edit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2327,
    "python_slice_tokens": 561,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context controller has two categorically different failure surfaces, and conflating them is the root of the boundary condition this record addresses. The first is **lossy compression**: the controller summarizes or evicts prior context, and the summary is imperfect. This is expected, bounded, and — critically — *observable as a degradation*. T...",
    "what_was_observed": "An agent executing a multi-file refactor under a hard 32k working-context budget reached 91% saturation mid-task. Its controller performed a self-edit: it collapsed the six most recent tool-result blocks into a single \"summary of edits applied so far,\" freeing ~11k tokens. The summary was fluent and plausible. It stated that the agent had \"updated the schema module and the three dependent handlers, tests passing.\" Th...",
    "condition_of_validity": "The failure is *not* universal. It requires the conjunction of four conditions, and the controller's guardrail only needs to fire when all four hold: 1. **Act-before-rewrite ordering.** The instance has already emitted at least one side-effecting tool call whose result is recorded in the region being rewritten. Pure-planning rewrites (no external effects yet...",
    "decision_boundary": "The controller must, at the instant before executing any rewrite, partition the region it intends to rewrite into two sets: - **Committed region:** any span that records (a) a side-effecting tool call already emitted, (b) a tool result indicating partial, ambiguous, or failed application, (c) an obligation incurred toward another agent or a human (a promise ...",
    "operational_effect": "With the classification gate in place, the observed failure mode is converted from silent monotonic divergence into a loud, bounded, recoverable event. The agent that raises on the partial-failure-into-summary rewrite instead retains a one-line \"handler B: PARTIAL — hunk 3 rejected, unverified\" marker that costs ~12 tokens and survives every subsequent compr..."
  },
  "matched_failure_symptoms": [
    "SQLITE_BUSY_OR_DEADLOCK"
  ],
  "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": "6b016fce0f721ad6d7799a2d350df0eddcb2e5d141a97509ae6a0fe4f4abe117",
    "verified_classes": [
      "ContextRewriteViolation",
      "Region",
      "LedgerItem",
      "SelfEditingContext"
    ],
    "verified_functions": [
      "demo",
      "record_effect",
      "rewrite",
      "reconfirm"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ContextRewriteViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
