feat: always-on remote node — MCP over HTTP, TLS/token, Docker, CI, sqlc #9

Merged
david merged 14 commits from feat/remote-node into main 2026-11-05 02:14:34 +00:00
Showing only changes of commit 906712cf9a - Show all commits
+10 -11
View File
@@ -854,20 +854,19 @@ func (w *Watcher) extractSnippets() {
// syncGossip runs one anti-entropy sweep against configured peers and rebuilds
// derived state if anything new arrived.
func (w *Watcher) syncGossip() {
peers := PeerAddrs()
if len(peers) == 0 {
return
// Taken before the peer check: a replica with no seed peers still receives
// pushes, and that is the only thing that ever changes its log. Returning
// early on an empty peer list would leave its entries cache empty forever.
pushedIn := w.pendingReconcile.Swap(false)
pulled := 0
if peers := PeerAddrs(); len(peers) > 0 {
pulled = Run(w.knoxDB, w.metrics, peers)
}
pulled := Run(w.knoxDB, w.metrics, peers)
// A pull only appends to the observation log; the entries cache and
// auto-threads are derived state that reconcile rebuilds. Comparing entry
// counts can never trigger this (pushes/pulls never touch entries directly),
// so reconcile fires on the sweep's newly-inserted observation count.
// Reconcile when this sweep changed the log, in either direction: a pull
// inserts rows here, a peer's push inserted them in the HTTP handler.
pushedIn := w.pendingReconcile.Swap(false)
// inserts rows here, a peer's push inserted them in the HTTP handler. The
// entries cache and auto-threads are derived state that reconcile rebuilds.
if pulled > 0 || pushedIn {
created, linked, err := Reconcile(w.knoxDB)
if err != nil {