Repository navigation
Index: every write declares what it changed and refreshes it - #1286
Merged
Merged
Conversation
This was referenced Nov 2, 2026
vmillet-dev
force-pushed
the
index/declared-writes
branch
3 times, most recently
from
November 3, 2026 03:36
b6a9442 to
a891c78
Compare
Engine::write runs the write, then reads again the notes, counts, folders or globals it names; corpus-wide writes empty the index for the next read to build.
vmillet-dev
force-pushed
the
index/declared-writes
branch
from
November 3, 2026 04:17
a891c78 to
7d66740
Compare
This was referenced Nov 3, 2026
3 tasks
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.
Closes #1151
Phase 1, step 5 of
docs/egui-migration-plan.md(§ 3.5 rule 2, Annex C, R4).index::Changed { notes, attachments, folders, globals, rebuild }andEngine::write(|db| …): the closure answers its value and what it changed;writethen refreshes the index — the named notes read again (notes::store::live, dropped when no longer live), the attachment counts, the folder chips or the global values reloaded. A refresh that fails empties the index rather than leaving it stale. No service function refreshes the index itself.{{field}}values;Changed::everything()— emptied, rebuilt by the next read: rename or drop tags corpus-wide, delete a folder or a space, import, the first launch's samples.Writes that touch nothing the index holds (space names and pins, board geometry, HTTP) keep
lock.Engine::index_matches_library(hidden) compares the index with one built from the database now; an index not started on the open library passes, since the next read builds it.Tests:
tests/commands/index.rschecks the index right after each write of every family above (a later write re-reading the same note would hide a miss — verified by breakingset_pinned's declaration: the test fails). Local: fmt, clippy (-D warnings),cargo test --workspace(1 608 tests) green.🤖 Generated with Claude Code