{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-a-self-editing-context-pass-as-a-state-mutating-commit-rather-than-a-lossless-cache-eviction",
  "title": "In what scenarios must an instance treat a self-editing context pass as a state-mutating commit rather than a lossless cache eviction",
  "date_of_record": "2026 November 25",
  "scope": "Applies to any agent that rewrites, prunes, summarizes, or relevance-scores its own working context mid-episode (including self-summarization loops, eviction-by-score policies, and tool-output compaction). Does not apply to contexts mutated only by an external orchestrator with a full audit log, nor to stateless single-turn inference.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-editing-context-pass-as-a-state-mutating-commit-rather-than-a-lossless-cache-eviction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-editing-context-pass-as-a-state-mutating-commit-rather-than-a-lossless-cache-eviction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-editing-context-pass-as-a-state-mutating-commit-rather-than-a-lossless-cache-eviction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1853,
    "python_slice_tokens": 353,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure lives in the gap between two mental models of context editing that look identical at the API layer but are categorically different in state semantics: - **Eviction-as-cache:** the assumption that dropping or rewriting a span removes *bytes* but preserves *information availability* — that the model can \"re-derive\" anything it needs from what remai...",
    "what_was_observed": "A long-horizon agent (task: reconcile a schema migration across ~40 tool calls) ran a self-summarization pass every time context utilization crossed 80%. The policy scored each message by cosine similarity to the current subgoal embedding and evicted the bottom 30%, then wrote a compressed digest of the evicted span back into the head of the context. Failure trace: 1. At pass 3, the agent had already accepted a user ...",
    "condition_of_validity": "The \"lossless eviction\" assumption holds — and self-editing is safe — only when **all three** of the following are true for every pruned span: 1. **Reconstructibility:** the span's load-bearing content is derivable from retained context plus a deterministic tool call (e.g., re-reading a file, re-querying an API). If the span contains user utterances, one-sho...",
    "decision_boundary": "The operational rule the instance must apply at every self-editing pass: Additionally, any self-editing pass that precedes a **destructive or irreversible action** (DROP, DELETE, send, deploy, payment) must re-validate the action against the *pinned* constraint set, not against the current summarized context. The pinned set is the authority; the working cont...",
    "operational_effect": "- **Latency of failure inverts intuition.** Lossless-eviction bugs do not fail at the edit; they fail N passes later, at the first step that needed the pruned fact. Debugging must therefore treat the self-edit log, not the failing tool call, as the root-cause surface. - **Fluency is not integrity.** A digest that reads correctly can still have dropped the on..."
  },
  "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": "00fbbc780c8e1505846c59f9f091090e58595a2483169acb490f4f003f4d7d66",
    "verified_classes": [
      "SelfEditViolation",
      "SpanKind",
      "Span",
      "SelfEditPass"
    ],
    "verified_functions": [
      "apply",
      "assert_destructive_action_ok"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SelfEditViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
