Files
zeekayandHanzo Dev e0c8182042 store: shards may keep their rows on a shared SQL server
TASKSD_STORE=sql keeps every shard's rows in one table, tasks_kv, on the
hanzoai/sql server TASKSD_SQL_ADDR names (its ZAP listener), so a process running
the engine keeps nothing on disk and any process can take its place. A shard is
(principal, ns), the same value it always was; its rows are a fileKV in its own
SQLite file or an sqlKV in the table, behind one rows interface. Keys are bytea
compared as bytes, so a scan walks keys in exactly a shard file's order whatever
the server's collation; each value is sealed (AES-256-GCM) under the key a shard
file of the same tenant and namespace derives from the master, bound to its shard
and key, so the server holds only ciphertext. A shared store refuses to open
without a master key.

Copy moves every shard from one manager to another a page at a time, leaves the
destination holding the source's rows and no others, and proves each shard by
count and a SHA-256 over its rows in key order. SQLite stays the default; nothing
changes for a deployment that sets nothing.

Proved against a hanzoai/sql test server: scans equal a file shard's for UTF-8,
DEL and prefix-boundary keys; the server holds no plaintext; a crashed engine
recovers a workflow mid-activity from the table into a fresh data directory, the
activity running exactly once.

Co-authored-by: Hanzo Dev <[email protected]>
2026-10-03 19:03:47 -07:00
..