Expand description
Orchestration: turn observed changes and the vault’s authoritative state into
server pushes/deletes. RagSync wires the observer; drain flushes the
dirty-set (the fast path); reconcile is the correctness backbone.
All server I/O goes through RagTransport, so this logic is
tested with a fake against a real vault.
Structs§
- RagSync
- Bundles a vault, its dirty-set, and the server client, and drives sync. The
caller (the TUI) owns the schedule:
probeto gate features, and calltickperiodically to keep the server in step. - Server
Probe - One
/healthround-trip’s worth of facts: what the server can do, and whether it gates its API behind a bearer token./healthitself is un-gated, so a client with a missing/wrong token still probes fine —auth_requiredlets it report “unauthorized” up front instead of discovering a 401 on the first sync call.
Enums§
- Server
Capability - What a reachable server can do, derived from
/health: search needs an embedder, question-answering needs an embedder AND an LLM.
Functions§
- build_
doc - Builds the wire document for a note: its canonical path, content hash, and
heading sections pulled from the index. Returns
Nonewhen the note has no indexable sections — an empty note is not RAG content, so it is never pushed (this keeps both backends from perpetually re-pushing chunkless notes, since only one of them records a hash for them server-side). - drain
- Flushes the dirty-set to the server. Failed operations are re-queued so the next drain (or a reconcile) retries them.
- reconcile
- Reconciles the server with the vault: diff hash sets, then push/delete only the differences. Self-healing — repairs anything the drain path missed.