Single-commit clean baseline after security scrub of niche-tells, project codenames, internal jargon, and contributor-email leaks. Contents: - 100 Rust crates (_primitives/_rust/) - 37 agent manifests (_manifests/) + generated specs (_generated/) - 67 user-invocable skills (skills/) - 33 hooks (hooks/) - Composition blocks (_blocks/) - Documentation (docs/, README.md) - TS adapter packages (_ts_packages/) - Assembler (_assembler/) - Roles (_roles/) - Templates (_templates/) - Forgejo CI (.forgejo/) Author: Denis Parfionovich <info@greendragon.info> License: see LICENSE.
6.1 KiB
USB Exobrain — Step-by-Step Test Recipe
Put a KeiSeiKit "brain" on a portable USB drive, mount it into Claude Code (and Cursor / Continue / Zed if installed), verify MCP tools, unplug — verify clean detach.
This top-level document holds prerequisites, the shared filesystem warning, the TOC, and platform-agnostic troubleshooting. Step-by-step walkthroughs live in the three platform sub-documents.
Platform walkthroughs
- macOS walkthrough —
/Volumes/<LABEL>, APFS recommended, Gatekeeper /xattrhandling. - Linux walkthrough —
/media/$USER/<LABEL>, ext4 recommended,umount/ optional systemd-udev auto-attach. - Windows walkthrough — drive letter, NTFS recommended,
Dismount-Volume/ PowerShell.
0. Prerequisites (all platforms)
On the host:
- KeiSeiKit installed:
./install.sh --profile=fullran successfully,cargo test -p keiseishows 32/32 pass (v0.22). keiseiCLI on PATH:ls ~/.claude/agents/_primitives/_rust/target/release/keiseireturns the binary. Symlink into~/.local/bin/or%USERPROFILE%\binas convenient.- At least one supported client installed (Claude Code / Cursor / Continue / Zed) —
keiseiauto-detects all four. - A USB stick or flash card physically attached and mounted by the OS.
On the USB drive:
- Free space: ~500 MB recommended (5 mcp-server binaries × ~90 MB each + room for memory/artifacts SQLite).
- Filesystem — see the warning below.
⚠️ Filesystem warning — exFAT / FAT32 are NOT safe for multi-client attach
SQLite WAL mode (used by kei-memory, kei-artifact, kei-social-store inside a brain) requires a filesystem with reliable shared-memory mmap. exFAT and FAT32 do NOT provide this, and keisei mount (multi-client fan-out) WILL corrupt the memory DBs if the brain lives on one of those filesystems.
Since v0.22 keisei itself prints an advisory on stderr when it detects an exFAT / FAT32 root at load time (via statfs(2) on macOS + Linux; Windows returns Unknown pending GetVolumeInformationW). The warning is non-blocking — single-client keisei attach on exFAT is still a supported path.
- On exFAT / FAT32: use the brain with ONE client at a time (
keisei attach --scope=user). Do NOT runkeisei mount. - For reliable multi-client use, format the stick as APFS (macOS), ext4 (Linux), or NTFS (Windows). exFAT is fine for single-client or read-only cross-platform transport.
- If you already ran
keisei mounton an exFAT brain and see SQLite errors, see "SQLite corruption on mount-attach" in Troubleshooting below.
Brain safety invariants (all platforms)
The following load-time checks fire regardless of OS. They prevent the most common misuse and attack patterns:
- Name regex —
brain.namemust match^[a-z][a-z0-9_-]{0,63}$(lowercase letter start, 1-64 chars, word chars + hyphen). - Relative paths — every
[paths.*]entry must be relative; no absolute paths, no..components. Canonical form must live under the brain root. - Symlink reject — the brain root itself cannot be a symlink. Pass the resolved path; this closes a USB→host pivot surface.
- Manifest size cap —
manifest.tomlis bounded at 64 KiB. - Schema —
schema_version ∈ {1, 2}. v1 uses single-stringmcp_server; v2 uses per-platform map.
Platform-agnostic troubleshooting
"BrainNotFound" on attach
- Check
<BRAIN>/manifest.tomlexists. - Pass an absolute path to
keisei attach, not a relative one.
"PathEscape" on attach
- Every
[paths.*]entry must be relative and resolve inside the brain root. No../, no absolute paths.
"BrainIsSymlink" on attach
- The brain root is a symlink. Pass the resolved path instead —
keiseirefuses symlink roots to prevent accidental host-dir pivot via a crafted USB.
"NoPlatformBinary" on first use
- Your platform's binary isn't in
bin/. Checkstd::env::consts::{OS, ARCH}on your host — the expected filename iskei-mcp-server-<os-renamed>-<arch-renamed>wheremacos→darwin,x86_64→x64,aarch64→arm64.
"NameConflict" on attach
- An MCP server with the same name already exists in the client's config. Either rename your brain (
nameinmanifest.toml) or remove the existing entry manually.
SQLite corruption on mount-attach
kei-memory/kei-artifact/kei-social-storedatabases show "disk image is malformed" or "database is locked" afterkeisei mounton a USB drive.- Root cause: the brain lives on exFAT or FAT32, which don't reliably support SQLite WAL shared-memory mmap. Multi-client attach corrupts the DB.
- Fix:
- Copy the brain dir to an APFS (macOS) / ext4 (Linux) / NTFS (Windows) volume.
- Re-attach via
keisei attach <new-path>orkeisei mount <new-path>. - For single-client use on the same exFAT drive, restrict to
keisei attach --scope=user. Do NOT usekeisei mount.
Filesystem-warning advisory not appearing
keiseiprints the exFAT/FAT32 warning to stderr (not stdout). Shells that redirect stderr away will hide it.- Windows
detect_fs_warningreturnsUnknownin v0.22 — format as NTFS manually.
What this tests end-to-end
- Portable brain — works from a USB drive, no installer needed on the brain itself.
- Per-platform dispatch — schema v2 picks the right binary for the host OS+arch.
- Multi-client fan-out —
keisei mountattaches to every detected client in one call. - Clean detach — zero residue in host configs, preserves unrelated MCP servers.
- Safety gates — path confinement, name regex, symlink rejection, manifest size bound, filesystem-type advisory (v0.22).
- Schema v1 compat — an older v1 brain with a single-string
mcp_serverstill works.
If the walkthrough for your platform passes end-to-end, the v0.22 exobrain is production-ready for single-user workflows on that platform.
For shared-brain scenarios (team members all mounting the same brain over git / S3) see the kei-store backend docs — keisei attach s3://my-bucket/brain/ requires --features s3 at install.