- Changed min_confidence from 50.0 to 0.5 (Vision uses 0.0-1.0 range)
- Changed min_size from 32 to 1 (was filtering out all small faces)
- Changed min_capture_quality from 25.0 to 0.25
- Fixes issue where all videos showed 0 faces detected
Root cause: admin_config.rs used wrong defaults (50.0/32) instead of
config.rs constants (0.5/1), causing Vision framework to filter out
ALL faces because confidence threshold exceeded valid range.
Verified: IMG_9449 now correctly detects 191 faces (was 0).
Problem: Re-scan (/api/v1/file/:file_uuid/process) only deleted processor_results from DB,
but not output files. Worker checks if output file exists and skips re-processing,
resulting in stale/incorrect results persisting.
Solution:
- Add 'force' parameter to ProcessRequest struct (default: false)
- When force=true, delete all output files before re-processing
- Worker will then re-run processors from scratch
Changes:
- src/api/processing.rs:
- Added 'force: bool' to ProcessRequest
- Added delete_output_files_for_uuid() helper function
- Modified trigger_processing() to delete output files when force=true
API usage:
POST /api/v1/file/:file_uuid/process
{
"processors": ["face","ocr",...],
"force": true
}
Note: Build currently fails due to unrelated uncommitted admin_config changes.
Those should be fixed separately.
- Delete YOLO processor implementation (src/core/processor/yolo.rs)
- Remove YOLO from processing pipeline and worker
- Clean up YOLO-related code across multiple modules
- Add migration 033_remove_yolo.sql
YOLO functionality removed as part of architecture simplification
- vlm_summary now skips VLM call if description exists, but still generates embedding + Qdrant
- API endpoint checks both vlm_description AND vlm_embedding before saying 'already done'
- Fixed point_id hash generation (was creating 0, now properly hashes)
- Add upsert_vlm_embedding to QdrantDb with trace_id in payload
- chunk_id format: {file_uuid}_t{trace_id_hex} for search enrichment
- Update enrich_vlm_from_pg to extract trace_id from chunk_id
- VLM summary now searchable via semantic search with source_type=vlm
- Added trace_profiles query to compute vlm_done/vlm_total
- vlm_summary stage now shows actual progress (e.g. 312/4829)
- Status shows 'running' while in progress, 'completed' when done
- Add TraceArtifacts phase to TkgPhase enum (phase 18)
- Report progress as key_frame.jpg/key_face.jpg are created
- VLM trigger now polls until ALL key_frame.jpg files exist
(was: started after TKG build, before artifacts were ready)
- Add iron rule to AGENTS.md: ask before removing data
Tested: Gamma 8 (27 traces) → 27/27 VLM summaries completed
Register should only write videos table, not automatically create
monitor jobs. This violates the design principle that register does
not trigger deep scan.
The auto-pipeline (triggered only for new files with auto_pipeline_enabled)
handles job creation separately. Re-scan via processing API will handle
job creation when needed.
When a file is re-registered after unregister, the monitor_job is
missing. The register function now checks if a job exists and creates
one with full pipeline processors (cut, asr, asrx, ocr, face,
face_cluster) if missing.
This ensures re-scan after unregister triggers the complete pipeline
including face detection → TKG → VLM summary (P5).
- Add vlm_point_id column to trace_profiles (stores Qdrant point ID)
- Add upsert_chunk_embedding_u64 to QdrantDb (numeric ID support)
- Add chunk_id to VLM payload in Qdrant for search enrichment
- Update enrich_from_pg to fallback to VLM lookup when chunk not found
- Add /api/v1/file/:uuid/vlm-summary endpoint for manual trigger
- Fix VLM point_id: use u64 hash instead of string (Qdrant requirement)
- Fix VLM timeout: was 0 (immediate timeout), now 120s
Verified: semantic search returns [vlm] results with proper enrichment
- tkg.rs: key_frame/key_face/best_bbox now use best-confidence frame
(was cq_best capture-quality) so thumbnails agree with trace_agent_api
best_face_frame / [F..] labels
- keep cq_best_quality as trace-level stat only
- add backfill_trace_dirs + skip_existing resume mode
- trace_agent_api.rs regenerate-thumbnail: use strict > tie-break (reduce)
matching list_traces_sorted so equal-confidence frames pick the same one
Two pre-existing bugs broke rename/get operations:
1. schema.rs: DO UPDATE referenced 'tp' alias from LEFT JOIN which is
invisible in ON CONFLICT scope → 'missing FROM-clause entry for table tp'
Fix: use {tp_table}.column instead of tp.column
2. profile.rs: SELECT tp.properties / tn.properties can be NULL when no
trace_profile row exists but decoder expected non-optional Value
→ 'unexpected null; try decoding as an Option'
Fix: decode as Option<serde_json::Value> and handle None in merge logic
- validator::clamp_crop: clamp crop rect to frame dims (fixes OOB shift)
- tkg.rs: use clamp_crop in key_face crop paths (root-cause fix)
- trace_agent_api: POST /api/v1/file/:file_uuid/trace/:trace_id/regenerate-thumbnail
- docs: 26_trace_thumbnail_regenerate.md for Studio team
- Fixed upsert_trace_profile() SQL: changed trace_profiles.xxx to tp.xxx in ON CONFLICT DO UPDATE
to fix invalid reference to FROM-clause entry error
- Fixed cluster_agent.rs error handling: replaced 'let _ =' with proper error logging
- Created migration script to backfill trace_profiles from tkg_nodes for existing files
- Migration successfully inserted 98 missing trace_profiles records
- Verified merge now works correctly: traces_merged > 0 instead of silent no-op
This fixes both the rename 500 error and the merge silent failure, as they share
the same root cause in upsert_trace_profile() SQL.
- Fixed upsert_trace_profile() SQL: replaced scalar subqueries with LEFT JOIN
to properly reference trace_profiles table in backfill logic
- Fixed face_filter routes: changed {file_uuid} to :file_uuid syntax for
axum 0.7.9 compatibility
- Both fixes resolve HTTP 500 errors in rename and 404 errors in face filter
- Database: Added bbox_size column (min(width, height)) to face_filter_features
- API: Updated all endpoints to include bbox_size in responses
- Documentation: Added bbox_size explanation and frontend filtering examples
- Maintains current Swift implementation calculation method
- Enables efficient frontend filtering without backend threshold
This allows the frontend to do real-time filtering using bbox_size
while the backend pre-computes and stores the value.
- Database schema: face_filter_features and filter_rules tables
- Core engine: FilterEngine with 4 filter rules (landmark, mediapipe, embedding, temporal)
- API endpoints:
- GET /faces - Get faces with filtering
- GET /face/{id}/filter-report - Get filter report for single face
- POST /faces/filter - Apply filter rules
- GET /filter-stats - Get filter statistics
- GET/POST /filter-rules - Manage filter rules
- API documentation for Studio team with examples
- Based on FaceNet analysis results from WD and KOBA videos
- files.rs: register_file now converts FaceSettings to json and passes to create_monitor_job
- processing.rs: ProcessRequest now includes face_settings field
- processing.rs: trigger_processing now passes face_settings to create_monitor_job and updates existing jobs
- docs: updated API examples to use correct endpoints (/api/v1/files/register and /api/v1/files/:uuid/process)
- schema.rs: Change DATABASE_SCHEMA default from 'dev' to 'public'
- rule2_ingest.rs, files.rs, tools.rs, scan.rs: Same schema default fix
- files.rs, watcher.rs, processing.rs: Change output_dev to output
- identities.rs: Change API schema parameter default from 'dev' to 'public'
- postgres_db.rs: Add face_settings column to SELECT query (fix ColumnIndexOutOfBounds panic)
This fixes worker not processing jobs due to missing dev schema.
- DB: Added face_settings jsonb column to monitor_jobs
- API: RegisterFileRequest accepts face_settings
- DB: create_monitor_job accepts and stores face_settings
- MonitorJob struct includes face_settings field
- Swift face processor will read from FACE_MIN_CONFIDENCE and FACE_MIN_SIZE env vars
- Changed Cache-Control from 'public, max-age=86400' to 'no-cache, must-revalidate'
- Added ETag header (sha256 hash of image bytes)
- Browser will revalidate on each request
- If file unchanged → 304 Not Modified (save bandwidth)
- If file changed → 200 with new image
- Applied to all thumbnail endpoints (trace, face, chunk, live extraction)
- Changed from 'public, max-age=86400' to 'no-cache'
- Allows immediate verification of rebuilt key_face.jpg files
- Can be changed back to max-age=300 after verification
- Added request_logger middleware in middleware.rs
- Logs every API request with method, path, and query string
- Logs every API response with status code and duration
- Skips health checks and static files to reduce noise
- Error responses (4xx/5xx) logged at warn/error level
- Added to server router as global middleware
- tkg.rs key_frame: select=eq(n\,best_frame) instead of -ss frame/fps
- tkg.rs retry: same fix for need_retry block
- tools.rs agent frame: select=eq(n\,frame_number)
- media_api.rs segment video: select=between(n\,sf\,ef-1) for frame mode
VFR videos (r_frame_rate != actual fps) now get correct frames.
CFR videos unaffected: select=eq(n) produces same result as -ss frame/fps.
Fixes: face card / face-detail thumbnail mismatch for VFR files.
- Thumbnail endpoint was using select_rep_face (blurdetect) which could pick
a different frame than the trace_profile's key_frame/key_face
- This caused mismatch between Face Detail modal and thumbnail in trace list
- Fix: add Step 1.5 to check trace_profile's key_face.jpg before falling back
to select_rep_face
- Ensures thumbnail always matches what Face Detail modal shows
Verified: trace_21 thumbnail now matches key_face.jpg (same hash)
Now all unregister operations log:
- source: who triggered it (api, studio, watcher, auto-cleanup, etc.)
- reason: why it was triggered (manual, failed-processing, duplicate, etc.)
Also adds proper ERROR logging for failures:
- Transaction commit failures
- Redis client creation failures
- Qdrant deletion failures
This allows tracking which operations caused file deletion and
identifying failures that were previously silent.
trace_profiles was missing from the unregister cleanup, leaving orphaned
records when files were unregistered. This caused data inconsistency:
- trace_profiles remained while Qdrant _faces and TKG nodes were deleted
- Studio could show stale face groups pointing to non-existent data
Changes:
- Added trace_profiles_table to both unregister functions
- Added delete_safe! call to delete trace_profiles by file_uuid
- Updated log message to include trace_profiles count
Verified: Cleaned up 24 orphaned records for a4442006be2d401a7e22ed8ff29da772
Single-trace groups with auto-generated names (Person_N) are filtered
to unassigned, but user-named groups are kept even with 1 trace.
This fixes the issue where moving traces one-by-one to a new group
caused them to disappear from the UI.
Before: trace → 'NewGroup' → filtered → unassigned (FS disappeared)
After: trace → 'NewGroup' → shown as group (FS visible)
Direct access to trace key_face.jpg — simpler URL, faster routing.
Response: ~8ms (read from disk, no ffmpeg).
Studio can use: /api/v1/trace-thumb/{file_uuid}/{trace_id}
Instead of: /api/v1/face-thumbnail?uuid={uuid}&trace_id={tid}&frame={frame}
1. Thumbnail API now checks trace/{tid}/key_face.jpg before ffmpeg
- First request: 8ms (read from disk) vs ~500ms (ffmpeg)
- All 2,451 trace thumbnails now served from pre-cached key_face.jpg
2. Face-groups API accepts ?include_trace_ids=false
- Default: includes trace_ids (32KB for Charade)
- With flag: excludes trace_ids (17KB, 48% reduction)
- Frontend can fetch full data only when user clicks into a group
Add async_mode option to POST /api/v1/unregister:
- async_mode=false (default): synchronous, waits for completion
- async_mode=true: spawns background task, returns immediately with job_id
Response now includes job_id field (None for sync mode).
Used by Studio when unregistering large files that take >30s
(e.g., 83K faces, 20K tkg_nodes).