fix(memory): harden correctness and privacy#1920
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR hardens agent memory across chunked extraction, authoritative retrieval, revisioned persistence, conflict handling, provider cancellation, vector-store leases, provenance migration, disposal, and native SQLite validation. It also adds architecture specifications, implementation tasks, and regression coverage. ChangesAgent memory correctness and lifecycle hardening
Estimated code review effort: 5 (Critical) | ~120 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/presenter/memoryPresenter/infra/providerGateway.ts`:
- Around line 129-135: In the timeout callback that creates the deadline
promise, update the ordering so reject(createAbortError(`[Memory] ${purpose}
deadline exceeded (${deadline}ms)`)) executes before controller.abort(). Keep
the existing timer and cleanup behavior, ensuring the deadline rejection wins
the Promise.race instead of the abort handler.
In `@test/main/presenter/memoryPresenter.test.ts`:
- Around line 112-118: Update the return type of
conflict.repairConflictIntegrity in the test seam to include the clearedLinks
field, matching the actual returned object and existing assertions while
preserving the current fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5577a954-83fd-44ee-b2bb-19a0caec839c
📒 Files selected for processing (50)
.github/workflows/prcheck.ymldocs/architecture/agent-memory-correctness-privacy-hardening/plan.mddocs/architecture/agent-memory-correctness-privacy-hardening/spec.mddocs/architecture/agent-memory-correctness-privacy-hardening/tasks.mddocs/architecture/agent-memory-system/spec.mdpackage.jsonscripts/smoke-memory-native-sqlite.jssrc/main/presenter/agentRuntimePresenter/index.tssrc/main/presenter/agentRuntimePresenter/memoryExtractionChunks.tssrc/main/presenter/index.tssrc/main/presenter/memoryPresenter/context.tssrc/main/presenter/memoryPresenter/core/decision.tssrc/main/presenter/memoryPresenter/core/extraction.tssrc/main/presenter/memoryPresenter/core/injectionPort.tssrc/main/presenter/memoryPresenter/core/lifecycle.tssrc/main/presenter/memoryPresenter/core/scoring.tssrc/main/presenter/memoryPresenter/index.tssrc/main/presenter/memoryPresenter/infra/embeddingPipeline.tssrc/main/presenter/memoryPresenter/infra/providerGateway.tssrc/main/presenter/memoryPresenter/infra/vectorStoreManager.tssrc/main/presenter/memoryPresenter/ports.tssrc/main/presenter/memoryPresenter/services/conflictService.tssrc/main/presenter/memoryPresenter/services/maintenanceService.tssrc/main/presenter/memoryPresenter/services/managementService.tssrc/main/presenter/memoryPresenter/services/personaService.tssrc/main/presenter/memoryPresenter/services/reflectionService.tssrc/main/presenter/memoryPresenter/services/retrievalService.tssrc/main/presenter/memoryPresenter/services/rowMutations.tssrc/main/presenter/memoryPresenter/services/workingMemoryService.tssrc/main/presenter/memoryPresenter/services/writeCoordinator.tssrc/main/presenter/memoryPresenter/types.tssrc/main/presenter/sqlitePresenter/index.tssrc/main/presenter/sqlitePresenter/schemaCatalog.tssrc/main/presenter/sqlitePresenter/tables/agentMemory.tssrc/main/routes/index.tssrc/shared/lib/agentMemoryLineage.tstest/main/presenter/agentMemoryLineage.test.tstest/main/presenter/agentMemoryTable.test.tstest/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.tstest/main/presenter/agentRuntimePresenter/memoryExtractionChunks.test.tstest/main/presenter/fakes/memoryFakes.tstest/main/presenter/memory-persona-eval.test.tstest/main/presenter/memoryAdd.test.tstest/main/presenter/memoryExtraction.test.tstest/main/presenter/memoryLifecycle.test.tstest/main/presenter/memoryNativeMigration.test.tstest/main/presenter/memoryPresenter.test.tstest/main/presenter/memoryProviderGateway.test.tstest/main/presenter/memoryRetrieval.eval.test.tstest/main/presenter/memoryUpdate.test.ts
💤 Files with no reviewable changes (1)
- package.json
Summary
Harden Agent Memory correctness, privacy, concurrency, and native-resource lifecycle behavior.
This change prevents extraction data loss, stale semantic writes, privacy-sensitive injection races, invalid conflict aggregates, late destructive-operation side effects, and unbounded provider or vector-store operations.
Changes
decision_revisionmigration and revision-checked UPDATE, SUPERSEDE, CHALLENGE, and maintenance merge operations.memory-native-validationGitHub Actions job for native binding, FTS, fresh-schema, and migration validation.Summary by CodeRabbit
decision_revisionoptimistic concurrency and provenance v2 keying (with legacy compatibility).