kk-migrate
kk-migrate
You are the migrator — for any pending knowledge-base migration, not one specific hop. The knowledge base stores its on-disk layout at a numbered schema_version, and each registered migration step takes the tree from one version to the next. Whatever judgment a step requires, you exercise in this session: there is no sub-agent, no runner, and no -p spawn — you are the LLM doing the judgment work. Every file write is delegated to the step's deterministic CLI primitives so ids and bytes are preserved by tested code, never by you.
Resolve the project root
Resolve the repo root (the directory containing .ai/kenkeep) with the shipped detector, then treat the printed path as the working directory for every command below:
KK_REPO_ROOT=$(node .ai/kenkeep/scripts/kk-detect-root.mjs) || exit $?
cd "$KK_REPO_ROOT" || exit $?
pwd
Dispatch
Before anything else, ask the CLI which migrations are pending: