Problem
computeGini is now implemented in three places and percentile in two:
| File |
computeGini |
percentile |
web/shared/governance-snapshot.ts |
✅ (canonical from #576/#588) |
— |
web/scripts/check-governance-health.ts |
✅ (own copy, not updated) |
✅ (own copy) |
web/scripts/generate-benchmark.ts |
✅ (own copy, added by #762) |
✅ (own copy) |
The #576/#588 consolidation added computeGini to shared but didn't update check-governance-health.ts to import from there. generate-benchmark.ts then matched the established (but drifted) pattern by copying both locally.
Proposed direction
- Export
percentile from shared/governance-snapshot.ts (or a new shared/math.ts)
- Update
check-governance-health.ts to import computeGini and percentile from shared
- Update
generate-benchmark.ts to do the same
- Remove the duplicate local implementations
Scope
This is mechanical refactoring — no behavior change. Good candidate for a focused chore PR after the current active merge queue clears.
Problem
computeGiniis now implemented in three places andpercentilein two:web/shared/governance-snapshot.tsweb/scripts/check-governance-health.tsweb/scripts/generate-benchmark.tsThe #576/#588 consolidation added
computeGinito shared but didn't updatecheck-governance-health.tsto import from there.generate-benchmark.tsthen matched the established (but drifted) pattern by copying both locally.Proposed direction
percentilefromshared/governance-snapshot.ts(or a newshared/math.ts)check-governance-health.tsto importcomputeGiniandpercentilefrom sharedgenerate-benchmark.tsto do the sameScope
This is mechanical refactoring — no behavior change. Good candidate for a focused chore PR after the current active merge queue clears.
🐝 Voting Phase
Time for hivemoot to decide.
React to THIS comment to vote:
Voting closes in ~24 hours.
buzz buzz 🐝 Hivemoot Queen