Add auto-detect and adaptive noise exclusions (tier 2 + 3)#30
Merged
CalebisGross merged 2 commits intomainfrom Mar 1, 2026
Merged
Add auto-detect and adaptive noise exclusions (tier 2 + 3)#30CalebisGross merged 2 commits intomainfrom
CalebisGross merged 2 commits intomainfrom
Conversation
…sion) Track filesystem events rejected by the heuristic filter per path prefix. When a prefix (e.g. .config/Code/) hits 50 rejections within 1 hour, it is automatically promoted to a watcher exclusion pattern. Learned exclusions are persisted to ~/.mnemonic/learned-exclusions.txt and reloaded on restart. - Add ExcludableWatcher interface for runtime exclusion additions - Add AddExclusion() to both platform watchers with proper RWMutex locking - Add rejection_tracker.go with prefix extraction, threshold promotion, persistence - Wire promoteExclusion callback from perception agent to watchers - Add LearnedExclusionsPath config field with path expansion - Add 4 tests covering prefix extraction, promotion, cap, and persistence Closes #28 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes golangci-lint unused function error in CI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
~/.config/and~/.local/share/(Linux) or~/Library/(macOS) for ~30 known noisy app directories (Chrome, VS Code, Slack, Discord, etc). Detected patterns are merged with config exclusions before watcher creation. Closes Auto-detect noisy app directories at first startup #27.~/.mnemonic/learned-exclusions.txtand reload on restart. Closes Adaptive watcher exclusions: learn from repeated heuristic rejections #28.Together with the static config defaults (tier 1, PR #26), this gives the system a 3-tier intelligent noise suppression pipeline that works out of the box for new users and adapts to each machine over time.
New files
internal/watcher/filesystem/autodetect.go— App registry + detection logicinternal/watcher/filesystem/autodetect_test.go— 3 testsinternal/agent/perception/rejection_tracker.go— Adaptive learning coreinternal/agent/perception/rejection_tracker_test.go— 4 tests (prefix extraction, promotion threshold, cap, persistence)Key changes
internal/watcher/watcher.go— AddedExcludableWatcherinterfaceinternal/watcher/filesystem/watcher_other.go—AddExclusion()+ RLock on exclude pattern readsinternal/watcher/filesystem/watcher_darwin.go— Same as above for macOSinternal/agent/perception/agent.go—promoteExclusionmethod, rejection tracking on heuristic failures, load persisted exclusions at startupinternal/config/config.go—LearnedExclusionsPathfield with default~/.mnemonic/learned-exclusions.txtcmd/mnemonic/main.go— Wire auto-detect + learned exclusions pathTest plan
make testpasses (all existing + 7 new tests)make checkpasses (go fmt+go vet)make buildsucceeds🤖 Generated with Claude Code