Skip to Content

hardDeleteDecayedOp

hardDeleteDecayedOp(ctx: VaultMemoryOperationsContext, id: string, opts: object): Promise<boolean>

Defined in: src/lib/db/memoryVault/operations.ts:2450 

Hard-delete a memory ONLY if it is still archived and still past the delete window (PR2 decay terminal transition). Unlike the generic deleteVaultMemoryOp, this re-reads archived_at INSIDE the writer and bails if the row was restored (archived_at → null) or re-archived more recently since the sweep’s candidate scan. This is the restore-vs-delete mutual-exclusion guard: a user hitting Restore between the scan and this write must win, so their just-rescued memory is never permanently lost.

Parameters

ParameterType

ctx

VaultMemoryOperationsContext

id

string

opts

object

opts.hardDeleteWindowMs

number

opts.now?

number

Returns

Promise<boolean>

true if this call hard-deleted the row; false if it was stale (deleted / not owned / no longer archived / no longer past the window).

Last updated on