Skip to content

Fix/auto reindex - #248

Merged
samkeen merged 2 commits into
mainfrom
fix/auto-reindex
Oct 12, 2026
Merged

samkeen merged 2 commits into
mainfrom
fix/auto-reindex

Conversation

@samkeen

@samkeen samkeen commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Vaults are reconciled on open, including changes made while the app was closed. Keyword search becomes available after projection while missing vectors are embedded in the background.
    • Cached vectors are reused to restore note similarity data without repeating embedding work.
    • Filesystem changes and saves are coalesced, with follow-up indexing runs handling changes that occur during indexing.
  • Bug Fixes

    • Deleted notes are removed from listings and search after reconciliation, and edits undone to original content can recover their prior similarity data.

Update source-map-js to 1.2.2 and undici to 7.30.0 within existing dependency ranges to clear both high-severity npm audit findings. Verified with make ci.
Scan disk on every vault open instead of treating cached embedding coverage
as evidence that the vault is current. Preserve delayed saves and filesystem
changes across active index runs, while Cancel suppresses earlier embed
requests even when reconciliation is already in progress.

Restore centroids from cached vectors during projection so copied notes and
editor undo remain discoverable without loading the model. Document the
existing save and embedding delays.

Verify with scheduling regressions, disk-backed projection tests, and make ci.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 47ac1147-3e70-48c8-9fb0-5b8f765dedfc

📥 Commits

Reviewing files that changed from the base of the PR and between 4726e12 and e8351a2.


⛔ Files ignored due to path filters (1)
  • ui/package-lock.json is excluded by !**/package-lock.json

📒 Files selected for processing (8)
  • crates/b2-core/src/ingest.rs
  • crates/b2-core/tests/project_embed.rs
  • docs/index-engine.md
  • docs/quickstart.md
  • ui/src/indexing.test.ts
  • ui/src/main.ts
  • ui/src/reconcile.test.ts
  • ui/src/reconcile.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

Vault projection now restores centroids from cached vectors. Desktop indexing reconciles vault changes on open and coordinates trailing embedding for notes with missing vectors.

Changes

Vault reconciliation and indexing

Layer / File(s) Summary
Projection and centroid recovery
crates/b2-core/src/ingest.rs, crates/b2-core/tests/project_embed.rs
Projection refreshes missing note centroids when cached vectors and an embedding space are available. Tests cover offline edits, additions and deletions, copied notes, and editor undo.
Desktop reconciliation and trailing embedding
ui/src/main.ts, ui/src/indexing.test.ts, ui/src/reconcile.ts, ui/src/reconcile.test.ts, docs/index-engine.md, docs/quickstart.md
Vault opens project and reload notes before checking embedding coverage. Changes during indexing remain queued for a later pass. Trailing embedding checks current coverage and run state before embedding. Tests and documentation describe reconciliation, delays, and cancellation behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Desktop
  participant autoIndexOnOpen
  participant project_vault
  participant Embedding
  Desktop->>autoIndexOnOpen: open vault
  autoIndexOnOpen->>project_vault: project vault changes
  project_vault-->>autoIndexOnOpen: return projected vault
  autoIndexOnOpen->>Embedding: embed missing vectors when eligible
Loading

Suggested reviewers: claude


Merge Risk: ⚪ Minimal · up to e8351

The identified reconciliation and vault-switch cases retain their expected behavior. No issue remains that should prevent merging after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 59.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 6 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title identifies the main change: automatic vault reindexing and reconciliation.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 59.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 6 files. (2 skipped: 2 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.98.1)

Clippy execution timed out



Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the notes at dawn,
Cached vectors bring centroids on.
New changes wait, then join the queue,
Missing vectors get their due.
The rabbit hops through indexes, pleased.

Comment @coderabbitai help to get the list of available commands.

@samkeen
samkeen merged commit 1c9f61e into main Oct 12, 2026
2 checks passed
@samkeen
samkeen deleted the fix/auto-reindex branch October 12, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant