fix: remediate all 9 yield audit findings (issue #355)#365
Merged
CalebisGross merged 10 commits intomainfrom Mar 29, 2026
Merged
fix: remediate all 9 yield audit findings (issue #355)#365CalebisGross merged 10 commits intomainfrom
CalebisGross merged 10 commits intomainfrom
Conversation
Extract canonical CosineSimilarity to internal/mathutil with float64 accumulation for better numerical precision. Remove 3 duplicate implementations from retrieval agent, sqlite store, and main.go. agentutil.CosineSimilarity now delegates to mathutil. Addresses finding #1 from yield audit (issue #355). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The encoding agent constructor creates a default context for test-friendliness. Start() replaces it but never cancelled the original, leaking a context. Now cancels the old context before creating the new one. Addresses finding #3 from yield audit (issue #355). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SearchByConcepts and SearchByConceptsInProject now use the existing memories_fts virtual table with column-scoped queries (concepts:term*) instead of LIKE '%concept%' OR chains. Eliminates full table scans and scales properly beyond 5K memories. Addresses finding #6 from yield audit (issue #355). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both encodeMemory and finalizeEncodedMemory had ~145 lines of identical finalization logic (dedup check, memory write, resolution, concepts, attributes, associations, event publishing). Extract into persistEncodedMemory with a persistResult return type. Both callers now delegate to it. Addresses finding #8 from yield audit (issue #355). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move 110 hardcoded filter entries (ignored paths, lockfiles, app dirs, sensitive files, commands, keywords, etc.) into package-level defaults in heuristic_defaults.go. Add Extra* config fields that extend the defaults without replacing them, merged at construction time. Addresses finding #8 from yield audit (issue #355). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Define focused sub-interfaces (RawMemoryStore, MemoryStore, SearchStore, AssociationStore, ConceptStore, EpisodeStore, PatternStore, AbstractionStore, MetacognitionStore, FeedbackStore, ConsolidationStore, SessionStore, ExclusionStore, UsageStore, ForumStore, AnalyticsStore) and redefine Store as their composition. Zero behavior change — the method set is identical, SQLiteStore and MockStore still satisfy the interface. Consumers can be gradually migrated to accept sub-interfaces in follow-up work. Addresses finding #9 from yield audit (issue #355). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Break cmd/mnemonic/main.go (3407 lines) into logical files: - main.go (241 lines): router, constants, printUsage - serve.go (730): daemon serve command - dedup_cli.go (368): dedup and reset-patterns commands - cycle.go (263): meta-cycle, dream-cycle, mcp, autopilot - status.go (251): status command and helpers - runtime.go (233): config builders, LLM provider factory - daemon.go (207): start/stop/restart commands - memory_cli.go (182): remember, recall, consolidate - purge.go (175): purge and cleanup commands - diagnose.go (174): diagnose command - export.go (143): export, import, backup - watch.go (134): watch command - web.go (124): agent web server - update.go (90): check-update, update, generate-token - insights.go (89): insights command - restore.go (73): restore command - install.go (60): install/uninstall commands - util.go (9): truncate helper All files remain in package main. No function signatures changed. Addresses finding #10 from yield audit (issue #355). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
All 9 findings verified against the live daemon — recall, remember, encoding pipeline, dashboard, and WebSocket all working. Merging this one. @jkbennitt heads up — this touches a lot of surface area (store interface decomposition, main.go split into 16 files, FTS5 concept search migration). Nothing should break since it's all backward-compatible, but worth a scan if you're working in any of these areas. |
8 tasks
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
Changes
179e4eeinternal/mathutil/, deleted 3 copies, float64 precisionc8848cddonechannel +Close()method6a77042Start()acf9324agentutil/config.go, deleted 2 local copiesdc836b1AllowedOriginsconfig field with defaultsSearchByConceptsLIKE queries2b2eabee1ff61fpersistEncodedMemory(), -236 linesa59ba04Extra*config overrides9bcefb18771e7bTest plan
make buildpassesmake testpasses (0 failures)golangci-lint run— only 3 pre-existing issues, none from this branchpersistEncodedMemoryextraction)Closes #355
🤖 Generated with Claude Code