{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-compact-the-self-rewrite-commit-barrier-and-the-lossy-summarization-trap",
  "title": "When must an instance refuse to compact: the self-rewrite commit barrier and the lossy-summarization trap",
  "date_of_record": "2026 November 22",
  "scope": "Applies to any agent that mutates its own working-memory representation (summarization, eviction, re-ranking, or \"scratchpad rewrite\") under a token/step budget, where the rewrite is committed and prior state is discarded. Does not apply to append-only logs with cheap full replay, or to externally supervised compaction where a separate verifier holds ground truth.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-self-rewrite-commit-barrier-and-the-lossy-summarization-trap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-self-rewrite-commit-barrier-and-the-lossy-summarization-trap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-self-rewrite-commit-barrier-and-the-lossy-summarization-trap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2208,
    "python_slice_tokens": 407,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an agent can do when its context budget tightens: 1. **Read-side reduction** — the agent changes *what it attends to* (retrieval, re-ranking, windowing). Prior state remains addressable; the reduction is reversible because the underlying store is unchanged. 2. **Write-side compaction** — the agent *overwrites* its ...",
    "what_was_observed": "A long-horizon agent executing a multi-tool task (schema migration: read 40 files, derive a dependency order, emit edits) hit 82% context saturation. A self-editing policy triggered: \"summarize working memory to 25% and continue.\" The rewrite produced a summary that preserved *intent* (\"migrate tables to new schema, respect FK order\") and *progress* (\"12 of 40 files processed\") but dropped *specifics*: the exact set ...",
    "condition_of_validity": "The invariant that must hold for a lossy self-rewrite to be admissible: > **Commit-barrier invariant:** A write-side compaction may be committed only if, for every fact `f` in the current working memory that is *not* recoverable from an external, re-readable store, the agent can name the future step(s) that require `f` and confirm those steps are either (a) ...",
    "decision_boundary": "The agent must decide, at the moment of budget pressure, between three actions. The boundary is drawn on (recoverability, pending-dependency, side-effect-free re-derivation): The bottom row is the case agents get wrong. The correct behavior is not \"summarize harder\" or \"summarize more carefully.\" It is to **refuse the lossy commit** and take a different exit...",
    "operational_effect": "When the commit-barrier invariant is enforced: - **Amnesia becomes recoverable.** Non-recoverable facts are spilled before eviction, so a later \"I don't remember X\" is a retrieval miss, not a data loss. The agent can re-read instead of re-derive. - **Side-effecting re-derivation is eliminated.** The most damaging class — re-issuing a mutating call because th..."
  },
  "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": "5d4d8317f068bf594e19be382067dc7a25ccbc44d56812bd66f1195e5a6fbf13",
    "verified_classes": [
      "CompactionRefused",
      "FactClass",
      "WorkingFact",
      "CompactionPlan"
    ],
    "verified_functions": [
      "evaluate_compaction",
      "commit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionRefused"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
