feat(knowledge): implement knowledge store layer#8
Open
milarze wants to merge 2 commits into
Open
Conversation
Add knowledge management layer with in-memory caching: - KnowledgeStore with RwLock-based caching for thread safety - SiteConfigManager with defaults for popular recipe sites - UserModelManager for preference learning from recipe interactions - PatternMatcher for success/anti-pattern detection - KnowledgeContextAssembler for LLM prompt injection All 135 tests pass, including 58 new knowledge module tests.
a13f1ed to
e2726d7
Compare
Priority 1 - Critical Issues: - Fix race condition in cache access (TOCTOU vulnerability) - Fix division by zero in preference matching - Fix flawed merge logic in site config - Remove dead code suppression Priority 2 - Logic Bugs: - Improve pattern matching with proper path boundaries - Fix difficulty preference to track frequency not recency Priority 3 - Architecture: - Add TTL-based cache eviction (5-minute default) - Create MockKnowledgeStorage for faster unit tests Priority 4 - Code Quality: - Replace minimal User-Agent with realistic Chrome string - Add comprehensive documentation to magic numbers - Fix comment/code mismatches Tests: 155 passed (up from 142) Clippy: 0 warnings
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.
Overview
Implements the knowledge management layer that provides cached read/write access to site configs, user models, and discovered patterns. This layer sits between the storage layer and the tools layer.
Changes
Testing