Skip to content

Latest commit

 

History

History
374 lines (326 loc) · 15.9 KB

File metadata and controls

374 lines (326 loc) · 15.9 KB

Project History (Pre-1.0 Sprint Archive)

⚠️ Historical snapshot — not current. This document preserves the Sprint 0-12 development log and an early "Features" snapshot exactly as they read in older revisions of the README. Version numbers, test counts, and provider lists below are out of date. For the current state of the project, see the top-level README.md and ROADMAP.md instead.


✨ Features

Currently Implemented (Sprint 11 Complete ✅)

Interactive Terminal UI (TUI)

  • Modern Interface - Built with Ratatui for responsive terminal experience
  • Real-time Chat - Send/receive messages with AI models
  • Session Management - Create, switch, and resume conversations
  • Markdown Rendering - Rich text formatting with pulldown-cmark
    • Headings (H1-H3) with bold, underlined, cyan styling
    • Code blocks with decorative borders and language labels
    • Inline code with yellow highlighting
    • Horizontal rules and proper line spacing
  • Syntax Highlighting - 100+ languages via syntect
    • Rust, Python, JavaScript, TypeScript, Go, Java, C++, and more
    • Line numbers for code blocks
    • Base16 Ocean Dark theme
  • Visual Polish
    • Animated braille spinner for loading states (⠋ ⠙ ⠹ ...)
    • Block cursor (█) in input field
    • Color-coded messages by role (User: Cyan, Claude: Green)
    • Emoji indicators (📝 Session, 🤖 Model, 💬 Tokens, 💰 Cost)
    • Beautiful croissant splash screen on startup
  • Keyboard Shortcuts - Efficient navigation and control
    • Enter - Send message (Ctrl+Enter still works as a legacy alias)
    • Shift+Enter - New line (Alt+Enter on terminals without Kitty keyboard protocol support)
    • Ctrl+N - New session
    • Ctrl+L - List sessions
    • Ctrl+H - Show help (📚 Press Ctrl+H from anywhere to see all commands!)
    • Ctrl+D - Download an Ollama model (native provider, --features ollama)
    • Ctrl+O - Show the Model Info panel (provider, model, context window, last response perf metrics)
    • Ctrl+W - Switch to a different local Ollama model (native provider, --features ollama)
    • Ctrl+Y - Copy last response (or its code block) to clipboard
    • Ctrl+V - Paste from clipboard at cursor
    • Shift+Tab - Cycle Auto Mode: InteractiveAutoPlanFullAuto
    • Ctrl+C - Quit
    • Escape - Clear input
    • Page Up/Down - Scroll chat history
  • Enhanced Help Screen - Comprehensive command reference with:
    • Global commands (always available)
    • Chat mode commands (message composition)
    • Session list commands (navigation)
    • Feature showcase (what Crustly can do)

LLM Integration

  • Multi-Provider Support - Two providers fully implemented:
    • Anthropic Claude - Full support for Claude 3 models
      • claude-3-5-sonnet-20240620 (default)
      • claude-3-opus-20240229
      • claude-3-sonnet-20240229
      • claude-3-haiku-20240307
    • OpenAI - Full support for GPT models + local LLMs
      • gpt-4-turbo-preview (default)
      • gpt-4, gpt-3.5-turbo
      • Compatible with LM Studio, Ollama, LocalAI (OpenAI-compatible APIs)
  • Streaming Responses - Real-time message streaming
  • Context Preservation - Multi-turn conversations with full history
  • Automatic Retry Logic - Exponential backoff with jitter
  • Rate Limit Handling - Respects Retry-After headers

Tool Execution System

  • Built-in Tools:
    • read - Read file contents
    • write - Create or edit files
    • bash - Execute shell commands
  • Interactive Approval System - Full control over dangerous operations
    • Beautiful approval dialogs with tool details
    • View full JSON parameters before approving
    • Auto-deny after 5 minutes (timeout protection)
    • Visual countdown timer (color-coded: green/yellow/red)
    • Keyboard shortcuts: A/Y (approve), D/N (deny), V (view details)
  • Extensible Registry - Easy to add new tools

