Expand description
The component inside Kimün that owns every dealing with the RAG server:
connection/capability probing, pushing note changes, and hash-diff
reconciliation (see CONTEXT.md, “Server client”). Core stays network-free;
it feeds this module only through the observer seam, which reports a
path, a content hash and upsert-or-delete, and knows nothing of RAG.
Published as the kimun_server_client crate until kimun-notes went to
crates.io — which forced every path dependency of a published crate to be
published too, and this one was on crates.io for no reason of its own. Like
the ropetext module it stays self-contained, so it can go back out if a
second consumer (a GUI) ever wants it: nothing here may name crate::
outside crate::server_client::, checked in CI. kimun_core is the one
kimün dependency it keeps, and it would keep that as a crate too.
Re-exports§
pub use dto::ChunkResult;pub use dto::WireSection;pub use observer::DirtyOp;pub use observer::DirtySet;pub use observer::RagObserver;pub use reconcile::ReconcilePlan;pub use reconcile::diff as reconcile_diff;
Modules§
- dto
- Wire types mirroring the RAG server’s JSON. Defined here (not shared with the server crate) so the client stays independent of the server build.
- observer
- The
IndexObserverthe client registers on the vault, and the dirty-set it feeds. The dirty-set is deliberately best-effort in-memory: a lost entry costs a reconciliation pass, not a lost update. - reconcile
- Hash-diff reconciliation: the correctness backbone. Given the
vault’s authoritative
{note-path → hash}and the server’s, compute exactly which notes to push and which to delete so the two agree. - sync
- Orchestration: turn observed changes and the vault’s authoritative state into
server pushes/deletes.
RagSyncwires the observer;drainflushes the dirty-set (the fast path);reconcileis the correctness backbone. All server I/O goes throughRagTransport, so this logic is tested with a fake against a real vault.
Structs§
- RagClient
- HTTP client for one vault’s collection on a RAG server.
Enums§
- Context
Size - Number of results to request. Maps to the server’s
context_sizevariants, so a caller can’t send an invalid string (which the server rejects with 400). - RagError
Traits§
- RagTransport
- The subset of server operations the sync orchestration depends on, behind a
trait so it can be exercised with a fake in tests.
RagClientis the real implementation.
Functions§
- hash_
string - The single place a note’s content hash is turned into its wire/reconcile
string. Both the pushed
WireDoc::hashand the reconcilelocalhash set MUST go through this — string equality inreconcile::diffonly holds if the two are byte-identical.