# Session Summary — 2026-05-07

## Pipeline
- Job 255 (Charade 25fps, 169K frames) ✅ **completed**
- 7/7 processors: asr, cut, yolo, ocr, face, pose, asrx
- Rule 1: 5,250 sentence chunks
- Rule 3: 1,130 cut scenes
- face_trace: 6,186 detections, 2,769 traces

## Identity Agent — Iterative Multi-Angle Face Matching
- TMDb seeds (12 identities) → Round 1: 33% → Round 2-3: **99%**
- 6,175/6,186 face detections matched to 11 identities
- Quality control (temporal collision check) integrated
- Face-embedding matching now uses propagation (matched traces' faces become new seeds)

## Code Changes

### `src/core/tmdb/face_agent.rs`
- Rewrote `match_faces_against_tmdb` with iterative multi-angle matching
- Added `quality_check_temporal_collisions` for temporal collision detection
- Added 4-face minimum check

### `src/api/identity_agent_api.rs`
- `analyze_identity` now persists results to `identities` table
- Added `match_faces_iterative` with same iterative algorithm
- Fixed hardcoded FPS (23.976 → 25)
- Fixed ASRX field name parsing (`speaker` → `speaker_id`)
- Fixed `face_clustered.json` path fallback
- Fixed `suggest_clustering` to use `face_detections` directly

### `src/core/processor/executor.rs`
- Partial output preservation on timeout: if .tmp is valid JSON → rename to .json not .err

### `src/worker/processor.rs`
- `kill_existing_processor`: kill old PID before starting new processor
- `sweep_stale`: reset to Pending instead of Failed

### `src/worker/job_worker.rs`
- `any_pending` + `any_skipped` checks to prevent premature job completion
- Auto-vectorize after Rule 1 chunking

### `src/api/five_w1h_agent_api.rs`
- Rewrote with hierarchical 5W1H+ (parent summary + child enhanced)
- Uses Gemma4 via `MOMENTRY_LLM_SUMMARY_URL`
- Embedding-optimized prompt (5W1H+ per sentence)
- Face trace info in prompt context

## Models Downloaded
- LLM: Gemma4 26B MoE, Qwen3 30B MoE, Mistral 24B
- Embedding (Ollama + GGUF): mxbai-embed-large, bge-m3, nomic-embed-text-v2-moe
- ANE CoreML: mxbai-embed-large (8.5ms, 1.8x faster than Ollama)
