Expand description
NDJSON-to-SQLite sync library boundary.
Rebuilds the SQLite database from .khive/kg/entities.ndjson and edges.ndjson.
Builds atomically into a .tmp file then renames. Also supports remote archive
fetch with SHA-256 pin verification via run_sync_remote.
Structs§
- Remote
Config - Configuration for a remote KG archive (maps to one entry in
schema.yamlremotes:list). - Remote
Name - A validated remote cache name: a single path segment safe to join under
.khive/kg/remotes/without escaping that directory. - Remote
Sync Report - Summary of a completed remote sync run (F201).
- Sync
Report - Summary of a completed sync run.
Functions§
- run_
sync - Rebuild
db_pathfrom.khive/kg/{entities,edges}.ndjsonunderrepo_root. - run_
sync_ remote - Fetch a remote KG archive, verify SHA-256, populate
.khive/kg/remotes/, writemeta.json. Fail-closed on hash mismatch; userepin=trueto update the pin.