1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! kkernel — khive admin/management library.
// `pending_events` (the scheduled-event drain) now lives in `khive-mcp`
// (`khive_mcp::pending_events`), not here — the daemon-resident tick (ADR-106)
// needs to call it from `khive-mcp::serve`, which cannot depend back on
// `kkernel`. `kkernel exec --pending-events` (`exec.rs`) calls the moved
// module directly.
// Force the pack crates into the binary so their `inventory::submit!` blocks
// run at startup. Cargo deps alone are not enough — the linker drops
// crates whose symbols aren't referenced, and `inventory` registration is one
// such dropped symbol. The simplest way to keep them is to reference a marker
// type that the binary sees. We don't expose these in the public API; the
// `#[allow(unused_imports)]` makes the intent explicit.
//
// To add a new first-party pack: (1) add its crate as a `[dependency]` in
// `kkernel/Cargo.toml`, (2) add a `use` line below referencing any public type
// — this is the force-link anchor that prevents linker dead-stripping.
// Test-only: force-link `khive-pack-template` (a dev-dependency) so its
// `inventory::submit!` registration is visible to this crate's test binary —
// tests that need a second, non-`kg` pack (for registry/taxonomy variety,
// multi-backend routing, etc.) dispatch through `template.my_verb` / the
// `template_note` note kind instead of a removed pack.