pub trait Pack {
const NAME: &'static str;
const NOTE_KINDS: &'static [&'static str];
const ENTITY_KINDS: &'static [&'static str];
const HANDLERS: &'static [HandlerDef];
const EDGE_RULES: &'static [EdgeEndpointRule] = _;
const REQUIRES: &'static [&'static str] = _;
const NOTE_KIND_SPECS: &'static [NoteKindSpec] = _;
const SCHEMA_PLAN: Option<PackSchemaPlan> = None;
const VALIDATION_RULES: &'static [&'static str] = _;
}Expand description
A composable module that contributes vocabulary, verbs, and edge endpoint rules to the khive runtime.
Packs declare what entity kinds, note kinds, and verbs they introduce, and
optionally extend the per-relation endpoint contract via EDGE_RULES.
The runtime merges vocabularies from all loaded packs and rejects
unregistered kinds at the service boundary.
The closed EdgeRelation enum (ADR-021) is not extensible — only its
per-relation endpoint contract is (ADR-031).
Required Associated Constants§
Sourceconst NOTE_KINDS: &'static [&'static str]
const NOTE_KINDS: &'static [&'static str]
Note kinds this pack contributes to the runtime vocabulary.
Sourceconst ENTITY_KINDS: &'static [&'static str]
const ENTITY_KINDS: &'static [&'static str]
Entity kinds this pack contributes to the runtime vocabulary.
Sourceconst HANDLERS: &'static [HandlerDef]
const HANDLERS: &'static [HandlerDef]
Handlers this pack registers (ADR-023).
The runtime routes verb calls to the pack that declares them.
Only entries with visibility: Visibility::Verb are surfaced on the
MCP wire; Visibility::Subhandler entries are internal.
Provided Associated Constants§
Sourceconst EDGE_RULES: &'static [EdgeEndpointRule] = _
const EDGE_RULES: &'static [EdgeEndpointRule] = _
Additional edge endpoint rules this pack contributes (ADR-031).
Defaults to empty — packs that introduce no new endpoint pairs (or only rely on the ADR-002 base contract) can ignore this.
Sourceconst REQUIRES: &'static [&'static str] = _
const REQUIRES: &'static [&'static str] = _
Other pack names whose vocabulary this pack references (ADR-037).
The runtime checks that every name in REQUIRES appears in the
loaded pack set before any pack is registered. Defaults to empty
so existing packs compile without changes.
Sourceconst NOTE_KIND_SPECS: &'static [NoteKindSpec] = _
const NOTE_KIND_SPECS: &'static [NoteKindSpec] = _
Lifecycle and schema specs for note kinds this pack owns (ADR-004).
Packs that introduce note kinds with explicit lifecycle semantics
(e.g. GTD’s task kind) declare the spec here. The runtime collects
these at boot time for introspection and future enforcement. Defaults
to empty so existing packs compile without changes.
Sourceconst SCHEMA_PLAN: Option<PackSchemaPlan> = None
const SCHEMA_PLAN: Option<PackSchemaPlan> = None
Pack-auxiliary schema plan (ADR-019).
Packs that need their own auxiliary tables (e.g. GTD’s
gtd_lifecycle_audit) declare idempotent DDL statements here.
The runtime applies them once at registration time. Defaults to
None so packs with no auxiliary schema cost nothing.
Sourceconst VALIDATION_RULES: &'static [&'static str] = _
const VALIDATION_RULES: &'static [&'static str] = _
Validation rule IDs contributed by this pack (ADR-034).
Rule IDs are namespaced by pack name: <pack-name>/<rule-id>.
The runtime merges rule IDs from all packs; the actual rule
implementations live in khive-runtime::validation::ValidationRule
(not in khive-types, which stays no_std). This const serves as
the declarative catalog of rule identifiers so the validation
infrastructure can enumerate what rules a pack claims without
loading the runtime.
Defaults to empty — packs with no domain-specific validation rules can leave this unset.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".