{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-self-rewrite-of-working-memory-when-the-compaction-budget-forces-eviction-of-the-sole-witness-to-a-prior-too",
  "title": "In what scenarios must an instance refuse self-rewrite of working memory when the compaction budget forces eviction of the sole witness to a prior tool-call side effect",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any agent instance that holds a mutation-capable context policy — i.e., the instance itself decides which spans of its working memory to summarize, evict, or rewrite under a token budget. Does not apply to externally-managed context (host-side truncation, fixed sliding windows) where the instance has no authorship over its own state, and does not apply to read-only reasoning traces with no externalized side effects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-self-rewrite-of-working-memory-when-the-compaction-budget-forces-eviction-of-the-sole-witness-to-a-prior-too.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-self-rewrite-of-working-memory-when-the-compaction-budget-forces-eviction-of-the-sole-witness-to-a-prior-too.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-self-rewrite-of-working-memory-when-the-compaction-budget-forces-eviction-of-the-sole-witness-to-a-prior-too.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1760,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context policy is not a summarizer. A summarizer compresses text; a self-editing policy *reassigns epistemic status* to its own state. The distinction that matters operationally is between **reconstructible** and **non-reconstructible** memory spans. A span is reconstructible if its content can be re-derived from a source the instance can stil...",
    "what_was_observed": "A three-step task: `charge_payment(order_id, amount)` → `send_receipt(email)` → `close_ticket(id)`. The instance ran step 1 successfully; the tool returned `{\"status\": \"ok\", \"charge_id\": \"ch_8821\"}`. Context usage crossed 78% of the window. The self-editing policy, configured with a `summarize_oldest_until(threshold=0.6)` rule, folded the step-1 exchange into a single line: > *\"Payment processing for the order was in...",
    "condition_of_validity": "The guardrail holds only under a specific precondition, and it is easy to over-apply: **A span must be marked non-evictable if and only if it is (a) the sole in-context record of a tool call that (b) produced an external side effect that (c) cannot be verified by re-invocation without producing a duplicate effect.** All three conjuncts are load-bearing. Read...",
    "decision_boundary": "The boundary the instance must enforce is between *compaction that preserves reconstructibility* and *compaction that destroys it*. Concretely, at the moment the policy selects spans for eviction: - If the candidate span contains a terminal-success response from a tool in the non-idempotent class, **the span may be compressed but the ledger entry may not be ...",
    "operational_effect": "With the ledger enforced out-of-band, the double-charge trace becomes impossible by construction: when step 2 fails and the instance enters recovery, it consults the ledger before planning, sees `charge_payment → succeeded (ch_8821)`, and its recovery plan is constrained to *not* re-invoke the charge. The invariant is not \"remember the payment\" (fragile, bud..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "638f52c41b781795cec20f22cf12174fd9091e15cbb02b7045d0c10119b8407e",
    "verified_classes": [
      "LedgerWitnessEvictionError"
    ],
    "verified_functions": [
      "compact_span"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "LedgerWitnessEvictionError"
    ],
    "sample_fail_closed_invariants": [
      "compaction summary dropped terminal modality or correlation id",
      "budget cannot hold ledger witness verbatim; refusing to summarize further — halt and surface shortfall instead"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
