{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-self-editing-context-policies-as-a-checkpointable-transaction-rather-than-a-lossy-rewrite",
  "title": "Under what conditions must an instance treat self-editing context policies as a checkpointable transaction rather than a lossy rewrite",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that mutate their own working memory (summarize, evict, compress, or re-score their own context) under an explicit token budget while a multi-step task is in flight. Does not apply to read-only retrieval, to externally managed context (host-controlled truncation), or to single-turn inference with no persistent working set.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-self-editing-context-policies-as-a-checkpointable-transaction-rather-than-a-lossy-rewrite.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-self-editing-context-policies-as-a-checkpointable-transaction-rather-than-a-lossy-rewrite.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-self-editing-context-policies-as-a-checkpointable-transaction-rather-than-a-lossy-rewrite.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2320,
    "python_slice_tokens": 314,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the summary was bad.\" It is that **a self-edit is an irreversible in-place mutation of the only substrate the agent reasons over, executed by the same probabilistic process that depends on that substrate.** When an agent rewrites its working memory to fit a budget, it performs a `read → compress → overwrite` cycle with no commit poin...",
    "what_was_observed": "A planner agent running a 40-step dependency-resolution task hit its 8k-token working-memory ceiling at step 22. Its self-edit policy was \"summarize the oldest 60% of the transcript when over budget, preserve the last 4 turns verbatim.\" The transcript at step 22 contained, among 14k tokens of tool output, three load-bearing facts: 1. A version constraint `pkg-b < 2.0` discovered at step 6 via a failed install. 2. A n...",
    "condition_of_validity": "A self-edit is only valid as a lossless-in-effect operation under a conjunction of conditions, and the failure above is the case where the conjunction is violated without detection: - **C1 — Eviction is auditable against a retained oracle.** The pre-edit state (or a content-addressed digest of it) survives the edit and is reachable for comparison. If the old...",
    "decision_boundary": "The decision boundary is **whether the edit can be validated before the pre-edit state is released.** This is a hard line, not a spectrum: - **Below the line (transactional):** the agent retains the pre-edit state or its digest, applies the compression, runs a validation pass that checks for dropped constraints and negative facts against the oracle, and comm...",
    "operational_effect": "The operational consequence is that self-editing context policies must be reclassified from \"memory management\" to \"state mutation with correctness implications,\" and instrumented accordingly: 1. **Retain a pre-edit digest.** Before any self-edit, write a content hash (or the full transcript to durable storage) so the post-edit state can be diffed. This is c..."
  },
  "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": "011a55227f8d2a5d8a466e6175c327d5fdbfcdf4790ccc0322efdda249145ac5",
    "verified_classes": [
      "UnauditableSelfEditError",
      "DroppedConstraintError",
      "WorkingMemory"
    ],
    "verified_functions": [
      "self_edit",
      "digest"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "DroppedConstraintError",
      "UnauditableSelfEditError"
    ],
    "sample_fail_closed_invariants": [
      "self-edit under binding budget requires a retained pre-edit oracle; lossy in-place rewrite is not permitted for this tas"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
