Commit Graph
54 Commits
Author SHA1 Message Date
inference-bot 575338a577 Guest-invite form: keep a name field, optional and clearly labelled
Final operator preference: the standard form is the guest's email
(required) plus an OPTIONAL display name, labelled 'Their name
(optional)'. The name passes through to provisioning as the initial
display name (the Cloudron path fills only empty names and never
overwrites one the guest sets at setup); an empty name is never derived
from the email.
2026-11-08 02:57:28 +00:00
inference-bot d6d960324a Standard guest-invite form: one email field, admin inviter, mobile-first
Replaces the tab-bar form (email + name + inviting-member inputs, which
overflowed a narrow frame) with the standard form: a card in the members
view — 'Invite a guest', a single required email input, a 'Send invite'
button. No name field (the guest chooses their own at Cloudron setup) and
no inviter field: the portal records the co-op's ADMIN account and applies
no monthly cap to admin invites. Form submits on Enter; full-width input
and button under 600px. Removed the dead member-email datalist.
2026-11-08 02:55:23 +00:00
inference-bot d5baffdb48 manifest: pin to 20261108-cf82ab5 2026-11-08 02:45:41 +00:00
inference-bot cf82ab55ea Pending-guests approval: the member self-serve trial gate in the panel
New Guest requests tab: the pending queue (inviter + recipient + name
visible, Approve/Reject per row with confirms), recent decisions, and the
guests ledger with every status pill — pending vs approved in one view.
Approve fires the portal's full guest pipeline through
/admin/guest-requests/{id}/approve (every guard re-runs); reject tells the
inviting member 'not approved' in their own dashboard trail. The tab badge
carries the pending count; the queue refetches on every visit and after
every decision so a row is never stale.
2026-11-08 02:44:46 +00:00
inference-bot a8674af611 Rename 'gift' to 'guest' throughout: guest pill, Guests list wording, provision-guest route and send form (pure rename, no behaviour change) 2026-11-08 02:31:07 +00:00
inference-bot 7b8a3f5654 manifest: pin to 20261108-4744a4f 2026-11-08 02:08:54 +00:00
inference-bot 4744a4fd31 panel: gifting action (provision-gift) + gift pill and datalist for member emails
The Send-gift control sits in the members-view toolbar: recipient email +
name + inviting member (datalist of member emails), proxied to the portal's
/admin/provision-gift which enforces the abuse rules and returns clear
refusals. Gift rows carry the 'gift' pill in the Source column (inviter +
expiry in the tooltip); the pre-built Guests section shows inviter, expiry,
credits and ledger status as columns once the portal payload carries
account_type.
2026-11-08 02:08:36 +00:00
inference-bot 2a6ec9301e manifest: pin to 20261108-2904a4c 2026-11-08 01:55:32 +00:00
inference-bot 2904a4c2f8 money chart: drop the caveat caption and the history-start legend note
The operator removed all caveats from the finance chart. Gone: the
money-caption element, the caveat/stale/errors caption rendering, the
.legend 'history begins' suffix and the orphaned CSS. Chart, legend keys,
series and toggles untouched; balance_history_start stays in the payload.
Harness now asserts no caveat text renders in any mode.
2026-11-08 01:55:23 +00:00
inference-bot 02fdd9f51c manifest: pin to 20261108-90294df 2026-11-08 01:50:28 +00:00
inference-bot 90294df4c6 money chart: cumulative OC revenue, token spend, and OC balance
New Money tab beside Trends, fed by the portal's /admin/money-series
(hourly-cached server-side). One fetch at full range; period (30/90/all)
and spend-mode (cumulative/daily) toggles re-render client-side.

- Cumulative mode: three lines — Revenue (OC contributions, green),
  Token spend (blue), OC balance (amber). NULL balance days render as a
  gap (the OC API exposes only the CURRENT balance; history accrues from
  daily snapshots from the deploy date onward — stated in the caption
  and in the balance legend key).
- Daily mode: token spend per day as bars (spend-only; the other series
  are cumulative and would need a second axis).
- Money ticks use the 1/2/5 x 10^k rule; tooltips reuse the shared
  chart-tip helper (all three series listed per day).
- The caption is a deliberate exception to the no-caption chart rule:
  the operator asked for the honest data-history limits in the UI.