Cost & Token Tracking

  • Per-Message Tracking - Token count and cost for each message
  • Session Totals - Accumulated usage per conversation
  • Database Persistence - All metrics saved for analysis

Database & Persistence

  • SQLite Storage - Local-first data storage
  • Automatic Migrations - Schema versioning with SQLx
  • Session History - All conversations saved
  • File Tracking - Monitor files touched by tools

Plan Mode (Sprint 12) 🎯

  • Structured Task Decomposition - Break down complex tasks into manageable steps
  • Interactive Approval Workflow - Review and approve plans before execution
    • Visual plan viewer with task dependencies
    • Edit and refine plans before starting
    • Safe execution with user control
  • State Management - Complete plan lifecycle tracking
    • 7 plan states: Draft → PendingApproval → Approved → Rejected → InProgress → Completed → Cancelled
    • 6 task statuses: Pending, InProgress, Completed, Skipped, Failed, Blocked
    • Timestamps for approval and completion
  • Database Persistence - SQLite storage for plans and tasks
    • Full plan history per session
    • Task dependency tracking
    • JSON export/import for migration
  • Multi-Task Support - Complex plans with dependencies
    • 10 task types: Research, Edit, Create, Delete, Test, Refactor, Documentation, Configuration, Build, Other
    • Dependency graph validation
    • Complexity estimation (1-5 scale)
  • Session Integration - Plans scoped to conversations
    • Multiple plans per session
    • Get most recent plan
    • Session isolation

Configuration System

  • TOML Configuration - Easy-to-edit config files
  • Environment Variables - Override config with env vars
  • Hierarchical Loading - System → Local → Environment
  • Provider Management - Configure multiple LLM providers

CLI Commands

  • chat - Launch interactive TUI (default)
  • run - Non-interactive single command execution
  • init - Initialize configuration
  • config - Show current configuration
  • db - Database management (init, stats)

Output Formats (Non-Interactive Mode)

  • Text - Plain text with statistics (default)
  • JSON - Structured JSON output
  • Markdown - Formatted markdown

Error Recovery & Resilience (Sprint 11)

  • Automatic Retry Logic - Exponential backoff with jitter for API calls
    • Configurable max attempts (default: 3 retries)
    • Smart error classification (retryable vs permanent)
    • Rate limit aware with Retry-After header support
  • Database Lock Recovery - SQLite lock detection and retry
    • Busy timeout configuration (5 seconds)
    • Exponential backoff for concurrent access
  • Structured Error Reporting - Rich error information with severity levels
    • Color-coded error display (Info/Warning/Error/Critical)
    • Error categorization (Network/Database/Config/Input/Tool/Internal)
    • Retry tracking with next-retry estimation

Developer Experience

  • Fast Execution - Async runtime with Tokio
  • Comprehensive Error Handling - Detailed error messages with context
  • Logging - Structured logging with tracing
  • Local-First - All data stored locally for privacy
  • Cross-Platform - Windows, Linux, macOS support
  • Performance Benchmarks - Criterion-based database benchmarks

Planned Features (Future Sprints)

  • Additional LLM Providers - Expand beyond Anthropic and OpenAI
    • Google Gemini
    • AWS Bedrock
    • Azure OpenAI
    • Groq (ultra-fast inference)
    • OpenRouter (multi-model gateway)
    • Cerebras
  • LSP Integration - Semantic code understanding for better context
  • MCP Support - Model Context Protocol
  • Context Files - Auto-load .cursorrules for project-specific behavior
  • Image/Vision Support - Vision model integration for analyzing images
  • Security Hardening (Sprint 12)
    • OS keyring integration for API key storage
    • Audit log for tool approval decisions
    • Path validation (prevent directory traversal)
    • Command sanitization (prevent injection)


📈 Status

Current Version: 0.1.0-alpha Development Status: 🎉 Sprint 12 CompleteApplication Status: 🟢 Production Ready with Plan Mode Test Coverage: 307 tests (100% pass rate - 244 lib + 61 integration + 2 doc) Multi-Provider Support: ✅ Anthropic + OpenAI Local LLM Support: ✅ LM Studio, Ollama (via OpenAI provider) Database Layer: ✅ Complete (with lock recovery) Configuration System: ✅ Complete Service Layer: ✅ Complete LLM Integration: ✅ Complete (2 providers) TUI Framework: ✅ Complete (Markdown, Syntax Highlighting) CLI Application: ✅ Complete Testing Infrastructure: ✅ Complete (307 total tests) Error Recovery: ✅ Complete (Retry logic, rate limiting) Plan Mode: ✅ Complete (Database-backed task planning)

Sprint 0-1 Achievements ✅ (Database & Foundation)

  • ✅ Project structure initialized (30+ files)
  • ✅ Database schema (5 tables, 8 indexes)
  • ✅ SQLx connection pool with migrations
  • ✅ 5 data models (Session, Message, File, etc.)
  • ✅ 3 full repositories with CRUD operations
  • ✅ Archive system for sessions
  • ✅ Token & cost tracking
  • ✅ Error handling with 12 error codes
  • ✅ Logging setup (tracing)

Sprint 2 Achievements ✅ (Configuration System)

  • ✅ Enhanced config loading (TOML + env vars)
  • ✅ Hierarchical config system (defaults → system → local → env)
  • ✅ Provider configurations for 6 LLM providers
  • ✅ Secure secret management with zeroize
  • ✅ Provider auto-update mechanism with Crabrace
  • ✅ Config validation & save/load
  • ✅ Debug options (debug_lsp, profiling)
  • ✅ 29 comprehensive tests (all passing)

Sprint 3 Achievements ✅ (Service Layer)

  • ✅ Service layer architecture (ServiceContext, ServiceManager)
  • ✅ SessionService with comprehensive business logic (350+ lines, 12 tests)
  • ✅ MessageService with message management (390+ lines, 12 tests)
  • ✅ FileService with file tracking (350+ lines, 11 tests)
  • ✅ Enhanced database module with Pool management
  • ✅ Model alignment with modern Rust patterns
  • ✅ Custom FromRow implementations for type safety
  • ✅ Database migration for schema transformation

Sprint 4 Achievements ✅ (LLM Integration)

  • ✅ Provider abstraction layer (trait-based)
  • ✅ Anthropic provider implementation
  • ✅ Message streaming support
  • ✅ Agent service with context management
  • ✅ Tool execution framework (3 tools: read, write, bash)
  • ✅ Tool registry system
  • ✅ Token usage and cost calculation
  • ✅ Error handling for API failures
  • ✅ Model selection and routing

Sprint 5 Achievements ✅ (TUI Framework)

  • ✅ Modern TUI with Ratatui
  • ✅ Event-driven architecture with async channels
  • ✅ Chat interface with scrolling
  • ✅ Session list overlay
  • ✅ Help screen
  • ✅ Status bar with keyboard shortcuts
  • ✅ Input handling with multi-line support
  • ✅ Message rendering (user/assistant)
  • ✅ Real-time UI updates

Sprint 6 Achievements ✅ (Runnable Application)

  • ✅ Complete CLI implementation (420+ lines)
  • ✅ Command routing (chat, run, init, config, db)
  • ✅ Component wiring (Database → Provider → Tools → Agent → TUI)
  • ✅ Non-interactive mode with multiple output formats
  • ✅ Configuration management commands
  • ✅ Database management commands
  • ✅ User-friendly error messages
  • ✅ Application fully functional end-to-end

Sprint 7 Achievements ✅ (Testing Infrastructure)

  • Integration tests with MockProvider and Plan Mode (61 tests)
  • Unit tests across all modules (244 tests)
  • 100% test pass rate (307/307 tests passing)
  • Fast execution (< 5 seconds for full suite)
  • Manual testing guide (800+ lines, 6 scenarios)
  • Testing summary documentation
  • CI/CD recommendations
  • Comprehensive test coverage across all layers

