feat: implement per-note search and document pipeline

- Add SourceType::Note with extract_note_document() and ParentMetadataCache
- Migration 022: composite indexes for notes queries + author_id column
- Migration 024: table rebuild adding 'note' to CHECK constraints, defense triggers
- Migration 025: backfill existing non-system notes into dirty queue
- Add lore notes CLI command with 17 filter options (author, path, resolution, etc.)
- Support table/json/jsonl/csv output formats with field selection
- Wire note dirty tracking through discussion and MR discussion ingestion
- Fix test_migration_024_preserves_existing_data off-by-one (tested wrong migration)
- Fix upsert_document_inner returning false for label/path-only changes
This commit is contained in:
teernisse
2026-02-12 12:37:11 -05:00
parent fda9cd8835
commit 83cd16c918
21 changed files with 5345 additions and 126 deletions

View File

@@ -30,6 +30,7 @@ pub struct NormalizedNote {
pub project_id: i64,
pub note_type: Option<String>,
pub is_system: bool,
pub author_id: Option<i64>,
pub author_username: String,
pub body: String,
pub created_at: i64,
@@ -160,6 +161,7 @@ fn transform_single_note(
project_id: local_project_id,
note_type: note.note_type.clone(),
is_system: note.system,
author_id: Some(note.author.id),
author_username: note.author.username.clone(),
body: note.body.clone(),
created_at: parse_timestamp(&note.created_at),
@@ -265,6 +267,7 @@ fn transform_single_note_strict(
project_id: local_project_id,
note_type: note.note_type.clone(),
is_system: note.system,
author_id: Some(note.author.id),
author_username: note.author.username.clone(),
body: note.body.clone(),
created_at,