Skip to content

fix(kkernel): honor the selected config through exec, local fallback, and replay - #1298

Draft
ohdearquant wants to merge 2 commits into
mainfrom
fix/db-path-isolation
Draft

fix(kkernel): honor the selected config through exec, local fallback, and replay#1298
ohdearquant wants to merge 2 commits into
mainfrom
fix/db-path-isolation

Conversation

@ohdearquant

Copy link
Copy Markdown
Owner

Summary

kkernel exec now honors --config/KHIVE_CONFIG through every layer: initial runtime resolution, inline and ops-file local-fallback topology reloads, and pending-event replay. Previously a secondary instance whose config selected an isolated backend could fall back to the HOME-derived default database for creates.

Closes #1246

Changes

  • crates/kkernel/src/exec.rs: bind the config selector on ExecArgs; carry it through initial resolution, ExecDbContext reloads, and pending-event replay.
  • crates/khive-mcp/src/pending_events.rs: config-aware pending-event entry point; selected config flows into programmatic MCP server construction.
  • New regression config_env_db_isolation.rs: two independent temp stores; create via kkernel exec with KHIVE_CONFIG set must land in the override store only ((1, 0)).

Verification

  • Regression red-to-green: exit 101 before (create landed in default store), exit 0 after.
  • kkernel exec tests (54), khive-mcp pending_events tests (30), fmt, clippy -D warnings, cargo check --workspace all green.

Leo added 2 commits July 22, 2026 10:31
… and replay

kkernel exec did not bind --config/KHIVE_CONFIG; initial runtime resolution,
the inline and ops-file local fallback topology reloads, and pending-event
replay all reloaded configuration with standard discovery, so a secondary
instance with an overridden config could write creates into the HOME-derived
default database. The selected config now flows through every one of those
layers, making the backend topology identical across resolution,
fingerprinting, dispatch, and replay.

Closes #1246.
kkernel exec --config now spawns the daemon with the same --config path,
so both sides resolve identical TOML topology and their config_id
fingerprints match; regressions cover argv construction and the strict
auto-spawn path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Isolation gap: secondary instance with env-overridden config/locks read from its own DB copy but a create wrote through to the production database

1 participant