Commit 6250f94
v0.6.0: Write pipeline with sqlite-vec migration (#7)
* feat: add vecstore module with sqlite-vec integration
Wrap sqlite-vec for vector search, replacing HNSW-based approach.
Provides init, insert, delete, search (with tombstone filtering),
and clear operations on a vec0 virtual table. Includes 5 unit tests.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: integrate sqlite-vec into Store with transaction helpers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: replace HNSW semantic lane with sqlite-vec in search
All search code paths now use store.search_vec() instead of
HnswIndex::search(). The hnsw module remains but is unused — deletion
is deferred to Task 5.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: replace HNSW rebuild with sqlite-vec inserts in indexer
- Remove HnswIndex import and HNSW rebuild steps (11-12)
- Insert vectors into vec0 table during chunk write loop
- Delete from vec0 when files are deleted or changed
- Clear vec0 on full rebuild
- Use store.next_vector_id() instead of scanning all vectors
- Add folder centroid computation and storage after indexing
- Add folder_centroids table migration and upsert/get methods in Store
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: remove hnsw_rs dependency, delete hnsw.rs — vectors now in sqlite-vec
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: auto-migrate existing BLOB vectors to sqlite-vec on startup
Adds `migrate_vectors_to_vec0()` which copies BLOB vectors from
`chunks.vector` into the `chunks_vec` vec0 virtual table. Called from
`init()` after `init_vec_table()` so the virtual table is guaranteed
to exist. No-ops when vec0 is already populated or no BLOBs are present.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add tag registry with fuzzy resolution
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add link discovery module for auto-wikilinks
Scans note content for potential wikilink targets using exact filename
and alias matching. Supports case-insensitive search, word boundary
checking, existing wikilink skipping, and longest-match-first priority.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add folder placement module with type rules and semantic centroids
Three-strategy cascade: type-based rules (person/daily/workout + content
pattern detection) → semantic centroid matching against precomputed folder
embeddings → inbox fallback. 12 tests covering all strategies.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add write pipeline orchestrator with create, append, update, and move
Implements the writer module that ties together content analysis, tag
resolution, link discovery, folder placement, and atomic write+index.
- CreateNoteInput: 5-step pipeline (filename, tags, links, placement, write)
- AppendInput: append content with mtime conflict detection
- UpdateMetadataInput: frontmatter-only updates without re-chunking
- move_note: relocate files with store record updates
- All writes use temp+rename for atomicity with transaction rollback
- Pre-computes embeddings before holding DB lock
- Adds Store::resolve_file() for path/basename/#docid resolution
- Adds time crate for date formatting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: resolve clippy warnings in writer, links, and placement modules
* feat: add create, append, update_metadata, and move_note MCP write tools
Extends the MCP server with 4 write tools that expose the writer module
pipeline to Claude Code clients, completing the read-write tool surface.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add write CLI subcommands (create, append)
Adds `engraph write create` and `engraph write append` subcommands backed
by the writer module pipeline. Both support --content flag or stdin for
content input, with --json output mode.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add crash recovery — cleanup orphan .tmp files on startup
Scans the vault for leftover `.md.tmp` files on both `engraph index` and
`engraph serve` startup, removing any that survived a previous crash mid-write.
Logs the count if any are removed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test: add write pipeline integration tests
Three #[ignore] tests covering create_note searchability, append index
update, and mtime conflict detection. Run with:
cargo test --test write_pipeline -- --ignored
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: v0.6.0 — write pipeline, sqlite-vec migration, tombstone removal
Remove redundant tombstone writes from indexer (delete_vec handles it).
Replace tombstone loading in search with empty set. Fix clippy warning
in writer.rs. Apply cargo fmt across all modules. Bump version to 0.6.0.
Update CLAUDE.md with 19 modules, 190 tests, write pipeline docs, and
sqlite-vec architecture.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: update stored mtime after rename to prevent false conflict detection
* feat: add archive/unarchive for soft-delete with index exclusion
- archive: moves note to 04-Archive/, adds archived frontmatter, removes from index
- unarchive: restores to original location (via archived_from), re-indexes
- indexer auto-excludes archive folder during walks
- MCP tools: archive, unarchive (13 total tools now)
- CLI: engraph write archive/unarchive
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style: apply cargo fmt to archive/unarchive code
* feat: complete v0.6 spec coverage — content analysis, suggested_folder, incremental centroids, orphan cleanup, tag queries
- Gap 1: Add suggestion field to PlacementResult; add ticket ID detection
(BRE-XXXX/DRIFT-XXX), meeting note detection, decision type_hint
- Gap 2: Inject suggested_folder frontmatter when semantic placement finds
a below-threshold match during inbox fallback
- Gap 3: Incrementally update folder centroids after each note creation
(weighted merge with existing centroid)
- Gap 4: Add verify_index_integrity() to clean orphan DB entries for files
that no longer exist on disk; called on index and serve startup
- Gap 5: Add agent_created_tags(), low_usage_tags(), stale_tags() queries
to store for tag hygiene tooling
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0be5225 commit 6250f94
18 files changed
Lines changed: 3503 additions & 637 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | | - | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | | - | |
| 33 | + | |
29 | 34 | | |
30 | | - | |
| 35 | + | |
31 | 36 | | |
32 | | - | |
33 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | | - | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
47 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | 59 | | |
| 60 | + | |
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
54 | | - | |
| 64 | + | |
55 | 65 | | |
56 | | - | |
| 66 | + | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
| |||
0 commit comments