iwe
Added
new --key <KEY>— create a document at an explicit key, bypassing the template's key derivation. Subdirectory keys (e.g.people/ada) are allowed; omit the file extension.new --if-exists fail— report an error and exit non-zero when the document already exists. It is the default when--keyis given (an explicit key asserts an identity), where previously an existing key silently gained a-1suffix.retrieve --expand-includes/--expand-included-by/--expand-references/--expand-referenced-by— one flag per expansion direction, each taking an optional depth (bare flag = one level,0= unbounded, omitted = not followed).--expand-referenced-by(pull documents that reference a seed) and transitive--expand-referencesare new directions.retrieve --lexical/--fuzzy— a one-shot form that searches for seed documents within the candidate set (-k/--filter/ anchors) and then expands the graph around the ordered seeds.retrieve --max-documents N— cap the number of documents returned after expansion, trimming periphery documents first (0= unlimited).
Changed
retrieve --limitnow caps the selected seed documents before expansion — top-N by relevance when searching, the first N of the selection otherwise (previously it capped the number of documents returned after expansion; use--max-documentsfor that).retrieveno longer expands by default: with no--expand-*flag (and no deprecated flag) it returns the requested document(s) only. The previous implicit-d 1 -c 1is now written explicitly as--expand-includes 1 --expand-included-by 1.
Deprecated
retrieve -d/--depth,-c/--context,-l/--links— retained as hidden aliases for--expand-includes N/--expand-included-by N/--expand-references 1(keeping their legacy0= off meaning). Passing one together with its--expand-*counterpart is an error.
iwec
Added
iwe_creategains an optionalkeyparameter — create a document at an explicit key instead of a title-derived slug. Derive it from stable metadata (entity name, session date); subdirectory keys (e.g.people/ada) are allowed; omit the file extension. Creation fails if a document with that key already exists.iwe_queryfindoperations accept asearchclause (search: { lexical, fuzzy }) — relevance selection that restricts and orders results; alexicalquery with no searchable terms returns an empty array plus a warning content block.iwe_retrievegainssearch/fuzzy(seed queries),expand(object overincludes/includedBy/references/referencedBy→ integer depths,0= unbounded), andmax_documents(cap the documents returned after expansion). With a search query the tool finds seed documents within the candidate set (keys+ selector) and expands the graph around the ordered seeds.
Changed
iwe_retrievelimitnow caps the seed documents before expansion (top-N by relevance when searching, the first N of the selection otherwise); usemax_documentsfor the post-expansion document cap.iwe_retrieveno longer expands by default — omitexpandand it returns the requested document(s) only (previously the implicit behavior was one level of children and parents).iwe_deleteandiwe_querydeletes now also remove any parent directory left empty by a removed document, matching the CLI (previously empty directories were kept).
Deprecated
iwe_retrievedepth/context/links— retained as aliases forexpand'sincludes/includedBy/references; passingexpandtogether with any of them is an error.
liwe
Added
Changes::merge— fold anotherChangesinto this one, deduplicating by key so a later update replaces an earlier one for the same document.operationsgains the section/reference selection helpers (sections,select_section,references,select_reference,SelectError,SectionRef,InclusionRef) andattach_reference/AttachTarget, so all operations live inliwe::operationsalongsideextract,inline,delete, andrename.searchclause onFindOp(SearchSpec { lexical, fuzzy }) — a relevance stage that restricts membership to documents matching the query and supplies the default ordering, jointly withfilter;search+sortkeeps membership from search whilesortsupplies the order. The ranking logic (query::search::ranked/matched, RRF fusion) is now a shared stage used by bothDocumentFinderand the query engine.RetrieveOptionsexpansion generalized to four edge-named depths —includes,included_by,references,referenced_by(u32,0= off,UNBOUNDED= no limit) — replacing thedepth/context/linksfields. Inbound-reference expansion (referenced_by) and transitive outbound-reference expansion (references> 1) are now expressible;retrieve::expand_depthmaps an--expandvalue (0= unbounded) to a depth.format::DocumentFormattrait (read/write/write_skip_frontmatter) as the format boundary, with the built-inMarkdownFormatand (feature-gated)DjotFormatimplementations and aformat::format_forconstructor.query::QueryScoresandquery::execute_with_scores— the query engine now ranks asearchclause from caller-injected per-key relevance scores instead of computing them itself, keeping the kernel free of any search index.
Changed
- Djot support is now behind an opt-in
djotcargo feature;jotdownis an optional dependency and thedjotmodule compiles only when the feature is enabled. Markdown remains built in. Enablefeatures = ["djot"]to read and write.djdocuments. - The BM25 search index left the kernel:
Graphno longer builds or holds one, soGraph::search,has_search_index,search_scores, andlexical_query_has_termsare removed, andGraph::from_state/Graph::importno longer take asearch_languageargument. The BM25 index and thesearchscoring (ranked/matched) moved to thediwecrate;query::SearchSpecstays as the DSL type. Graph::has_search_index()reports whether the graph carries a BM25 index; running afindwith asearchclause against a graph without one is an execution-time error (EvalError::SearchIndexMissing).RetrieveOptions.limitnow caps the seed set beforeDocumentReader::retrieve_manyexpands (it was a post-expansion cap on the number of documents returned); the post-expansion cap moves to the newRetrieveOptions.max_documentsfield. Both areOption<usize>,None/Some(0)= unlimited.EdgeRefmoved fromretrievetoquery::edges.
Removed
- The engine modules (
find,retrieve,stats,tokens,fs,file) and the.iwe/config.tomlmapping (Configuration,LibraryOptions,CompletionOptions,SearchOptions,Command,ActionDefinitionand its variants,NoteTemplate,load_config) moved to the newdiwecrate;liwekeeps the document kernel and the format/option types (Format,FormatOptions,MarkdownOptions,DjotOptions,FormattingOptions,LinkType,InlineType,TargetType,Operation) inliwe::model::config. Graph::from_path— the filesystem-loading constructor moved todiwe; build aStatefrom disk and callGraph::from_state.
diwe
Added
diweis the IWE engine library carved out ofliwe. It carries the app-facing layer:find(BM25 / fuzzy search),retrieve(document expansion with token budgeting),stats,tokens,fs(filesystem / workspace loading),graph_from_path, and the.iwe/config.tomlmapping (config::Configuration,config::load_config). It depends onliwefor the document kernel and re-exportsliwe's format/option types fromdiwe::config.search(the BM25 index) andsearch_query(BM25 + fuzzy resolvers, RRF fusion,build_index,ranked/matched, and anexecutewrapper that resolves a query'ssearchclause into scores and injects them into theliweengine).DocumentFinder::with_indextakes a caller-built index.fs::apply_changes— write aChangesset to a workspace (creates, updates, and removals), pruning any parent directories left empty by a removal.