# S01: Pipeline Admin Dashboard — UAT

**Milestone:** M005
**Written:** 2026-03-30T08:37:43.367Z

## UAT: Pipeline Admin Dashboard

### Preconditions
- Chrysopedia stack running on ub01 (all 7 containers healthy)
- At least one video has been processed through the pipeline (events exist in pipeline_events table)
- Browser access to http://ub01:8096

### Test 1: Navigate to Pipeline Admin Page
1. Open http://ub01:8096 in browser
2. Click "Pipeline" link in the navigation bar
3. **Expected:** Page loads at `/admin/pipeline` with heading "Pipeline Management"
4. **Expected:** Video list table is visible with at least one row
5. **Expected:** Worker status indicator visible showing online/offline state

### Test 2: Video List Shows Correct Data
1. On the pipeline admin page, observe the video list
2. **Expected:** Each video row shows: filename, creator name, processing status badge, event count, total tokens used, last event timestamp
3. **Expected:** Status badges use colored backgrounds matching status (e.g., "extracted" has a distinct color)
4. **Expected:** At least 3 videos visible (Skope Drum Design, Skope Waveshapers, Malux SUBPAC)

### Test 3: Expand Event Log for a Video
1. Click on a video row to expand its event log
2. **Expected:** Event log timeline appears below the video row
3. **Expected:** Events show stage name (e.g., "stage4_classification"), event type (start/complete/error), and timestamp
4. **Expected:** Events are ordered by most recent first
5. **Expected:** Pagination controls visible if more than default limit of events

### Test 4: Collapsible JSON Viewer
1. In an expanded event log, find an event with a non-null payload
2. Click to expand the JSON payload
3. **Expected:** JSON content renders in a formatted, readable view
4. **Expected:** Clicking again collapses the JSON view
5. **Expected:** Error events show error message in payload (e.g., "Model not found")

### Test 5: Worker Status Auto-Refresh
1. Observe the worker status indicator
2. Wait 15-20 seconds without interacting
3. **Expected:** Worker status refreshes automatically (no manual refresh needed)
4. **Expected:** Shows worker name, active task count, reserved tasks, and pool size

### Test 6: Retrigger Button
1. Find the retrigger button for any video in the list
2. Click the retrigger button
3. **Expected:** API call to POST /admin/pipeline/trigger/{video_id} is made
4. **Expected:** UI provides feedback (success/error state)

### Test 7: Revoke Button
1. Find the revoke/pause button for any video
2. Click the revoke button
3. **Expected:** API call to POST /admin/pipeline/revoke/{video_id} is made
4. **Expected:** UI provides feedback (success/error state)

### Test 8: API Endpoints Direct Verification
1. `curl -s http://ub01:8096/api/v1/admin/pipeline/videos | python3 -m json.tool`
   **Expected:** JSON with `items` array and `total` count, each item has id, filename, processing_status, creator_name, event_count, total_tokens_used
2. `curl -s http://ub01:8096/api/v1/admin/pipeline/worker-status | python3 -m json.tool`
   **Expected:** JSON with `online` boolean and `workers` array
3. `curl -s "http://ub01:8096/api/v1/admin/pipeline/events/{video_id}?limit=5" | python3 -m json.tool`
   **Expected:** Paginated JSON with `items` array, each event has id, video_id, stage, event_type, token fields, payload, created_at

### Edge Cases
- **No events for a video:** Expand a video with event_count=0. Expected: empty event log with appropriate message, no errors.
- **Large JSON payload:** Find an event with a large payload object. Expected: JSON viewer handles it without layout breakage.
- **Worker offline:** If the Celery worker is stopped, worker-status should show online:false or empty workers array.
