Bind corpus version, embed model, and index as one versioned bundle #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Concern
The semantic index is addressed by
SHA256(model + exact corpus text)(src/embed.rs:20-26). Two independent inputs therefore silently invalidate the entire index:data/icd10gm2026_alphaidse_edvtxt_20250926.txt) changes every entry's text → every key misses.embed_modelin config (currentlyBAAI/bge-m3,config/*.toml) changes the model component of every key → every key misses.Either case forces a full re-embed of all ~90 896 corpus entries against IONOS — expensive in calls, time, and (per the user-level IONOS rule) explicit per-session consent.
Why this is a deployment hazard, not just a rebuild cost
Pipeline::loadbuilds the semantic index all-or-nothing: it constructs theVectorIndexonly when every corpus entry already has a cached embedding, otherwise it leaves the vector indexNoneand Mode A degrades to Mode C (src/pipeline.rs:43-50). A partial or mismatched index does not error — it silently downgrades the hybrid retrieval mode to the lexical baseline.Consequence for deployment: if the deployed
index/does not exactly match the deployed corpus snapshot and the configuredembed_model, the service runs the cheaper baseline while reporting Mode A was requested, and the only signal isdegraded: truein diagnostics (src/pipeline.rs:233). There is currently no artifact-level binding that prevents shipping a mismatched triple.What is missing
There is no single versioned unit binding {corpus snapshot, embed model, packed index} together. The three are gitignored and sourced independently (
.gitignoreexcludes/data/,/icd-claml/,/index/), so nothing structurally prevents a corpus update from landing without its matching index.Shape of the work (unverified — design to be ratified)
embed_model, and the index identity, checked atPipeline::loadtime.Acceptance
degraded: trueafter a request.Cross-link: the packed-matrix work referenced under 'Shape of the work' is now #3. The manifest described here should be embedded in the packed index file from #3.
Coupled with #3: the packed single-file matrix from #3 is the artifact this versioned bundle must bind (corpus version + embed model + index). Decision (2026-05-31): #3 and #4 will be brainstormed/specced together as one cycle in a fresh session, so the pack format and the version-binding scheme are designed coherently instead of #4 reworking #3's alignment.