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 24d28c4cc5 - Show all commits
+11 -6
View File
@@ -233,16 +233,21 @@ func (w *Watcher) Start() error {
snippetTicker := time.NewTicker(snippetInterval)
gossipTicker := time.NewTicker(gossipInterval)
// A node that only replicates peers (a server with none of the local
// sources) skips the ingest/derive tickers entirely. Nil channels block
// forever, so the select simply never fires for them.
var browserC, giteaC, gitC, opencodeC, karakeepC, healthC, threadC, snippetC <-chan time.Time
// Derivation always runs. Threads and snippets are computed from rows that
// are already in the log, so a replica needs them exactly as much as the
// origin does — gating them with the ingesters left a replica with an
// almost empty thread list while the data sat right there.
threadC, snippetC := threadTicker.C, snippetTicker.C
// Ingestion only runs where the sources exist. A node with no local
// sources (KNOX_LOCAL_SOURCES=none) leaves these nil: nil channels block
// forever, so the select never fires for them.
var browserC, giteaC, gitC, opencodeC, karakeepC, healthC <-chan time.Time
if LocalSourcesEnabled() {
browserC, giteaC, gitC = browserTicker.C, giteaTicker.C, gitTicker.C
opencodeC, karakeepC, healthC = opencodeTicker.C, karakeepTicker.C, healthTicker.C
threadC, snippetC = threadTicker.C, snippetTicker.C
} else {
log.Printf("[knox] KNOX_LOCAL_SOURCES=none: gossip-only mode, local ingest disabled")
log.Printf("[knox] KNOX_LOCAL_SOURCES=none: local ingest disabled, derivation still active")
}
var browserRunning, giteaRunning, gitRunning, threadRunning, gossipRunning atomic.Bool
var opencodeRunning, karakeepRunning, healthRunning, snippetRunning atomic.Bool