Skip to content

feat(mcp): add 10 advanced analysis tools to InsightMcpContributor#1859

Closed
akapug wants to merge 81 commits intomainfrom
feat/insight-mcp-34-tools
Closed

feat(mcp): add 10 advanced analysis tools to InsightMcpContributor#1859
akapug wants to merge 81 commits intomainfrom
feat/insight-mcp-34-tools

Conversation

@akapug
Copy link
Member

@akapug akapug commented Jan 24, 2026

Draft Powered by Pull Request Badge

Summary

Adds 10 new advanced analysis tools to InsightMcpContributor, bringing the total to 34 MCP tools for AI-native debugging.

New Tools (v3.0)

Tool Description
type-check-runtime Validate values against type annotations at runtime
heap-snapshot Capture memory state - objects, sizes, references
async-trace Track async/await suspension points and coroutine flow
intercept-fetch Mock/intercept network requests at runtime
import-graph Trace module loading order and dependencies
auto-test-gen Generate test cases from traced execution
mutate-and-verify Inject mutations and verify tests catch them
parallel-trace Track concurrent execution and detect race conditions
live-ast Inspect AST nodes at runtime
branch-coverage Track which code branches were taken

Changes

  • packages/cli/src/main/kotlin/elide/tooling/project/agents/InsightMcpContributor.kt: Added 10 new tool definitions with JSON schemas and placeholder implementations

Testing

Tools use the same execution path as existing Insight tools. Full implementations require insight.on() API integration."

Added 10 new tools for v3.0:
- type-check-runtime: Runtime type validation
- heap-snapshot: Memory state capture
- async-trace: Coroutine/await tracking
- intercept-fetch: Network request mocking
- import-graph: Module dependency tracing
- auto-test-gen: Test case generation from traces
- mutate-and-verify: Mutation testing
- parallel-trace: Concurrent execution tracking
- live-ast: Runtime AST inspection
- branch-coverage: Code coverage tracking

