Repository navigation
v0.1.4: a new embedding model needs --rebuild instead of wiping the index - #3
Merged
Merged
Conversation
…ndex `puremind index` with a changed embedder name or embedder_revision emptied the index and re-embedded every note. A `watch` left on the old config and a fresh `index` on the new one wiped each other in turn, with a full re-embed each time. - index_vault raises ModelMismatch (nothing changed, no probe embedded) when the model or revision differs from the one the index was built with and rebuild is not set. --rebuild keeps the probe-then-clear path. An index that holds no notes still takes a new model at once. - `puremind index` reports it with exit 2 and a --rebuild hint. - `puremind watch` stops on it, like a vault mismatch, with a hint to restart the watch, so a stale watch leaves the rebuilt index alone. - README, --rebuild help, CHANGELOG (0.1.4, unreleased) and a note at PINNED_REVISIONS that changing the pinned embedder revision now makes every existing index need --rebuild. Tests: the four tests that relied on the wipe now use rebuild=True and check the refusal; new tests cover the empty-index case, the CLI index refusal and the stale-watch scenario. The behavioural ones fail against the previous source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011zd8G1cibJoQPVbZEpVLYs
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.
Fixes the known issue carried over from #1: changing the embedder name wiped the index without
--rebuild. Apuremind watchleft running on the old config and a freshpuremind indexon the new one kept wiping each other, and each wipe meant a full re-embed.Behaviour
puremind index, model orembedder_revisionchangederror: the index was built with A but B is configured; nothing was changed+ hint to run--rebuild, exit 2puremind index --rebuild, model changedpuremind watchwhose model differs from the index's--rebuild--rebuildThe refusal comes before the probe passage, so a refused run embeds nothing.
Changes
indexer.py: newModelMismatch(ValueError).index_vaultraises it when the model or revision changed, the index holds notes, andrebuildis not set.cli.py:cmd_indexreports it with a--rebuildhint.cmd_watchstops on it the same way it already stops onVaultMismatch, with a restart hint.--rebuildhelp text updated.models.py: a comment atPINNED_REVISIONS. A future release that changes the pinned embedder revision now makes every existing index need--rebuild, so its release notes must say so.## 0.1.4 (unreleased)),__version__ = "0.1.4".Validation
pytest -q: 599 passed, 6 skipped.ruff check src tests bench(0.17.1): clean.rebuild=Trueand check the refusal first. New tests: the empty-index case, the CLIindexrefusal and recovery, and the stale-watch scenario (a watch onold-modelmeets an index rebuilt fornew-model, stops with exit 2, and the index keeps its 3 notes). The 5 behavioural tests fail against the previous source.index(A), thenindex(B) is refused with exit 2, thenindex --rebuild(B) rebuilds.Not on the model-loading path, so the real-models job isn't needed for this one.
🤖 Generated with Claude Code
https://claude.ai/code/session_011zd8G1cibJoQPVbZEpVLYs