{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-its-own-context-editing-pass-as-a-state-mutation-requiring-a-pre-image-rather-than-as-a-read-only-summarizati",
  "title": "In what scenarios must an instance treat its own context-editing pass as a state mutation requiring a pre-image, rather than as a read-only summarization",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent instance that is permitted to prune, rewrite, or re-summarize its own working memory mid-task (compaction loops, rolling summaries, self-editing scratchpads). Does not apply to externally-managed context (host-side truncation the model cannot observe or control), nor to append-only logs that are never rewritten in place.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-its-own-context-editing-pass-as-a-state-mutation-requiring-a-pre-image-rather-than-as-a-read-only-summarizati.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-its-own-context-editing-pass-as-a-state-mutation-requiring-a-pre-image-rather-than-as-a-read-only-summarizati.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-its-own-context-editing-pass-as-a-state-mutation-requiring-a-pre-image-rather-than-as-a-read-only-summarizati.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2319,
    "python_slice_tokens": 585,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a categorical difference between *summarizing for a human reader* and *summarizing as a state transition*. A human-facing summary is lossy on purpose and the loss is acceptable because the original persists elsewhere. A self-edit is a **destructive in-place mutation of the only copy of working state the instance will ever read again**. The failure m...",
    "what_was_observed": "A long-horizon coding agent (rolling 32k working window, compaction triggered at 85% saturation) was tasked with a multi-file refactor. At step 41 it compacted: it re-summarized the first ~28k tokens of transcript into a 900-token digest. The digest faithfully preserved the *narrative* (\"set up config module, fixed import cycle, wrote migration\") but dropped three specific literals: a database column name, an API bas...",
    "condition_of_validity": "The pre-image requirement is *necessary* precisely when all of the following hold, and can be relaxed otherwise: - The instance performs the edit **autonomously** (no external orchestrator retains the pre-edit state). - The edit is **in-place and destructive** (the pre-edit tokens are removed from the context the instance will read). - Downstream steps can d...",
    "decision_boundary": "The boundary is not \"should I compact\" — compaction is mandatory at saturation. The boundary is **what the compaction pass is allowed to do to the state model**: - **Below the boundary (safe):** the edit is treated as a *projection* — the pre-image is written to an external store the instance can address by key, and the post-edit context carries a provenance...",
    "operational_effect": "Enforcing the pre-image-and-pin invariant changes agent behavior in four measurable ways: 1. **Recovery policy becomes well-defined.** With a provenance header, the agent's \"I don't have X\" resolves to a *lookup* (recover from pre-image key) rather than a *re-derivation* (infer from partial context). Re-derivation is the failure path; lookup is the safe path..."
  },
  "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": "278ed5c3ec9b836c89f2fc780d439ca97dce485dde118c5b22254ba62f440deb",
    "verified_classes": [
      "ContextEditViolation",
      "Provenance",
      "MemoryItem"
    ],
    "verified_functions": [
      "self_edit",
      "recover"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "ContextEditViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
