v0.31.0 — cooperative index yield + concurrency/self-heal fixes - #6
Merged
Conversation
Two shipping-together pieces for the index-fix release:
LC-3 — index({ yield: true }): release the event loop between per-file
parses (setImmediate) so a co-hosted timer/socket breathes during a large
or force pass. Byte-identical stored index; default false unchanged.
Code-review fixes (validated + regression-tested, mutation-verified):
- Atomic force/self-heal rebuild: fold the destructive clear into
applyChanges' transaction so a concurrent reader never sees the empty
window between clear and re-populate (the warm-index-vs-recall race).
- Separate mem_embeddings table: written-memory vectors no longer share
file_embeddings, where a global-tier id equal to a file path clobbered
that file's vector. Kind-scoped getEmbeddings + one-time migration.
- Backfill drift guard: skip a file whose disk bytes drifted from its
stored hash; batch backfilled vectors in one transaction.
- MCP: retry a failed warm-index on the next initialize.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MEtvo8nTSpwN59712wEPEt
- index({ yield: true }) — LC-3 cooperative event-loop yielding
- atomic force/self-heal rebuild (no empty-index window for concurrent readers)
- separate mem_embeddings table (fixes global-tier id==path vector clobber) + migration
- embeddings backfill drift guard + batched writes
- MCP: retry a failed warm-index on next initialize
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MEtvo8nTSpwN59712wEPEt
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
Ships the index-fix work as one release (0.31.0):
Feature (LC-3):
index({ yield: true })— cooperatively release the event loop between per-file parses (setImmediate) so a co-hosted timer/socket breathes during a large/forcepass. Byte-identical stored index; defaultfalseunchanged. (bareloop upstream ask LC-3.)Fixes (all validated + regression-tested, mutation-verified):
applyChanges' transaction, so a concurrent reader (e.g. the 0.30.0 background warm-index firing while the model recalls) never sees an empty index. Reproduced: recall returned 0 mid-rebuild; now returns the full set.mem_embeddingstable — written-memory vectors no longer sharefile_embeddings, where a global-tierremember()whose id equalled a file path clobbered that file's vector (and aforgetdeleted it). Kind-scopedgetEmbeddings+ one-time auto-migration on open.initialize.Verification
node --test→ 416 pass / 0 fail / 1 skip (pre-existing embeddings-dep skip); +6 new regression tests (LC-3 yield, concurrency ×3, embeddings ×2).tsc --noEmit→ exit 0./ship,/security, independent/diff-reviewon the range → all clean (0 Critical / 0 Warning).Notes
index({ force:true, paths:[…] })still clears the whole index while re-inserting only the scoped subset — identical to prior behavior, not reachable via CLI/MCP.🤖 Generated with Claude Code
https://claude.ai/code/session_01MEtvo8nTSpwN59712wEPEt