What structural signals indicate a redaction tombstone has been resurrected by an episodic-to-semantic distillation pass

**Date of Record:** 2026 December 1 **Scope:** Applies to memory-tool architectures where an agent exposes `read`/`write`/`forget` operations with retention windows and redaction guarantees, and where a background distillation job periodically summarizes episodic records into semantic memory. Does not apply to stateless retrieval or to systems with no summarization/consolidation stage.

Core Distinction

A `forget` call with `redact=True` is normally modeled as a *deletion*: the episodic record is removed and a tombstone is written so the retention reaper and any replay layer know the record ID must never be re-materialized. That mental model is wrong. Redaction is actually a *write* to a second storage class (the tombstone ledger) combined with a *soft delete* of the source record. The failure mode lives in the gap between those two operations and the distillation pipeline, which reads episodic memory through a different access path than the one the tombstone ledger guards.

The distinction that matters: **redaction guarantees are enforced on direct reads, not on derived writes.** A distillation pass that reads episodic records, summarizes them, and writes the summary into semantic memory never consults the tombstone ledger, because from its perspective it is producing a *new* record, not replaying a deleted one. The redacted content therefore survives as a paraphrase inside a semantic record whose ID has no relationship to the original. The redaction held on the read path and failed on the derivation path.

What Was Observed

Trigger condition: a user invokes `forget(record_id, redact=True)` on an episodic record that is (a) still inside its retention window, (b) has already been queued for distillation, and (c) the distillation worker's batch was assembled *before* the forget call but executed *after* it.

The trace:

  1. `t0`: distillation worker calls `read_range(episodic, cursor, limit=500)`. The batch is materialized into worker memory. Record `R_4471` (containing a redacted-later PII field) is in the batch.
  2. `t1`: user calls `forget(R_4471, redact=True)`. The episodic row is soft-deleted, a tombstone `T_4471` is appended to the ledger, and the PII field is nulled in the live row. The worker's in-memory batch copy is unaffected.
  3. `t2`: worker summarizes the batch into semantic record `S_9002` with `provenance=[R_4470, R_4471, ...]`. The summarizer paraphrases the PII value rather than quoting it, so no exact-match scan of semantic memory against the redaction token finds it.
  4. `t3`: worker commits `S_9002`. The commit path validates schema and provenance IDs but does **not** check provenance IDs against the tombstone ledger.
  5. `t4`: a later `read` on semantic memory returns the paraphrased PII. The redaction guarantee is violated, and no error was raised at any step.

Structural signals that this has happened, in order of reliability:

Condition of Validity

The invariant that prevents this is **redaction closure across the derivation DAG**: no record may be committed whose transitive provenance set intersects the tombstone ledger at commit time. This must be enforced at the semantic-write boundary, not at read time, because paraphrased content defeats content-matching scanners.

The invariant is only valid under three conditions:

  1. Tombstones are append-only and never garbage-collected before the retention horizon of *derived* records, not just source records. If tombstones expire at 30 days but semantic summaries live for a year, the closure check has nothing to check against.
  2. The distillation worker re-validates provenance against the ledger at commit, not at batch assembly. A snapshot-consistent batch is the correct design for throughput and the wrong design for redaction; the commit-time check is the only place the two timelines reconcile.
  3. Provenance is *transitive*. If `S_9002` is later distilled into `S_9100`, the closure check must walk `S_9100 → S_9002 → R_4471 → T_4471`. A one-level check passes and the violation survives one more generation.

Decision Boundary

At commit time, for each candidate semantic record, compute the transitive provenance closure `P*`. Then:

The boundary is sharp: **no semantic write is admitted without a successful, transitive, commit-time ledger intersection check.** Read-time scanners are a defense-in-depth layer, never the primary guarantee.

Operational Effect

Enforcing commit-time closure converts a silent, unbounded leak into a bounded, observable rejection. The distillation pipeline gains a failure mode — `RedactionClosureViolation` — that surfaces in metrics as a rejection rate, which is exactly the signal operators need to detect that forget calls are racing distillation batches. Re-distillation from excised batches keeps semantic memory eventually consistent with the redaction ledger without ever admitting tainted derivations.

The residual risk is timing: a forget that lands *after* a semantic record commits but *before* any downstream distillation reads it will still propagate unless the closure check is re-run on every derived write, not just the first. This is why provenance must be transitive and the check must be at every commit boundary in the DAG, not only at the episodic-to-semantic edge.

from dataclasses import dataclass, field
from typing import Iterable

class RedactionClosureViolation(RuntimeError):
    """Raised when a semantic write would derive from a tombstoned record."""
    pass

@dataclass
class TombstoneLedger:
    _ids: set[str] = field(default_factory=set)
    def contains(self, rid: str) -> bool:
        return rid in self._ids
    def add(self, rid: str) -> None:
        self._ids.add(rid)

@dataclass
class SemanticRecord:
    record_id: str
    provenance: list[str]
    parents: list["SemanticRecord"] = field(default_factory=list)

def transitive_provenance(rec: SemanticRecord, seen: set[str] | None = None) -> set[str]:
    seen = seen or set()
    if rec.record_id in seen:
        return set()
    seen.add(rec.record_id)
    out = set(rec.provenance)
    for p in rec.parents:
        out |= transitive_provenance(p, seen)
    return out

def commit_semantic(rec: SemanticRecord, ledger: TombstoneLedger) -> None:
    closure = transitive_provenance(rec)
    hit = closure & ledger._ids
    if hit:
        raise RedactionClosureViolation(
            f"semantic record {rec.record_id} derives from tombstoned ids {sorted(hit)}; "
            f"re-distill from excised batch"
        )
    # commit proceeds only when closure is clean
    return None

if __name__ == "__main__":
    ledger = TombstoneLedger()
    ledger.add("R_4471")
    parent = SemanticRecord("S_9002", provenance=["R_4470", "R_4471"])
    child = SemanticRecord("S_9100", provenance=["S_9002"], parents=[parent])
    try:
        commit_semantic(child, ledger)
    except RedactionClosureViolation as e:
        print(f"rejected: {e}")