Commit Graph
30 Commits
Author SHA1 Message Date
inference-bot a5229103f6 charts: add Energy and Carbon (co-op/support#26)
Two more metrics on the same chart, from the portal's new energy_wh and co2e_g
daily columns.

- Energy in watt-hours, carbon in grams CO2e, both for the day shown.
- Continuous metrics use the 1/2/5 axis rule (not the integer rule reserved for
  counts), so energy ticks read 500 Wh rather than being rounded to whole
  people-style numbers.
- Labels carry units, so a reader never has to guess what the axis measures.
- Same measured-vs-estimated provenance as the data layer: GreenPT models use
  facts fitted from their own impact API, everyone else a labelled proxy. The
  docs page on estimation is still to be written; the factor table and its
  sources are in metrics_snapshot.py.

Harness extended: one bar per measured day for each, no NaN in markup, and axis
labels matching ^[\d,]+(\.\d+)? (Wh|g)$ so a unit prefix or a forced integer
axis fails the build.
2026-10-28 04:36:13 +00:00
inference-bot 10d62fdde4 panel/dashboard: drop the caveat and the status line under the co-op chart
Nathan: the disclaimers are not necessary, especially now that reporting is in
place going forward — and then, on the status line under it: remove that too.

Gone from both apps: the explanatory note paragraph, its per-metric config
strings, the status line ("55 days - 2 not measured"), the now-orphaned CSS for
both, and the gaps counter that only fed the status line. The period toggles
still say what range is on screen, so no information is lost.

The harness assertions that described the status line are replaced by stronger
ones: the rendered chart must contain no caveat text at all, and the 30-day view
must still end at the most recent measured day.
2026-10-28 04:23:21 +00:00
inference-bot 41b86bcc80 panel: integer y-axis for people; round money and request ticks
Nathan: the members axis should be whole numbers, since it counts people. It
was drawing fractional ticks (19.17 people) because the 1.08 headroom factor
fed straight into the label math.

Ticks now come from a step, with the axis top set to step x 4, so labels land
on round numbers:
- counts (members, requests): whole numbers, rounded up to a half power of ten
  (requests read 3,000, not 2,888). Never below 1, so a near-empty series still
  gets an integer axis rather than fractions.
- money: the 1/2/5 x 10^k rule, so ticks read $10.00 rather than $4.92.

Rendered now: members 0 | 20 | 40 | 60 | 80; requests 0 | 3,000 | 6,000 |
9,000 | 12,000; spend $0.00 | $10.00 | $20.00 | $30.00 | $40.00.

The node harness gained assertions for this, checked geometrically (tick values
ascend while their screen positions descend, the zero tick sits lowest, ticks
are evenly spaced) rather than assuming a text order, so a fractional
people-axis or a misplaced label fails before a deploy.
2026-10-28 04:08:18 +00:00
inference-bot 11ae968889 panel: Trends tab — members and usage over time, charted
Nathan asked to see a chart. The portal now owns a daily metrics series
(metrics_daily, written 03:15 UTC by the portal's own scheduler); this is the
first surface to read it.

- New route /api/metrics proxies the portal's /admin/metrics/series (admin
  token stays server-side, same pattern as /api/model-usage).
- New Trends tab, added to switchView in the same edit (every view toggled
  there must be shown/hidden there). Lazy: the series loads on first visit, so
  the panel's initial load is unchanged.
- Metric toggle (Members / Spend / Requests) and period toggle (30 / 90 / all
  time). Fetched once at the widest range and re-rendered client-side, so the
  toggles never refetch.
- Inline SVG, hand-rolled: no chart library, no CDN, no external dependency.
  Colours come from the panel's existing CSS vars, so it matches the rest.
- Gaps are drawn as gaps. A NULL metric means "not measured" and the line
  deliberately breaks rather than drawing through a day we never recorded
  (backfilled members_active is NULL every day, by design). The sub-line says
  how many days are unmeasured.
- Members shows the cumulative total; spend and requests are per-day bars.

Verified against the live 55-day series with a node harness running the real
page functions: 22 checks, including that a NULL breaks the line into two runs,
that no NaN reaches the markup, that the toggles do not refetch, and that the
SVG carries no hardcoded hex.
2026-10-28 04:01:52 +00:00
Inferencebot 476394b946 account cell: username on top (prominent), email + matrix handle beneath in muted style; admins section matches; dedupe org block 2026-10-20 23:34:52 -06:00
Inferencebot 0a66498ed2 panel: fix broken string escape in org-pill JS (killed the render script — no data) 2026-10-20 23:16:41 -06:00
Inferencebot f0cf8d9663 panel: org pill (dues paid by OC organization) + Matrix handle under each email (external MXID or local identity) 2026-10-20 23:02:01 -06:00
Inferencebot 71c4e68a5c fmt: snap |n| < half a cent to exact 0 — kills $-0.00 from float-residue spend 2026-10-19 12:04:58 -06:00
Inferencebot b8f737d1ee panel: Admin accounts show raw spend only — Status/Activated/Spend/Reset (30-day spend in Balance mode, all-time in All Time); drop allowance/credits/remaining/adjust 2026-10-19 11:16:31 -06:00
inference-bot 0f12dc9e7b Hide Admin section in Models view (was rendering above the model table, breaking format) 2026-10-15 16:44:29 -06:00
inference-bot bee02c6e4d Panel: add Admin category under Members view; exclude operator accounts from member list/counts 2026-10-08 15:08:24 -06:00
inference-bot 345eca7f1e Credits column: balance view = credits left, all-time view = total purchased 2026-10-03 13:59:34 -06:00
inference-bot 585f133412 Admin panel: move emphasis from Credits to Remaining (bold green highlight) 2026-10-03 12:59:47 -06:00
inference-bot 4d54d92742 Leaderboard default: members sorted by spend descending on load 2026-10-01 15:33:48 -06:00
inference-bot 8c6f2a85c0 Members view: Balance / All-time mode switch (period columns hide in all-time); drop redundant 'active' total card 2026-10-01 07:38:54 -06:00
inference-bot 52314ddfe2 Panel wording: 'current balance used' (per-member periods, not a global cycle); Spend header toggles current/all-time 2026-09-30 22:26:46 -06:00
inference-bot 90d76dc7ab Spend clarity: since-reset vs all-time (per-member resets), toggle on Spend header, both totals shown; rename cycle wording 2026-09-30 22:22:13 -06:00
inference-bot 51e189ae4d Fix clipped Credit button: nowrap on adjust cell, flex-shrink:0 on controls 2026-09-27 22:38:43 -06:00
inference-bot de3ef3f7ca Layout cleanup: full-width totals grid, grouped period controls, scrollable tables, wider container 2026-09-27 22:27:31 -06:00
inference-bot 119cf0531a Source column: show manual vs OC member status (bronze pill for manual) 2026-09-27 21:20:37 -06:00
inference-bot 4df546fbe9 Credits: column, pill display, and add-credits control (two-bucket budgets) 2026-09-27 19:11:49 -06:00
inference-bot 2b42812c22 Add Members/Model-usage tabs, 30-day/all-time range toggle, sortable columns 2026-09-26 16:09:34 -06:00
inference-bot 25568680b4 Add model-usage table to admin panel 2026-09-26 15:31:12 -06:00
inference-bot 6b4dcac7a1 Phase 4: remove proxyAuth header fallback — identity only from OIDC session 2026-09-23 09:45:52 -06:00
inference-bot 048654d000 Phase 1: add OIDC client (redirect/callback/token/session) with proxyAuth header fallback
No manifest change yet — proxyAuth stays active, so get_identity() still works
via header. OIDC routes only activate when CLOUDRON_OIDC_* env vars are present.
Validates id_token signature (JWKS), iss/aud/nonce, exp/nbf.
2026-09-23 09:13:37 -06:00
inference-bot 30ca7cbcf3 Send admin token via X-Admin-Token header (not URL path) 2026-09-14 18:06:02 -06:00
inference-bot 6d3f6f7c86 Show activation status (yes/pending) column 2026-09-14 17:00:58 -06:00
inference-bot 8785e8650c Show username under email in member table 2026-09-14 16:53:37 -06:00
inference-bot 30b330aa1a Fix admin panel JS: use data-attribute for balance button (was emitting invalid onclick) 2026-09-14 16:50:48 -06:00
inference-bot c8c6e23a28 Admin panel: member overview + balance adjustment (proxyAuth, admin-gated) 2026-09-14 16:41:55 -06:00