Skip to content

fix(core): FTS5 columns, unix index lock, pinned bulk delete, doc_search pairing - #1333

Merged
ajianaz merged 2 commits into
developfrom
fix/core-fts5-lock-pinned-docsearch
Oct 7, 2026
Merged

ajianaz merged 2 commits into
developfrom
fix/core-fts5-lock-pinned-docsearch

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

What

  • FTS5 columns: the four FTS5 SELECTs now return slug, source, source_type, author_type, deprecated_at in the order row_to_memory reads them; rank moves to index 22. Before, FTS-derived memories (hybrid recall, recall_explain) got slug = source, source = source_type, source_type = "unknown" and default author_type/deprecated_at.
  • Unix index lock: VectorIndex::save() locks the new temp file before renaming it over the index and keeps that handle as the live lock. Previously the flock stayed on the orphaned inode, so a second process could lock the new file and cross-process exclusion was lost after the first save.
  • Pinned: find_ids_cold / bulk_delete_cold skip pinned memories ("never decays"). forget --all is intentionally unchanged.
  • doc_search: chunk hits are paired with SQLite rows by id (pair_chunk_hits) instead of zip, which misaligned every score after a missing chunk row.
  • resolve_db_path: only chmods 0700 directories it created itself (a db path like ~/uteke.db no longer chmods $HOME).

Why

Validated findings from the Cora scan of v0.19.1 — see #1330. The FTS5 and lock issues silently produce wrong data / weaken the lock added to the safety net in #1320.

Testing

  • cargo clippy --workspace --all-targets clean; cargo test -p uteke-core -p uteke-server passes.
  • New tests: FTS5 rows carry correct metadata columns (both search paths), unix lock stays on the published file across repeated saves (verified it fails without the fix), cold bulk skips pinned, pair_chunk_hits with a missing row, resolve_db_path leaves pre-existing dirs alone.

Refs #1330

🤖 Generated with Claude Code

… doc_search pairing, db dir chmod

- fts5: select slug/source/source_type/author_type/deprecated_at in row_to_memory order; rank at index 22
- vector: on unix lock the new index file before rename so the exclusive lock follows the published inode
- bulk: cold find/delete skip pinned memories
- doc_search: pair chunk hits with rows by id instead of zip
- resolve_db_path: only chmod 0700 directories it created

Refs #1330

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@ajianaz ajianaz added bug Something isn't working scope:core Core engine work priority:high Fix in next release labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

The vecq-only CI check cannot load a .usearch file.

Refs #1330

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority:high Fix in next release scope:core Core engine work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant