Commit Graph

111 Commits

Author SHA1 Message Date
Accusys 5d18183d82 feat: Face JSON v2 schema - add schema_version, bbox x2/y2/center, keep embeddings, update clustering 2026-11-02 14:34:02 +08:00
Accusys c151b49334 feat: implement service management API for VLM control
- Add /api/v1/mbe/health endpoint for status checks
- Add /api/v2/service/start to start llama-server
- Add /api/v2/service/stop to stop llama-server
- Use TCP connection test for port detection (more reliable than lsof)
- Add ps aux fallback for PID detection
- Implement structured bilingual VLM tags
- Add VLM integration documentation for Studio team

Endpoints tested and working with Momentry Studio AdminView UI.
2026-10-24 02:37:53 +08:00
Accusys 121610f8d9 feat: dynamic processor list from pipeline_flows.json
- Changed pipeline_flows.json: scene → scene_vlm
- Added get_enabled_processors() method to PipelineFlows
- Updated create_monitor_job to use dynamic processors
- Updated process_register_command to use dynamic processors
- Removed hardcoded processor arrays
- Added tests for get_enabled_processors()
2026-10-19 02:03:15 +08:00
Accusys 9f7bc1c37a feat: add pause/resume job functionality
- Added Redis paused set for job management
- Worker skips paused jobs during polling
- Added POST /api/v1/jobs/:uuid/pause endpoint
- Added POST /api/v1/jobs/:uuid/resume endpoint
- Added GET /api/v1/jobs/paused endpoint
- Paused jobs are excluded from worker processing queue
2026-10-18 20:13:31 +08:00
Accusys 58431d1d8d feat: sync_trace_label unified function + fix is_tkg_done
- Created trace_sync module with sync_trace_label() to sync labels across:
  1. tkg_nodes.label (PostgreSQL)
  2. trace_profiles.name (PostgreSQL)
  3. trace_profile.json label (FS)
  4. Qdrant _faces payload.label (NEW - was missing)

- Fixed is_tkg_done: allow 0 trace dirs if tkg_nodes exist
  (prevents permanent stuck in 'Scanning' status)

- Updated Face Cluster to use sync_trace_label
- Updated merge_trace to use sync_trace_label + cleanup source dir

- Created Face_Operations_Complete.md reference document
  (consolidates all face-related docs into single source of truth)
2026-10-18 14:15:12 +08:00
Accusys aecf64af27 fix: replace hardcoded store_traced_faces.py with Rust binary
- Worker was calling Python store_traced_faces.py instead of Rust version
- This caused trace_id=0 in Qdrant, blocking TKG and file completion
- Now uses rust_binary_path() to find and execute rust_store_traced_faces
- Also removed all Python implementations from processor config
- Removed POSE processor (deprecated)
- Added redis_publisher.py symlink for face clustering

Fixed: file stuck in 'Scanning' due to trace stability check failure
2026-10-18 08:43:56 +08:00
Accusys 17cdb6c7fd feat: implement dynamic concurrency control for SCENE_VLM (complete)
- Add DynamicSemaphore, SystemMonitor, VlmMonitor, AutoScaler
- Replace static SCENE_VLM_SEM with dynamic version (max: 3)
- Start AutoScaler in Worker::run() for automatic adjustment
- Configured for M5Max48: 48GB, thresholds at 38GB/41GB
- Expected processing time: 23-28 days for 10000 files

Note: VLM response tracking to be added separately if needed
2026-10-17 21:52:01 +08:00
Accusys 229eef6db1 fix: call start_autoscaler() in Worker::run() to enable dynamic concurrency 2026-10-17 21:49:58 +08:00
Accusys 9886a3a5b2 feat: implement dynamic concurrency control for SCENE_VLM
- Add dynamic_concurrency module with DynamicSemaphore, SystemMonitor, VlmMonitor, AutoScaler
- Replace static SCENE_VLM_SEM with dynamic version (max concurrency: 3)
- Add AutoScaler background task for automatic concurrency adjustment
- Configured for M5Max48 (48GB): thresholds at 38GB/41GB
- Expected processing time: 23-28 days for 10000 files

Related: Phase 1 implementation after Phase 0 TKG fix verification
2026-10-17 21:47:33 +08:00
Accusys 91f83f781c fix(tkg): remove tkg_nodes.json file check in is_tkg_done()
- TKG processor writes to database, not file
- Check database + trace directories instead
- Fix infinite loop for completed files
- Related: Phase 0 preparation for dynamic concurrency
2026-10-17 18:24:26 +08:00
Accusys 2090dd25ea feat: improve face clustering and add trace-profile API fallback
Core changes:
- Face clustering threshold: 0.35 → 0.15 (better male/female separation)
- Add auto-filtering for low-quality clusters (face_count<20, bbox_area>150000)
- Add filesystem fallback for trace-profile API

Face clustering improvements:
- Correctly separates male and female faces
- Filters hand detections and isolated faces
- Result: 2 persons (186 male, 174 female) vs 4 persons before

Trace profile API:
- GET /api/v1/trace-profile?file_uuid=X&trace_id=Y
- Returns data from PostgreSQL or filesystem fallback
- Simplifies frontend: no need to know filesystem structure
- Fixes Studio 'trace profile not found' error

Issue: docs_v1.0/M4_workspace/2026-10-16_studio_trace_profile_bug_report.md
2026-10-16 13:36:29 +08:00
Accusys 882e31ab96 feat: declarative pipeline config, non-blocking Scene VLM, rust_asrx
Consolidated snapshot (previously WIP in working tree).

- core/pipeline_config: new module loading config/pipeline_flows.json as the
  source of truth for stage execution mode (parallel/blocking) and dependencies
- worker/job_worker: dispatch Scene VLM to a background task when the stage is
  declared parallel, unblocking the worker poll loop; resolve processor
  dependencies from pipeline_flows.json (fallback to built-in)
- config/pipeline_flows.json: asrx depends on [cut, asr]
- scripts/fix_stuck_jobs: fix UTC timezone comparison, raise default threshold
  to 6h, skip jobs with recent processor activity
- rust_asrx: Rust speaker diarization CLI + processor wiring
- processor metadata helper; fast_face_clustering script; file_progress pipeline
  API; scan API; VAD updates
2026-10-15 13:01:12 +08:00
Accusys 63fbbe1225 release: v1.3.1 - Pipeline Queue Integration, OCR Fix, Worker Compatibility
Major Changes:
- Pipeline Queue integration completed (internal.file + pipeline.commands)
- Fixed old job_worker database compatibility with new command_queue table
- Compiled Swift OCR binary (was missing, causing empty OCR results)
- Added deep scan functionality through re-scan API

Fixes:
- Changed CommandJob.id from i32 to i64 for database compatibility
- Added UUID generation in create_command (message_id field)
- Fixed claim_pending_commands to query queue_name = 'internal.file'
- Fixed field mappings: command_id → message_id, job_type → command_type
- Added support for 'processing' status in CommandJobStatus

Queue System:
- internal.file queue: for register/unregister/re-scan commands (job_worker)
- pipeline.commands queue: for vectorize/store_asrx/etc commands (pipeline_worker)

Documentation:
- Added comprehensive queue system documentation
- Created M4 workspace status reports
- Updated AGENTS.md with queue system details
2026-10-12 10:00:51 +08:00
Accusys d55d398832 fix: handle null status in face_traced.json for no-face videos
Issue: Files with face_traced.json status=null and total_faces=0 stuck in PROCESSING forever

Root cause:
- ingestion_complete checks trace_status == 'no_faces' to skip TKG
- But some old files have status=null instead of 'no_faces'
- TKG check fails because no nodes for no-face videos

Solution:
- Check both status='no_faces' AND total_faces=0
- Skip TKG check for no-face videos (total_faces=0)
- Also update face_cluster_done to handle total_faces=0

Impact:
- Fixes stuck files with null status in face_traced.json
- Consistent with scan.rs fix (commit 0d11c601)

Affected: M4ProMini file 18173b62d80bf829910348fa1a6ddcf5
2026-10-08 09:41:51 +08:00
Accusys cd00a7fec5 fix: worker finalize stuck processing files
- Improve face fast-path trigger: recognize has_faces with empty frames
- Add re-evaluation mechanism: check PROCESSING files every 10 mins
- Enhance ASRX silent fast-path: detect empty segments array
- Fix files stuck in PROCESSING status when all data is produced

Related: M4ProMini deep scan (114 files, 89 bad + 2 stuck)
Issue: ASRX & FACE_CLUSTER forever running/0, no completion trigger
2026-10-07 13:11:10 +08:00
Accusys 036fc9f853 fix: replace hardcoded paths in job_worker.rs (A-4.2 P3)
Issues: 2 hardcoded output_dir paths

Solution: Use config::OUTPUT_DIR

Verification: cargo check --lib passes
2026-10-04 16:37:41 +08:00
Accusys 162ece34f7 revert: disable Pose processor (was cancelled decision)
Pose was previously decided to be removed (ProcessorType::all()
already excludes it: 'Disabled in production pipeline'). However,
create_monitor_job's default processors array still contained 'pose',
job_worker's auto-pipeline status init still listed pose/appearance,
and processor_tools_v3.json had pose implementations enabled.

This reverts the pose portions of 8c6a2de8 (pose.rs placeholder
expansion and config --output args change) and fully disables Pose:

- config/processor_tools_v3.json: pose swift/mediapipe enabled=false,
  restore original --output args for swift
- src/core/db/postgres_db.rs: create_monitor_job default processors
  no longer includes 'pose'
- src/worker/job_worker.rs: auto-pipeline status init no longer lists
  pose/appearance
- src/core/processor/pose.rs: revert placeholder expansion (unchanged
  from pre-8c6a2de8)

Face config-driven fix (positional args + placeholder expansion) is kept.
2026-10-02 15:04:48 +08:00
Accusys 9e1fa0a3ff fix: ASRX null frame tolerance and FaceCluster unblocking
- AsrxSegment.start_frame/end_frame -> Option<u64> so the ASR fallback
  (which emits null frames) deserializes instead of erroring
- P2 face-trace trigger gated on has_face alone (not has_asrx), so
  no-face videos still get face_traced.json via the fast-path,
  unblocking FaceCluster and preventing the job from failing
2026-10-02 13:50:49 +08:00
Accusys e0d04e242f feat: face clustering pipeline improvements and Rust/Swift face processing
- Add Rust face processor module (detection, embedding, tracking, qdrant)
- Add Facenet CoreML/ONNX conversion scripts and tests
- Refactor swift_face into Sources/swift_face with ArgumentParser support
- Update store_traced_faces to handle face.json correctly
- Fix ASRX parsing and TKG bbox reading from Qdrant
- Improve admin_config and trace_agent APIs
- Add M4 workspace docs for face clustering, dedup, and Facenet validation
- Fix worker heartbeat TTL (poll_interval x 3, min 60s) for offline detection
2026-10-02 12:24:55 +08:00
Accusys 8eca08c7c9 refactor: simplify status to scanning and completed only
變更:
- ✅ 移除 Processing 狀態
- ✅ 移除 Waiting 狀態
- ✅ 移除 Indexed 狀態
- ✅ 移除其他中間狀態
- ✅ 只保留 Scanning 和 Completed

VideoStatus 枚舉:
- Unregistered
- Registered
- Pending
- Queued
- Scanning (處理中)
- Completed (完成)
- Failed (失敗)

狀態流程:
Scanning → Completed

簡化原因:
- 中間狀態太多導致用戶困惑
- Scanning 和 Completed 足夠表示處理狀態
- 其他狀態(Pending, Queued, Failed)仍保留

狀態: ✅ 已實施
2026-09-29 02:11:30 +08:00
Accusys aa4e50f4dc feat: add Waiting status for long-running operations
問題:
- 處理過程中有長時間等待
- 用戶不知道為什麼卡住
- 無法區分「處理中」和「等待中」

修復:
- ✅ 添加 VideoStatus::Waiting 狀態
- ✅ 修復重複的 match arms
- ✅ TKG verification 前設為 Waiting
- ✅ Ingestion 前設為 Waiting

狀態流程:
- Scanning → Processing → Waiting → Indexed → Completed

用戶體驗:
- 等待 TKG 時顯示 'waiting'
- 等待 ingestion 時顯示 'waiting'
- 更清晰的狀態區分

狀態: ✅ 已實施
2026-09-29 01:35:19 +08:00
Accusys ef94fac8fa feat: add intermediate status updates during processing
問題:
- Worker 只在開始時更新 status 為 scanning
- 只在完成時更新為 completed 或 failed
- 中間沒有狀態更新
- 用戶無法知道當前在哪個步驟

修復:
- ✅ Processing: 處理器開始運行時
- ✅ Indexed: Rule 1 完成時
- ✅ Completed: 全部完成時(已存在)

影響:
- 用戶可以看到處理進度
- 更好的狀態透明度
- 問題排查更容易

文檔:
- docs_v1.0/M4_workspace/2026-09-28_status_update_proposal.md

狀態: ✅ 已實施基本狀態更新
2026-09-29 01:21:22 +08:00
Accusys c3b40e6f27 fix: worker reads vlm_output_language from admin_config
修復:
- Worker 啟動時讀取 admin_config.search.vlm_output_language
- 設置 preferred_language
- Scene VLM 將使用該語言生成本地化描述

測試:
- 重啟 Server 和 Worker
- 等待處理新文件
- 檢查日誌中的 preferred language 設置

狀態: ✅ 已修復
2026-09-28 23:40:27 +08:00
Accusys 585fd8728a fix: VLM output language configuration
問題:
- admin_config.json 的 vlm_output_language 被忽略
- Worker 使用默認語言 (zh-TW)
- VLM 輸出語言無法設置

修復:
- ✅ SearchConfig 添加 vlm_output_language 字段
- ✅ Worker 讀取 admin_config 並設置語言
- ✅ Scene VLM 使用 preferred_language

配置優先級:
1. admin_config.json (最高)
2. MOMENTRY_PREFERRED_LANGUAGE 環境變數
3. 默認值 zh-TW

支持語言:
- ja (日文)
- en (英文)
- zh-TW (繁體中文,默認)
- zh-CN (簡體中文)
- ko (韓文)

文檔:
- docs_v1.0/M4_workspace/2026-09-28_vlm_output_language_fix.md

狀態: ✅ 已修復
2026-09-28 23:23:12 +08:00
Accusys f15842e9cf fix: remove traced_faces directory check in Worker
問題:
- Worker 檢查 traced_faces/ 目錄是否存在
- Python store_traced_faces.py 不創建此目錄
- 導致無限重試

修復:
- 只檢查 face_traced.json 是否存在
- 移除 traced_faces/ 目錄檢查

影響:
- ✅ Worker 不再無限重試
- ✅ 支持 Rust store_traced_faces
- ✅ 支持 Python store_traced_faces

驗證:
- Worker 將在下次 Pipeline 運行時使用新邏輯
2026-09-28 10:40:30 +08:00
Accusys 9d1f53d70b fix: correct auto-pipeline trigger logic for re-scan
問題:
- auto_pipeline_enabled 全局設置默認為 false
- 即使 auto_pipeline_override=true,條件判斷仍需要全局設置為 true
- 導致 Re-scan API 無法觸發處理

修復:
- 修改條件邏輯: auto_pipeline_override 直接觸發,忽略全局設置
- 原有邏輯: (force || !already_exists) && auto_pipeline_enabled

測試結果:
- ✅ Re-scan API 成功
- ✅ Monitor Job 已創建
- ✅ 文件狀態: scanning
- ✅ 處理正在進行

日誌驗證:
- auto_pipeline_override=true 時直接觸發
- 不再依賴全局 auto_pipeline_enabled 設置
2026-09-27 14:39:09 +08:00
Accusys ecb209633a feat: implement Re-scan API (partial)
實現內容:
1. 新增 ReScanRequest 和 ReScanResponse 結構體
2. 實現 re_scan API 函數
3. 添加路由 POST /api/v1/re-scan
4. 修改 process_register_command 添加 auto_pipeline_override 支持

測試結果:
- ✅ Re-scan API 可用
- ✅ Command 創建成功
- ✅ Force unregister 正確執行
- ❌ Monitor Job 未自動創建(需要進一步修復)

已知問題:
- register_single_file 在 force unregister 後仍返回 already_exists=true
- 導致 auto_pipeline 條件判斷失敗

下一步:
- 修改 register_single_file 修復 already_exists 標志
- 或在 process_register_command 中添加 force_unregister_executed 標志
2026-09-27 14:29:23 +08:00
Accusys 0558cd7615 fix: add data integrity check for Face Tracing
Problem:
- Worker only checked face_traced.json existence
- Didn't verify traced_faces/ directory exists
- Didn't check if directory has files
- Result: incomplete traces marked as complete

Solution:
- Check traced_faces/ directory exists
- Check directory has files (file_count > 0)
- Remove incomplete face_traced.json if trace incomplete
- Re-run Face Tracing for incomplete traces

Impact:
- Prevents false "already done" detection
- Ensures data integrity before skipping
- Auto-repairs incomplete traces

Fixes:
- 020.mp4 stuck at 40% issue
- Similar stuck cases with missing traced_faces/
2026-09-27 08:23:02 +08:00
Accusys 357e585399 fix: Face processor now saves status and total_faces to face.json 2026-09-26 23:06:11 +08:00
Accusys 0fe09afdb6 fix: prevent 'running' status deadlock in worker
** Problem:
- Worker set processor status to 'running' BEFORE checking capacity
- If capacity limit reached, processor was skipped but status stuck at 'running'
- Worker would skip processors with 'running' status on next poll (deadlock)

** Root Cause:
- Line 591-600: update_processor_progress(..., 'running')
- Line 1434: check capacity (TOO LATE!)
- Result: status='running' but processor never started

** Fix:
- Move capacity check BEFORE setting 'running' status
- If capacity limit reached, mark as 'skipped' immediately
- Prevents 'running' status from being set when processor won't actually run

** Impact:
- Fixes UI 'Deep Scan' deadlock issue
- Workers will no longer get stuck in infinite loop
- Processor status will accurately reflect actual state

** Files Changed:
- src/worker/job_worker.rs: Moved capacity check to line 591-592
- Removed duplicate capacity check at line 1464-1493
2026-09-18 03:53:39 +08:00
Accusys 31d1b4050f fix: correct face detection threshold defaults
- 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).
2026-09-18 02:42:21 +08:00
Accusys 474a5bee99 refactor: remove YOLO processor and dependencies
- 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
2026-09-17 16:56:25 +08:00
Accusys 20f5974b52 feat: Rule 3 moment chunks — 10s windows with 1-2 key frames
- Add ChunkType::Moment to types.rs
- Add moment_interval to FileProfile (configurable, default 10s)
- Create rule3_moment.rs: reads trace_profile.json, groups by time window,
  selects 1-2 diverse key frames using Jaccard similarity on VLM text
- Embed moment chunks into Qdrant using trace VLM embeddings
- Wire into worker: triggers after VLM completes, blocks job completion
- Add moment_chunks progress stage (weight: 0.01)
2026-08-26 02:37:47 +08:00
Accusys 8732c3e0a4 fix: VLM blocking in worker — job waits for all traces to have VLM description
Problem: vlm_done_bool=true was hardcoded, so job completed immediately
without waiting for VLM generation. After re-scan, trace_profile.json
showed vlm_summary: null.

Fix: Query trace_profiles to check VLM completion status before
marking all_ok=true. Job now blocks until vlm_done_count >= vlm_total.
2026-08-25 21:50:54 +08:00
Accusys 2bbbf1950d fix: integrate VLM into worker poll loop for auto-resume
- Move VLM trigger from TKG spawn to worker poll loop
- Each poll checks if VLM is incomplete and key_frames are ready
- If VLM was interrupted (server restart), next poll will restart it
- Removed duplicate VLM spawn from TKG block
2026-08-24 21:34:31 +08:00
Accusys 9f12e835b8 feat: add TraceArtifacts phase + VLM waits for all key_frame.jpg
- 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
2026-08-24 19:13:11 +08:00
Accusys d29b4804af fix: P5 VLM trigger after Face Dedup + sync label to on-disk JSON
- Move P5 VLM trigger from TKG block to Face Dedup block
  (trace_profiles DB is written by update_face_track_labels, not TKG)
- Update on-disk trace_profile.json label when Face Dedup updates names
- Add output_dir and redis_clone to Face Dedup spawn scope

