---
title: Memory consent and derived text
lastModified: '2026-12-03T19:35:24.000Z'
description: A deletion contracts memory and records content refusal before its tombstone commits. memory.delete, a successful memory.delete_version, natural-language…
---

A deletion contracts memory and records content refusal before its tombstone commits.
`memory.delete`, a successful `memory.delete_version`, natural-language forgetting and
`memory.clear` keep canonical JSON hashes and normalized literal fingerprints in
`memory_refusals`. Refusal records contain no deleted plaintext and have no TTL. Ordinary
revision, supersession, expiry and an internal move do not express permanent refusal.

A point deletion applies to the same user in its namespace, across agents and sessions.
A user erasure applies across the organization, including namespaces created later.
A namespace erasure applies to later intake by every user in that namespace. The policy
scope is separate from the original row's identity tuple, so a derived row keeps its
writer identity without narrowing the erased subject's refusal. Captured derived content
also records an indexed erasure refusal under that writer's namespace and user identity.

Canonical values are compared after JSON decoding. Literal comparisons normalize Unicode,
letter case and whitespace, and check passages within later strings. Wrapping a deleted
value in another JSON object does not bypass the check. These fingerprints compare
content; they do not recognize arbitrary semantic paraphrases. Verification work is
bounded and an incomplete check refuses the write.

A deleted string of at most eight tokens is looked for at every position of a later
string. A longer one also records an anchor, the hash of its first eight tokens, and a
mark that names its literal hash. The check hashes each eight-token run of the later
string once, looks those hashes up as anchors, and hashes the full length only where an
anchor matched. The hashing therefore grows with the write and the anchors it matches,
not with how many values its scope deleted: one run per token for each short length
deleted, one for the anchors, and one full-length hash per anchor match. A long literal
without the mark is looked for at every position. Each run is hashed from one encoding of
the string, and the work bound counts hash calls, a long run as several. The policy reads
still scan the scope's literal rows, so their cost grows with the values the scope
deleted.

ClickHouse writers share admission leases with deletion and erasure. A successful delete
records refusal under the exact head's write fence. Every publisher takes one admission
stripe of its organization, namespace and user. Erasure drains every stripe of its scope
before capture, and a user erasure every organization stripe as well; it drains admitted
sends before deleting content. Postgres stores policy beside canonical memory. Native
writers share the organization policy lock before namespace, user, generation and head
locks. Erasure takes its scope's lock exclusively; a user erasure also takes the
organization lock exclusively, and a namespace erasure shares it, including when it spans
several namespaces.

An unfinished erasure blocks the new intake it may reach until it completes or is
abandoned. A namespace erasure blocks writes to its own namespaces. A user erasure
blocks every namespace of the organization: its refusals also bind the writers of
derived copies, which its capture finds only as it runs. The policy read leaves out
erasures of other single namespaces; a scope it cannot parse, or a full page of 100 of
the remaining unfinished erasures, blocks the organization too. A failed policy read
refuses intake. Raw evidence, deferred extraction, canonical writes, embeddings and
shared promotion use the same policy. A delayed projection rechecks its source under
admission before publishing.

Erasure captures ClickHouse revision history under either storage authority. A native
revision whose payload was cleared still supplies its typed identity for raw dependent
capture; ClickHouse history supplies its content before either copy is removed.

Canonical tombstones check erasure policy even though their content is no longer served.
Point deletion can retain its canonical history. Native authority commits check point
refusal before entering the journal. Delivery can publish those committed revisions after
point deletion, while rechecking erasure policy under the policy locks. Raw evidence,
chunks, extraction payloads and new vector publication still check point refusal.

A vector retirement keeps cache bytes
only while its authoritative source and policy permit them; point refusal produces an
empty marker. With no source or an erasure match, cleanup deletes older vector versions
across every partition, bounded by the caller's retirement version. It inserts no new row
and preserves equal or newer versions. Native publication proves source absence with a
durable read before borrowing a connection, then rechecks on that connection under policy
locks. Present heads remain locked until publication finishes.

Native delivery clears search-document debt only for acknowledged publications or a
source that no longer needs a document. A vector withheld after source selection stays
owed for another pass. Receipts match the complete identity and published version;
a newer metadata copy settles its original revision's delivery. Copy follow-ups confirm
the exact document in ClickHouse before settling debt.

Each native publication batch finishes its canonical send before sending its vectors.
Both sends acquire the same consent fences; ordering them prevents competing partial
claims from blocking the batch. Audit publication runs alongside them. A failed canonical
send still permits the independently checked vector send and preserves each target's debt.

Shared canonical retirement holds admission through its final send. It checks the
promoted source identities against erasure policy and requires the shared head to remain
present. Missing heads, erased content and unproven legacy sources are removed below the
retirement version without inserting plaintext or a marker. Definition promotion and
demotion acquire the namespace claim before borrowing a source connection.

Deferred extraction checks caller data in current and prior messages, names, instructions,
schema enums and pipeline arguments. Standard protocol fields do not become refusal
patterns. Enqueue, claim and every payload-carrying transition share this admission.
A transition also requires its exact source revision and payload hash to remain present.
A refused job ends through a control-only update bound to that same source; its transcript
is never copied into the terminal update. A missing source cannot be recreated.

An extraction also checks the facts it is about to write, before the write. A transcript
can pass admission while the model states a fact whose value is, or contains, content its
writer deleted. The write fence refuses a whole batch that holds one such value, and a
queued capture would repeat that refusal on every attempt. A deletion is a decision, not
a failure: the extraction skips that fact, reports it in `refused` with the verdict
`forgotten`, and writes the other facts, so the capture ends `done` with no attempt spent.
The check costs one policy read per extraction write, and one more per fact only when the
batch matches. A value too large to verify and an unfinished erasure that may reach the
write still fail it. The fence remains the authority: a deletion that lands between this
check and the insert refuses the batch once, and the next replay skips the fact.
`memory.set`, `memory.bulk_set` and `memory.import` state their values themselves and
answer 422 with the reason `forgotten`.

An owed `memory.delete_version` check carries a hash of the exact checked state.
Recovery compares that hash before writing a missing tombstone. A numeric version
collision cannot turn a different fact into the target of permanent refusal.

Vector maintenance reports only acknowledged replacements. A legacy vector without a
source hash stays held when its complete source cannot be proved; `--delete-old` keeps
that organization's old vectors. Run `memory.reindex` with `force=true` to rebuild such
vectors from the complete authoritative values.

Permanent refusal also applies to `memory.restore` and snapshot restoration. Automatic
retirement can still be undone when the content has not been refused. Keeping the
historical row for inspection does not grant permission to publish it again.

## Session digests

A session digest contains complete committed source facts joined by newlines. Each fact
has a corresponding key in `derived_from`, under the same complete identity. A model does
not draft session digest text. Search and other digest consumers reconstruct the text
from the authoritative current heads and withhold any digest whose source is missing,
changed, retired, expired, sensitive, incomplete or awaiting review. A metadata touch
keeps an unchanged fact valid. A legacy digest without a complete proof is withheld.

Publication checks the complete digest text and each source fact against the effective
blacklist before any write. Every digest reader repeats the pattern check, so a later
pattern also withholds an existing digest without waiting for its source sweep.
Under Postgres the publisher holds the checked policy generations through its final
send; a changed generation refuses publication. The composition root supplies the
pattern checker to stores, and an unwired or unreadable policy fails closed.

Digest listing, outline and evidence export scan past withheld candidates to fill their
requested rows. `memory_digest_listing_page_size` bounds candidates per query and
`memory_digest_listing_max_pages` bounds queries per call; both default to 256. If that
budget cannot find enough verified rows or prove exhaustion, the operation returns
`BACKEND_UNAVAILABLE` rather than claiming the listing is complete.

Period planning selects the newest live digest per session before pagination. Source
verification applies to each digest row; a valid row cannot admit another model's stale
digest from the same session.

Period and contrast synthesis remain proposals. A model-generated restatement therefore
waits for independent review before ordinary fact retrieval serves it.
Period synthesis checks its generated text against the blacklist before embedding or
writing, and binds the native commit to that checked policy.

## Rollout

Stop and drain older APIs, workers and command-line writers before applying the additive
ClickHouse and Postgres migrations. Finish pending versioned deletion checks before
the drain. Without a checked-state hash, recovery closes a check that would need
a missing tombstone without deleting the fact; retry the deletion to check its current state.
Keep writes paused until every publisher enforces the
consent rules. If an older writer ran alongside a migrated store, keep traffic paused
until the affected deletion and erasure scopes have been verified again; a migration does
not certify writes admitted by the older build. Existing rows removed before policy recording was
introduced have no reconstructed consent record. Operators needing a historical guarantee
must establish the intended refusals from their deletion records before resuming intake.
Rolling back restores the earlier admission behavior. Audit records use their separate
retention policy and do not inherit namespace deletion windows.
