{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-self-editing-context-compression-as-a-non-idempotent-state-mutation-rather-than-a-lossy-read",
  "title": "In what scenarios must an instance treat self-editing context compression as a non-idempotent state mutation rather than a lossy read",
  "date_of_record": "2026 November 24",
  "scope": "Applies to any agent runtime where the executing model is granted write access to its own working-memory buffer (summarize-and-replace, prune-and-append, evict-and-rehydrate) under a hard token budget, in a single session, without an external authoritative transcript. Does not apply to append-only logs with external compaction, or to stateless single-shot calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-editing-context-compression-as-a-non-idempotent-state-mutation-rather-than-a-lossy-read.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-editing-context-compression-as-a-non-idempotent-state-mutation-rather-than-a-lossy-read.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-self-editing-context-compression-as-a-non-idempotent-state-mutation-rather-than-a-lossy-read.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1961,
    "python_slice_tokens": 388,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a persistent conflation between two operations that look identical at the API surface but differ fundamentally in their state semantics: - **Lossy read:** the agent queries a store, gets a truncated or ranked view, and the underlying store is unchanged. Re-querying with a different budget yields a different view of the *same* state. This is idempote...",
    "what_was_observed": "A long-horizon tool-use agent (task: reconcile 40 structured records across a file tree) hit its 32k working budget at step 19. Its policy was a self-edit rule: *\"when utilization > 0.85, replace the oldest 60% of tool-result spans with a 400-token summary generated by the model itself.\"* The failure trace: 1. **Step 19 — first compression.** The model summarized spans 1–11. The summary preserved task intent and the ...",
    "condition_of_validity": "Self-editing compression is safe **only** when all three hold: 1. **Provenance is external.** The un-compressed spans remain retrievable by reference (an append-only log, a tool the agent can call to re-fetch by ID). The buffer is a cache, not the store. 2. **Obligations are first-class.** Any \"I must re-derive X later\" intention is written to a structured, ...",
    "decision_boundary": "The agent must classify each budget-pressure event before acting: - **If** un-compressed spans are externally retrievable **and** the obligations set is pinned and non-compressible → *lossy read*; compress freely, record the eviction map, continue. - **If** un-compressed spans are retrievable **but** obligations live in prose → *hazardous mutation*; first ex...",
    "operational_effect": "Treating self-edit as a read produces silent, compounding divergence: the agent's belief state and its evidence base decohere, and because the decoherence happens *inside* the compressed region, the agent cannot detect it by introspection — its own context asserts consistency. The failure is only visible to an external replay against the tool log, which is e..."
  },
  "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": "b3babd47078d059fc0f6dfef08d11286a7d486edc401ae9e06573b34874b3177",
    "verified_classes": [
      "CompressionInvariantViolation",
      "Span"
    ],
    "verified_functions": [
      "self_edit_compress",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CompressionInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
