Skip to content

feat(admin-ui): Operate pages — Query Playground, Ingest, Chat (7.9b)#188

Merged
officialCodeWork merged 1 commit into
mainfrom
build/phase-7/step-7.9b-admin-operate-pages
Jun 11, 2026
Merged

feat(admin-ui): Operate pages — Query Playground, Ingest, Chat (7.9b)#188
officialCodeWork merged 1 commit into
mainfrom
build/phase-7/step-7.9b-admin-operate-pages

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Summary

The console can now drive the request path, not just observe it. This closes the three High-priority "no UI yet" gaps from the v2 API-coverage analysis, built to the Operate design brief and 1:1 on the real wire types (rag_core.gateway_types / rag_core.openai_types) — no invented shapes.

Query Playground (/playground, new Operate nav group)

  • Full QueryRequest control rail: corpus multiselect, top_k slider, Rerank / Pack / Generate switches, an Advanced disclosure (pack_budget, generate_max_tokens, generate_temperature, key→value filters).
  • Run queryPOST /v1/query; Retrieve onlyPOST /v1/retrieve (ChunkRef view).
  • Results: routing decision strip (shape · bm25 fallback · corpus strategy · packed tokens · A/B experiment tag), the answer with clickable [n] citation chips + hallucination-guard verdict, citations list, ranked chunks table (trust badges, row → detail sheet), and a stacked per-stage timings bar (skipped stages marked).
  • Feedback bar (👍/👎 · 1–5★ · copy · regenerate · PII-redacted comment) → POST /v1/feedback with the exact 9-signal enum; toasts echo the FeedbackAck score.
  • View full trace deep-links to /trace?rid=<request_id> (the trace page now accepts rid); the seeded run reuses DEMO_REQUEST_ID, so the demo resolves end-to-end.

Ingest (/ingest, Knowledge group)

  • Drag-and-drop multipart POST /v1/ingest/document (10 parser types advertised), staged queue with per-file progress → IngestResult chunk/embedding count badges + "View in Corpora" on success, error + Retry on failure.
  • Pipeline explainer: parse → chunk → enrich → PII-redact → embed → indexPII is redacted before embedding.

Chat (/chat)

  • OpenAI-compatible playground in three tabs: Chat (streaming SSE thread; right rail = model / temperature / max_tokens / stream + the non-standard rag options, RAG on by default; every reply surfaces the terminal chunk's rag annotations — shape, chunks_n, citations, guard, finish_reason, usage), Embeddings (one input per line, float/base64, dim + L2 norm + sparkline per vector), Models (GET /v1/models — the wired backends, not a catalog).

Plumbing

  • Live→seed hybrid as everywhere; these are action surfaces, so without a gateway they simulate (deterministic worked query, token-streamed replies, prefers-reduced-motion honoured).
  • New Slider + Tabs primitives; CorpusMultiSelect / GuardBadge / CitedText shared components.
  • api.ts: runQuery, retrieveOnly, submitFeedback, ingestDocument (multipart), streamChat (SSE reader → terminal chunk), chatComplete, createEmbeddings, fetchModels. Identity body-carried on /v1/query·/v1/retrieve·/v1/feedback, header-driven elsewhere — matching the gateway.

Verification

  • tsc --noEmit clean · next lint clean · 46/46 vitest (12 new across the three pages) · next build — all 17 routes static (the /trace Suspense boundary keeps it prerenderable).
  • Browser-verified in light and dark: all three pages, the seeded query → answer → citations → chunks flow, ingest success/failure rows, chat streaming + rag annotations, embeddings cards, and the /trace?rid=… deep link (resolves to the signed demo trace).
  • Note: repo CI is currently blocked by the account billing issue (no Actions runs) — gates were run locally.

Documentation

  • docs/reference/admin-ui.md — Operate pages, updated page table (16 routes), hybrid/simulation semantics, body-carried identity note, config row.
  • TRACKER.md — 7.9b entry under Recently shipped.

🤖 Generated with Claude Code

The console can now drive the request path, not just observe it. Closes the
three High-priority no-UI gaps from the v2 API-coverage analysis, built to the
Operate design brief (apps/admin-ui/design/claude-design-prompt-operate.md),
1:1 on the real wire types (rag_core.gateway_types / rag_core.openai_types).

- Query Playground (/playground, new Operate nav group): full QueryRequest
  control rail (corpus multiselect, top_k, rerank/pack/generate, advanced
  pack_budget / generate_max_tokens / generate_temperature / filters editor);
  Run query → POST /v1/query, Retrieve only → POST /v1/retrieve. Results:
  decision strip (shape, bm25 fallback, corpus strategy, packed tokens,
  experiment tag), answer with clickable [n] citation chips + guard verdict,
  citations list, ranked-chunks table (trust badges, detail sheet), stacked
  per-stage timings with skipped-stage markers, and a feedback bar
  (thumbs / 1-5 stars / copy / regenerate / PII-redacted comment →
  POST /v1/feedback, exact signal enum). "View full trace" deep-links to
  /trace?rid=… (trace page now reads the rid param; seeded runs reuse
  DEMO_REQUEST_ID so the demo resolves end-to-end).
- Ingest (/ingest, Knowledge group): drag-and-drop multipart
  POST /v1/ingest/document; staged queue with progress, IngestResult
  chunk/embedding badges + View-in-Corpora on success, error + Retry on
  failure; parse → chunk → enrich → PII-redact → embed → index explainer.
- Chat (/chat): OpenAI-compatible playground — streaming SSE thread with the
  non-standard rag annotations per reply (shape, chunks_n, citations, guard,
  finish_reason, usage; RAG on by default), Embeddings tab (one input per
  line, float/base64, dim + L2 norm + sparkline), Models tab (GET /v1/models).

Live→seed hybrid as everywhere: action surfaces simulate without a gateway
(deterministic worked query, token-streamed replies, prefers-reduced-motion
honoured). New Slider + Tabs primitives; CorpusMultiSelect / GuardBadge /
CitedText shared components; api.ts gains runQuery / retrieveOnly /
submitFeedback / ingestDocument / streamChat (SSE reader) / chatComplete /
createEmbeddings / fetchModels. Identity body-carried on /v1/query,
/v1/retrieve, /v1/feedback; header-driven elsewhere.

Documentation: docs/reference/admin-ui.md (Operate pages + hybrid + config).

Gates: tsc clean, eslint clean, 46/46 vitest (12 new), next build 17 static
routes; browser-verified light + dark, all three pages + trace deep-link.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit 6cbab40 into main Jun 11, 2026
13 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant