{ "project": "StackMemory - Lossless Call-Stack Memory Runtime", "version": "0.5.1", "status": "Phase 2 - Intelligence Layer Complete", "last_updated": "2025-01-03T18:25:00Z", "progress": { "phase": "Phase 3 - Collaboration Layer Complete", "completion": "95%", "current_sprint": "Code Review and Critical Bug Fixes" }, "completed": [ "Project structure consolidation", "Logger utility with file output", "Error handling with StackMemoryError class", "PRD with product vision", "Technical architecture design", "SQLite schema design", "MCP integration contract", "Core MCP server with basic tools", "Frame manager with call-stack implementation", "Frame lifecycle (create, close, digest generation)", "Event and anchor management", "Hot stack context assembly", "Comprehensive SPEC.md (776 lines)", "Query language parser with NLP support (STA-94)", "Configurable weight profiles system (STA-97)", "Linear integration (10 implementation tasks)", "Documentation updates (README, AGENTS.md)", "Test coverage for query parser and config system", "Database abstraction layer with adapter pattern", "SQLite adapter with backward compatibility (45 tests)", "ParadeDB adapter with BM25 & vector search (1100+ lines)", "PostgreSQL connection pool with health checks & metrics", "Intelligent query router for tiered storage (530+ lines)", "Security hardening: SQL injection prevention, type safety", "Comprehensive test suites: 100+ tests across components", "Production-ready error handling & fallback mechanisms", "Performance monitoring & metrics collection", "Migration manager for dual-write strategy (600+ lines)", "Security-hardened migration with input validation", "Comprehensive migration test coverage (33 tests)", "Transaction-safe batch operations with rollback", "LLM-driven context retrieval system (STA-95)", "Multi-strategy intelligent search (keyword, semantic, hybrid)", "Advanced query analysis with intent detection", "Enhanced ranking with recency and relevance scoring", "Hybrid digest generation system (STA-96)", "60/40 deterministic/AI split with idle processing", "Comprehensive test coverage for hybrid digest generator", "Production-ready digest queue management", "Dual stack architecture foundation (STA-99)", "Individual and shared stack management design", "Frame handoff request system architecture", "Stack synchronization and conflict resolution framework", "Dual stack architecture (STA-99)", "Frame handoff mechanism (STA-100)", "Stack merge conflict resolution (STA-101)", "Team collaboration analytics system", "Permission-based access control framework", "Comprehensive Phase 3 integration tests", "Code review and critical issue identification" ], "in_progress": [ "Critical bug fixes from code review" ], "todo": [ "Complete ParadeDB migration system", "Production deployment configuration", "Incremental garbage collection (STA-103)", "Performance benchmarking & optimization", "Enterprise security audit" ], "architecture": { "core_concepts": { "frame_stack": "Call stack with 10,000 max depth", "storage": "Three-tier: Hot (SQLite) + Warm (ParadeDB) + Cold (S3)", "retrieval": "LLM-driven with compressed summaries", "digests": "60% deterministic, 40% AI-generated", "scoring": "Configurable weights with tool importance", "collaboration": "Dual stacks (individual + shared)", "routing": "Intelligent query routing with fallback tiers" }, "core_files": { "mcp_server": "src/integrations/mcp/server.ts", "query_parser": "src/core/query/query-parser.ts", "frame_manager": "src/core/context/frame-manager.ts", "context_service": "src/services/context-service.ts", "config_service": "src/services/config-service.ts", "linear_sync": "src/integrations/linear/sync-service.ts", "database_adapter": "src/core/database/database-adapter.ts", "sqlite_adapter": "src/core/database/sqlite-adapter.ts", "connection_pool": "src/core/database/connection-pool.ts", "query_router": "src/core/database/query-router.ts", "migration_manager": "src/core/database/migration-manager.ts", "context_retriever": "src/core/retrieval/context-retriever.ts", "hybrid_digest_generator": "src/core/digest/hybrid-digest-generator.ts", "dual_stack_manager": "src/core/context/dual-stack-manager.ts", "frame_handoff_manager": "src/core/context/frame-handoff-manager.ts", "stack_merge_resolver": "src/core/context/stack-merge-resolver.ts" }, "database": { "hot_tier": "SQLite (<24h, high-frequency operations)", "warm_tier": "ParadeDB (1-30 days, search & analytics)", "cold_tier": "S3/GCS (30+ days, archival storage)", "features": "BM25 search, vector similarity, SQL analytics", "connection_pool": "Health checks, metrics, auto-scaling" }, "integration": "MCP server for Claude Code, Linear API, PostgreSQL", "query_language": { "natural": "provide context from the last day", "structured": "TypeScript interfaces with filters", "hybrid": "command-line style with modifiers" }, "search_capabilities": { "full_text": "BM25 ranking with custom scoring", "vector": "Semantic similarity search", "hybrid": "Combined text + vector with weights", "analytics": "Aggregations, pattern detection, time series" } }, "performance_targets": { "retrieval_latency": "p50 < 50ms, p99 < 500ms", "search_latency": "Hot tier: <50ms, Warm tier: <200ms", "max_stack_depth": 10000, "max_events_per_frame": 5000, "storage": "2GB local SQLite, 100GB ParadeDB, infinite S3", "throughput": "Hot: 1000 qps, Warm: 500 qps", "connection_pool": "2-10 connections, health checks every 30s", "gc_strategy": "Incremental, 100 frames/cycle" }, "linear_tasks": { "phase_2": ["STA-94", "STA-95", "STA-96", "STA-97", "STA-98"], "phase_2_paradedb": ["Database abstraction", "SQLite adapter", "ParadeDB adapter", "Connection pooling", "Query routing"], "phase_3": ["STA-99", "STA-100", "STA-101"], "phase_4": ["STA-102", "STA-103"] }, "next_milestone": "Complete Phase 3: Frame handoff mechanism and stack merge conflict resolution", "blockers": [], "decisions": [ "Use SQLite for local-first approach", "Implement as MCP server for Claude Code integration", "Call-stack memory model over linear chat", "Lossless event storage with digest summaries", "Frame-based architecture with 10,000 max depth", "Three-tier storage: Hot (SQLite) + Warm (ParadeDB) + Cold (S3)", "LLM-driven retrieval analyzing compressed summaries", "60/40 hybrid digest generation during idle time", "Configurable scoring weights for different workflows", "Dual stack architecture for team collaboration", "Incremental GC to avoid UI freezes", "Deterministic scoring over ML for predictability", "Database abstraction layer for seamless storage migration", "PostgreSQL connection pooling with health checks & metrics", "Intelligent query routing with automatic tier fallback", "ParadeDB for BM25 full-text and vector search capabilities", "Security-first: parameterized queries, input validation, type safety" ], "key_insights": [ "Frame stack provides natural boundaries vs linear chat", "Intelligent retrieval more efficient than full context", "Different workflows need different importance weights", "Individual + shared stacks enable true collaboration", "Deterministic approaches more debuggable than ML", "Tiered storage enables cost optimization with performance guarantee", "Database abstraction enables zero-downtime migrations", "Connection pooling essential for PostgreSQL production reliability", "Query routing allows workload-specific tier optimization" ] }