feat(who): expand expert + overlap queries with mr_file_changes and mr_reviewers

Chain: bd-jec (config flag) -> bd-2yo (fetch MR diffs) -> bd-3qn6 (rewrite who queries)

- Add fetch_mr_file_changes config option and --no-file-changes CLI flag
- Add GitLab MR diffs API fetch pipeline with watermark-based sync
- Create migration 020 for diffs_synced_for_updated_at watermark column
- Rewrite query_expert() and query_overlap() to use 4-signal UNION ALL:
  DiffNote reviewers, DiffNote MR authors, file-change authors, file-change reviewers
- Deduplicate across signal types via COUNT(DISTINCT CASE WHEN ... THEN mr_id END)
- Add insert_file_change test helper, 8 new who tests, all 397 tests pass
- Also includes: list performance migration 019, autocorrect module, README updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Taylor Eernisse
2026-02-08 13:35:14 -05:00
parent 435a208c93
commit 95b7183add
19 changed files with 2139 additions and 291 deletions

View File

@@ -49,6 +49,9 @@ pub struct SyncConfig {
#[serde(rename = "fetchResourceEvents", default = "default_true")]
pub fetch_resource_events: bool,
#[serde(rename = "fetchMrFileChanges", default = "default_true")]
pub fetch_mr_file_changes: bool,
}
fn default_true() -> bool {
@@ -66,6 +69,7 @@ impl Default for SyncConfig {
dependent_concurrency: 8,
requests_per_second: 30.0,
fetch_resource_events: true,
fetch_mr_file_changes: true,
}
}
}

View File

@@ -57,6 +57,14 @@ const MIGRATIONS: &[(&str, &str)] = &[
"018",
include_str!("../../migrations/018_fix_assignees_composite_index.sql"),
),
(
"019",
include_str!("../../migrations/019_list_performance.sql"),
),
(
"020",
include_str!("../../migrations/020_mr_diffs_watermark.sql"),
),
];
pub fn create_connection(db_path: &Path) -> Result<Connection> {