Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
1.2 KB
Raw Blame

kind: fix

On Postgres, a database write role that neither owns gbrain's purge and withdrawal ledgers (fact_purges, fact_withdrawals, take_purges, page_purges, page_segment_derivation_purges, page_segment_derivation_purge_pages) nor bypasses row-level security, and holds no policy that lets it read one, now gets a refusal on the writes that ledger's guard checks, where before the guard read the ledger as empty and let the write through: a purged claim, take, page or derivation could be stored again and a withdrawn fact saved active. The refusal is writer_coordinator_required: writer state is unreadable to this database role (P0001, unreadable_state); its hint names the table and the policy to add, and docs/ENGINES.md ("Purge and withdrawal guards") lists the policies a scoped write role needs. The guards stay SECURITY INVOKER: no trigger runs with different rights. The owner, a role that bypasses RLS, a ledger without row-level security and PGLite are unaffected. Where the role running migrations does not own a guard function, the upgrade leaves that function, names it on stderr and finishes; the next migration run by a role that owns it fixes it (#7632, #7659).