Expand description
High-level operations composing storage capabilities into user-facing verbs.
Fault-injection arming uses scoped guards only — see docs/operations.md#fault-injection-arm-migration.
Structs§
- Edge
Stats Counts - The live edge total and its two breakdowns consumed together by
stats. - Entity
Alias Change - A change to an entity’s caller-origin aliases, validated when it is made.
- Entity
Alias Report - What an alias change asked for and did not do.
- Entity
Claim Spec - Inputs for a store-owned entity identity. Unlike ordinary creation, a competing insert must leave the existing row untouched.
- Entity
Create Spec - Fully specified entity creation request — input to
KhiveRuntime::create_many. - Entity
Stats Counts - The entity total and optional type report consumed together by
stats. - Link
Spec - Fully specified edge creation request — input to
KhiveRuntime::build_edgeandKhiveRuntime::link_many. - Note
Create Spec - One note item for
KhiveRuntime::prepare_bulk_note_plan, the note analogue ofEntityCreateSpec. The caller has already run the kind’s own preparation hook, so owner-kind policy such as the memory pack’s creation refusal happens before this point. - Note
Search Hit - A note search result with UUID, salience-weighted RRF score, and display text.
- Note
Search Outcome - Result of
KhiveRuntime::search_notes_outcome: the fused hits — text hits alone when the vector arm failed — plus the vector arm’s error, if any. Mirrorscrate::HybridSearchOutcomefor the note substrate. - Pending
Entity Id - A fresh id for the row a keyed bulk create will write (ADR-221 section 1).
- Post
Commit Degradation - A non-retryable failure after a substrate mutation has committed. Callers can report the committed id/result and this diagnostic together.
- Prefix
Scope - The rows of a pack-owned table that
KhiveRuntime::resolve_prefix_inconsiders. - Query
Result - Result of a GQL/SPARQL query with optional validation warnings.
Enums§
- Conditional
Insert Stage - The post-commit stages a conditional note insert reports in its committed
post_commit_degradedoutcome. The comm ingest decoder accepts a stage only when it is the label of a member ofConditionalInsertStage::ALL, and the insert can record a stage only through this type, so every label the runtime emits is one the decoder accepts. - Edge
Endpoint Kind - A by-ID edge-endpoint substrate kind, including
Edgeitself. - Entity
KeyAdd - Outcome of
KhiveRuntime::add_entity_key. - Keyed
Entity Create - Outcome of
KhiveRuntime::create_keyed_entity_with_post_commit_report. - Keyed
Entity Reload - Outcome of
KhiveRuntime::reload_keyed_entity. - 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.
- ENTITY_
KEY_ ADD_ HELD_ LABEL - Label of the statement that holds an add only while the entity holds the key once the claim has run. It fails when another live entity holds it.
- ENTITY_
KEY_ ADD_ LIVE_ LABEL - Label of the statement that holds an add to an entity that is live, not merged away and of the kind the key is added under.
Functions§
- accepted_
entity_ relations_ for_ entities - Relations accepted for one resolved entity endpoint pair under the full live contract: the base allowlist plus the loaded packs’ additive rules.
- accepted_
pack_ relations_ for_ entities - Relations that a composed pack
EDGE_RULESset accepts for a given(entity_kind, entity_type)endpoint pair, using the EXACT SAMEendpoint_matchessemanticspack_rule_allowsapplies internally (EntityOfKind,EntityOfType,NoteOfKind) — never a re-filtered copy. - allowed_
pairs_ for_ relation_ description - Every endpoint pair the loaded contract admits for
relation, writtensource -> target: the base allowlist’s kind pairs (*= any kind) and the loaded packs’ rules, a typed endpoint askind:entity_type. Pack declarations forannotatesand the special relations are left out for the reasonaccepted_entity_relations_for_entitiesgives. - base_
entity_ endpoint_ rules - Returns the base entity endpoint allowlist.
- base_
entity_ rule_ allows trueif(src_kind, relation, tgt_kind)is in the base entity endpoint allowlist. Pure and DB-free — exposed alongsidebase_entity_endpoint_rulesso 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.- dependency_
kind_ inference_ hint - Explain a dependency qualifier added by inference without changing metadata.
- endpoint_
matches trueifspecmatches the given substrate + kind + entity_type triple.- entity_
carries_ create_ payload - Whether
holdercarries the payloadspecasks for, as a keyed create compares them. - entity_
key_ add_ plans - The plans that add caller key
keyto entityentity_id, of base kindkindinnamespace, claimed atat(ADR-221 Amendment 1). - entity_
key_ conflict key_conflictfor a keyed create whose key a different payload holds.- entity_
stats_ counts - Count caller-visible live entities through one store. A supported breakdown supplies its own scalar total; only an unavailable report uses legacy counting.
- 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 hyphenatedidcolumn 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 resultingLIKEpattern 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. - keyed_
replay_ assertion_ plan - A plan that writes nothing and holds only while
holderis still the live row it was read as: same id,updated_at,deleted_atand version. - merge_
entry_ metadata - Merge a caller-supplied top-level
dependency_kindparam into an edge’smetadataobject, filling the key only ifmetadatadoesn’t already carry one. This is distinct frommerge_dependency_kindabove (which infers a default from endpoint entity kinds when no explicit value was given at all) — this one folds in an EXPLICITdependency_kindargument the caller passed alongsidemetadata. - same_
create_ payload - Whether two keyed create payloads are the same, as
entity_carries_create_payloadcompares a holder with a request. - uuid_
prefix_ bounds - Return the inclusive lower and exclusive upper bounds for a UUID prefix stored as a canonical lowercase UUID string under SQLite’s BINARY collation.
- validate_
entity_ alias - Validate one caller alias and scan its exact bytes with the secret gate.