Commit Graph
66 Commits
Author SHA1 Message Date
lukaszraczylo b48ec65f94 test(mock): enforce backend series metric rules
Port seriesValidMetric and the usage/series query checks into the mock so it
returns the backend 400 for an invalid scope, metric and window combination.
2026-11-25 12:38:58 +00:00
lukaszraczylo 13a38a6631 refactor(webui): reuse entity links and formatters; drop stale component comments 2026-11-25 12:11:21 +00:00
lukaszraczylo dccf04f840 test(webui): widen leak scan to mock sources and e2e 2026-11-25 12:11:20 +00:00
lukaszraczylo a7e9c98663 fix(webui): show unavailable usage when the store is down 2026-11-25 12:11:11 +00:00
lukaszraczylo 158a96ea55 fix(webui): open provider panel from reliability breakers 2026-11-25 12:11:10 +00:00
lukaszraczylo 62817af834 fix(webui): toasts above sheets; drop unreachable alias helpers
Stack the toast viewport on perfect-design's --z-toast token so it sits
above Sheet overlays, and add a harness check that the toast is the
topmost element at its centre while a sheet is open.

Delete useAliasNames, lib/alias and its spec, which nothing imports
since the shadcn migration removed AliasBadge.
2026-11-25 11:52:38 +00:00
lukaszraczylo ff58b03e21 test(webui): guard tailwind @source against missing perfect-design components
Add a spec that maps every component imported from perfect-design, and
every directory it imports in turn, to an @source entry in main.css.
Extend the bundle gate spec to check that utilities unique to recently
added components appear in the built CSS.
2026-11-25 11:52:38 +00:00
lukaszraczylo 6bc144cc12 refactor(webui): migrate remaining shadcn components to perfect-design
Move AuthGate, ConfigWarningsBanner, ToastViewport, SnippetBlock,
PageLoadError, LabeledSelect and the helper forms to perfect-design
Button, Input, Card, Callout, NativeSelect and ToastItem. Number fields
use a small native input because the library input rewrites typed text.

Delete components/ui, the unused ModelChip, CompactNumber, AliasBadge and
lib/utils, and the shadcn config. Remove shadcn-vue, tw-animate-css,
class-variance-authority and clsx. Give FaIcon an optional title and drop
role from decorative icons. Refresh stale comments and the README.
2026-11-25 11:52:38 +00:00
lukaszraczylo e1f1a60d4d refactor(webui): remove shadcn-vue, chart.js and replaced components
Delete 89 files that no live entry imports, drop chart.js, vue-chartjs,
@tanstack/vue-table and the FontAwesome runtime, and replace the Vue
FontAwesome wrapper with a small SVG component.

