[maintainer-simulation] Cost page AIC rounding makes per-repository and workflow dollar values disagree with totals

Open
#20,097 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Start with the aicc branch of formatNumber in dashboard/site/src/view-formatters.js, where values are rounded to unit.significant before formatAicc divides by 100. Check the DLS-UNIT-004 rule in docs/dashboard-language-specification.md and the aic unit on cost-by-repository and cost-by-workflow in dashboard/site/dashboard-fragments/overview.json. Done means the per-repository slices, the center total and the per-workflow values reconcile, which needs a maintainer decision on the spec change first.

Written by the indexing model from the issue text.

Description

Finding from simulation (synthetic local fixture), not production.

Summary

On the Cost page, aicc-formatted values are rounded to 2 AIC before conversion to dollars. Parts then do not add up to the displayed total, and small per-run costs are distorted.

Maintainer impact

A FinOps maintainer sees three repositories at $0.40 each (sum $1.20) beside a center total of $1.18. Per-workflow values show $0.22 and $0.18 and an average of $0.04, even though the fixture runs cost 0.5 to 6 AIC. Cost figures cannot be reconciled.

Affected scenario

S08 (desktop 1440x1000).

Preconditions

Local simulation fixture: 36 successful synthetic runs, 3 repositories, 2 workflows each. Each repository has 39 AIC (true $0.39), 117 AIC in total ($1.17).

Reproduction

  1. Start node scripts/maintainer-simulation.mjs serve and open the local dashboard at 1440x1000.
  2. Expand Data and click Cost.
  3. Read the "Cost per repository" pie slices, the center "AIC cost" total, and the "Cost per workflow" bars.
  4. Reproduced in a fresh browser session.

Expected / actual

  • Expected: slices of $0.39 each, with a total of $1.17, or at least parts that agree with the total.
  • Actual: slices of $0.40 each, a total of $1.18, and an average of $0.04 per run.
Evidence and source paths
  • Artifact maintainer-simulation: shots/s08.png, shots/s08-repro.png, results.json.
  • dashboard/site/src/view-formatters.js formatNumber: with unit.format === 'aicc' it rounds to unit.significant (2 AIC) and then calls formatAicc (value/100).
  • docs/dashboard-language-specification.md DLS-UNIT-004 requires this rounding.
  • dashboard/site/dashboard-fragments/overview.json cost-by-repository and cost-by-workflow use the aic unit.

Potential minimal fix (hypotheses)

  • Format aicc after dividing by 100 and rounding to cents, instead of rounding to 2 AIC first. This needs a DLS-UNIT-004 change.
  • Alternatively, show the unrounded AIC in tooltips or aria labels so totals can be reconciled.

Tested SHA: fb8ce95eda1a96712fbce50c84ff2162bf25c375
Run: https://github.com/githubnext/gh-cao/actions/runs/41409482643

Generated by Dashboard Maintainer Simulation · copilot · auto · ~96 AIC · ⌖ ~1 AIC · ⊞ 10.4K · ◷

  • expires on Nov 16, 2026, 8:08 AM UTC
Dominant language
JavaScript
Stars
8
Forks
5
Avg merge
3h 20m
Merged PRs (30d)
811

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from githubnext/gh-cao

All issues in githubnext/gh-cao

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.