📄 Documentation:

Sprint 8-12 Achievements (Recently Completed)

Sprint 8: Enhanced Testing ✅

  • ✅ 43 new tests (172 total tests, up from 139 in Sprint 7)
  • ✅ CLI command tests (24 tests)
  • ✅ Streaming response tests (10 tests)
  • ✅ Error scenario tests (9 tests)
  • ✅ 100% test pass rate maintained

Sprint 9: Enhanced TUI Experience ✅

  • ✅ Markdown rendering with pulldown-cmark (267 lines)
  • ✅ Syntax highlighting with syntect (219 lines, 100+ languages)
  • ✅ Animated braille spinner for loading states
  • ✅ Beautiful croissant splash screen
  • ✅ Color-coded messages and emoji indicators

Sprint 10: Multi-Provider Support + Quick Wins ✅

  • ✅ OpenAI provider fully implemented (517 lines)
  • ✅ Local LLM support (LM Studio, Ollama)
  • ✅ Fixed hard-coded model display
  • ✅ Added config path support (--config flag)
  • ✅ Implemented connection timeouts
  • ✅ Added approval timeout (5 minutes with visual countdown)
  • ✅ Created first benchmark suite (Criterion)

Sprint 11: Error Recovery & Resilience ✅

  • ✅ Retry logic with exponential backoff and jitter
  • ✅ Rate limit detection with Retry-After header parsing
  • ✅ Database lock recovery with busy timeout
  • ✅ Structured error reporting with severity levels
  • ✅ Error categorization (Network/Database/Config/Input/Tool/Internal)

Sprint 12: Plan Mode Implementation ✅

  • Plan Mode feature - Full task planning and approval workflow
    • PlanDocument data structure with tasks and dependencies
    • 7 plan states (Draft, PendingApproval, Approved, Rejected, InProgress, Completed, Cancelled)
    • 10 task types (Research, Edit, Create, Delete, Test, Refactor, Documentation, Configuration, Build, Other)
    • 6 task statuses (Pending, InProgress, Completed, Skipped, Failed, Blocked)
  • Database layer - PlanRepository with full CRUD operations
    • Plans and tasks tables with foreign key relationships
    • JSON serialization for risks and dependencies
    • Cascade delete for plan removal
    • Session-scoped queries
  • Service layer - PlanService with business logic
    • Plan creation and updates
    • Get most recent plan per session
    • JSON export/import for migration
    • Atomic file operations
  • Comprehensive test suite - 35 new Plan Mode tests (307 total)
    • 15 repository tests (CRUD, serialization, edge cases)
    • 11 service tests (business logic, JSON operations)
    • 9 integration tests (end-to-end workflows, state transitions)
    • 244 lib tests, 61 integration tests, 2 doc tests
    • 100% pass rate maintained
  • Documentation - Full test suite summary
    • PLAN_MODE_TEST_SUITE_SUMMARY.md (339 lines)
    • Test coverage by category
    • Technical decisions documented
  • Benchmark fixes - Database benchmarks now compile and run
  • ✅ Database lock recovery (SQLite BUSY/LOCKED)
  • ✅ Structured error infrastructure (severity levels, categories)
  • ✅ TUI bug fixes (keyboard double-input, splash screen timing)
  • ✅ 13 new tests (retry, database, error handling)

Next Priorities

Short Term (Sprint 12):

  • Security hardening (OS keyring, audit log)
  • Path validation and command sanitization
  • Enhanced approval system features

Medium Term (Sprint 13-14):

  • Additional LLM providers (Gemini, Bedrock, Azure)
  • LSP integration for code understanding
  • MCP protocol support
  • Advanced context management

Long Term:

  • Context file support (.cursorrules)
  • Vision model integration
  • Advanced tool system
  • Plugin architecture