fix(memory-reflection): Issue #680 - serial guard, fail-open, bulkStore (B/C options)#684
Open
jlin53882 wants to merge 5 commits intoCortexReach:masterfrom
Open
fix(memory-reflection): Issue #680 - serial guard, fail-open, bulkStore (B/C options)#684jlin53882 wants to merge 5 commits intoCortexReach:masterfrom
jlin53882 wants to merge 5 commits intoCortexReach:masterfrom
Conversation
…ore (B/C options) Fix 1 (CRITICAL): Move serial guard set() outside if(reflectionRan) Fix 2 (CRITICAL): Add searchFailed flag - skip item on vectorSearch error Fix 3 (MEDIUM): Replace N x store.store() loop with single bulkStore() call TDD tests: 3/3 pass
…lkStore recovery After bulkStore filters entries, storedEntries may be shorter than mappedEntries. Fix: store _reflectionHeading in each entry object; retrieve from stored entry instead of index-based lookup. Avoids heading mismatch when duplicate text exists under different sections.
…opagation Edge cases covered: - mdMirror heading from metadata JSON (not index-based) after bulkStore filtering - bulkStore error propagates (not swallowed) - Production path coverage note explaining closure limitation 5/5 tests pass.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Fixed issues found by adversarial review (6m23s Claude session): 1. [MAJOR] bulkStore error test: now uses mock throwing store (not valid-entry call) 2. [MINOR] JSON.parse crash: wrapped in try/catch with warn log 3. [MINOR] unbounded mappedEntries: added cap of 100 entries per run 4. [CHORE] NOTE comment in index.ts referencing Bug #1 test Code comment added at mdMirror loop explaining why metadata-based heading lookup is needed (index mismatch when bulkStore filters). All 5 tests pass.
507c2d8 to
1ce25b7
Compare
Adds test/memory-reflection-issue680-tdd.test.mjs to the core-regression CI group so it runs on every push and PR.
Contributor
Author
CI Status for PR #684PR #684 包含 5 个 commits,已通过本地测试 5/5。 3 个 CI 失败均为上游既有问题,与本 PR 无关:
本 PR 的 Issue #680 测试:
建议:3 个 CI 失败在 master 分支同样存在,应在 master 上统一修复。 |
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
Fix 3 bugs in the memory-reflection mapped-memory loop (Issue #680):
getSerialGuardMap().set()was insideif (reflectionRan), so early throws never triggered the guard. Fixed by moving it to unconditionalfinallyblock.searchFailedflag +if (searchFailed) continue.store.store()N times instead ofbulkStore()once. Fixed with singlebulkStore()call. Heading is embedded in metadata JSON (_reflectionHeading) to survive LanceDB round-trip and avoid index mismatch when bulkStore filters entries.Changes
index.ts: 3 bug fixes + 100-entry cap + JSON.parse defensive try/catch + mdMirror loop commenttest/memory-reflection-issue680-tdd.test.mjs: 5 TDD tests covering all 3 bugs + edge casesTest Results
Adversarial Review
Full adversarial review performed (Claude Code, 6m23s). All findings addressed:
Commits
474ea7atest+fix: Issue refactor: runMemoryReflection should use bulkStore() instead of individual store.store() #680 TDD - serial guard, fail-open, bulkStore601539cfix(reflection): mdMirror heading fix056b95dtest: add edge cases - mdMirror heading recovery + bulkStore error propagation1ce25b7fix: address all adversarial review findingsIssue
Fixes #680