Skip to content

✨ benchmarks export: per-PR estimated cost from launch attribution #17790

Closed

Description

@clubanderson

Follow-up to #17694 / #17716. GET /api/benchmarks/export emits every record without a cost block, so https://hivecommons.dev/benchmarks/ had to impute every dollar from fleet medians.

The spoke already attributes spend to PRs: /api/launch-cost (persisted at /data/launch-cost.json, daily rollup per ref) prices each kick's tokens with pkg/tokens/pricing.go and splits it across the refs the kick named — the swarm's owner/repo#N PR ref, or the governor's repo#N issue ref.

Wire it into the export:

  • pkg/evidence/benchmarks: Cost{basis, usd_est, *_tokens, launches, price_table_date} on Record; Options.CostLookup hook; author records look up the PR and the issues it closed (issue_closures, both ref spellings), reviewer records the PR ref.
  • pkg/dashboard: implement the lookup over LaunchCostCollector.DailyRollup() (USD) + Snapshot().ByLaunch (token share). basis: tokens_x_pricing when usage landed, else unknown. Never emit fleet_model_median (the site imputes it).
  • Refresh the vendored testdata/result.schema.json (benchmarks schema now has cost.basis enum reported|tokens_x_pricing|fleet_model_median|unknown), golden/schema tests, docs (src/docs/benchmarks.md cost section), changelog fragment.

Privacy: only the per-PR estimate and its token share leave the spoke; no per-session usage, no billed figures.

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 11, 2026
  2. added a commit that references this issue on Nov 12, 2026
    ed0d01a
  3. added a commit that references this issue on Nov 12, 2026
    2ab505e
  4. added a commit that references this issue on Nov 13, 2026
    7d122ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions