Expand description
Embedded edition composition root (ADR-013): wires the application services over the local store with synchronous in-process projection, and resolves the data directory per the ADR-012 contract and the storage engine per ADR-018. No transport, no infrastructure clients.
Structs§
- Embedded
Kernel - One opened embedded kernel: the composed service plus the store handle for operational tooling (replay, stats, compaction).
- Embedded
Kernel Store - Every kernel persistence port on one local store.
- Store
Migration Receipt - What a migration did, kept in the store it produced.
Enums§
- Resolved
Data Dir - Where the data directory came from — logged at startup so the winning resolution rule is always visible.
- Storage
Engine - The engine behind a data directory’s
store/. Chosen once, when the directory is created; recorded as itsFORMAT_VERSION; never guessed.
Constants§
- DATA_
DIR_ ENV - Explicit data directory override (ADR-012 rule 1).
- ENGINE_
ENV - Explicit engine override for a fresh data directory. Without it, the user-facing binary chooses SQLite when compiled and redb otherwise; existing directories always open from their stamp.
- PROJECT_
BUNDLE_ PATH - Where a project keeps the committed copy of its memory, relative to the project root.
- SUPPORTED_
FORMAT_ VERSION - The layout this binary creates for a fresh data directory, and the one it has always created: redb (ADR-009).
Functions§
- default_
engine_ for_ data_ dir - Implicit engine choice for a data directory when no operator override is present. Existing stores defer to their stamp; fresh stores prefer the shareable engine when this build carries it.
- ensure_
data_ dir_ skeleton - Creates the non-store part of a KMP data directory.
- migrate_
data_ dir - Migrates
source_dirintodestination_dir, returning what was moved. The destination is created with the default engine. - migrate_
data_ dir_ to migrate_data_dirwith the destination engine chosen — how a store changes engines (ADR-018). A redb store becomes a SQLite one that two agent hosts can share by replaying its history into a fresh directory; the source stays as it was and the receipt records both layouts.- open_
or_ migrate_ data_ dir - Migrate once, reopen afterwards. Safe on every start: a destination that already holds a store is opened as it is, and the returned receipt says whether this call was the one that migrated it.
- parse_
engine - Parses an engine name the way the environment variable and the CLI spell
it. Pure, for testing;
resolve_engine_from_envfeeds it. - project_
bundle_ path - The conventional bundle path for the project
data_dirbelongs to. - resolve_
data_ dir - ADR-012 resolution: env override > project
.kernel/> per-user default. Pure function for testability;resolve_data_dir_from_envfeeds it from the process environment. - resolve_
data_ dir_ from_ env - Resolves from the process environment and prepares the directory. Every data directory gets the same safety skeleton, regardless of whether it was discovered from a project, supplied explicitly, or created by migration.
- resolve_
engine_ for_ data_ dir_ from_ env - Resolves the engine for a particular data directory.
- resolve_
engine_ from_ env - The engine
KMP_MCP_ENGINEasks for, if it is set. Unset or empty means “no preference”: a fresh directory gets the default, an existing one opens as it is.
Type Aliases§
- Embedded
Memory Service - The KMP memory facade composed over the embedded store: every port is the
same single-file redb store, and ingest projects synchronously in-process,
which is what makes
read_after_write_readyunconditionally true.