Indexer behaviour (fnord v0.9.22)
View SourceThis behaviour wraps the AI-powered operations used by Cmd.Index to allow
overrides for testing. See impl/0.
Summary
Functions
Returns the current indexer module. This can be overridden by config for unit
testing. See test/test_helper.exs.
Indexes a single entry: reads the source, generates summary and outline in parallel, computes embeddings, and persists everything. Returns the entry struct on success so callers can immediately read its data.
Types
Callbacks
@callback get_embeddings(file_content()) :: embeddings() | error()
@callback get_outline(file_path(), file_content()) :: completion() | error()
@callback get_summary(file_path(), file_content()) :: completion() | error()
Functions
Returns the current indexer module. This can be overridden by config for unit
testing. See test/test_helper.exs.
@spec index_entry(Store.Project.Entry.t()) :: {:ok, Store.Project.Entry.t()} | {:error, term()}
Indexes a single entry: reads the source, generates summary and outline in parallel, computes embeddings, and persists everything. Returns the entry struct on success so callers can immediately read its data.
This is the canonical single-file indexing pipeline, used by Cmd.Index
for bulk indexing.