Add Babashka migration plan document#40
Closed
theronic wants to merge 5 commits intoqwibitai:mainfrom
Closed
Conversation
Document complete analysis of NanoClaw TypeScript codebase with: - All data structures and interfaces mapped to Malli schemas - Complete function signatures for all modules - Library mapping (TypeScript → Babashka equivalents) - Hybrid architecture recommendation (Babashka + nbb for WhatsApp) - 6-week phased migration strategy - Risk assessment and mitigation strategies Key findings: - WhatsApp connectivity requires nbb bridge (no native Clojure lib) - SQLite, process mgmt, file watching have direct Babashka equivalents - Container agent can remain TypeScript (Claude Agent SDK is Node-native) https://claude.ai/code/session_019xrFcqksNc7AgjXwG7ytn1
Major simplification of the migration strategy: - Replace WhatsApp/Baileys with Telegram Bot API - Remove hybrid architecture (no nbb/Node.js bridge needed) - Pure Babashka implementation using babashka.http-client - Reduced timeline from 6-8 weeks to 4 weeks (~50% faster) Key benefits of Telegram: - HTTP/JSON API (no WebSocket protocol complexity) - Works natively with Babashka's built-in HTTP client - Long polling for updates (no webhooks required) - Simple bot token auth (no QR code scanning) Added: - Full Telegram client implementation in Clojure - API comparison table (WhatsApp vs Telegram) - Updated risk assessment (eliminated several high risks) - Revised file structure (no whatsapp_bridge.cljs) https://claude.ai/code/session_019xrFcqksNc7AgjXwG7ytn1
Major architectural change from Babashka to JVM Clojure: Key benefits: - nREPL server: Agent can modify running system via eval - clojure-mcp: Agent can register new tools at runtime - Full library access: core.async, next.jdbc, chime, hawk - Self-evolving system: Bot can improve its own code New capabilities: - Agent connects to host nREPL from container - Runtime tool registration via clojure-mcp - Hot code reload without restart - Persisted modifications survive restarts Updated libraries: - clj-http (not babashka.http-client) - next.jdbc + SQLite JDBC (not pod) - hawk for file watching (not fswatcher pod) - chime for scheduling (full cron support) - nrepl + cider-nrepl for REPL server Added Appendix D with self-modification examples showing how the agent can add command handlers, modify config, and register new MCP tools at runtime. Timeline: 5 weeks (includes self-modification phase) https://claude.ai/code/session_019xrFcqksNc7AgjXwG7ytn1
Named after Futamura projections - self-application of interpreters.
Key architectural changes:
- Tura (JVM Clojure + nREPL) runs in container for sandboxing
- Thin host launcher (~100 lines Babashka) spawns containers
- Apple Container doesn't support nested containers, so:
- Tura writes spawn requests to IPC directory
- Host launcher watches IPC and spawns agent containers
- socat relay enables container-to-container nREPL
(macOS 15 blocks direct container networking)
Container communication:
- Agent connects to 192.168.64.1:7888 (host gateway)
- socat relays to Tura's nREPL at 192.168.64.2:7888
- macOS 26 (Tahoe) will support direct container networking
Added:
- Phase 0: Thin launcher implementation
- launcher.clj example code
- Updated file structure with spawn/ IPC directory
- Container communication flow diagram
https://claude.ai/code/session_019xrFcqksNc7AgjXwG7ytn1
Architecture changes: - braaimaster: JVM Clojure host orchestrator with pre-warmed braaier pool - tong master: Containerized JVM Clojure with nREPL + clojure-mcp - braaiers: JVM Clojure sub-agents claimed from pool (~100ms startup) Key features: - Git-based tool evolution (braaiers clone, propose PRs, tong master reviews) - Pre-warmed JVM pool solves startup time (pool claim vs cold start) - Checkpoint/rollback system for tool repo safety - Full clojure-mcp support for all agents Naming: project=braainet, tools=tongs, tools repo=tong rack https://claude.ai/code/session_019xrFcqksNc7AgjXwG7ytn1
kenansun-dev-bot Bot
pushed a commit
to kenansun-dev/nanoclaw-github-copilot
that referenced
this pull request
Apr 12, 2026
Direct mode: nanoclaw pair tg:123 --name kenan --main Interactive mode: nanoclaw pair (prompts for JID, name, main) Auto-detects channel from JID prefix. Writes to nanoclaw.json. 336/336 tests pass. Co-authored-by: Kenan Rpi5 Claw <rpi5-claw@nanoclaw.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
oops accidental upstream push