Files
gitlore/docs/ideas/churn.md
Taylor Eernisse 4185abe05d docs: add feature ideas catalog, time-decay scoring plan, and timeline issue doc
Ideas catalog (docs/ideas/): 25 feature concept documents covering future
lore capabilities including bottleneck detection, churn analysis, expert
scoring, collaboration patterns, milestone risk, knowledge silos, and more.
Each doc includes motivation, implementation sketch, data requirements, and
dependencies on existing infrastructure. README.md provides an overview and
SYSTEM-PROPOSAL.md presents the unified analytics vision.

Plans (plans/): Time-decay expert scoring design with four rounds of review
feedback exploring decay functions, scoring algebra, and integration points
with the existing who-expert pipeline.

Issue doc (docs/issues/001): Documents the timeline pipeline bug where
EntityRef was missing project context, causing ambiguous cross-project
references during the EXPAND stage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 10:16:48 -05:00

2.6 KiB

MR Churn Analysis

  • Command: lore churn [--since <date>]
  • Confidence: 72%
  • Tier: 3
  • Status: proposed
  • Effort: medium — multi-table aggregation with composite scoring

What

For merged MRs, compute a "contentiousness score" based on: number of review discussions, number of DiffNotes, resolution cycles, file count. Flag high-churn MRs as candidates for architectural review.

Why

High-churn MRs often indicate architectural disagreements, unclear requirements, or code that's hard to review. Surfacing them post-merge enables retrospectives and identifies areas that need better design upfront.

Data Required

All exists today:

  • merge_requests (state='merged')
  • discussions (merge_request_id, resolved, resolvable)
  • notes (note_type='DiffNote', discussion_id)
  • mr_file_changes (file count per MR)

Implementation Sketch

SELECT
    mr.iid,
    mr.title,
    mr.author_username,
    p.path_with_namespace,
    COUNT(DISTINCT d.id) as discussion_count,
    COUNT(DISTINCT CASE WHEN n.note_type = 'DiffNote' THEN n.id END) as diffnote_count,
    COUNT(DISTINCT CASE WHEN d.resolvable = 1 AND d.resolved = 1 THEN d.id END) as resolved_threads,
    COUNT(DISTINCT mfc.id) as files_changed,
    -- Composite score: normalize each metric and weight
    (COUNT(DISTINCT d.id) * 2 + COUNT(DISTINCT n.id) + COUNT(DISTINCT mfc.id)) as churn_score
FROM merge_requests mr
JOIN projects p ON mr.project_id = p.id
LEFT JOIN discussions d ON d.merge_request_id = mr.id AND d.noteable_type = 'MergeRequest'
LEFT JOIN notes n ON n.discussion_id = d.id AND n.is_system = 0
LEFT JOIN mr_file_changes mfc ON mfc.merge_request_id = mr.id
WHERE mr.state = 'merged'
  AND mr.merged_at >= ?1
GROUP BY mr.id
ORDER BY churn_score DESC
LIMIT ?2;

Human Output

High-Churn MRs (last 90 days)

  MR       Discussions  DiffNotes  Files  Score  Title
  !234          12          28       8     60    Refactor auth middleware
  !225           8          19       5     39    API versioning v2
  !218           6          15      12     39    Database schema migration
  !210           5           8       3     21    Update logging framework

Downsides

  • High discussion count could mean thorough review, not contention
  • Composite scoring weights are arbitrary; needs calibration per team
  • Large MRs naturally score higher regardless of contention

Extensions

  • Normalize by file count (discussions per file changed)
  • Compare against team averages (flag outliers, not absolute values)
  • lore churn --author alice — which of alice's MRs generate the most discussion?