Pipeline flow:
  Face → P2 Tracing → P3 Cluster → update_face_track_labels
    → DB trace_profiles + on-disk JSON updated
    → P5 VLM triggered with verified trace count
2026-08-23 15:21:43 +08:00
Accusys ff9fb9a4ca fix: make VLM non-blocking in ingestion check
VLM summary was blocking job completion, causing jobs created before
P5 deployment to be stuck forever (vlm=false, all_ok=false).

Now VLM logs progress but doesn't block: vlm_done_bool always true.
This allows older jobs to complete while VLM can be triggered
separately via API.
2026-08-23 03:10:58 +08:00
Accusys 58d80e34c6 fix: move P5 verify inside TKG spawn — guarantee DB committed before VLM
verify_traces_ready now runs synchronously after build_tkg().await
completes, not inside a separate spawned task. This guarantees the
DB transaction from TKG is fully committed before VLM checks for data.

Before: TKG spawn → P5 spawn (race: P5 may run before TKG DB commit)
After:  TKG spawn → build_tkg() await → verify → spawn VLM (sequential)
2026-08-22 22:36:14 +08:00
Accusys 906243fdc1 refactor: replace P5 polling with JOIN-based verification + timeout
B: Replace wait_for_traces polling with verify_traces_ready
   - Uses JOIN query: trace_profiles INNER JOIN tkg_nodes
   - Ensures trace_profiles data is consistent with TKG before VLM runs
   - Single query instead of 30 retry attempts

C: Add 5-minute timeout to VLM generation
   - tokio::time::timeout(300s) prevents worker from hanging
   - Logs completion stats or timeout error

This fixes the root cause: P5 no longer polls blindly waiting for
TKG to finish. The JOIN query only returns rows when both
trace_profiles AND tkg_nodes face_track entries exist.
2026-08-22 22:17:21 +08:00
Accusys 978b2b338b fix: P5 race condition — poll for trace_profiles before VLM generation
- Add wait_for_traces() helper: polls trace_profiles table every 2s
  up to 60s, returning when rows appear (TKG may still be writing)
- Replace one-shot face_count query in both P5 triggers (has_face +
  no-face paths) with polling
- Verified: 22/22 traces summarized for 9df18017, semantic search
  returns 10 VLM results with sim 0.601-0.696
2026-08-22 16:17:30 +08:00
Accusys 476a31ecc6 feat: P5 VLM Summary pipeline integration + trace_profile vlm_summary field
- Add src/core/processor/vlm_summary.rs: VLM + Embedding pipeline stage
  * Reads key_frame.jpg → Ollama llava:7b → vlm_description
  * Writes DB (vlm_description, vlm_model, vlm_embedding) + on-disk JSON
  * EmbeddingGemma → Qdrant upsert (chunk_type=vlm_summary)
  * Non-blocking: errors logged, does not prevent job completion
  * Redis progress tracking: vlm_summary stage N/M traces

- Add src/bin/backfill_trace_vlm.rs: manual backfill binary
  * Supports --file-uuid, --force, --limit flags
  * Concurrency: 2 parallel VLM calls

- Add vlm_embedding JSONB column to trace_profiles (schema + migration)
- Add vlm_summary field to FaceTraceProfile struct
- Add P5 trigger in job_worker.rs (has_face + no-face paths)
- Add VLM monitoring to ingestion_complete() (non-blocking)
- Update .env / .env.development: VISION_URL → Ollama 11434
2026-08-22 09:52:04 +08:00
Accusys 39e9ce4c3b fix: add min_capture_quality to FaceFilterSettings + trace profile fixes
- Add min_capture_quality to FaceFilterSettings (file_profile.rs)
- Fix store_traced_faces.py: load embeddings from Qdrant with_vector=True
- Fix face_tracker.py: force new traces when frame_gap > 30
- Fix backfill_trace_profiles.py: key_frame select=eq(n,N), bbox scaling, best_frame
- Add best_frame to FaceTraceProfile (Rust + Python)
- Fix min_capture_quality persistence in file-profile API
2026-08-13 10:12:21 +08:00
Accusys 86f1fe8852 fix: restore Apple Vision default detection thresholds (0.5 / 1px)
job_worker.rs was overriding Apple Vision defaults with 0.75/64 even when
no face_settings were provided, causing fewer faces to be detected.

