huskies: merge 490_story_crdt_state_layer_backed_by_sqlite

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>
This commit is contained in:
dave
2026-04-07 16:12:19 +00:00
parent c621bca7b1
commit c73153dd4e
8 changed files with 1990 additions and 69 deletions
@@ -0,0 +1,14 @@
-- 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
);