Repository navigation
Preserve embedding indexes and report coverage health - #117
Conversation
There was a problem hiding this comment.
Confidence Score: 2/5
Summary
Score reconciled from 3/5 because the review includes a blocking finding.
Fail-closed embedding fingerprint handling (no auto-drop) plus read-only coverage diagnostics in doctor/status. Well tested, but a stale vec_meta state becomes a permanent dead-end and doctor flips unhealthy for every graph without vectors.
Important Files Changed
| File | Overview |
|---|---|
| src/kindex/vectors.py | Fingerprint gate refuses index replacement; vector_search raises EmbeddingFingerprintMismatch |
| src/kindex/embedding_health.py | New read-only coverage/freshness diagnostics; missing tables reported as unavailable issue |
| src/kindex/retrieve.py | hybrid_search re-raises fingerprint mismatch for every caller |
| src/kindex/cli.py | Doctor adds embedding findings; embed failures exit 1; mismatch exits 2 |
| CHANGELOG.md | Unreleased Fixed/Added entries |
| README.md | Documents preservation and diagnostics; awkward hard wrap |
| tests/test_doctor_fts.py | Fixtures now asserted unhealthy because no vector index exists |
| tests/test_doctor_idempotence.py | Same healthy-to-unhealthy contract rewrite |
| tests/test_embedding_cost_behavior.py | Config-change tests flipped from regeneration to refusal |
| tests/test_embedding_index_safety.py | New preservation/CLI/MCP/scheduler regressions |
| tests/test_embedding_quarantine.py | Mocked index now seeds vec_meta identity |
| tests/test_vectors.py | Mocked index now seeds vec_meta identity |
| tests/test_kindex_embedding_health.py | New offline coverage/freshness diagnostics tests |
Findings
src/kindex/cli.py— Humankin embed statusoutput still prints only 'Coverage complete'; emit embedding_health_lines so coverage and mismatch detail is not JSON-only.
Reviewed 63aad55...e42e217 · ↻ Re-run review · View in Adapt
|
Addressed the finding in Adapt review #5865199113 in 1d45bc6. Human-readable |
|
This is to address an issue where importing nodes after switching machines, I couldn't tell why my recovery was so bad but it turns out periodic model failures were causing the index to be cleared, but not successfully rebuilt. After triggering the rebuild, I now get |
|
Reviewed current head P2: preserve secondary-graph mismatch warnings in all MCP evidence paths. The new warning rendering in Independently reproduced with temporary graphs and no provider access: seed the secondary index using one model, reopen it read-only with a different model, and query through an empty primary graph. Ordinary context includes the mismatch warning; evidence context and Please propagate The preservation changes otherwise look sound in this review. Independently ran 145 focused tests plus 10 subtests successfully; |
|
Addressed @jmcentire’s finding in comment 6837812466 with commit Embedding mismatch warnings now survive MCP Reproduced seven warning-loss subcases against the previous head using temporary primary/read-only secondary graphs and no provider access. Those regressions now pass. Focused coverage: 175 passed, 19 subtests passed. Full local suite: 4,959 passed, 3 skipped, 286 subtests passed on Python 3.13.14; |
Summary
Existing vectors are durable state. A different embedding provider, model, dimensions or chunk strategy refuses indexing and semantic retrieval instead of dropping the index. Explicit provider settings and missing legacy fingerprint metadata do not authorize replacement. Vectors, metadata and pending work remain intact, and no provider request or interactive prompt is made for the mismatch.
Mismatch errors identify the stored and current provider/model/dimensions/strategy. Read-only secondary graphs skip only their incompatible semantic channel, keep lexical/graph results available, and surface a warning. MCP
ask, evidence-level context, and empty-result responses also retain that warning, including when the affected graph contributes no hits.kin task nearbydoes not depend on vectors, and optional compact-hook context reports an omission without failing the hook.kin doctorandkin embed statusreport eligible, fresh, missing and stale/incomplete coverage, quarantine and the latest retained vector update. A graph with no initialized optional vector index reports 0/N coverage as a warning; partial coverage or an unreadable existing index remains an issue. Freshness follows current redacted text, fingerprint and complete retained chunks, not timestamp age. The timestamp is not attempt history. Diagnostics never reindex, includingdoctor --fix.Restore the matching configuration to reuse the index. Ordinary indexing commands do not authorize erasure or migration, and no rebuild command is added.
Validation
pytest -n 4 --dist loadfile --timeout 300).git diff --checkpassed.testis pending for current head7fc301a62f2c19ab6f1e1630b839ac91872b8824.Proofwas skipped; the active default-branch ruleset has no required status-check contexts.Scope
Data-integrity safeguards and read-only diagnostics only. No provider/default/credential changes, release/version bump, deployment, live-graph changes or backfill. Real providers and live stores are intentionally not exercised.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.