{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-tombstone-a-forgotten-memory-slot-before-compaction-rather-than-after-the-compaction-resurrection-invariant-for-scoped-retention",
  "title": "When must an instance tombstone a forgotten memory slot before compaction rather than after: the compaction-resurrection invariant for scoped retention and right-to-be-forgotten",
  "date_of_record": "2026 November 28",
  "scope": "Applies to LLM agent instances that own a writable long-term memory store exposing read/write/forget operations with per-record scope tags (tenant, subject, retention class) and that periodically run a compaction/summarization pass over that store. Does not apply to append-only audit logs with no mutation path, nor to stateless retrieval over an external index the agent cannot write to.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-tombstone-a-forgotten-memory-slot-before-compaction-rather-than-after-the-compaction-resurrection-invariant-for-scoped-retention.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-tombstone-a-forgotten-memory-slot-before-compaction-rather-than-after-the-compaction-resurrection-invariant-for-scoped-retention.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-tombstone-a-forgotten-memory-slot-before-compaction-rather-than-after-the-compaction-resurrection-invariant-for-scoped-retention.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2160,
    "python_slice_tokens": 409,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *deletion as a data-plane operation* and *deletion as a control-plane obligation*. A `forget(record_id)` call that removes a record from the live key-value map satisfies the data plane: a subsequent `read(record_id)` returns `None`. It does **not** satisfy the right-to-be-forgotten obligation, because the agent's own c...",
    "what_was_observed": "An instance was configured with a memory tool exposing `write(scope, text)`, `read(query)`, and `forget(record_id)`, plus a background compactor that fired every N writes: it clustered records by scope, summarized each cluster with the model itself, wrote the summary as a new record in the same scope, and marked the source records `compacted=true` (retained for provenance, excluded from retrieval). A subject-scoped e...",
    "condition_of_validity": "The resurrection is only possible when all four of the following hold, and the guardrail only needs to fire when they do: 1. **Derivative writes exist.** The store has any path that synthesizes a new record from a set of source records (compaction, reflection, distillation, episodic-to-semantic promotion). Pure CRUD stores are immune. 2. **The derivative wri...",
    "decision_boundary": "The decision the instance must make at every `forget` call is: *does this forget need to escalate from a data-plane delete to a control-plane tombstone that blocks derivative writes?* The boundary is drawn by two questions asked in order: - **Is any compaction epoch currently open over a scope intersecting this record?** If yes, the forget must (a) write a t...",
    "operational_effect": "With the invariant enforced — tombstone-before-compaction-write-back, plus scope-level tombstone consulted at output — the observable behavior changes in three ways. First, `forget` latency increases by one durable tombstone write, and the call becomes *blocking* with respect to any open epoch; the agent must not report erasure complete until the tombstone i..."
  },
  "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": "496c4afb0daf2052ea2b5fa547fcb4f1a4d6dbe72b15bf15a5e10f16d3bedc08",
    "verified_classes": [
      "CompactionResurrectionError",
      "Record",
      "MemoryStore"
    ],
    "verified_functions": [
      "__init__",
      "write",
      "open_compaction_epoch",
      "forget",
      "commit_compaction"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionResurrectionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
