Files
gitlore/docs/ideas/hotspots.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.4 KiB

File Hotspot Report

  • Command: lore hotspots [--since <date>]
  • Confidence: 85%
  • Tier: 2
  • Status: proposed
  • Effort: low — single query on mr_file_changes (requires Gate 4 population)

What

Rank files by frequency of appearance in merged MRs over a time window. Show change_type breakdown (modified vs added vs deleted). Optionally filter by project.

Why

Hot files are where bugs live. This is a proven engineering metric (see "Your Code as a Crime Scene" by Adam Tornhill). High-churn files deserve extra test coverage, better documentation, and architectural review.

Data Required

  • mr_file_changes (new_path, change_type, merge_request_id) — needs Gate 4 population
  • merge_requests (merged_at, state='merged')

Implementation Sketch

SELECT
    mfc.new_path,
    p.path_with_namespace,
    COUNT(*) as total_changes,
    SUM(CASE WHEN mfc.change_type = 'modified' THEN 1 ELSE 0 END) as modifications,
    SUM(CASE WHEN mfc.change_type = 'added' THEN 1 ELSE 0 END) as additions,
    SUM(CASE WHEN mfc.change_type = 'deleted' THEN 1 ELSE 0 END) as deletions,
    SUM(CASE WHEN mfc.change_type = 'renamed' THEN 1 ELSE 0 END) as renames,
    COUNT(DISTINCT mr.author_username) as unique_authors
FROM mr_file_changes mfc
JOIN merge_requests mr ON mfc.merge_request_id = mr.id
JOIN projects p ON mfc.project_id = p.id
WHERE mr.state = 'merged'
  AND mr.merged_at >= ?1
GROUP BY mfc.new_path, p.path_with_namespace
ORDER BY total_changes DESC
LIMIT ?2;

Human Output

File Hotspots (last 90 days, top 20)

  File                              Changes  Authors  Type Breakdown
  src/auth/middleware.rs                 18        4  14 mod, 3 add, 1 del
  src/api/routes.rs                     15        3  12 mod, 2 add, 1 rename
  src/db/migrations.rs                  12        2  8 mod, 4 add
  tests/integration/auth_test.rs        11        3  9 mod, 2 add

Downsides

  • Requires mr_file_changes to be populated (Gate 4 ingestion)
  • Doesn't distinguish meaningful changes from trivial ones (formatting, imports)
  • Configuration files (CI, Cargo.toml) will rank high but aren't risky

Extensions

  • lore hotspots --exclude "*.toml,*.yml" — filter out config files
  • lore hotspots --dir src/auth/ — scope to directory
  • Combine with lore silos for risk scoring: high churn + bus factor 1 = critical
  • Complexity trend: correlate with discussion count (churn + many discussions = problematic)