Skip to main content

populate_context_blocks

Function populate_context_blocks 

Source
pub async fn populate_context_blocks(
    conn: &Connection,
    config: &EmbeddingsConfig,
    repo_root: &Path,
    head_commit: Option<&str>,
    db_path: Option<&Path>,
) -> Result<PopulateStats>
Expand description

Embed all .normalize/context/ markdown files in the workspace.

Walks <repo_root>/.normalize/context/ recursively. Each *.md file is chunked by heading section and stored with source_type = "context" so normalize context --semantic can filter to context blocks exclusively.

Existing context embeddings for the same paths are replaced via the UNIQUE constraint on (source_type, source_path, source_id).