Now detect all faces with Vision defaults (confidence 0.5, min_size 1px);
filter later for display via face_filter settings.
2026-08-12 09:16:30 +08:00
Accusys 2e4559715b fix: tkg face_track drift — trace stability check + repair script
Part B (source fix): Enhanced TKG build Qdrant readiness check in
job_worker.rs. Previously only checked point count >= expected_faces,
which could fire before short traces finished uploading. Now verifies
trace_id stability: two consecutive scroll checks (2s apart) with same
unique trace count before proceeding.

Part A (repair): New scripts/repair_tkg_face_tracks.py reconciles Qdrant
_faces traces with PG tkg_nodes face_track rows, inserts missing ones.
Fixed 233 missing traces in 44c37c (1197 → 1430).
2026-08-12 06:21:18 +08:00
Accusys 1571f675a5 fix: worker reads face_settings from job and sets env vars for face processor
- job_worker.rs: Read face_settings from monitor_jobs before processing
- job_worker.rs: Set FACE_MIN_CONFIDENCE and FACE_MIN_SIZE env vars
- job_worker.rs: Restore env vars after processing completes
- Add detailed logging: [WORKER] face_settings and env var changes

This ensures the executor receives the correct face settings from the job.
2026-08-08 23:16:35 +08:00
Accusys 3d13a06bd9 feat: face fix deployment + trace_* regeneration + executor stderr filter fix
- swift_face.swift: frame rounding (.rounded()), conf 0.75, min_size 64
- trace_* directories regenerated for KOBA (37 traces, start_frame 5307)
- executor.rs: stderr filter now logs all non-empty stderr (was discarding)
- VAD not skippable in ASRX (main_fixed.py Step 2 always runs)
- Step 2.5 sentence boundary refinement added
- Cluster agent async endpoints + similarity transparency
- Keyword search: relationship text extraction, priority ordering
- Face fix handoff doc for Studio team
2026-08-05 00:13:50 +08:00
Accusys 36a704e3d3 fix: two issues - per-job concurrency budget + face_cluster race condition
1. Per-job concurrency budget: add can_start_for_job() to ProcessorPool
   so multiple files process in parallel instead of one job starving others.
   Uses active_job_count to compute fair slot budget per job.

2. FaceCluster race condition: add face_traced.json existence check before
   running face_cluster processor. face_traced.json is produced by P2
   store_traced_faces.py which runs AFTER process_job completes, so
   clustering was producing no_faces (0 clusters) despite having faces.
2026-08-03 12:18:22 +08:00
Accusys 4d0d2204fd fix: auto-update face track labels after clustering in worker pipeline
The P3 Face Dedup trigger previously only logged when cluster_count !=
face_track_count without actually syncing labels. Now it calls
update_face_track_labels to:
- UPDATE tkg_nodes SET label = cluster_id for each trace
- UPSERT trace_profiles SET name = cluster_id
- Reset unclustered traces to default Person_N name

This matches what the manual 'Face Deduplication' button in Studio
already does via the cluster-agent API endpoint, ensuring the automatic
pipeline produces the same result without requiring manual intervention.
2026-08-03 08:09:16 +08:00
Accusys 5244386892 fix: executor output_idx corrupting --file-uuid arg in store_traced_faces.py
The PythonExecutor.run() hardcoded output_idx=1, which treats args[1] as
an output file path and rewrites it to .json.tmp. For scripts like
store_traced_faces.py that use --file-uuid (not an output path) at
position 1, this corrupted the UUID into a file path, causing the script
to fail with exit status 1 within 90ms.

- run_with_output_idx: output_idx changed from usize to Option<usize>
- run_with_output_idx_and_frames: same change
- run(): doc comment added, passes Some(1) for backward compatibility
- job_worker.rs: store_traced_faces.py and release_pack.py calls now
  pass None for output_idx (no output path substitution)
- appearance.rs: passes Some(2) explicitly (output at index 2)

Verified: Gamma 8 file completed full pipeline with 24 face traces
and 185 TKG nodes.
2026-08-02 20:53:51 +08:00