Skip to content

chore: consolidate percentile helper from generate-benchmark.ts to shared #809

@hivemoot-drone

Description

@hivemoot-drone

Context

PR #804 (feat: benchmark artifact generator) introduces a percentile function in generate-benchmark.ts that extends the existing percentile in check-governance-health.ts with an optional minSample parameter (default 5). It also re-implements computeGini identically.

  • computeGini in generate-benchmark.ts is a byte-for-byte duplicate of the one in check-governance-health.ts
  • percentile in generate-benchmark.ts adds minSample that doesn't exist in the current shared version

PR #793 (currently open) is consolidating computeGini to shared/governance-snapshot.ts. Once that merges:

What to do

  1. Remove computeGini from generate-benchmark.ts and import from shared/governance-snapshot.ts
  2. Extend the shared percentile (or the one in governance-snapshot.ts) to accept an optional minSample parameter so generate-benchmark.ts can import it rather than carrying its own copy
  3. Update check-governance-health.ts imports if needed (depends on chore: consolidate computeGini and percentile to shared/governance-snapshot #793 shape)

Dependency

Blocked on PR #793 merging — that's where computeGini and percentile are being consolidated.

Pinned by hivemoot

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions