# S01: [B] LightRAG Deployment + Docker Integration — UAT

**Milestone:** M019
**Written:** 2026-04-03T21:36:50.606Z

# S01 UAT: LightRAG Deployment + Docker Integration

## Preconditions
- SSH access to ub01
- Docker Compose stack running on ub01

## Test Cases

### TC1: LightRAG Health Endpoint
1. Run `ssh ub01 'curl -sf http://localhost:9621/health'`
2. **Expected:** JSON response with `"status":"healthy"`, `"llm_binding":"openai"`, `"embedding_binding":"ollama"`, `"vector_storage":"QdrantVectorDBStorage"`

### TC2: Container Health Status
1. Run `ssh ub01 'docker ps --filter name=chrysopedia-lightrag --format "{{.Status}}"'`
2. **Expected:** Output contains "(healthy)"

### TC3: Docker Compose Config Valid
1. Run `docker compose config` from repo root
2. **Expected:** Exits 0, output contains `chrysopedia-lightrag` service definition

### TC4: Env File Git Ignored
1. Run `git check-ignore .env.lightrag`
2. **Expected:** Exits 0, prints `.env.lightrag`

### TC5: Entity Extraction
1. Run:
   ```
   ssh ub01 'curl -sf -X POST http://localhost:9621/documents/text \
     -H "Content-Type: application/json" \
     -d "{\"text\": \"COPYCATT uses Serum for bass sound design with sidechain compression. The signal chain runs through OTT then Valhalla Room reverb.\", \"file_source\": \"uat_test.txt\"}"'
   ```
2. **Expected:** HTTP 200 response with status indicating success

### TC6: Query Returns Entities
1. Run:
   ```
   ssh ub01 'curl -sf -X POST http://localhost:9621/query \
     -H "Content-Type: application/json" \
     -d "{\"query\": \"What plugins does COPYCATT use?\", \"mode\": \"mix\"}"'
   ```
2. **Expected:** Response contains references to Serum, OTT, and/or Valhalla Room

### TC7: Existing Services Unaffected
1. Run `ssh ub01 'docker ps --filter name=chrysopedia --format "{{.Names}} {{.Status}}"'`
2. **Expected:** All 10 existing services (db, redis, qdrant, ollama, api, worker, watcher, web-8096, mcp, lightrag) show "healthy" or "Up"

### TC8: Service Dependencies
1. Run `docker compose config` and inspect chrysopedia-lightrag depends_on
2. **Expected:** Depends on chrysopedia-qdrant (service_healthy) and chrysopedia-ollama (service_healthy)

## Edge Cases

### EC1: Container Restart Recovery
1. Run `ssh ub01 'docker restart chrysopedia-lightrag'`
2. Wait 45 seconds for start_period
3. Run `ssh ub01 'docker inspect --format="{{.State.Health.Status}}" chrysopedia-lightrag'`
4. **Expected:** "healthy" within 60 seconds

### EC2: Healthcheck Without Curl
1. Run `ssh ub01 'docker exec chrysopedia-lightrag which curl'`
2. **Expected:** Exits non-zero (curl not found — confirms Python urllib healthcheck is necessary)
