Feature/goose parity#780
Closed
Flynn013 wants to merge 287 commits into
Closed
Conversation
…s task queue Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/c25c6994-8a21-44ed-81c1-a88cd380c7aa Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…ueue tool instructions Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/c25c6994-8a21-44ed-81c1-a88cd380c7aa Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/c25c6994-8a21-44ed-81c1-a88cd380c7aa Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…AgentTools Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/11cfde60-179f-4cc6-ba4b-0aefeb255b87 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/11cfde60-179f-4cc6-ba4b-0aefeb255b87 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…mpression Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/11cfde60-179f-4cc6-ba4b-0aefeb255b87 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…I toggle Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/ad5a58d5-7898-4a64-b05e-602fd8f608e7 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/ad5a58d5-7898-4a64-b05e-602fd8f608e7 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/7e4053f4-4a86-43d4-9385-7dd8d2c389c2 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/7e4053f4-4a86-43d4-9385-7dd8d2c389c2 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…drawer entry Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/b518f5e8-2112-4c63-a6c1-7bac4b811e09 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…dd Auto-Validator interceptor Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/b518f5e8-2112-4c63-a6c1-7bac4b811e09 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…in auto-validator Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/b518f5e8-2112-4c63-a6c1-7bac4b811e09 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…on-reject in auto-validator Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/81256440-0ef0-4208-ab7b-521506b7b9fb Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…ted_and_deleted Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/81256440-0ef0-4208-ab7b-521506b7b9fb Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…_Diff_Read tools, nav drawer DIFF_BOX Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/20f901fc-fda7-417f-bd4c-527caf3ed11e Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
… optimize terminal buffer Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/20c01e51-5fd0-49e7-ba07-b5c9c9127d54 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/20c01e51-5fd0-49e7-ba07-b5c9c9127d54 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…textualization loop Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/5fb35a6d-d9d2-4b82-9ebb-0e59e88334bd Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…nchedEffect for initAppContext Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/5fb35a6d-d9d2-4b82-9ebb-0e59e88334bd Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/8055fb1d-e5f5-413e-9aac-951020cf23c3 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
… AnnotatedString.Builder API Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/338f7f0a-f636-4fe8-9252-e2c2e336c6ce Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…r and unbounded join after process exit Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/338f7f0a-f636-4fe8-9252-e2c2e336c6ce Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
… and thread joins Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/e5166936-1a3d-4717-b4e5-47b34119e6a1 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…CTRL - Add JitPack repository and terminal-view v0.118.0 dependency - Create TermuxSessionBridge: PTY-backed shell via Termux TerminalSession - Update MstrCtrlScreen to embed TerminalView via AndroidView composable - Fix stderr leak: replace shell-based pkg probe with pure Kotlin file check - Keep TerminalSessionManager for agent tools and pre-flight checks Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/c1054dc3-fb08-4c82-8646-2f0b8c83e4bf Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…s, transcript rows, and TOCTOU Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/c1054dc3-fb08-4c82-8646-2f0b8c83e4bf Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
… SkillBoxScreen with FILE_BOX and MSTR_CTRL tool cards Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/3b67dff4-3b15-4f7f-9f12-18c1444cff72 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…MAND_CENTER split-screen HUD - Add observable editor state (currentFilePath, cursorLine) to FileBoxManager - Add workspaceSyncSnapshot tool returning unified editor+terminal state - Add editorTerminalPipe tool for running current file with auto-detected runtime - Add COMMAND_CENTER OsModule with split-screen FILE_BOX/MSTR_CTRL layout - Update system prompt with new tool descriptions - Update SkillBoxScreen with new built-in tool cards Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/fa8efab4-4428-4608-8b0a-fa1ec663e483 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…aths, fix cursor tracking Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/fa8efab4-4428-4608-8b0a-fa1ec663e483 Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…alSessionClient interface Agent-Logs-Url: https://github.com/Flynn013/CLU-BOX/sessions/9cd0eff2-7108-4eed-81a5-080d029ec4bd Co-authored-by: Flynn013 <77566449+Flynn013@users.noreply.github.com>
…linter god-mode managers, Goose-style governor
Architectural overhaul transforming CLU/BOX into a pure-native,
self-contained Cognitive OS while protecting the LiteRT runtime.
PHASE 1 — Surgical purge
- Deleted: TermuxSessionBridge, NativeShellBridge, TerminalSessionManager,
SharedShellManager, ShellManager, EnvironmentInstaller,
TermuxOutputReceiver, VirtualCommandSkill (8 files).
- Stripped: com.termux.permission.RUN_COMMAND, the TermuxOutputReceiver
receiver block, the dead Termux module hook in settings.gradle.kts,
and the Termux JitPack deps in build.gradle.kts.
PHASE 2 — God-mode managers (data/)
- busybox/BusyBoxBridge.kt — extracts an arm64-v8a BusyBox from APK
assets, runs commands via ProcessBuilder, no PTY, no IPC.
- git/JGitManager.kt — pure-Java Git (clone/pull/branch/commit/
push/reset/status) on top of Eclipse JGit; closes the self-modifying
loop without an external git binary.
- splinter/SplinterAPI.kt — singleton Kotlin facade injected into
Chaquopy; exposes SKILL_BOX, SCDL_BOX, LNK_BOX, FILE_BOX, BRAIN_BOX,
CLN_BOX CRUD to every Python skill.
- python/PythonBridge.kt — initialises Chaquopy and binds Splinter
as a global on the clu_runner module.
- python/clu_runner.py — gains introspect() for dynamic schema
generation and exposes Splinter to user scripts automatically.
PHASE 3 — Goose-style orchestration
- customtasks/agentchat/AgentGovernor.kt — rewritten as a real state
machine (IDLE -> STREAMING_TOKENS -> TOOL_CALL_DETECTED -> EXECUTING_TOOL
-> RESUMING_STREAM); exposes engine routing (CLOUD/LOCAL),
activeTool/phase StateFlows, beginIteration/onToolCallDetected/
onToolResult/onToolError. Backwards-compatible LOCAL/CLOUD constraint
constants preserved.
- customtasks/agentchat/DynamicSchemaGenerator.kt — translates Python
skill files into JSON tool schemas at runtime by introspecting their
inspect.signature output; emits Gemini functionDeclarations or
LiteRT tools envelopes.
PHASE 4 — Moody UI
- Theme.kt / Color.kt already enforce pitch-black + neon-green (kept).
- customtasks/agentchat/ui/ToolExecutionBox.kt — Goose-style collapsible
tool-execution card with monospace args/result/error blocks.
- ui/osmodules/MstrCtrlScreen.kt — pure-native BusyBox terminal panel
(Compose LazyColumn + BasicTextField + BusyBoxBridge.shell), no more
com.termux.view.TerminalView.
COMPATIBILITY
- data/CompatShims.kt resurrects the seven removed types as BusyBox-
backed wrappers so AgentTools, ScdlBoxWorker, GalleryApp, FileBoxScreen,
DiffBoxScreen, SystemSettingsScreen and LogBoxManager all compile
without a single edit.
- SkillRegistry no longer registers VirtualCommandSkill (shell access
flows through ShellExecuteSkill -> BusyBoxBridge).
DEPENDENCIES (build.gradle.kts)
- Added: org.eclipse.jgit:6.7.0.202309050840-r (with httpclient excl.),
slf4j-nop:2.0.9, androidx.work:work-runtime-ktx:2.9.1.
- Removed: com.github.termux.termux-app:terminal-emulator/-view 0.118.1.
- LiteRT, MediaPipe, Chaquopy, OpenID AppAuth — UNCHANGED.
ASSETS
- assets/busybox/README.md documents how to drop a real arm64-v8a
busybox binary into the APK; binary is intentionally not committed.
…ility, LNK_BOX MCP, continuous loop, delegation, pulse UI Phase 2 (BRAIN_BOX hardening): - Add getNeuronById, deleteEpisodicById, updateEpisodicFields DAO methods with hard-coded "WHERE isCore = 0" so the AI can never mutate user-curated CORE memories. Returns rows-affected so SplinterAPI can surface a structured refusal envelope rather than a silent ok. - New SplinterAPI methods: brainBoxStore (forces isCore=false), brainBoxUpdate, brainBoxForget. Each returns a JSON envelope explaining why an operation was refused (id missing vs. CORE-protected). Phase 3 (CLN_BOX runtime resolution): - Add SplinterAPI.clnBoxApply(name) returning the persona's systemPrompt for use by the new DelegationEngine. Phase 4 (LNK_BOX bare-metal MCP): - New data/lnkbox/LnkBoxBridge.kt: Ktor 2.3.x SSE client (CIO engine) for remote MCP servers + Chaquopy stdio bridge running an in-process Python MCP server. Exposes connect/send/close + a SharedFlow<Event> stream. - New python/mcp_stdio_server.py helper that wraps any user module exposing `handle(method, params)` or a `Server` class into a JSON-RPC frame router. - SplinterAPI.lnkBox* now delegates to LnkBoxBridge instead of just storing JSON specs. Phase 5 (continuous loop + delegation): - New customtasks/agentchat/ContinuousAgentDriver.kt: implements the full Goose-style autonomous loop (Stream -> Detect -> Halt -> Execute -> Observe -> Resume) with a 64-hop safety bound. Owns the context window, drives AgentGovernor's state machine, dispatches tools through SkillRegistry, and delegates error-budget bookkeeping to AgentLoopManager. - New customtasks/agentchat/DelegationEngine.kt: spawns persona-bound ContinuousAgentDriver sub-workers (single or fan-out) with per-job timeout, loads systemPrompt from CLN_BOX, returns synthesised output back to the parent's context. Exposed as a CluSkill named `delegate_to`. Phase 6 (UI pulse + build): - ToolExecutionBox now animates the neon-green border opacity (35% <-> 100% on a 900ms triangle wave) while phase == EXECUTING_TOOL, giving the user Goose-style "alive" feedback that the autonomous loop is actively executing. Border thickens 0.5dp during pulse. - build.gradle.kts: add Ktor 2.3.12 (core + cio + sse) for LNK_BOX MCP. WorkManager 2.9.1 + JGit 6.7.0 already present from previous commit. No regressions in protected runtime/* package or model-download workers.
Stage 0 of the Goose-inspired parity epic.
Captures the exact mapping between every Goose Desktop subsystem
(block/goose @ main, Rust + React desktop) and the existing CLU-BOX
module that already provides 80% of its function:
- Goose extensions -> LnkBoxBridge (Ktor SSE + Chaquopy stdio)
+ SkillRegistry (per-tool registry)
- Goose recipes -> CLN_BOX personas extended with parameters,
sub-recipes, and extension allow-lists
- Goose scheduler -> SCDL_BOX (already WorkManager-backed)
- Goose subagent -> DelegationEngine (persona-bound today,
gains a delegateRecipe overload)
- Goose todo -> BRAIN_BOX EPISODIC + new Session.todoMarkdown
- Goose tool perms -> SkillRegistry.dispatch becomes the gate
- Goose providers -> wraps protected LiteRT runtime + new Gemini
streaming provider patterned after the
MaxFlynn13/goose-android reference repo
- Goose sessions -> new Room entity sharing AppDatabase
Reference repo MaxFlynn13/goose-android (Apache-2.0) noted as the
prior-art Android implementation we may borrow patterns from with
attribution. CLU-BOX remains its own product; we keep Splinter,
Python skills, and every BOX subsystem intact.
Adds an explicit 11-stage commit plan, ~6,000 LOC across ~30 new
files, with documented review checkpoints after stages 3, 6, and 10.
No code changes in this commit -- documentation only.
Flynn013
commented
May 3, 2026
Author
Flynn013
left a comment
There was a problem hiding this comment.
Native kotlin Goose parity phase one
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.
No description provided.