v0.31.1 — scoped-force clear + doc vector routing + warm-retry bound - #7
Merged
Conversation
Four correctness fixes to the index/recall/MCP surface (all uncommitted working-tree changes; none had reached npm): - index(): a scoped force pass (force + paths) no longer wipes the whole index while re-inserting only the scoped subset. Decouple clearAll (physical whole-index wipe) from rebuild (re-chunk in scope); a scoped force pass now re-chunks in place and reports `updated`, not `added`. - MCP warm-index: bound the retry (WARM_MAX_ATTEMPTS=3) so a persistently failing index can't thrash a full rebuild on every reconnect. - doc recall vector-table split: a written doc whose id equals an indexed .md path no longer has its file vector clobbered by the mem vector at cosine time. search() carries `source`; docCandidateVectors routes each doc candidate to the table its source names (positional, no clobber); the internal `source` field is stripped before recall returns. Each fix ships a mutation-verified regression test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MEtvo8nTSpwN59712wEPEt
…ry bound Docs + version bump for the four correctness fixes: - CHANGELOG: [0.31.1] entry (scoped-force clear, doc vector-table routing, bounded warm-index retry). - litectx.context.md: scoped pass never deletes outside scope now holds under `force`; warm-index retry documented as bounded. - litectx-prd.md: doc recall routes each candidate to its own vector table; scoped-force clear gated on a whole-index rebuild. 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.
Four correctness fixes to the index/recall/MCP surface (all were uncommitted working-tree changes; none had reached npm). Each ships a mutation-verified regression test.
Fixes
src/index.js) —index({ force: true, paths: […] })cleared the whole index while re-inserting only the scoped subset, deleting files outside the caller's scope. The destructive whole-index wipe is now gated on a whole-index rebuild (clearAll = rebuild && !partial); a scoped force pass re-chunks its files in place (reportedupdated, notadded) and touches nothing else. Not reachable via CLI/MCP — a latent library-API footgun.src/store.js+src/index.js) — a written doc whose id equals an indexed.mdpath put the same path in bothfile_embeddingsandmem_embeddings; the semantic re-rank merged both into one path-keyed map, letting the written vector clobber the file's at cosine time.search()now carriesdocs.source;docCandidateVectorsroutes each doc candidate to the table its source names (positional, no clobber); the internalsourcefield is stripped before recall returns. Completes the 0.31.0 vector-table split for the one kind spanning both tables.bin/litectx-mcp.js) — 0.31.0 retried a failed warm-index on everyinitialize, so a reconnect loop against a durably-broken index thrashed a full rebuild each handshake. Bounded to 3 attempts before giving up until restart.added/updatedreporting (src/index.js) — a scoped force pass counted files asadded; now correctlyupdated, consistent with the stale-stamp scoped path.Verification
/diff-reviewonorigin/main...HEAD: 0 Critical / 0 Warning./ship: tests 419 pass / 0 fail / 1 skip (pre-existing embeddings-dep skip),tsc --noEmitexit 0./security: injection-safe (${table}literals, bound params), tenant fence intact.🤖 Generated with Claude Code
https://claude.ai/code/session_01MEtvo8nTSpwN59712wEPEt