fix: comprehensive audit — security, perf, tech debt, tests#51
Merged
pszymkowiak merged 1 commit intomainfrom Mar 21, 2026
Merged
fix: comprehensive audit — security, perf, tech debt, tests#51pszymkowiak merged 1 commit intomainfrom
pszymkowiak merged 1 commit intomainfrom
Conversation
Security: - Credentials file permissions set to 0o600 on Unix - Input validation for MCP tool_store (topic max 255, content max 100k) - FTS query hardening (length limit, token cap, quote stripping) - Embedding dims validated to 64-4096 range - Search result limits capped to 100 Performance: - CLI recall uses batch_update_access instead of N individual calls - Reduced cloning in search_hybrid (owned keys iteration) - Reduced cloning in tool_store dedup (struct literal vs clone) Tech debt + Logging: - Replaced eprintln! with tracing::warn! (6 locations) - Fixed unwrap() panic in extract_patterns - Replaced .expect() with proper error handling in embed command - Added tracing on rollback paths and datetime parse failures - Added DEFAULT_EMBEDDING_DIMS constant (replaces hardcoded 384) - Added DEDUP_SIMILARITY_THRESHOLD constant (replaces magic 0.85) Redundancy + Dead code: - Removed unused delete_cloud_memory and sync_memory_background - Extracted topic_matches/keyword_matches to icm-core (shared CLI+MCP) - Added MSG_NO_MEMORIES constant for consistent messaging Tests (+29 new): - Store: empty queries, nonexistent CRUD, batch access, auto-consolidate, decay, prune, topics, stats, topic prefix - MCP: empty recall, input validation (topic/content length) - Security: FTS sanitization, embedding dims bounds, search limits, credentials permissions
Contributor
Author
📊 Automated PR Analysis
SummaryComprehensive codebase audit fixing security vulnerabilities (credential file permissions, input validation, FTS query hardening), performance improvements (batch DB calls, reduced cloning), tech debt cleanup (replacing eprintln with tracing, fixing unwrap panics, extracting constants), removing dead code, and adding 29 new tests bringing the total to 182. Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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.
Summary
Full codebase audit fixes: 5 parallel agents audited + fixed security, performance, redundancy, dead code, and technical debt. Added 29 new tests.
Security (5 fixes):
Performance (3 fixes):
Tech debt (6 fixes):
Redundancy (3 fixes):
Tests: 182 total (was 153, +29 new)
Test plan
🤖 Generated with Claude Code