Skip to main content

Module operations

Module operations 

Source
Expand description

High-level operations composing storage capabilities into user-facing verbs.

Structs§

EntityCreateSpec
Fully specified entity creation request — input to KhiveRuntime::create_many.
LinkSpec
Fully specified edge creation request — input to KhiveRuntime::build_edge and KhiveRuntime::link_many.
NoteSearchHit
A note search result with UUID, salience-weighted RRF score, and display text.
QueryResult
Result of a GQL/SPARQL query with optional validation warnings.

Enums§

EdgeEndpointKind
A by-ID edge-endpoint substrate kind, including Edge itself.
Resolved
Result of resolving a UUID to its substrate kind.

Constants§

BASE_ENTITY_ENDPOINT_RULES
Base entity endpoint allowlist — the closed set of permitted entity→entity relation triples.

Functions§

accepted_pack_relations_for_entities
Relations that a composed pack EDGE_RULES set accepts for a given (entity_kind, entity_type) endpoint pair, using the EXACT SAME endpoint_matches semantics pack_rule_allows applies internally (EntityOfKind, EntityOfType, NoteOfKind) — never a re-filtered copy.
base_entity_endpoint_rules
Returns the base entity endpoint allowlist.
base_entity_rule_allows
true if (src_kind, relation, tgt_kind) is in the base entity endpoint allowlist. Pure and DB-free — exposed alongside base_entity_endpoint_rules so offline consumers (e.g. kkernel kg validate) can apply the exact same base-table membership test the live validator uses, instead of re-deriving a parallel .any() predicate over a hand-copied allowlist.
endpoint_matches
true if spec matches the given substrate + kind + entity_type triple.
hex_prefix_to_uuid_pattern
Re-insert hyphens at canonical UUID positions (8-4-4-4-12) into a hyphen-free hex prefix, so a LIKE '<pattern>%' scan against the hyphenated id column matches correctly. Prefixes that already contain a hyphen are passed through unchanged. No-op for len <= 8 (already correct). Input longer than 32 hex chars is NOT truncated: the extra hex chars are appended past the canonical 12-char final segment with no further hyphen, so the resulting LIKE pattern requires literal characters beyond position 36 that no real (36-char) UUID string can ever have — the scan naturally fails closed instead of silently resolving <valid-32-hex><extra-hex> to the valid UUID.
merge_entry_metadata
Merge a caller-supplied top-level dependency_kind param into an edge’s metadata object, filling the key only if metadata doesn’t already carry one. This is distinct from merge_dependency_kind above (which infers a default from endpoint entity kinds when no explicit value was given at all) — this one folds in an EXPLICIT dependency_kind argument the caller passed alongside metadata.