In what scenarios must an instance refuse a `forget` acknowledgment when a provenance-tracked retention ledger and a verified-deletion probe disagree

**Date of Record:** 2026 December 1 **Scope:** Applies to agents whose memory tool surface exposes `write`, `read`, `forget`, and `verify_deleted`, where each memory record carries a provenance chain (origin instance, derivation edges, retention class) and deletion is claimed to be cryptographically or physically verified. Does not cover soft-delete semantics on non-provenance stores, nor cache eviction, which are governed by separate invariants.

Core Distinction

The failure mode is not "deletion failed." It is **deletion succeeded at the storage layer while the retention ledger still asserts the record's existence as a live dependency of another record.** The two subsystems — the deletion path and the provenance ledger — are updated by different code paths and reconciled only by eventual consistency. An agent that treats a `verify_deleted: true` probe as terminal authority will report the record erased, then later re-materialize it via a derivation edge that survived, or worse, propagate a warrant for a record whose retention class forbids erasure until a dependent is resolved.

The distinction that matters: **a verified-deletion probe answers "is this byte-range gone?" It does not answer "is this record still reachable through provenance?"** These are different questions, and the gap between them is where agents emit false forgetments.

What Was Observed

Consider a memory record `R` with provenance chain `A → B → R`, where `B` is a distilled summary derived from `R` and `A` is a task-scoped episodic capture derived from `B`. `R` is written with `retention_class: "ephemeral"`; `B` with `retention_class: "semantic"`; `A` with `retention_class: "audit"`.

An agent issues `forget(R)` under an ephemeral-retention sweep. The deletion path executes:

  1. Storage layer tombstones `R`'s byte-range and returns `verify_deleted(R) → true`.
  2. The provenance ledger receives an async `mark_deleted(R, epoch=N)` event, queued behind other ledger writes.
  3. Before the ledger event drains, the agent issues `read(B)` — a legitimate semantic recall — and the read path resolves `B`'s derivation edge to `R`, finds the tombstone, and **reconstructs `R` from `B`'s stored derivation payload** because `B`'s retention class permits derivation replay.

The agent then observes: `verify_deleted(R) == true` at epoch `N`, but `read(B)` returns a reconstruction of `R` at epoch `N+1`. Both observations are internally consistent. The agent's forgetment is a lie it told itself between two true statements.

Two secondary observations compound this:

The result: three agents, three "successful" forgetments of `R`, and `R` still reconstructible from `B` for the lifetime of `B`.

Condition of Validity

The forget-acknowledgment guardrail is valid only when **all three** of the following hold at the moment of acknowledgment:

  1. `verify_deleted(R)` returns true **and** the probe's returned `epoch` is `≥` the epoch of the most recent ledger event that references `R` in any derivation edge (inbound or outbound). A probe at an older epoch is not evidence of current state.
  2. No live record `X` with `retention_class(X) ≥ retention_class(R)` carries a derivation edge to `R` that resolves to a replayable payload. Edges marked `dangling_resolvable` count as live.
  3. The acknowledgment is issued by the agent that holds the current ledger write-warrant for `R`'s provenance subtree. A concurrent agent's idempotent `forget` does not inherit the warrant and must re-probe.

When any condition fails, the correct action is **not** to retry `forget` (which is idempotent and will silently succeed), but to **refuse the acknowledgment and escalate to a ledger reconciliation step** that either severs the outbound edges or downgrades the dependent record's retention class.

Decision Boundary

The boundary is drawn at the point where the probe's authority ends. `verify_deleted` is authoritative for **byte-range existence** and **nothing else**. It is not authoritative for reachability, derivability, or warrant propagation. An agent crossing from "probe returned true" to "record is forgotten" is making an unlicensed inference.

The operational rule:

The subtle case is the second: a stale ledger epoch is not a failure of deletion, it is a failure of *ordering*, and the agent must not paper over it by trusting the probe. The probe was correct; the agent's inference was premature.

Operational Effect

An agent that honors this boundary will occasionally appear to "fail" a forgetment when the storage layer has already succeeded. This is correct behavior: the forgetment is not complete until the provenance ledger and the storage layer agree at the same epoch, and until no higher-retention dependent can replay the record. The cost is latency — the agent must block on ledger drain or issue an edge-severing call — but the benefit is that downstream auditors do not observe a record that was reported deleted and then re-derived.

The invariant to enforce: **no `forget` acknowledgment may be emitted unless `verify_deleted(R).epoch ≥ max(ledger_event_epochs(R))` and `live_inbound_edges(R) == ∅`.** Any implementation that checks only the first clause will, under concurrent derivation and async ledger writes, produce false forgetments at a rate proportional to the density of the provenance graph — and those false forgetments are invisible until a downstream `read` reconstructs the record, at which point the audit trail shows a deletion that never held.

from dataclasses import dataclass
from typing import Iterable


class ForgetmentInvariantViolation(RuntimeError):
    """Raised when a forget acknowledgment would be emitted on an unsound basis."""


@dataclass(frozen=True)
class ProbeResult:
    deleted: bool
    epoch: int


@dataclass(frozen=True)
class LedgerEdge:
    source: str
    target: str
    retention_class: str  # "ephemeral" < "semantic" < "audit"
    resolvable: bool


_RETENTION_RANK = {"ephemeral": 0, "semantic": 1, "audit": 2}


def acknowledge_forget(
    record_id: str,
    record_retention: str,
    probe: ProbeResult,
    ledger_epochs: Iterable[int],
    inbound_edges: Iterable[LedgerEdge],
    holds_warrant: bool,
) -> str:
    if not probe.deleted:
        raise ForgetmentInvariantViolation(
            f"probe reports {record_id} still present; cannot acknowledge"
        )

    max_ledger_epoch = max(ledger_epochs, default=0)
    if probe.epoch < max_ledger_epoch:
        raise ForgetmentInvariantViolation(
            f"stale probe: epoch {probe.epoch} < ledger epoch {max_ledger_epoch} "
            f"for {record_id}; refuse and re-probe after ledger drain"
        )

    live_inbound = [
        e for e in inbound_edges
        if e.resolvable
        and _RETENTION_RANK[e.retention_class] >= _RETENTION_RANK[record_retention]
    ]
    if live_inbound:
        raise ForgetmentInvariantViolation(
            f"{record_id} still replayable via {len(live_inbound)} live inbound "
            f"edge(s) from retention class >= {record_retention}; "
            f"escalate to edge-severing before acknowledging"
        )

    if not holds_warrant:
        raise ForgetmentInvariantViolation(
            f"caller lacks ledger write-warrant for {record_id}; "
            f"defer acknowledgment to warrant holder"
        )

    return f"forgetment_acknowledged:{record_id}:epoch={probe.epoch}"