symfonic.memory.backends.postgres_erase_ownership¶
postgres_erase_ownership ¶
Indexed owner proof for explicit tenant retirement (CORE-426).
Each recursive step is one LIMIT 1 seek past a complete owner key: forty thousand generations at one owner cost one key, not forty thousand rows. An outer limit stops recursion after BUDGET+1 keys; it never sorts or hashes the history. Index probes pin custom and generic plans to those seeks. The first proof holds the lifecycle and EXCLUSIVE graph locks; the permanent job fences all later native writers. SHARE UPDATE EXCLUSIVE locks prevent concurrent DDL from removing the proof's required indexes while it runs.
This bounds logical keys/probes, not physical I/O through dead MVCC entries. The existing forget deadline is still authoritative and fails closed.
auxiliary_gate
async
¶
Refuse stores outside the separately attested bounded auxiliary subset.
Ordinary graph-only forget does not call this retirement-only gate. Empty auxiliary tables also refuse: their writers can recreate state after permanent intent because their retirement fence is not proven. The explicit schema prevents unrelated schemas/search paths from withdrawing the bound graph's retirement admission.
Source code in src/symfonic/memory/backends/postgres_erase_ownership.py
legacy_progress
async
¶
Exact positional root and its complete-level descendants, in two seeks.
Source code in src/symfonic/memory/backends/postgres_erase_ownership.py
owners_sql ¶
Exact production loose-index query; live tests EXPLAIN this SQL.
Source code in src/symfonic/memory/backends/postgres_erase_ownership.py
preflight
async
¶
Refuse all detectable unerasable ownership before permanent intent.
Source code in src/symfonic/memory/backends/postgres_erase_ownership.py
range_sql ¶
A scalar preserves ORDER BY; EXISTS may discard it and scan another index.
Source code in src/symfonic/memory/backends/postgres_erase_ownership.py
require_empty
async
¶
Completion/retry proof uses independent equality and range index seeks.
Source code in src/symfonic/memory/backends/postgres_erase_ownership.py
require_indexes
async
¶
Pin proof tables against DDL, then validate every exact index shape.
Source code in src/symfonic/memory/backends/postgres_erase_ownership.py
vectors_gate
async
¶
Admit only the migrated vector phase with its independent ownership proof.