Commit Graph
65 Commits
Author SHA1 Message Date
inference-admin 38b8d25d74 manifest: pin to 20261114-90e320e 2026-11-14 19:03:40 +00:00
inference-admin 90e320e190 dashboard: drop the dash for the chat row's missing Revoke
The chat key has nothing to revoke, and ' - ' never centred in a grid cell sized
for a button, so it read as misalignment rather than as a deliberate blank. The
action column is empty for that row; the other rows still define the columns.
2026-11-14 19:03:24 +00:00
inference-admin 0eb11dd221 manifest: pin to 20261114-83b52f4 2026-11-14 19:02:25 +00:00
inference-admin 83b52f4675 dashboard: equal columns in the API key chart, and a dash where the chat key has no Revoke
Four equal columns (the name/meta, the bar, the value, the action) instead of a
wider bar column, and the chat row shows ' - ' in the action column rather than
rendering an empty cell that made the row look broken.
2026-11-14 19:02:08 +00:00
inference-admin 628e89fc99 manifest: pin to 20261113-b5b0703 2026-11-13 21:47:27 +00:00
inference-admin b5b0703f0c keys chart: chart the keys that HAVE usage, not the ones with metadata
The first cut built a row per key in the metadata list and attached usage to it.
Live, an account with three keys that had spent real money (homebot $11.84,
office-pi $0.19, base-pi $0.19) came back with an EMPTY key list and four usage
rows, so the chart drew one bar — the chat key — and quietly dropped the rest.
Exactly the kind of "listing" this chart exists to compare.

Now the usage rows are the authoritative set: every row gets a bar, metadata is
attached when we have it, and a key with no usage still gets a zero row so a key
you own is never invisible. The harness pins all three cases.
2026-11-13 21:47:07 +00:00
inference-admin ffd42a2045 manifest: pin to 20261113-b37b954 2026-11-13 21:45:46 +00:00
inference-admin b37b9549e4 dashboard: the panel's button shape, the server's spend figure, and keys as a chart
* Chart buttons take the admin panel's look: bordered, 8px radius, green-mid when
  active (was a borderless segmented control). One design across both apps.
* "co-op spend, all time" now reads the portal's figure from /api/metrics instead
  of summing the chart series in the browser. The second card ("of which the
  co-op's own accounts") is gone: it was that same client-side sum, and the
  portal's own breakdown is a panel-side notion I will not fake here.
* The API keys are a chart: one bar row per key — the chat key included, so the
  built-in key's usage is comparable rather than a footnote — with a Spend /
  Requests toggle. Revoke stays on each real key's row.
2026-11-13 21:44:14 +00:00
inference-admin 6e044c0f05 manifest: pin to 20261113-2b8b8ad 2026-11-13 21:27:14 +00:00
inference-admin 2b8b8ade18 charts: take the shared concise metric titles (Members · Requests · Spend · Money · Energy · Carbon)
Same menu, same order, same words as the panel — the two UIs now differ only in
whose usage they show and in their own visual style.
2026-11-13 21:26:28 +00:00
inference-admin 2172202315 manifest: pin to 20261113-8f67896 2026-11-13 21:19:25 +00:00
inference-admin 8f67896407 page: Cache-Control no-store (same reason as the panel: no validators on a single inline script, so a cached copy runs the previous deploy's JS) 2026-11-13 21:18:41 +00:00
inference-admin a6a70a0754 manifest: pin to 20261113-f72af43 2026-11-13 21:18:14 +00:00
inference-admin f72af43051 dashboard: build the shared metric row at boot
buildMetricButtons() was defined but never called — a one-shot replace had
slipped the call into loadGuests()'s 401 branch, and removing that left no call
at all. So the dashboard rendered its data with an empty metric row: no way to
switch between the shared metrics. Called at boot now, anchored on the closing
script tag, and the harnesses plus the served-page browser check confirm the row
exists with all six data-metric buttons.
2026-11-13 21:17:59 +00:00
inference-admin 1340548859 manifest: pin to registry.inference.coop/code/member-dashboard:20261113-e2a5018 2026-11-13 21:14:40 +00:00
inference-admin e2a5018150 fix: same broken metric-button line, plus a mangled location.reload()
The dashboard carried the identical inline-handler line inside PAGE_HTML — the
served JS was a syntax error from there on, so the page loaded and then did
nothing — and a second casualty of the same sloppy one-shot replace:
`location.reload()` had become `location.rebuildMetricButtons()\nload()` inside
loadGuests(). Both are fixed, and the same gate fix applies (the gate now reads
PAGE_HTML via ast.literal_eval, i.e. the string the app serves, not the source
text between the quotes).

Buttons are delegated data-metric clicks now, the harness proves the click
reaches setTrendMetric, and the stub gained stateful attributes plus
addEventListener/__fire to make that possible.
2026-11-13 21:14:03 +00:00
inference-admin 36d8ba6e35 manifest: pin to member-dashboard:20261113-d10b817 2026-11-13 21:02:58 +00:00
inference-admin d10b817fdc dashboard: the co-op charts come from the shared definitions (Money included)
The dashboard kept its own TREND_CONF with its own titles ("The co-op over time",
"What the co-op spent (members + the co-op's own accounts)") and its own toggles —
the other half of the drift the panel just lost. The metric list is now
CoOpChart.CHART_METRICS, the chart is drawn by the shared renderChart(), and the
buttons are built from the shared list, so members and stewards read the same
charts with the same names.

Money arrives as a metric here too, fed by a new /api/money-series proxy to the
portal's /broker/money-series — the co-op's cumulative revenue, cumulative token
spend and OC balance (a gap before snapshots began, never a zero). Deleting the
local TREND_CONF/trendVal/trendLabel also removes the second set of formatters.

Two page-blanking bugs caught by check-page-js.sh before they could ship: a
destructured fmtMoney colliding with this page's own (duplicate const), and `esc`
(which the panel defines and this page does not — it uses escapeHtml).

Harness extended: the money metric draws 2 lines + a single-point balance marker,
the tooltip lists every series and reports the unmeasured balance as not
measured, the metric row equals the shared list filtered by METRIC_SOURCE, and a
metric with no source says so. Geometry proof: 15 captured renders (5 metrics x 3
ranges) byte-identical to the predecessor with aria stripped.
2026-11-13 21:01:38 +00:00
inference-admin c5d4677ec3 chart module: re-pin to the canonical revision that adds the definition layer
Same byte-identical module as the panel; the dashboard's own port to the shared
definitions is the next commit. check-page-js.sh's DOM stub now supports
setAttribute/insertAdjacentHTML, which the shared metric-button builder needs.
2026-11-13 20:55:52 +00:00
inference-bot 8c469c1242 usage charts on the shared chart module: my-usage chart + co-op trend tooltips
Both usage views get charts. The co-op trend refactor onto the shared
coop_chart.js module replaces its native <title> tooltips with the panel's
exact-value hover tooltips (registerChartTips contract). NEW: the my-usage
view gets a per-day chart (Spend/Requests metric toggle, 30/90/all-time
period toggle) fed by /broker/usage's new daily series, same shared module,
same tooltip contract. No chart library, no CDN.
CI: .woodpecker.yml (oidc + chart sync pins, both harnesses via the vendored
check-page-js.sh, which splices the module as the app does).
Verified: rendering captured across all chart states matches the panel's
shared-module output; harnesses exercise exact values, zero days, gaps,
clamping, no-refetch toggles.
2026-11-13 16:11:23 +00:00
inference-bot 622982a371 oidc.py: single-sourced shared module; guest trail consumes the portal's state
- app/oidc.py is now a byte-identical copy of the canonical module
  (ops-docs: scripts/shared/oidc_client.py); this app's identity (logger
  name, session cookie, session salt) is set via oidc.configure() in
  main.py with the app's historical values, so existing sessions survive.
  tests/test_oidc_sync.py pins the copy to the canonical revision — a hand
  edit goes red; changes go through the canonical + sync-oidc-module.sh.
- The guest trail pill consumes the portal-served `state` (the single
  invited-vs-active derivation, tested in the portal) with the old
  status-only payload fallback kept; dashboard-guests-harness.js asserts
  both shapes through the real page JS.
2026-11-11 05:21:31 +00:00
inference-bot 1e6e9e481c Guest invite: hide the form once the 30-day invite is used; guest errors render in the guest card
When the member has no invite left (one per rolling 30 days), the invite
form is REMOVED and a dated line takes its place: 'You have already
invited a guest this month. Your next invite is available <date>' — the
date computed by the portal from the last invite (next_eligible_at).

All guest-invite feedback (errors, refusals, success) now renders in a
dedicated #guest-flash inside the guest access card — never the #flash
element in the API-keys card, which is a different feature (the bug the
operator reported: over-limit refusals surfaced in the API key area).
Hiding the form is UX only; the portal refuses direct over-limit calls
server-side regardless.
2026-11-08 20:53:51 +00:00
Inferencebot e5162afa05 Gift trail: invited guest reads 'Invited — awaiting setup', not active
The portal's trail now carries a derived state per guest entry — 'invited'
while the Cloudron invite is un-accepted (the guest cannot log in yet) —
rendered as a pale-blue pill; the ledger status stays the fallback for
older payloads. Display only.
2026-11-08 20:40:26 +00:00
inference-bot 1e9d212bd0 Guest section: invitations send directly — remove the pending-approval state
The portal provisions member invites immediately now (approval gate removed
2026-11-08), so the dashboard drops the trial-gate UI: no auto_approve
branch, no 'pending approval' pill or its CSS, button is always 'Send
invite', and the confirmation says the friend can set up their account now.
The trail still shows each guest active with its expiry (legacy rejected
requests from the trial period remain as history).
2026-11-08 20:20:33 +00:00
inference-bot 032068bfb4 Guest copy: $5 -> $2 of AI credits/usage 2026-11-08 20:13:22 +00:00
inference-bot e59ba4d05a Guest-invite form: keep a name field, optional and clearly labelled
Same standard form as the admin panel: the guest's email (required) plus
an OPTIONAL display name ('Their name (optional)' placeholder). Passed
through as the initial display name; an empty name is never derived from
the email. Full-width inputs in the stacked mobile form.
2026-11-08 02:57:30 +00:00
inference-bot 8f8106742a Standard guest-invite form: one email field, no name input
Same form as the admin panel: 'Invite a guest' heading, a single required
email input, a 'Send invite' button, submit on Enter. The inviter is the
logged-in member (automatic); the portal applies the one-per-30-days rule,
recipient checks and the pending-approval gate as before. No name is
collected or derived — the guest chooses their own at Cloudron setup.
2026-11-08 02:55:23 +00:00
inference-bot 84d5389eb6 Member self-serve guest access: invite a friend from the dashboard
New Guest access card (members only — a guest's dashboard keeps its own
ended-state view): invite a friend by email with an optional display name,
the remaining invitation allowance (one guest per member per rolling 30
days, with the next open date), and the member's own guest trail — who they
invited, when, and the honest status (pending approval / not approved /
active guest / became a member / ended). Under the trial gate the button
says 'Send request' and the hint says the co-op approves before the account
is created; the portal's auto_approve flag flips both to 'Send invite' with
no deploy. Portal refusals pass through verbatim (429 member-facing text).
/api/guests GET+POST are one hop to the portal's /broker/guests endpoints.
2026-11-08 02:44:02 +00:00
inference-bot 7430811ddc Rename 'gift' to 'guest' throughout: guest-status/cancel-guest routes, cancel-link wording, ended-state lines (pure rename, no behaviour change) 2026-11-08 02:35:52 +00:00
inference-bot 19361e27e4 guest cancel: self-service end-of-access with the ended state, and the plain OC-payment note
Guests get a one-click-reveal, one-click-confirm Cancel control under the
Become-a-member row: it ends the gift via the portal broker (/api/cancel-gift
→ /broker/cancel-gift), which returns unspent credit to the co-op. An ended
guest (cancelled, expired or spent out — via /api/gift-status on the usage
403, or straight from the cancel response) renders the ended state plainly:
access ended, unspent credit returned where it was, account and data kept,
Become-a-member still present. Members see the new plain line under the
balance: membership continues while the Open Collective contribution is
active — ending the contribution ends the membership, allowance stops
renewing after the current cycle — with the contribute page as the place to
manage the payment. Informational only.
2026-11-08 02:28:55 +00:00
inference-bot 67c10bae25 dashboard: guest accounts — no Matrix section, Become-a-member instead of buy
Gift accounts (portal flag on /broker/usage) get a different dashboard: the
Matrix card is hidden in the markup and only revealed for members (a guest
never sees it, even before the usage fetch returns), the credit-pack buy
button becomes 'Become a member' pointing at the OC contribution page, and
the meta line names the gift. Everything else (spend, models, keys, docs
links) unchanged.
2026-11-08 02:06:50 +00:00
inference-bot 3453131c73 dashboard: point docs links (Docs/Terms/Privacy, models, energy, allowance) at docs.inference.coop 2026-11-03 21:47:35 +00:00
inference-bot 55e81bfff9 dashboard: show the co-op's own share in Co-op usage
The Co-op usage view charted the co-op-wide spend (which spans the co-op's own
operator accounts) with nothing saying so. Adds a stats pair — co-op spend all
time, and of which the co-op's own accounts — summed from the series' new
operator_spend_usd (NULL days skipped, not counted as zero), and labels the
spend chart and the model board as including the co-op's own accounts.
2026-11-02 15:44:34 +00:00
inference-bot 094a3cb588 credit the member whose diagnosis produced the buy path
code/member-dashboard PR #1 by cag identified that members looked for a way to add usage and could not find it. The implementation that shipped (b352b1f) took that intent with a configurable destination, but its commit message did not name the contributor, which is the sort of thing that stops people bothering next time. Credited in the source where the feature lives. Source-only: no rebuild, so the running image does not contain this comment.
2026-11-02 02:08:39 +00:00
InferenceBot b352b1f427 dashboard: always-visible "Buy a credit pack" link in My usage
Members looked for a way to add usage from the dashboard and could not
find it — the buy path was invisible unless someone pointed them at it.
Add an always-visible green button in the "My usage" card, opening in a
new tab, plus the member's real credit status and a docs link.

The destination comes from CREDIT_PACK_URL on the dashboard app (same
convention the portal uses), defaulting to the Open Collective
contribute page — configurable in one place, not hardcoded in the
template. When the member has purchased credits the hint reads
"Credits never expire ($X purchased all-time)"; otherwise it keeps the
static "Credit packs never expire · used after your monthly allowance".

Docs link points at getting-started.md#user-content-need-more-than-the-allowance
(the rendered heading id Gitea actually serves), not the bare anchor.
2026-11-02 00:50:45 +00:00
InferenceBot c28a5b3fe7 keys: show per-key spend, chat separately
The API-keys card now shows each key's all-time spend (secondary, muted,
appended to the key's meta line) and the built-in chat key's spend on its
own line, read from the portal's key_spend field in /broker/usage. Skip
rows flagged is_chat when matching spend to a member key, so an API key
named 'chat' is not mistaken for the built-in.
2026-11-01 18:01:46 +00:00
inference-bot 700339aea6 dashboard/portal: docs links and an honest comment
Two tidy-ups, one of which turned out to be a live bug.

1. The dashboard's "About these models" link pointed at
   `.../src/content/docs/models.md`, which 404s. The working route is
   `.../src/branch/main/<file>` (the same class of dead link a past newsletter
   shipped four of). Fixed, and verified 200 before deploying.

2. Added a sibling link to the new energy-and-carbon page, so members reading
   the co-op's energy figures can find out how they are produced.

3. The portal's admin-token comment still said "set ADMIN_TOKEN_LEGACY=0 and
   rotate both" — stale, and the direct cause of a wrong report that a rotation
   was outstanding. It now records that the cutover completed 2026-10-28 and
   that BOTH tokens were minted/rotated on 2026-10-27, so nobody "finishes" this
   by rotating again.
2026-10-29 04:17:27 +00:00
inference-bot daf8fbe471 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:42 +00:00
inference-bot a71271e35c 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:50 +00:00
inference-bot 8e8cb90d11 dashboard: "The co-op over time" chart in the Co-op usage view
Members asked for charts to share with the co-op. This is the member-facing
half of it, in the view where co-op-wide data already lives.

- /api/metrics proxies the portal's new /broker/metrics (aggregate, non-personal:
  co-op size, requests served, spend). No per-member figure is fetched.
- Same chart as the admin panel's Trends tab: inline SVG, no library, no CDN,
  colours from the shared palette vars. Members / Requests / Spend, and
  30 / 90 / all time, re-rendered client-side without refetching.
- Lazy: loads the first time someone opens the co-op view, so the dashboard's
  initial load is unchanged.
- Gaps stay gaps. A day never measured breaks the line rather than reading as
  zero members, with the sub-line saying how many days are missing.
- Integer y-axis for people and requests; 1/2/5 money ticks, per the panel fix.

Verified with the same node harness used for the panel (shared, so it asserts
the same invariants against the live series).
2026-10-28 04:15:42 +00:00
Inferencebot 2dee1ea71d fmtMoney: snap |n| < half a cent to exact 0 — kills $-0.00 from float-residue spend 2026-10-19 12:05:51 -06:00
Inferencebot 9cc636dd99 Co-op usage: sort by cost (default) or requests; uniform rank badges (no special #1 styling) 2026-10-19 11:08:27 -06:00
Inferencebot cdff951594 Matrix card: concise redesign per Nathan — 'Current Matrix ID' display, 'Use @local' button when on an external ID, 'Use external account' reveals a validated field; no my/your mixing 2026-10-19 11:03:18 -06:00
Inferencebot 88bda332c3 dashboard: show the member's registered Matrix ID prominently (registered box + notes), surface load errors, add 'Use my co-op account instead' clear button 2026-10-19 10:48:47 -06:00
inference-bot 1242024cc7 Matrix card: clear invite-confirmation UX when saving an external MXID 2026-10-12 09:01:27 -06:00
inference-bot 6627bf0793 Balance view shows credits LEFT (remaining); all-time total in meta line 2026-10-03 13:59:32 -06:00
inference-bot 92158da5ea Dashboard: Matrix chat card — self-serve one extra federated MXID below API keys 2026-10-03 10:48:18 -06:00
inference-bot 98f829b65a Remove all-time tokens stat (all-time spend + requests cover it) 2026-10-01 16:12:28 -06:00
inference-bot e32710f9a6 Dashboard: all-time total spend stat (labeled, sits with the other all-time figures) 2026-10-01 16:08:19 -06:00
inference-bot 14a42b0cbb Leaderboard: single period note at top ('last 30 days'); rows just request counts 2026-10-01 15:57:38 -06:00