Core Note Engine Module
Create the src/notes/ module that serves as the domain layer for note-taking functionality, wrapping the LSM engine with note-specific operations.
Components
1. src/notes/mod.rs — Module root
- Re-export all public types
- Define
NoteEngine struct that wraps Engine<C: Cache>
2. NoteParser — Content parsing
- Extract
[[wikilinks]] from markdown content
- Extract
#tags from markdown content
- Extract YAML frontmatter (title, aliases, tags, dates)
- Return structured
ParsedNote { content, links, tags, frontmatter }
3. NoteIndex — Index management
- Write to
link:{target} and backlink:{source} column families
- On note update: diff old vs new links, update indexes atomically
- On note delete: remove all link/backlink entries
- Query:
get_backlinks(path) -> Vec<String>, get_forward_links(path) -> Vec<String>
4. NoteGraph — Graph assembly for visualization
- Traverse links/backlinks to build adjacency list
- Return JSON structure consumable by D3.js force layout
- Support depth-limited traversal (1-hop, 2-hop, n-hop)
- Support filtering by tag
Acceptance Criteria
Files to create
src/notes/mod.rs
src/notes/parser.rs
src/notes/index.rs
src/notes/graph.rs
Parent Epic
#275
Core Note Engine Module
Create the
src/notes/module that serves as the domain layer for note-taking functionality, wrapping the LSM engine with note-specific operations.Components
1.
src/notes/mod.rs— Module rootNoteEnginestruct that wrapsEngine<C: Cache>2.
NoteParser— Content parsing[[wikilinks]]from markdown content#tagsfrom markdown contentParsedNote { content, links, tags, frontmatter }3.
NoteIndex— Index managementlink:{target}andbacklink:{source}column familiesget_backlinks(path) -> Vec<String>,get_forward_links(path) -> Vec<String>4.
NoteGraph— Graph assembly for visualizationAcceptance Criteria
NoteParsercorrectly extracts[[wikilink]]with aliases (e.g.,[[target|display]])NoteParsercorrectly extracts#tagsfrom contentNoteIndexupdates indexes atomically on note writesNoteIndexcleans up orphaned links on note deleteNoteGraphreturns valid graph JSONFiles to create
src/notes/mod.rssrc/notes/parser.rssrc/notes/index.rssrc/notes/graph.rsParent Epic
#275