project-nomad/admin/types
Chris Sherwood 43ca584b6c feat(KB): status pill + last-activity timestamp on Processing Queue (RFC #883 §5/§10)
Each in-flight (or stuck) embedding job gets a colored health pill,
relative-activity timestamp, and chunk counter so users can tell at a
glance whether ingestion is making progress.

## Health states

- **🟢 Active** — last batch < 2 min ago
- **🟡 Slow** — last batch 2-5 min ago (CPU-paced multi-batch ingestion
  lives here naturally; not always a problem)
- **🔴 Stalled** — last batch > 5 min ago (likely real problem)
- ** Waiting** — queued, no batch started yet
- **🔴 Failed** — job recorded failed status

## What lands

- New backend util `kb_job_health.ts` with pure `computeJobHealth(input)`
  decision function. Time-based thresholds (2 min / 5 min) inlined as
  constants. 9 unit tests pin the boundaries.
- `EmbedJobWithProgress` gains `lastBatchAt`, `startedAt`, `chunks` —
  already set by `EmbedFileJob.handle` on every batch transition, just
  not previously surfaced through `listActiveJobs`.
- Frontend `kb_job_health_display.ts` maps each status to a Tailwind
  dot color, label, and aria-label so backend and UI stay in sync.
- `ActiveEmbedJobs.tsx` renders the pill, "last activity Xs ago", and
  chunk counter above each progress bar. Adds a manual Refresh button
  and "Last updated Xs ago" line — the existing 2s/30s auto-poll
  cadence in `useEmbedJobs` is left intact.
- Live tick at 5s keeps the relative timestamps current without
  re-fetching from the API.

## Not in scope

- Per-card Cancel / Retry / Un-index — separate Phase 2 PR
- Conditional warnings A/B/C — separate Phase 2 PR
- Computing throughput rate (chunks/min) — needs ratio registry consumer
  (Phase 2 follow-up); for now the pill answers the "is it stuck?"
  question directly without a rate estimate.
2026-05-20 10:16:00 -07:00
..
benchmark.ts refactor(Benchmarks): cleanup api calls 2026-02-01 05:23:11 +00:00
chat.ts fix(AI): improved perf via rewrite and streaming logic 2026-03-03 20:51:38 -08:00
collections.ts feat(content-updates): show size, surface downloads in Active Downloads 2026-05-20 10:16:00 -07:00
docker.ts feat: initial commit 2025-06-29 15:51:08 -07:00
downloads.ts feat(downloads): rich progress, friendly names, cancel, and live status (#554) 2026-04-03 14:26:50 -07:00
files.ts feat: curated content system overhaul 2026-02-11 15:44:46 -08:00
kb_ingest_state.ts feat(KB): per-file ingest state machine (Phase 1 of RFC #883) (#888) 2026-05-20 10:16:00 -07:00
kv_store.ts feat(KB): per-file ingest state machine (Phase 1 of RFC #883) (#888) 2026-05-20 10:16:00 -07:00
maps.ts feat(Maps): regional map downloads via go-pmtiles extract (#780) 2026-05-20 10:16:00 -07:00
ollama.ts feat(AI): enable remote AI chat host 2026-04-03 14:26:50 -07:00
rag.ts feat(KB): status pill + last-activity timestamp on Processing Queue (RFC #883 §5/§10) 2026-05-20 10:16:00 -07:00
services.ts feat: support for updating services 2026-03-11 14:08:09 -07:00
system.ts feat(AI): improved AMD GPU acceleration for Ollama via ROCm + HSA override (#804) 2026-05-20 10:16:00 -07:00
util.ts feat: initial commit 2025-06-29 15:51:08 -07:00
zim.ts fix(ZIM): accumulate across Kiwix pages to prevent empty Content Explorer (#746) 2026-04-21 14:26:28 -07:00