c73153dd4e
CRDT state layer backed by SQLite for pipeline state. Integrates the BFT JSON CRDT crate with SQLite persistence via sqlx. Ops are persisted and replayed on startup. Node identity via Ed25519 keypair. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
15 lines
514 B
SQL
15 lines
514 B
SQL
-- Stores serialized CRDT SignedOps for pipeline state persistence.
|
|
-- On startup, all ops are replayed in sequence order to reconstruct the CRDT document.
|
|
CREATE TABLE IF NOT EXISTS crdt_ops (
|
|
op_id TEXT PRIMARY KEY,
|
|
seq INTEGER NOT NULL,
|
|
op_json TEXT NOT NULL,
|
|
created_at TEXT NOT NULL
|
|
);
|
|
|
|
-- Stores the node keypair seed so the same identity survives restarts.
|
|
CREATE TABLE IF NOT EXISTS crdt_node_identity (
|
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
seed BLOB NOT NULL
|
|
);
|