Replace flat-weight expertise scoring with exponential half-life decay, split reviewer signals (participated vs assigned-only), dual-path rename awareness, and new CLI flags (--as-of, --explain-score, --include-bots, --all-history). Changes: - ScoringConfig: 8 new fields with validation (config.rs) - half_life_decay() and normalize_query_path() pure functions (who.rs) - CTE-based SQL with dual-path matching, mr_activity, reviewer_participation (who.rs) - Rust-side decay aggregation with deterministic f64 ordering (who.rs) - Path resolution probes check old_path columns (who.rs) - Migration 026: 5 new indexes for dual-path and reviewer participation - Default --since changed from 6m to 24m - 31 new tests (example-based + invariant), 621 total who tests passing - Autocorrect registry updated with new flags Closes: bd-226s, bd-2w1p, bd-1soz, bd-18dn, bd-2ao4, bd-2yu5, bd-1b50, bd-1hoq, bd-1h3f, bd-13q8, bd-11mg, bd-1vti, bd-1j5o
21 lines
922 B
SQL
21 lines
922 B
SQL
-- Indexes for time-decay expert scoring: dual-path matching and reviewer participation.
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_notes_old_path_author
|
|
ON notes(position_old_path, author_username, created_at)
|
|
WHERE note_type = 'DiffNote' AND is_system = 0 AND position_old_path IS NOT NULL;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_mfc_old_path_project_mr
|
|
ON mr_file_changes(old_path, project_id, merge_request_id)
|
|
WHERE old_path IS NOT NULL;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_mfc_new_path_project_mr
|
|
ON mr_file_changes(new_path, project_id, merge_request_id);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_notes_diffnote_discussion_author
|
|
ON notes(discussion_id, author_username, created_at)
|
|
WHERE note_type = 'DiffNote' AND is_system = 0;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_notes_old_path_project_created
|
|
ON notes(position_old_path, project_id, created_at)
|
|
WHERE note_type = 'DiffNote' AND is_system = 0 AND position_old_path IS NOT NULL;
|