Total tools: 34
@akapug akapug requested a review from sgammon as a code owner January 24, 2026 04:04
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b8d87cd8e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +68 to +72
internal class InsightMcpContributor : McpContributor {

override suspend fun enabled(context: McpContributor.McpContext): Boolean =
context.project()?.manifest?.dev?.mcp?.insight != false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Register InsightMcpContributor with ServiceLoader

The new contributor class will never be discovered because McpContributor.all() uses ServiceLoader, but the CLI service registration file (packages/cli/src/main/resources/META-INF/services/elide.tooling.project.mcp.McpContributor) only lists SelfToolMcpContributor. As a result, these tools are never contributed at runtime, so the feature is effectively missing unless the service entry is added for this class.

Useful? React with 👍 / 👎.

Comment on lines 1133 to 1137
return successResult(buildString {
appendLine("=== Execution Result ===")
appendLine("Language: $language")
appendLine("Duration: ${executionMs}ms")
appendLine("Success: ${exception == null}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Surface runtime failures as tool errors

When user code throws (PolyglotException or any Exception), executeCode still returns successResult, so isError remains false and callers cannot programmatically detect failures. This will break workflows that rely on MCP error signaling (e.g., retries or fallbacks), even though the output text says Success: false.

Useful? React with 👍 / 👎.

Comment on lines 1105 to 1109
if (trace) {
// Install basic function tracing via insight
val insightCode = """
var traces = [];
insight.on('enter', function(ctx, frame) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Trace flag never produces traces

When trace is true, the code only builds a string with Insight hooks but never evaluates it in the context, and nothing ever appends to traces. This means tools like run-python, run-javascript, and tracing helpers always return empty traces even when tracing is requested.

Useful? React with 👍 / 👎.

@akapug akapug marked this pull request as draft January 24, 2026 04:20
akapug added 26 commits January 24, 2026 01:02
- Add Source.cached(false) to executeCode and runSelfHealing
- Prevents variable collision between executions
- Aligns with WHIPLASH fix pattern
Replace placeholder implementations with actual Python sys.settrace-based
tracing for all 34 debugging tools:

- traceFunctions: Real function entry/exit tracing with locals capture
- countCalls: Actual call counting with configurable limits
- conditionalTrace: Condition-based tracing with eval()
- inspectLocals: Capture all local variables at specific call
- modifyVar: Runtime variable modification via frame.f_locals
- walkStack: Full call stack with locals at each frame
- lineBreakpoint: Line-based breakpoint with state capture
- statementTrace: Line-by-line statement tracing
- collectErrors: Structured error collection with PolyglotException details
- debugAndFix: Combined conditional trace + variable modification
- typeCheckRuntime: Runtime type annotation checking
- heapSnapshot: Memory state capture with sizes
- importGraph: Track module imports via __import__ hook
- liveAst: Parse and return AST structure
- branchCoverage: Track executed lines for coverage

All tools now return structured JSON with:
- success: boolean
- output: captured stdout
- traces/counts/locals/etc: tool-specific data
- exception: error message if failed
- executionMs: execution time
Rust crate (crates/colide/):
- JNI bindings for bare metal VESA framebuffer
- PS/2 keyboard driver via Intel 8042 controller
- AI inference via llamafile integration
- Conditional compilation for bare-metal vs hosted

Kotlin package (packages/colide/):
- ColideNative: Main entry point with isMetal() detection
- Vesa: putPixel, fillRect, clear for graphics
- Keyboard: getChar, available, getModifiers for input
- Ai: init, complete, shutdown for inference

This enables Elide to call C drivers directly when running
on bare metal via Cosmopolitan, completing the JNI bridge.
- Widget.kt: Base class with position, colors, mouse/key events
- Container.kt: Parent container with focus management, tab navigation
- Window.kt: Draggable window with title bar, close/minimize buttons
- Button.kt: Clickable button with hover/press states
- Label.kt: Text label with alignment options
- TextInput.kt: Single-line input with cursor, placeholder
- Font.kt: Complete 8x16 bitmap font renderer (full ASCII)
- GuiManager.kt: Main loop, window management, mouse cursor
- ColideNative.kt: Add mouseX/mouseY/mouseButtons native methods
- lib.rs/keyboard.rs: Add mouse JNI function implementations
Shell enhancements:
- CommandRegistry: Extensible command system with categories
- AiAssistant: Elide-integrated AI wrapper with conversation history

New GUI widgets:
- Terminal: Shell emulator with scrollback, cursor, command callbacks
- FileBrowser: /zip/ filesystem navigation with file icons
- CodeEditor: Text editor with line numbers, cursor navigation

IDE integration:
- ColideIDE: Full IDE layout combining all components
- File browser → editor integration
- Terminal with command execution
- AI chat mode support

All components compile and integrate with existing GUI system.
FileSystem abstraction:
- FileSystem.kt: Unified API for /zip/ and standard filesystem
- Supports exists, isDirectory, listDirectory, readText, readBytes, writeText
- Falls back to java.io.File in hosted mode

Native JNI bindings (Rust):
- filesystem.rs: file_exists, file_is_dir, file_size, file_read, dir_list
- lib.rs: JNI exports for all FileSystem native methods
- Extern C declarations for bare-metal Cosmopolitan integration

GUI integration:
- FileBrowser: Now uses FileSystem.listDirectory for real contents
- CodeEditor: loadFile/saveFile methods using FileSystem
- ColideIDE: openFile wired to use CodeEditor.loadFile

All components compile and integrate with P6 IDE work.
SyntaxHighlighter:
- Token-based highlighting for Kotlin, JS, Python, Rust, C, JSON, Markdown
- Color theme with dark/light mode support
- Keywords, types, strings, numbers, comments, operators, annotations
- Extension-based language detection

CodeEditor integration:
- Auto-detects language from file extension
- renderHighlightedLine with scroll-aware token rendering
- syntaxHighlightingEnabled toggle
- Catppuccin-inspired color theme

All components compile and integrate with P7 file loading.
UndoManager:
- Edit action types: Insert, Delete, Replace, NewLine, DeleteLine, MergeLine, Batch
- Undo/redo stacks with configurable history limit
- Grouping support for batched edits

CodeEditor enhancements:
- Keyboard shortcuts: Ctrl+Z undo, Ctrl+Y redo, Ctrl+S save, Ctrl+O open
- Ctrl+A select all, Ctrl+D duplicate line
- Ctrl+F toggle search, Ctrl+G find next
- Search with case-insensitive matching
- findNext/findPrevious navigation
- Modifier key tracking (Ctrl/Shift)

All components compile and integrate with P8 syntax highlighting.
Auto-indent:
- Preserves existing indentation on newline
- Adds extra indent after opening brackets ({, (, [)
- Records undo action for newline operations

Bracket auto-close:
- Auto-closes brackets: {}, (), []
- Auto-closes quotes: "", ''
- Skip-over for closing brackets when typed
- Toggle via autoCloseBrackets property

All components compile and integrate with P9 keyboard shortcuts.
- Add StatusBar.kt widget (160 lines):
  - Line/column position indicator
  - Tab size, line ending, encoding display
  - Language mode (right-aligned, extension-based detection)
  - Modified/read-only indicators
  - Catppuccin-style dark theme colors

- Integrate StatusBar into ColideIDE:
  - Positioned between editor and terminal
  - Updates language on file open
  - Updates modified state from editor

Part of Colide OS IDE integration (P11/15)
- Add Dialog.kt (430 lines):
  - Dialog base class with title bar, buttons, modal behavior
  - InputDialog for text input prompts
  - ConfirmDialog for yes/no/cancel confirmations
  - FileDialog for save as / open file selection
  - Catppuccin dark theme styling

- Update GuiManager.kt:
  - Add dialogs list for modal overlay
  - showDialog/removeDialog/hasActiveDialog methods
  - Modal input handling (dialogs receive input first)
  - Dialog rendering on top of windows

- Update ColideIDE.kt:
  - showSaveAsDialog() method
  - showNewFileDialog() method
  - showUnsavedChangesDialog() with save/discard callbacks

Part of Colide OS IDE integration (P12/15)
- Add TabBar.kt (310 lines):
  - Tab data class with id, title, path, modified, closable
  - Tab selection, hover, and close button handling
  - Modified indicator (dot) and close button hover states
  - Overflow scrolling with < > indicators
  - Catppuccin dark theme styling

- Add TabbedEditor.kt (290 lines):
  - Container managing multiple CodeEditors
  - Tab bar integration with file tracking
  - openFile() - opens file in new/existing tab
  - newFile() - creates untitled file
  - saveActiveFile() / saveActiveFileAs()
  - closeTab() with unsaved changes callback
  - closeAllTabs() with recursive save prompts

Part of Colide OS IDE integration (P13/15)
- Add ProjectTree.kt (420 lines):
  - TreeNode data class with expand/collapse state
  - Project root detection (.git, package.json, build.gradle, Cargo.toml)
  - Gitignore pattern loading and filtering
  - File type icons with language-specific colors:
    - Kotlin (purple), Java (red), JS/TS (yellow)
    - Python (teal), Rust (orange), C/C++ (blue)
    - Markdown (green), config files (gray)
  - Keyboard navigation (arrows, Enter)
  - Mouse selection with hover states
  - Scrollbar for long file lists
  - Expand/collapse state memory across refreshes

Part of Colide OS IDE integration (P14/15)
- ANSI escape code parsing:
  - Standard colors (30-37, 40-47)
  - Bright colors (90-97)
  - Catppuccin Mocha palette for all ANSI colors
  - Background color support
  - Bold attribute tracking

- Command history:
  - In-memory history with configurable max size
  - Up/Down arrow navigation
  - loadHistory()/saveHistory() for persistence
  - Duplicate command filtering

- Tab completion:
  - onTabComplete callback for custom completion
  - Single match auto-complete
  - Multiple match display with common prefix

- Cursor improvements:
  - Left/Right arrow movement within input
  - Home/End for line navigation
  - Delete key support
  - Insert mode at cursor position

- Styled output:
  - Span-based line rendering
  - Multiple colors per line
  - Background color per span

Part of Colide OS IDE integration (P15/15)
WiFi subsystem for Colide OS with three implementation paths:
- USB Bridge: External device (Pi/host) handles WiFi via USB/Serial
- USB WiFi Dongle: Direct RTL8188EU/MT7601U support
- Native Intel WiFi: Intel AX211 PCIe (future, based on itlwm)

Kotlin API:
- WifiManager.kt: High-level WiFi API with scan/connect/disconnect
- WifiNetwork.kt: Data classes (WifiNetwork, WifiStatus, WifiSecurity)

Rust Implementation:
- net/mod.rs: JNI bindings for all WiFi backends
- net/bridge.rs: USB/Serial bridge protocol
- net/usb.rs: USB host controller and RTL8188EU/MT7601U skeleton
- net/wifi.rs: Common types and utilities
- net/ieee80211.rs: 802.11 frame parsing and construction

References:
- OpenIntelWireless/itlwm (macOS Intel WiFi)
- Fuchsia iwlwifi (non-Linux Intel WiFi)
- rtl8188eus (USB WiFi driver)
P0: Elide Foundation
- ColideMain.kt - Main entry point with mode detection (shell/gui/ide)
- JNI bridge verified working

P1: Tool Embedding
- ToolExecutor.kt - Execute embedded tools from /zip/bin/
- exec.rs - Rust JNI bindings for tool execution

P2: Mouse Driver
- Mouse.kt - Dedicated PS/2 mouse API with click/drag detection
- mouse.rs - Rust mouse driver with wheel support

P3: 2GB Full Image
- Build scripts and documentation in elide-os/

P4: GUI Layer Enhancement
- Theme.kt - Catppuccin-based theme system (dark/light/high-contrast)
- GuiManager mouse integration with dedicated driver

P5: Network Research
- Documentation for USB-Ethernet and Intel NIC options

Files added:
- crates/colide/src/exec.rs (~170 lines)
- crates/colide/src/mouse.rs (~200 lines)
- packages/colide/.../ColideMain.kt (~240 lines)
- packages/colide/.../Mouse.kt (~200 lines)
- packages/colide/.../exec/ToolExecutor.kt (~220 lines)
- packages/colide/.../gui/Theme.kt (~170 lines)

Total: ~1200 lines new code
This implements the foundation for porting Linux WiFi drivers to Colide OS,
inspired by Fuchsia's successful iwlwifi port.

New files:
- net/linux_compat.rs (~400 lines) - Linux kernel primitives:
  - SpinLock, Completion, Kref (reference counting)
  - SkBuff (network packet buffers)
  - Workqueue simulation
  - IEEE 802.11 frame types
  - Jiffies/timing helpers
  - Memory allocation helpers
  - Bit manipulation helpers

- net/cfg80211.rs (~450 lines) - WiFi configuration API:
  - Channel/Band definitions (2.4GHz, 5GHz, 6GHz)
  - Wiphy (physical device) abstraction
  - WirelessDev (interface) abstraction
  - BssInfo (access point info)
  - ScanRequest/ConnectParams
  - Cipher suite and AKM constants
  - Cfg80211Ops trait for driver implementation
  - Wiphy registry

Documentation:
- WIFI_LINUX_COMPAT.md - Architecture for TRUE linux-like WiFi support
  - Fuchsia iwlwifi port analysis
  - Linux driver shim layer design
  - cfg80211/mac80211 porting strategy
  - Timeline estimates (21-30 weeks for full iwlwifi)
  - Quick win: USB WiFi bridge option

This enables future porting of:
- mt7601u (USB dongle, ~10K lines, 2-3 weeks)
- iwlwifi (Intel AX211/T14 laptop, ~100K lines, 6-8 weeks)
Complete mac80211 abstraction layer (~700 lines):

- Ieee80211Hw - Hardware abstraction with flags, queues, capabilities
- Ieee80211Vif - Virtual interface with BssConf
- Ieee80211Sta - Station structure with HT/VHT/HE caps
- Ieee80211Ops trait - 25+ driver callbacks (start, stop, tx, config, etc.)
- TX/RX info structures with rate control
- Key configuration for encryption
- Channel context for multi-channel operation
- AMPDU aggregation support
- Power management hooks

This enables porting SoftMAC drivers (most consumer WiFi cards):
- mt7601u, ath9k, rtl8xxxu, iwlwifi

Hardware flags for capabilities:
- AMPDU_AGGREGATION, SUPPORTS_PS, MFP_CAPABLE
- HAS_RATE_CONTROL, QUEUE_CONTROL, etc.

TX/RX path abstractions:
- ieee80211_rx(), ieee80211_tx_status()
- Rate flags (MCS, VHT_MCS, HE_MCS, BW_*)
- RX encoding (Legacy, HT, VHT, HE, EHT)
Complete WPA2-Personal implementation (~750 lines):

Core Components:
- WpaSupplicant state machine for 4-way handshake
- EAPOL-Key frame parsing and building
- KeyInfo field encoding/decoding
- PMK derivation from passphrase + SSID
- PTK derivation (KCK + KEK + TK)
- GTK extraction from encrypted key data

Cryptographic Primitives:
- SHA-1 hash (FIPS 180-4)
- HMAC-SHA1 (RFC 2104)
- PBKDF2-SHA1 for PMK derivation (RFC 2898)
- PRF-SHA1 for PTK derivation (IEEE 802.11i)
- AES Key Unwrap (RFC 3394) for GTK
- AES-CCM stubs for frame encryption

4-Way Handshake:
- Message 1: Receive ANonce from AP
- Message 2: Send SNonce + RSN IE
- Message 3: Receive encrypted GTK, install keys
- Message 4: Confirm key installation

Group Key Handshake:
- Message 1: Receive new GTK
- Message 2: Confirm GTK installation

This enables connecting to WPA2-Personal networks
once WiFi drivers are implemented.
P9: AES-128/CCM encryption (~550 lines)
- Full AES-128 implementation (FIPS 197)
- AES-CCM mode for WiFi frame encryption (IEEE 802.11i)
- AES Key Wrap/Unwrap (RFC 3394) for GTK
- NIST test vectors passing

P10: USB host controller scaffolding (~700 lines)
- xHCI (USB 3.x) and EHCI (USB 2.0) support
- USB device enumeration and management
- Control/bulk/interrupt transfer APIs
- Known WiFi dongle VID/PID detection

P11: MT7601U driver skeleton (~380 lines)
- Based on Linux kernel mt7601u driver
- EEPROM calibration data reading
- RF/BBP initialization sequence
- Channel switching (2.4 GHz, 1-14)
- MAC address and BSSID configuration

Total new code: ~1630 lines toward TRUE linux-like WiFi
akapug added 27 commits January 25, 2026 19:00
- AccessCategory enum (Background, BestEffort, Video, Voice)
- EdcaParams with AIFSN, CW, TXOP for each AC
- WmmInfoElement/WmmParamElement for association
- QosControl field for QoS data frames
- TrafficClassifier with DSCP and port-based rules
- AcQueue with EDCA backoff management
- Maps DSCP values and well-known ports to ACs

~450 lines - enables proper traffic prioritization
- ScanType (Passive, Active, Mixed)
- ScanChannel with frequency and DFS flags
- ScanRequest with channels, SSIDs, dwell times
- ScanResult with BSS info, security, capabilities
- ScanCache with expiration and best candidate selection
- ScanStateMachine with tick-based processing
- ScanAction for driver integration
- Support for 2.4GHz and 5GHz channel lists

~520 lines - comprehensive scan management
- ConnState enum (Disconnected -> Connected lifecycle)
- ConnEvent for all connection events (auth, assoc, EAPOL, etc)
- ConnectRequest for WPA2-PSK and Open networks
- AuthFrame/AssocFrame builders with IE construction
- ConnectionStateMachine with full state transitions
- Roaming support with RoamTrigger event
- PTK/GTK key installation tracking
- Retry logic with configurable timeouts

~530 lines - unified connection management
- RoamReason enum (LowSignal, BeaconLoss, BetterAp, etc)
- RoamConfig with signal thresholds and cooldowns
- RoamManager with background scan and candidate scoring
- FtInfo for 802.11r Fast BSS Transition
- RoamCandidate scoring with 5GHz preference
- RoamStats for tracking roam success/failure rates
- FtActionBuilder for FT Request frames

~420 lines - seamless AP handoff support
- MonitorFlags for capture configuration
- RadiotapHeader builder/parser for pcap compatibility
- CapturedFrame with metadata (signal, noise, rate)
- FrameType classification for all 802.11 frames
- CaptureFilter by BSSID, frame type, signal
- MonitorManager with ring buffer capture
- FrameInjector for deauth and probe request frames
- Full radiotap header support for Wireshark

~550 lines - enables WiFi security analysis and debugging
- P2pDevice with device type and config methods
- P2pGroup for GO and client roles
- GoIntent with tie-breaker negotiation logic
- P2pConnectRequest for PBC and PIN methods
- P2pManager state machine (discovery, negotiation, forming)
- P2pIeBuilder for vendor-specific IE construction
- GO Negotiation Request frame builder
- WPS method support (PushButton, Display/Keypad PIN)

~520 lines - enables device-to-device WiFi without infrastructure
- WpsSession state machine (M1-M8 message exchange)
- WPS attribute types and message builders
- Push Button Configuration (PBC) support
- PIN method support (Display/Keypad)
- WpsCredential for receiving network credentials
- Key derivation structure (AuthKey, KeyWrapKey)
- E-Hash/R-Hash computation for PIN verification
- WPS PIN generation and validation with checksum

~700 lines - enables simplified WiFi configuration
- MeshConfig with HWMP path selection protocol
- MeshPeer with peer link state machine
- MeshPath routing table entries with airtime metric
- PathRequest/PathReply/PathError (PREQ/PREP/PERR) builders
- MeshManager with peer discovery and path finding
- HWMP reactive path discovery protocol
- Mesh IE builder for beacon/probe frames
- Multi-hop forwarding support

~680 lines - enables infrastructure-less WiFi mesh networks
- ApConfig for SSID, channel, security, WMM, HT settings
- ApClient tracking with state machine (auth/assoc/authorized)
- ApManager for full AP lifecycle management
- Beacon frame builder with all standard IEs
- Auth/Assoc request processing and response builders
- RSN IE construction for WPA2-PSK
- WMM/QoS parameter elements
- HT capabilities and operation elements
- Client inactivity timeout handling
- AID assignment and client management

~620 lines - enables device to act as WiFi access point
- EapPacket parser/builder with all standard codes
- EAPOL frame support (Start, Logoff, EAP, Key)
- EAP method types: TLS, PEAP, TTLS, MS-CHAPv2, SIM/AKA
- EapTlsSession with TLS Client Hello builder
- EapPeapSession for tunneled authentication
- EapTtlsSession for TTLS inner auth
- EnterpriseCredentials: username/password, certificate, SIM
- EapSupplicant state machine with method negotiation
- NAK response with preferred method list
- Anonymous identity support for privacy

~680 lines - enables WPA2/WPA3-Enterprise networks
- DhcpClient state machine (Init→Selecting→Requesting→Bound)
- DhcpPacket builder/parser with all standard options
- DhcpLease with renewal/rebinding time tracking
- DISCOVER, OFFER, REQUEST, ACK message handling
- Parameter request list (subnet, router, DNS, domain)
- Lease renewal and rebinding with exponential backoff
- RELEASE for graceful lease termination
- ARP probe for IP conflict detection
- Client identifier and hostname support

~580 lines - completes full network stack for WiFi
- DnsMessage builder/parser with full protocol support
- Query types: A, AAAA, CNAME, PTR, MX, TXT, SRV
- Name compression parsing for response handling
- DnsResolver with multi-server support and failover
- DNS cache with TTL-based expiration
- Pending query tracking with retry logic
- Reverse DNS lookup (PTR records)
- Response code handling (NXDOMAIN, SERVFAIL, etc.)

~550 lines - completes network stack with hostname resolution
- TcpConnection state machine (RFC 793 compliant)
- TcpSegment builder/parser with full header support
- TCP options: MSS, Window Scale, SACK, Timestamps
- Three-way handshake (active/passive open)
- Data transfer with flow control
- Graceful close (FIN/ACK sequence)
- Ipv4Packet builder/parser with checksum
- TCP checksum with pseudo-header
- Connection tracking with sequence numbers

~720 lines - enables actual network communication over WiFi
- UdpDatagram builder/parser with checksum
- UdpSocket with send/receive buffering
- ICMP echo request/reply (ping) support
- Pinger utility with RTT measurement
- NetworkStack combining all protocols
- DHCP lease integration for configuration
- Ephemeral port allocation
- Local network detection and routing
- Next-hop gateway selection

~420 lines - completes transport layer with UDP/ICMP
- ArpPacket builder/parser for request/reply
- ArpCache with entry state machine
- Entry states: Incomplete, Reachable, Stale, Permanent
- Automatic ARP request on cache miss
- Packet queuing during resolution
- Gratuitous ARP for IP announcement
- Entry aging and timeout handling
- Retry logic with configurable limits
- EthernetFrame builder/parser
- Gateway permanent entry support

~480 lines - completes link layer with MAC resolution
- NetStack combining ARP, DHCP, DNS, TCP, UDP, ICMP
- Automatic DHCP configuration on start
- Static IP configuration support
- Ethernet frame routing with ARP resolution
- TCP connection management
- UDP socket binding and transmission
- DNS hostname resolution
- Ping utility for connectivity testing
- Network statistics tracking
- EAPOL frame passthrough for WPA
- Graceful shutdown with DHCP release

~640 lines - unified network interface for Colide OS
- Ipv6Packet builder/parser with flow labels
- ICMPv6 with pseudo-header checksum
- Router Solicitation/Advertisement parsing
- Neighbor Solicitation/Advertisement handling
- NDP options: SLLADDR, TLLADDR, Prefix, MTU
- SlaacManager for address autoconfiguration
- EUI-64 interface identifier generation
- Duplicate Address Detection (DAD)
- Neighbor cache with state machine
- Link-local and global address management
- Default router tracking
- Solicited-node multicast computation

~780 lines - IPv6 ready for dual-stack support
- TlsRecord builder/parser for all content types
- HandshakeMessage with full type support
- ClientHello/ServerHello message building/parsing
- TLS extensions: SNI, supported_versions, groups, signatures
- Cipher suite definitions (AES-GCM, ChaCha20-Poly1305)
- TlsAlert for error handling
- TlsSession state machine for client handshakes
- TLS 1.3 detection via extensions
- Certificate message handling (validation placeholder)
- ChangeCipherSpec and Finished message flow
- Application data record framing

~720 lines - secure transport layer foundation
- HttpRequest builder with fluent API
- HttpResponse parser with chunked transfer support
- HttpMethod: GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH
- URL parser with scheme, host, port, path, query
- Header management with BTreeMap
- Redirect handling with configurable limits
- HttpClient state machine for async flow
- TLS integration hooks for HTTPS
- QueryBuilder for URL parameters
- HeaderBuilder for common patterns
- URL encoding for safe transmission
- Content-Type and Authorization helpers

~680 lines - complete HTTP client foundation
- WsFrame builder/parser with masking support
- WsOpcode: Text, Binary, Ping, Pong, Close, Continuation
- WsCloseCode with standard close reasons
- WsHandshake request builder with Sec-WebSocket-Key
- SHA-1 implementation for accept key computation
- Base64 encoding for WebSocket keys
- Fragment reassembly for large messages
- WebSocket client state machine
- Ping/pong heartbeat support
- Graceful close with code and reason
- Maximum message size enforcement
- RFC 6455 compliant implementation

~620 lines - real-time bidirectional communication
- Add llm/mod.rs with ModelSize, Quantization, OffloadConfig, ModelConfig
- Add llm/gguf.rs with GGUF file format parser (headers, tensors, metadata)
- Add llm/memory.rs with MemoryManager, KvCache, layer planning
- Add llm/inference.rs with InferenceEngine, sampling, generation
- Add llm/quantization.rs with Q4/Q8 quantization and dequantization

Supports:
- Models from 0.5B to 72B+ parameters via quantization (Q4_K_M, Q8_0, etc.)
- Memory-mapped loading for running models larger than RAM
- Layer offloading across GPU/RAM/disk
- Hardware detection and automatic configuration
- KV cache management for context windows up to 128K

Based on llamafile/llama.cpp patterns for Cosmopolitan/APE compatibility.
…indings, CLI config

- Add colide package dependency to CLI build
- Add libcolide.a to native linker options (both default and Linux)
- Add hw.rs module for bare-metal port I/O and VESA framebuffer
- Add x86 crate dependency for bare-metal feature
- Fix OffloadConfig missing field and borrow checker errors
- All package tests pass (1 passing, 3 pending)

Staticlib: 43MB libcolide.a with 52 JNI exports
Kotlin: 33 files in packages/colide with JNI bindings
Ready for: native-image build test
…hell, apps

New components:
- mcp/McpClient.kt: JSON-RPC 2.0 MCP client (HTTP + stdio)
- mcp/McpTools.kt: Local tool implementations (read/write file, run command, grep)
- tui/TuiRenderer.kt: Text UI renderer (VESA + ANSI)
- tui/TuiComponents.kt: UI components (Label, Button, Input, List, Panel, TextArea)
- tui/TuiApp.kt: App framework + FileBrowser/TextViewer apps
- shell/EnhancedShell.kt: Full shell with history, tab completion, MCP integration
- ai/AiSysadmin.kt: Autonomous AI sysadmin with tool use
- apps/SettingsApp.kt: System settings TUI app
- apps/BrowseApp.kt: Text-based web browser

All JVM-testable, no native rebuild required.
Storage subsystem:
- ATA/IDE driver with PIO mode (LBA28/LBA48)
- AHCI/SATA driver with port initialization
- FAT32 filesystem with directory listing and file read
- BlockDevice trait and utilities (memory, partition, cached)

USB enhancements:
- Mass Storage Class (MSC) with Bulk-Only Transport
- SCSI commands (READ/WRITE_10/16, READ_CAPACITY)
- HID class for keyboards and mice
- Keycode to ASCII mapping

Network TODOs fixed:
- USB host controller init (XHCI/EHCI with PCI scan)
- USB device enumeration framework
- 802.11 scan with beacon/probe response parsing
- Bridge serial communication
- iwlwifi firmware loading, command submission, connect/disconnect
- Driver registry USB/PCIe probing

~2500 lines of new Rust code for kernel maturity.
- Fix duplicate enum discriminant in MscSubclass
- Add mmio_base field to IwlwifiDriver
- Add to_bytes method to HostCmdHeader
- Fix array sizes in HID keycode tables (128 elements)
- Fix borrow checker issues with firmware section parsing
- Fix lifetime annotation in find_fw_section
- Fix packed field access in FAT32 LFN parsing
- RTL8188EU: Add USB control transfer-based register read/write
- mac80211: Implement RX/TX status functions with statistics tracking
- mac80211: Add atomic state tracking (registered, scanning, etc.)
- firmware: Implement filesystem-based firmware loading for /zip/ and external paths
- firmware: Add file_exists, read_firmware_file, get_firmware_info helpers
- Add 'model' command to CommandRegistry (load, info, list)
- Extend Ai object with loadModel() and modelInfo()
- Support local GGUF paths and HuggingFace IDs (hf:owner/repo)
- Users can now switch models from within the Colide shell

Usage:
  colide> model load /path/to/model.gguf
  colide> model load hf:openai/gpt-oss-20b
  colide> model info
  colide> model list
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​heapless@​0.8.08310095100100
Addedcargo/​x86@​0.52.093100100100100

View full report

@sgammon sgammon closed this Jan 26, 2026
@sgammon sgammon deleted the feat/insight-mcp-34-tools branch January 26, 2026 21:26
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.

2 participants