Store documents as Automerge state

This commit is contained in:
Eric Wendland 2026-05-22 14:54:00 +02:00
commit b01da7be4b
9 changed files with 490 additions and 73 deletions

View file

@ -209,15 +209,16 @@ live-sync loop runs the same KV sync for local KV stores and known peers.
Private value encryption should use resource secret epochs before payloads are
exposed to remote peers.
`geth-document` currently registers local document resources and stores
validated JSON state in the local SQLite metadata store through
`document create/status/set/get`. This is a bootstrap editing surface, not yet
Automerge CRDT state. `geth document sync <node-id> <name>` can pull remote JSON
state over the protected Iroh control ALPN when the peer grants `document.read`
on `resource:document:<name>`. The daemon background live-sync loop runs the same
sync for local documents and known peers using per-peer/per-document cursors.
The import rule is last-writer-wins by document timestamp. Automerge state
encoding and sync are future work.
`geth-document` registers local document resources and stores durable Automerge
save bytes in the local SQLite metadata store. The CLI still accepts and returns
validated JSON views for `document create/status/set/get`, but the persisted
state is an Automerge envelope containing binary save data plus the current JSON
view for operator output. `geth document sync <node-id> <name>` pulls remote
Automerge state over the protected Iroh control ALPN when the peer grants
`document.read` on `resource:document:<name>`. The daemon background live-sync
loop runs the same sync for local documents and known peers using
per-peer/per-document cursors. Received Automerge documents are merged before
being stored.
`geth-pubsub` currently supports local publish/subscribe snapshots through the
daemon control protocol. Messages live in a bounded in-memory ring buffer and