Skip to main content

assert_captured_db_anchor_consistent

Function assert_captured_db_anchor_consistent 

Source
pub fn assert_captured_db_anchor_consistent(
    resolved_db_path: Option<&Path>,
    db_anchor: Option<&Path>,
) -> Result<()>
Expand description

Assert that a resolved db_path: which compute_config_id folds into a process’s config_id: agrees with the database anchor captured from the same --db/KHIVE_DB input at the construction boundary.

Guards against a construction path recomputing db_path independently of resolve_db_anchor: left unchecked, that would silently desync config_id from a daemon or peer sharing the same database instead of failing loud. The caller passes the captured anchor so validation never re-reads mutable process environment. Inert (Ok(())) when the anchor itself is None (the :memory: sentinel) since there is nothing to compare against.