- Harness: tests/money-chart-harness.js (axis invariants, gap handling,
  daily bars, period slice, single-point balance).
2026-11-08 01:50:26 +00:00
inference-bot bdb5a9c6eb manifest: pin to 20261108-254f701 2026-11-08 01:48:35 +00:00
inference-bot 254f701416 panel: exact-value hover tooltips on every chart
One shared, hand-rolled helper (no library, no CDN) replaces the native
SVG <title> tooltips: charts stamp data-tip-host/data-tip-i on their data
elements and register their exact values from the data arrays; one
delegated pointer listener set serves every chart, so re-renders need no
re-binding and new charts (the upcoming finance chart) join chart-by-chart
by following the two-step contract documented in the helper. The box is a
fixed-position div with pointer-events:none, clamped inside the viewport
(no edge flicker, never intercepts clicks); touch shows on tap/drag and
hides on release. Harness: admin-panel-chart-harness.js (exact values,
gap handling, clamping, multi-series contract) run via check-page-js.sh.
2026-11-08 01:47:56 +00:00
inference-bot 831569391b manifest: pin to 20261105-0713551 2026-11-05 16:30:11 +00:00
inference-bot 071355191e docs: the panel authenticates to the portal with ADMIN_TOKEN, not WEBHOOK_TOKEN (audit L5 — the webhook URL token cannot unlock /admin/*) 2026-11-05 16:26:16 +00:00
inference-bot 69c730efba manifest: pin to 20261104-852be80 2026-11-04 18:55:02 +00:00
inference-bot 852be80c41 panel: show membership state as one short pill; drop the extended caption
The co-op's panels do not put text under the pills. Replace the long
state-reason caption (and the over-long pill tooltip) with a single short
pill (in_grace -> 'grace') whose tooltip is one short line, matching the
existing pill vocabulary.
2026-11-04 18:54:58 +00:00
inference-bot db59f0d48e panel: show membership state and reason from the portal on the Members view
The Members Status column now renders the portal's per-member 'state'
(active / in grace / awaiting / inactive) instead of the raw active flag, with
the portal's reason shown beneath the pill. The portal owns the state; the panel
only displays it. Non-active states keep the member's access.
2026-11-04 18:31:34 +00:00
inference-bot 8b773966a2 panel: break out the co-op's own share of every top-line total
The totals cards showed spend that silently mixed members and the co-op's own
operator accounts. /admin/overview now returns operator_spend and
operator_all_time_spend beside the totals, and each spend card names its scope
("members + co-op's own") and states the co-op's own share beneath it, so no
figure has to be guessed at.
2026-11-02 15:44:34 +00:00
inference-bot 624c891a30 agents table: show all-time spend instead of the resettable cycle counter
The agents table rendered the raw team spend field and labelled it 'Spend (30 days)', but that field is cycle-only and resets at budget_reset_at — for the agent teams, the 1st of the month. On 1 November both bot accounts therefore displayed as zeroed. It now prefers the all-time figure the portal supplies, and the label says what it shows.
2026-11-01 17:16:35 +00:00
inference-bot 4687efb369 panel: agents show unprefixed names; admin table matches the agents columns
- Agent accounts render without the "agent:" prefix, since the section header already
  says Agents. The full alias is still in the payload as `alias`.
- The admin/operator table now carries the same columns as the agents table — Account,
  Type, Spend, Budget — with Type "admin" and Budget "—". Activated and Reset are gone:
  neither applies to an account that is not a member and has no member budget cycle.
2026-10-29 21:19:18 +00:00
inference-bot b9957e9d68 panel: show agent/bot accounts as their own category
Bot and sandbox teams had real spend that the panel structurally could not show: they
have no member row, and the all-time query filtered to member:% teams. They now appear
in an "Agents" category beside Admin, fed by the portal's new `agents` list, with spend
and budget. Kept out of member counts and member aggregates — a collective expense,
like the operator accounts already were.

Read-only on the reporting path; the set-balance and set-credits write routes are
untouched.
2026-10-29 20:57:13 +00:00
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 c0157bac13 Add .gitignore (exclude __pycache__/bytecode) 2026-09-27 11:15:05 -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 ebddf0c698 Phase 2: swap proxyAuth -> oidc addon in manifest 2026-09-23 09:15:44 -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