Skip to content

feat: add vajra governance command with bus factor, Gini, churn metrics#32

Closed
copyleftdev wants to merge 2 commits into
mainfrom
feat/governance-metrics
Closed

feat: add vajra governance command with bus factor, Gini, churn metrics#32
copyleftdev wants to merge 2 commits into
mainfrom
feat/governance-metrics

Conversation

@copyleftdev

Copy link
Copy Markdown
Owner

Summary

  • New vajra governance command computing bus factor, Gini coefficient, contributor churn, and half-life
  • New vajra-stats/src/governance.rs module with 7 governance algorithms
  • CLI with --author-field and --time-field flags, JSON/text/markdown output
  • 18 new tests including property tests

Closes #28

Example

vajra governance commits.json --author-field '$.author' --time-field '$.date' --format json

Test plan

  • 18 tests pass (bus factor, Gini, churn, half-life, properties)
  • cargo clippy — zero warnings
  • No unwrap/expect/panic

🤖 Generated with Claude Code

copyleftdev and others added 2 commits April 9, 2026 21:02
…, and contributor churn

Implements issue #28: built-in governance metrics that were previously
computed externally in Python. Adds vajra-stats/src/governance.rs with
bus factor (50%/80%), Shannon entropy, Gini coefficient, top-K share,
one-commit rate, monthly contributor churn, and contributor half-life.
Adds `vajra governance` CLI command with JSON/text/markdown output.

All algorithms are O(n log n) or better, deterministic (BTreeMap),
and contain no unwrap/expect/panic. Includes 18 unit tests covering
known-value, edge-case, property, and rendering scenarios.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@copyleftdev copyleftdev force-pushed the feat/governance-metrics branch from ba10312 to 2439fc7 Compare April 10, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Built-in governance metrics: bus factor, merge equity, contributor churn

1 participant