-
Notifications
You must be signed in to change notification settings - Fork 1
Advanced k1s Development
This page is for developers working on WorkerBee and k1s together.
The common sibling layout is:
git/
k1s/
k1s-workerbee/
k1s-workerbee.wiki/
WorkerBee prefers the installed k1s-workerbee-runtime package. For source
development it can use a sibling k1s checkout:
export WORKERBEE_K1S_ROOT="$PWD/../k1s"
workerbee doctorIf the sibling checkout is on a development branch, keep the WorkerBee project name explicit or rely on the derived branch-scoped name so multiple branches can coexist.
From k1s-workerbee:
nix develop
python -m pip install -e ".[dev]"
workerbee doctorWhen rebuilding WorkerBee packages against a sibling k1s checkout and restarting the normal background MCP daemon, use:
workerbee mcp stop
scripts/build_wheelhouse.sh --k1s-root ../k1s --out dist/workerbee-wheelhouse
uv pip install --python .venv -e '.[dev]' --find-links dist/workerbee-wheelhouse --force-reinstall
sudo -v && workerbee mcp startThis keeps the old MCP process from serving stale code, refreshes the editable
install against the rebuilt runtime wheelhouse, and gives direct-containerd
sudo-helper a current sudo credential before startup.
Without Nix:
python3.11 -m venv .venv
. .venv/bin/activate
python -m pip install -U pip
python -m pip install -e ".[dev]"
workerbee doctorList profiles:
workerbee --runtime containerd profile listStart a profile against a sibling k1s checkout:
workerbee --runtime containerd profile start \
--profile k1s-dev-min-sqlite \
--k1s-root ../k1s \
--timeout 180Check profile state:
workerbee --runtime containerd profile status \
--profile k1s-dev-min-sqlite \
--k1s-root ../k1sStop and optionally purge:
workerbee --runtime containerd profile stop --k1s-root ../k1s
workerbee --runtime containerd profile stop --k1s-root ../k1s --purgeValidate profile startup:
workerbee --runtime containerd validate \
--scenario k1s-profile \
--profile k1s-dev-min-sqlite \
--k1s-root ../k1sValidate a workload on the profile:
workerbee --runtime containerd validate \
--scenario profile-workload \
--profile k1s-dev-min-sqlite \
--k1s-root ../k1s \
--timeout 240Through MCP, agents can use:
workerbee_v1_profile_listworkerbee_v1_profile_startworkerbee_v1_profile_statusworkerbee_v1_profile_validateworkerbee_v1_profile_workload_statusworkerbee_v1_profile_workload_validate
For the copy/paste validation ladder from a sibling k1s agent shell, including preflight, all-profile startup checks, realtime workload validation, evidence capture, and cleanup, use Direct Containerd k1s Profile Validation.
When the MCP daemon is running, profile dashboards and API shims are published under the project-scoped WorkerBee ingress. Example loopback hosts:
https://k1s.<project>.workerbee.localhost:19443/dashboard
https://k1s-api.<project>.workerbee.localhost:19443/healthz
In LAN mode, the same project hosts use the selected LAN base domain.
For sibling development, keep each active branch in its own worktree and let WorkerBee derive a project name from repo, branch, and path:
git -C ../k1s worktree add ../k1s-dev dev
git -C . worktree add ../k1s-workerbee-dev dev
cd ../k1s-workerbee-dev
export WORKERBEE_K1S_ROOT="$PWD/../k1s-dev"
workerbee mcp restartThis avoids state collisions between branches. Use workerbee projects and the
global dashboard to inspect which project belongs to which branch.
Use workerbee mcp restart for daemon option changes or editable source reloads.
After rebuilding WorkerBee packages or the local k1s runtime wheelhouse, use the
stop, wheelhouse build, force-reinstall, sudo-refresh, and start sequence from
Development Shell.
Focused unit tests:
python -m pytest tests/test_daemon.py tests/test_mcp_daemon.py tests/test_mcp_server.pyStyle:
ruff check .Live runtime tests require a local runtime and should be run deliberately after checking host state and cleanup output.