Limit Tailwind source scanning to the perfect-design components the app
bundles. Add the bundle gate script and spec: gzip JS+CSS of dist/assets
must stay at or below 324300 bytes.
2026-11-25 11:52:38 +00:00
lukaszraczylo 945621a3c5 fix(webui): compact config viewer, clear unknown helper sel, harness port guard 2026-11-25 11:52:38 +00:00
lukaszraczylo 1f8bdd8777 feat(webui): config page 2026-11-25 11:52:38 +00:00
lukaszraczylo dd11ada41f fix(webui): events dates, phone detail, model links, caller coverage
Events show the date for rows from earlier days, the message sits on a second line on phones, and consecutive identical events collapse into one row with a count. Unpriced events link to the model panel or a models search. The provider filter keeps one control type. The harness covers the target callers list and the mock gains a readitall caller fixture.
2026-11-25 11:52:38 +00:00
lukaszraczylo 55f1e743fe feat(webui): targets and events pages 2026-11-25 11:52:37 +00:00
lukaszraczylo ec9df6a92d fix(webui): router fixture consistency and panel screenshots
Router escalation fixtures now scale tiers, reasons and outcomes with requests, and the shadow classifier differs from live. The harness captures each panel's full scroll height, runs checks on the expanded panel, and samples smartrouter/uni. RoutersPage no longer refetches on range change. The breaker State column sorts by severity.
2026-11-25 11:52:37 +00:00
lukaszraczylo b9ca05be66 feat(webui): routers page 2026-11-25 11:52:37 +00:00
lukaszraczylo 7b660363e7 fix(webui): sort users and breaker tables before paging 2026-11-25 11:52:37 +00:00
lukaszraczylo f7cf402564 fix(webui): models page sort, request totals, panel polish 2026-11-25 11:52:37 +00:00
lukaszraczylo 0f6201da38 feat(webui): models page 2026-11-25 11:52:37 +00:00
lukaszraczylo 19950c40f6 fix(webui): users page filter, labels, panel fetches 2026-11-25 11:52:37 +00:00
lukaszraczylo abdc059ed3 feat(webui): users page 2026-11-25 11:52:36 +00:00
lukaszraczylo 713a8acb09 fix(webui): reliability degraded breakers, failure rates, TTFB coverage 2026-11-25 11:52:36 +00:00
lukaszraczylo 31a09f5064 feat(webui): reliability page 2026-11-25 11:52:36 +00:00
lukaszraczylo 0ac9f5fb10 fix(webui): usage CSV, detail flags, burn-down labels 2026-11-25 11:52:36 +00:00
lukaszraczylo ed57488980 feat(webui): usage and spend page 2026-11-25 11:52:36 +00:00
lukaszraczylo bbb397cd75 fix(webui): compact overview events and request-ranked top lists 2026-11-25 11:52:36 +00:00
lukaszraczylo d2334d879b feat(webui): overview page 2026-11-25 11:52:36 +00:00
lukaszraczylo 0ef0894140 test(webui): visual harness and Workbench table widgets 2026-11-25 11:52:36 +00:00
lukaszraczylo 5177b2209c feat(webui): perfect-design app shell, command palette and theme boot 2026-11-25 11:52:35 +00:00
lukaszraczylo af3628d13d fix(webui): mock live token meters and consistent huge scenario
Add tokensPerMinute to the live and limits-hot scenarios. Make the huge scenario agree across overview, catalog, performance and usage endpoints. Derive hot users from the friends group.
2026-11-25 11:52:35 +00:00
lukaszraczylo 853a66dcb7 feat(webui): mock admin API with scenarios for local development
Serve captured fixtures from the Vite dev server under MOCK=1. Synthesise missing ranges from the nearest fixture and select failure scenarios with ?mock=.
2026-11-25 11:52:35 +00:00
lukaszraczylo 4d77623f5d test(webui): anonymised admin API fixtures with leak scan 2026-11-25 11:52:35 +00:00
lukaszraczyloandGitHub 4c61d19a72 feat(router): smart routers and per-member rate limits (#9)
Add smart routers: virtual models that score each request and route it to admin-defined model tiers. A retryable failure moves the request to a higher tier. The classifier v2 extracts prose, finds the original ask in long tool loops, adds an uncertainty margin and reads tool-output failures. Sessions, outcome signals, bounded calibration, adaptive selection within a tier, gated saturation downgrade, a first-byte timeout and an opt-in timeout fallback are included. Every new feature is off by default.

Add per-member group limits, a tokensPerMinute window that counts uncached input and output, rate-limit headers in three dialects, soft pacing before the hard limit, and a limitExemptKinds list so embedding and reranking traffic never counts toward or hits a limit.

Fix yaegi named-result state that made smartContentSize grow between calls.
2026-11-25 00:40:30 +00:00
lukaszraczylo 6fb048b599 fix(admin): show kinds and endpoints in the providers panel
The provider accordion reads the overview response, not the catalog, so
the earlier change never reached it. Add kinds and endpoints to the
overview provider view and group the accordion rows by kind. Endpoint ids
now read gx10/v1/decide, without a doubled slash.
2026-11-10 12:38:33 +00:00
lukaszraczylo 085292143c feat(admin): group catalog models by kind
Add a display-only kinds map to the provider config. Each pathBaseUrls key
now appears in the admin catalog as an endpoint row. The Models page splits
a provider into one sub-section per kind.
2026-11-10 12:24:34 +00:00
lukaszraczylo aa9a925d49 fix(admin-ui): distinct percent ticks and a type-clean build
The error-rate axis rounded half-percent ticks up, so labels repeated (4%, 4%, 3%, 3%). Ticks now show one decimal where needed. The CSS layer test imported node:fs, which broke npm run build under vue-tsc, so it is removed.
2026-11-08 02:38:50 +00:00
lukaszraczylo 0a05dfc035 fix(admin-ui): keep sign and precision in CSV, YAML and context labels
CSV export prefixed negative numbers with an apostrophe, which corrupted the data. YAML emitted NaN and Infinity as plain strings. Context windows such as 1500 read as 2k. Numbers now skip the CSV formula guard, non-finite values use YAML float forms, and counts below 10k keep one decimal.
2026-11-08 02:29:28 +00:00
lukaszraczylo e985fded45 feat(admin-ui): hide runaway budget line and link form errors to inputs
The burn-down chart drew the budget line even when it was more than ten times the spend, which flattened the spend curve. The line now hides with a note. Limits, pricing, model metadata and grant forms mark invalid inputs with aria-invalid and aria-describedby.
2026-11-08 02:28:27 +00:00
lukaszraczylo 1ec8aacee7 feat(admin-ui): fit the Models catalog table without horizontal scroll
The table had 11 columns and scrolled at 1280px, hiding p50, p95 and error rate. It now shows compact price, one token column and a short error header. Context window stays in the model chip hover, and the :free flag moves into the price cell.
2026-11-08 02:27:10 +00:00
lukaszraczylo 758d7c7020 feat(admin-ui): alias labels, active-provider legends, denser tables and readable money
Label configured model aliases with an alias badge wherever a model id shows.
List only providers with traffic in the window in provider chart legends.
Page long tables, show a scroll shadow on wide ones and drop the duplicate model link.
Show costs with thousands separators and magnitude-scaled decimals on cards and chart axes.
Use whole-number ticks for count charts and replace all-zero charts with a message.
Back off polling after failures.
Keep the CSV status region from widening the page on phones.
Regenerate admin_assets_gen.go.
2026-11-08 02:22:22 +00:00
lukaszraczylo fcfb298077 fix(admin-ui): stale-data notice, request timeout and dedupe, hash and format edge cases
Show a persistent notice when a refresh fails while old data is on screen.
Add retry to the Targets and Access Matrix error states.
Give tables names, skeletons a status role and CSV export a live region.
Abort admin requests after 15 seconds and share concurrent identical GETs.
Show a reload prompt when a lazy page chunk fails to load.
Ignore prototype keys in the location hash.
Stop formatContextWindow emitting 1000k, round latency before the 1s cutoff,
and treat NaN as not enough data in the month projection.
Regenerate admin_assets_gen.go.
2026-11-08 01:59:34 +00:00
lukaszraczylo 2608e01c50 refactor(webui): extract repeated dashboard elements into shared components
Markup and helpers that were copied between pages now live in one
place:
- ChartCard, StatDisabledAlert, StatItem, DetailField, BudgetRatioBars,
  LabeledSelect, TargetPicker and LoadStateView components
- lib/scope.ts, lib/columns.ts and lib/chart-palette.ts
- messageOf, isAuthRejection, and the USD to micro-USD conversion
  helpers
- one monthly cost projection, one date formatter, and the
  useCopyFeedback composable

Behaviour is unchanged. Before and after screenshots of every page
match at 390 and 1440 px. Empty-state text now comes from the shared
EmptyState component, and the user run-out date uses the short date
format. admin_assets_gen.go is regenerated.

Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv
2026-09-24 06:04:46 +01:00
lukaszraczylo cf308624af feat(webui): make the dashboard responsive and add loading and empty states
Every tab row scrolls sideways instead of being clipped by its card.
On phones this hid tabs, such as the Config change helper's last forms
at 360-390px. The login button has a larger touch target, and long
names are truncated with a tooltip.

Loading and empty states:
- Skeletons show only while a selection has no data yet, never over
  data already on screen during a refresh.
- Empty states name the next step to take.
- Error states offer a Retry button that shows progress, and each card
  keeps its own error.
- Toasts confirm copies and key generation, and report background
  failures once per streak through polite and assertive live regions.

Other changes:
- The access matrix switches between Models, MCP servers and Agents,
  and says "none configured" only once its data has loaded.
- Home ranks the top 5 users by cost, requests or tokens. It requests
  only the needed metrics and warns before a range exceeds the
  server's key cap.
- MCP and agent deep links accept a bare target name.

admin_assets_gen.go is regenerated.

Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv
2026-09-23 23:02:22 +01:00
lukaszraczylo ee49467e64 feat(webui): redesign the admin dashboard around admin tasks
A sidebar replaces the flat tabs with seven pages, and one filter bar
sets the time range, comparison period and scope for all of them.

- Home: spend against budget, forecast, request rate, error rate,
  open breakers, top users and models, recent events and warnings.
- Spend: spend over time with comparison, budget burn-down, an
  attribution drill-down from group to user to model, pricing health
  and cost avoided by free models.
- Consumers: a directory with last seen and limit bars, an access
  matrix, and a detail page per user.
- Models: the catalog with billing prices, fleet latency and error
  rates, and provider health.
- Reliability: error, timeout, failover, 429 and 402 trends, events,
  and latency per provider.
- Config: the redacted config and a change helper that emits YAML or
  users.json snippets to paste into git.
- MCP & Agents: callers per target.

Page state lives in the URL hash, and old tab links map to the new
pages. The replaced views are removed. admin_assets_gen.go is
regenerated.

Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv
2026-09-23 16:41:01 +01:00
lukaszraczylo 782ea43b02 feat(webui): list every model with full usage on the Models tab
The Models tab ranks by requests by default and asks the server for
per-model detail. A table under the chart lists requests, tokens in,
tokens out and cost for each model. A model with no recorded cost that
is marked free shows a "free" badge instead of $0. The CSV export
includes every column and the free flag. admin_assets_gen.go is
regenerated.

Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv
2026-09-23 13:40:08 +01:00
lukaszraczylo 4261efc41b feat(webui): add limit bars, forecasts, events, exports and URL state
The Usage tab shows a bar for each configured limit. It turns amber at
80% and red at 100%. The tab also shows rejected requests per day, a
projected month-end cost with budget headroom, and CSV export for users
and groups. Names link to Charts with the matching scope.

The Charts tab ranks models over the full 24h, 30d or 12mo window. A
provider filter is applied on the server, and the ranking can be
exported as CSV. A new Events tab lists recent failures, filtered by
kind and user. The selected tab, filters and scope live in the URL
hash. Polling stops while the page is hidden. Views show which replica
answered, and a banner lists configuration warnings.

CSV cells that start with a formula character are neutralised. Links
sit outside the accordion buttons, so both controls keep their
accessible names. admin_assets_gen.go is regenerated.

Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv
2026-09-23 13:09:57 +01:00
lukaszraczylo 227200316d fix(webui): keep charts consistent with the current selection
Chart and ranking fetches carry a request id, and a superseded response
is dropped. Changing a selection clears the old data at once, so old
numbers never show under new labels or units. The auto-refresh tick
skips while a fetch is still in flight. "Loading..." shows only until
the first result for a selection arrives. Dashboard polls do not
overlap.

Users in several groups are counted and searched in every group. The
Models tab labels its windows as the current UTC bucket. Hour labels
are marked UTC. The Members column sorts numerically. Target access
shows "All groups" for null and "No groups" for []. The UI shows the
server's own error message. Cost axis ticks use the currency
formatter. npm run dev proxies /admin/api. Nine unused shadcn
components are removed.

admin_assets_gen.go is regenerated from the new build.

Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv
2026-09-23 09:44:32 +01:00
lukaszraczylo d8ba90c5d0 fix(admin): share the zero-time constant
The zero-time sentinel was module private, so the spec redeclared the
literal once a third consumer started depending on it. Export it and
import it in the spec. Regenerate the baked admin assets.

Claude-Session: https://claude.ai/code/session_01EebV5jyWvYocByNQ3oss1w
2026-09-03 08:57:25 +01:00
lukaszraczylo af84ed5eb7 feat(admin): show target health in the dashboard
Add a Health column to the MCP servers and A2A agents tables in
TargetsView. An unhealthy target renders a destructive badge with the
age of its last check and carries the failure count, source, and
scrubbed last error in the title. An unknown target renders an outline
badge and, when it has failed but never succeeded, the same failure
details in its title. A healthy target renders muted text with its last
observed latency and no badge, matching the providers' convention.

Add AdminTargetHealthView to the API types with the wire contract the
Go side emits, a bare formatElapsedAgo helper next to formatAgo, and
column-cell tests for all three states. Regenerate the baked admin
assets.

Claude-Session: https://claude.ai/code/session_01EebV5jyWvYocByNQ3oss1w
2026-09-03 02:49:55 +01:00
lukaszraczylo 3012586e8e feat(webui): show per-replica upstream latency in the Providers tab
Add streaming and non-streaming latency badges beside the discovery
health badge on each provider row. Streaming shows average time to
first byte, labeled ttfb, since it is the only load-sensitive figure
this data provides. Non-streaming shows average total duration,
labeled avg, never latency or ttfb, because a non-streaming provider
buffers the whole completion before sending anything and its ttfb
carries the same output-length contamination as its duration.

Badges omit entirely when a provider has no observations yet, so
absence never reads as a fabricated zero. Every badge title states the
per-replica, in-process scope explicitly: this data comes from the
same in-process accumulator the rate-limit counters use, never Redis,
so a single poll reflects only whichever replica answered it.

Mirror admin.go's adminLatencyView type in types/api.ts, keyed by the
literal streaming/non-streaming union admin.go emits. Add
formatLatencyMs to lib/format.ts with spec tests alongside its
siblings in format.spec.ts.
2026-08-23 18:55:16 +01:00
lukaszraczylo d0b55a37e9 fix(webui): match the health detail row color to its badge, add tests
ProvidersView.vue's accordion detail row hardcoded text-destructive red
for any non-closed health state, while the trigger row's Badge
deliberately used grey (secondary) for half-open and red (destructive)
only for open. Add healthDetailClass so the detail row's color always
matches the badge's own severity, instead of overstating a half-open
probe as an error.

Add a describe block for formatUntil to format.spec.ts, covering the
unset sentinel, undefined, a future timestamp, and a past one. It had
no test coverage since being added in the previous round.
2026-08-22 23:37:55 +01:00