feat(v0.18): keisei CLI MVP — exobrain attach/status
Phase 3 of exobrain architecture. Ships the entry-point CLI
that mounts a portable brain (memory + artifacts + manifests +
mcp-server) into an AI client via one command.
MVP scope: 2 subcommands (attach, status), 1 adapter (claude-code).
detach + mount + multi-client deferred to v1.0.
New Rust crate _primitives/_rust/keisei/ — 10 src files + 1 tests
(Constructor Pattern: all files <150 LOC, all fns <=23 LOC).
main.rs (53 LOC) — clap dispatch
error.rs (36 LOC) — thiserror enum (BrainNotFound,
UnsupportedSchema, NoClientDetected, Io/Toml/Json #[from])
brain.rs (103 LOC) — Brain::load() reads brain/manifest.toml
schema_v1 (name, created, paths.{memory,artifacts,manifests,
mcp_server})
adapter.rs (38 LOC) — ClientAdapter trait (detect/attach/
detach/config_path) + registry
adapters/claude_code.rs (121 LOC) — writes MCP server entry
into ~/.claude/settings.json via merge_mcp_entry (23 LOC,
mirrors jq-merge pattern from install/lib-hooks.sh)
attach.rs (44 LOC) — load brain, detect client, call adapter,
write SSoT ~/.claude/keisei-attached.toml
status.rs (62 LOC) — read SSoT, print brain name/path/client/
timestamp + health check (mcp_server binary exists?)
config.rs (97 LOC) — KeiseiAttached TOML struct + KEISEI_HOME
env hook for test isolation
tests/integration.rs (142 LOC) — 5 cases via tempfile + Mutex
env guard: happy-path, missing-manifest, unsupported-schema,
no-attach-state, marker-field verification
Workspace: keisei added to _primitives/_rust/Cargo.toml members.
MANIFEST.toml: [primitive.keisei] rust kind, kei-ledger-style
deps (rusqlite bundled, stub for future artifact reads), added
to full profile (standalone opt-in via --add=keisei).
README Rust crates table gains 1 row; count marker untouched.
CHANGELOG [Unreleased] bullet added.
Usage:
keisei attach /path/to/brain # mounts into current Claude Code
keisei status # shows mounted brain + health
Next (v0.18 follow-ups): detach impl, cursor/continue adapters,
list-adapters subcommand.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>