Skip to content

feat: git blame ownership + bus factor metrics #22

@bntvllnt

Description

@bntvllnt

Summary

Add file/module ownership metrics derived from git blame, including bus factor (how many authors would need to leave before knowledge is lost).

Motivation

  • CodeScene's biggest differentiator is team dynamics and bus factor analysis
  • Ownership data helps AI agents know who to tag for review
  • Bus factor identifies knowledge concentration risks
  • git blame data is free — we already parse git log for churn

Proposed Metrics

Metric Type Source Meaning
primaryOwner string git blame Author with most lines
ownershipConcentration 0-1 git blame How concentrated ownership is (1 = single author)
busFactor 1-N git blame Min authors covering 80% of lines
lastModifiedBy string git log Most recent committer
activeContributors number git log (90d) Authors active in last 90 days

Acceptance Criteria

  • git blame parsed per file (batch, not per-line subprocess)
  • Ownership metrics added to FileMetrics
  • Bus factor computed per module
  • Exposed in file_context and find_hotspots tools
  • Tests with real git repos

Priority

Short-term — Bridges gap with CodeScene at minimal effort.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions