symfonic.memory.backends.postgres_staged_fence¶
postgres_staged_fence ¶
Durable database fence for receipt-claimed pending rows.
A receipt-written row carries its selected claim in the same statement that
marks it pending. Until the exact selected publication runs, no UPDATE may
take such a row out of pending, change its claim, or move it, whichever code
path issues the statement: generic flush, reconciliation, graph-only publish,
or a raw backend update_node. The receipt publisher authorizes exactly one
claim at a time with a transaction-local setting before its UPDATE. Any
session can set that setting, so the fence guards framework code paths, not a
hostile writer; postgres_staged_roles is the opt-in database authority.
DELETE stays allowed, so privacy erasure is never blocked; an erased staged
row simply makes activation refuse.
The trigger is installed by the opt-in staged journal schema. Generic pending selectors exclude claimed rows independently, so they skip instead of failing.
authorize
async
¶
claimed_pending ¶
A receipt-claimed row that its selected publication has not released.
refuse_claimed ¶
Generic descendant lifecycle fails closed over any claimed pending row.
Source code in src/symfonic/memory/backends/postgres_staged_fence.py
require_installed
async
¶
Refuse staged work on a database whose fence is absent or disabled.
Source code in src/symfonic/memory/backends/postgres_staged_fence.py
without_claimed ¶
Hide claimed pending rows from one node-returning read result.