Commit Graph

180 Commits

Author SHA1 Message Date
Accusys d95857dcc7 refactor: Face Cluster prefer Rust binary, remove global switch
- Remove MOMENTRY_USE_RUST_PROCESSORS from .env
- Face Cluster now tries Rust binary first, falls back to Python
- Appearance and Pose keep using Python (not needed currently)
- Simpler configuration: no global switch needed
2026-09-20 20:48:32 +08:00
Accusys 93c8760788 fix: prevent VLM panic by using try_read instead of blocking_read
** Problem:
- get_face_filter_defaults() used blocking_read() in sync context
- Caused panic: 'Cannot block the current thread from within a runtime'
- VLM generation repeatedly failed with panic

** Root Cause:
- admin_config.rs:473: ADMIN_CONFIG.config.blocking_read()
- Called from FileProfile::defaults() which runs in async context
- Tokio runtime doesn't allow blocking operations

** Fix:
- Replace blocking_read() with try_read()
- Fall back to hardcoded defaults if config is locked
- Non-blocking, safe for async context

** Impact:
- VLM summaries now generate successfully
- No more panics in VLM processing
- Job 779 VLM generation now working
2026-09-18 05:38:40 +08:00
Accusys 73c59449fe fix: prioritize environment variables over config for face detection thresholds
** Problem:
- Worker set FACE_MIN_CONFIDENCE=0.5 via std::env::set_var()
- But Python subprocess received FACE_MIN_CONFIDENCE=0.4 (from config)
- get_face_settings() prioritized admin config over environment variables

** Root Cause:
- Line 17-21: Config checked first, env var as fallback
- Worker's runtime override was ignored

** Fix:
- Reversed priority: Environment variable > Admin config
- Now reads FACE_MIN_CONFIDENCE from env first
- Falls back to config only if env var not set

** Impact:
- Worker can override face thresholds at runtime
- UI 'Deep Scan' will use correct thresholds (0.5, 1)
- Allows per-job threshold customization

** Note:
- Binary built at 05:11
- All jobs currently completed
- Requires new job to test (no active jobs available)
2026-09-18 05:12:54 +08:00
Accusys 3aaaf36ff6 fix: processor status timestamps and admin config defaults
** Problem 1: started_at not set
- update_processor_result() ignored started_at/completed_at parameters
- Only updated 'status' field, leaving timestamps as None
- Caused false 'running' state detection

** Problem 2: AdminConfig missing fields
- admin_config.json missing required fields (updated_at, paths, etc.)
- JSON parsing failed, caused panic on worker startup
- Lazy instance poisoned, all processors failed

** Fix:
1. update_processor_result now sets timestamps automatically:
   - Running -> started_at = CURRENT_TIMESTAMP
   - Completed/Failed -> completed_at = CURRENT_TIMESTAMP

2. Added #[serde(default)] to all AdminConfig fields
   - Allows partial config files
   - Missing fields get default values

** Impact:
- Processor status now accurately tracked
- Worker can start with minimal config
- UI 'Deep Scan' deadlock resolved
2026-09-18 05:00:59 +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 791c782606 fix: search_bm25 NUMERIC→f64 decode panic + rerank UTF-8 truncation
- postgres_db.rs: CAST source_weight to ::float8 (NUMERIC→FLOAT8)
- rerank.rs: char-based truncation for UTF-8 safety
- Both fixes prevent tokio worker panics that killed search requests

Bug root causes:
- keyword/BM25: sqlx decode f64 from NUMERIC panicked at postgres_db.rs:3758
- llm-smart: &text[..100] byte slice panicked at rerank.rs:52 on Chinese text

Verified: both /api/v1/search/keyword and /api/v1/search/llm-smart now return 200
2026-09-17 16:55:48 +08:00
Accusys e25c279eeb feat: port face clustering to Rust (rust_face_cluster) with A/B gating
- rust_face_cluster: seed-leader + agglomerative clustering port of
  fast_face_clustering_processor.py (Qdrant _faces scroll, trace aggregation,
  auto speaker bind, strict 2dp rounding parity)
- A/B verified vs Python on same Qdrant snapshot: both methods match on
  cluster membership/trace_id/confidence (leader + agglomerative)
- face_clustering.rs: USE_RUST_PROCESSORS switch with Python fallback
- executor.rs: run_rust_with_output_idx_and_frames (+ QDRANT env passthrough)
- appearance/pose: re-use rust runner path (previous migration)
- verify_face_cluster.py / verify_pose.py / verify_appearance.py: A/B harness
2026-09-16 21:50:07 +08:00
Accusys 362a735a91 feat: add VLM model logging before processing
- Add info log in vlm_summary.rs showing VLM model name
- Add print statements in Python VLM scripts showing model name
- Applies to: trace_vlm_caption.py, scene_vlm_caption.py, interval_vlm_caption.py
2026-08-27 20:16:08 +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 8a34dcb8f2 fix: VLM re-embedding support + API checks vlm_embedding
- 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)
2026-08-25 08:11:48 +08:00
Accusys 29f14e83c4 feat: VLM summary vector storage in Qdrant for semantic search
- 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
2026-08-25 02:57:18 +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 165af40f3c fix: upsert_trace_profile preserves VLM fields on conflict
The ON CONFLICT DO UPDATE clause was missing vlm_* columns, causing
Face Cluster (P3) label sync to overwrite and lose VLM data.

Added COALESCE preservation for:
  vlm_description, vlm_clothing, vlm_tags, vlm_location, vlm_setting,
  vlm_lighting, vlm_weather, vlm_hand_objects, vlm_has_plants,
  vlm_has_animals, vlm_background, vlm_bg_tags, vlm_model,
  vlm_embedding, vlm_point_id
2026-08-22 17:27:56 +08:00
Accusys 054545bccd feat: VLM summary vector search integration
- 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
2026-08-22 12:10:47 +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 6d7b477b31 fix: TKG key frame/face selection uses best-confidence — match frontend label
- 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
2026-08-20 01:27:35 +08:00
Accusys efa17d4b62 fix: preserve integers in trace_profile.json — no more .0 suffix on trace_id/frame/bbox 2026-08-16 23:41:15 +08:00
Accusys dda0b7cc7f feat: expose face artifact completion counts (trace_profile/key_frame/key_face) in scan + traces APIs 2026-08-16 23:09:12 +08:00
Accusys 0533248f2c fix: workspace pre_chunks dedup — stop 19GB re-dispatch bloat (A1) + charade analysis 2026-08-16 08:44:29 +08:00
Accusys 5e6a7b7d51 feat: round output JSON floats to 2dp + unify ensure_ascii for asr/asrx 2026-08-16 06:38:39 +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 c1e158a368 fix: trace-profile API SQL errors (missing FROM alias + null decoding)
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
2026-08-12 05:51:12 +08:00
Accusys 59ca6cdf83 feat: add regenerate trace thumbnail endpoint with bbox clamping
- 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
2026-08-12 03:04:19 +08:00
Accusys aa28bf93fb fix: resolve merge silent failure by fixing upsert_trace_profile SQL and backfilling data
- 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.
2026-08-10 01:42:34 +08:00
Accusys d6f45683a0 fix: resolve trace-profile UPSERT SQL error and face-filter route syntax
- 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
2026-08-09 23:41:11 +08:00
Accusys dfa515f249 feat: add bbox_size field for frontend filtering
- 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.
2026-08-09 19:05:09 +08:00
Accusys 9b6750b85e feat: implement face filter API for GUI filtering mechanism
- 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
2026-08-09 17:11:07 +08:00
Accusys 8d83d9f217 fix: replace dev schema defaults with public
- 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.
2026-08-08 17:35:23 +08:00
Accusys 8dada662e8 fix: add parameter logging for face detection settings
- swift_face.swift: Log MIN_CONFIDENCE and MIN_SIZE at startup
- face_processor.py: Log settings passed to swift_face subprocess
- executor.rs: Log face settings being passed to Python subprocesses (4 run methods)
- Enables debugging of face detection parameter chain

Test results:
- FACE_MIN_CONFIDENCE=0.5, FACE_MIN_SIZE=1 → 392 faces (195 frames with 2 faces)
- SwiftFace log shows: MIN_CONFIDENCE=0.5, MIN_SIZE=1
- face_processor.py log shows: Settings passed to swift_face: FACE_MIN_CONFIDENCE=0.5, FACE_MIN_SIZE=1
2026-08-08 16:10:47 +08:00
Accusys a06973484b fix: pass FACE_MIN_CONFIDENCE and FACE_MIN_SIZE env vars to swift_face subprocess
- executor.rs: Add cmd.env() for FACE_MIN_CONFIDENCE and FACE_MIN_SIZE in all 4 run methods
- face_processor.py: Pass os.environ to subprocess.Popen to inherit env vars
- Fixes multi-face detection issue where second face was being filtered out
- Tested: CONFIDENCE=0.5 preserves both faces (392 total), CONFIDENCE=0.75 filters second face (196 total), SIZE=100 filters small faces (201 total)
2026-08-08 15:41:26 +08:00
Accusys 606f4ce5be feat: add per-file face_settings (min_confidence, min_size) support
- 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
2026-08-08 04:17:05 +08:00
Accusys ca8b910d59 fix: schema.rs COALESCE加固 + rebuild_trace_thumbs tool
- schema.rs: ON CONFLICT 加入 COALESCE 避免 edge case 把回填值打回 NULL
- rebuild_trace_thumbs: 從 Qdrant _faces 找 best face 重建 key_face.jpg
- 已完成 61/10184 traces(工具運作中,大檔案需較長時間)
2026-08-07 15:55:30 +08:00
Accusys cd8df324be fix: tkg.rs avg_confidence moved before props construction + schema.rs ON CONFLICT backfill derived fields
- tkg.rs: avg_confidence calculation moved to line 1207 (before props json)
- tkg.rs: Added 'avg_confidence' to props json (round4)
- schema.rs: ON CONFLICT DO UPDATE expanded to backfill start_frame, end_frame,
  frame_count, key_frame, key_face, avg_confidence from tkg_nodes.properties

This fixes trace_profiles.avg_confidence always being NULL, and enables
automatic self-healing when upsert_trace_profile is called from any caller.
2026-08-07 14:04:54 +08:00
Accusys a6d705abf1 fix: VFR frame extraction - use select=eq(n) instead of -ss frame/fps
- 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.
2026-08-05 12:36:25 +08:00
Accusys 15967929ef fix: ASR fails to find cut.json when executor uses .tmp output path
- ASR script used output_path.replace('.asr.json', '.cut.json') to find CUT file
- Executor passes output path with .tmp suffix (xxx.asr.json.tmp)
- This produced wrong path: xxx.cut.json.tmp (doesn't exist)
- Fix: use --uuid to construct CUT path from output_dir instead
- Also added executor Full command logging for debugging

Fixed IMG_9449 (1).MOV ASR failure: status changed from failed → completed
2026-08-05 01:45:59 +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 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
Accusys 4c8041974a fix: executor .tmp output handling clobbered fresh script results
run_with_frames / run_with_output_idx / run_with_output_idx_and_frames
had an inverted .tmp-file flow:

1. Before spawning, if the final .json existed it was renamed to .json.tmp
   (the OLD output set aside as "tmp").
2. The script was passed the FINAL .json path, so it wrote fresh data there.
3. On success, .json.tmp (the OLD/empty file) was renamed back OVER the
   fresh .json, discarding the new result.

For face clustering this meant the freshly-clustered 2-person result was
always overwritten by the stale/empty previous face_cluster.json, so the
cluster agent reported "0 clusters" and Face Deduplication matched nothing.

Fix: remove the bogus pre-rename and instead pass the .tmp path to the
script as its output argument, then promote .tmp -> .json only on success.
This guarantees the fresh result is what lands in the final file. Applied
identically to all three run_* helpers.

Verified on 9cbeb112 (FilmRiot): cluster-agent now returns 2 clusters /
17 traces and face_cluster.json contains the real clustering (was 0).
2026-07-31 14:59:37 +08:00
Accusys 40fc8c6a53 fix: group delete semantics - unassign instead of destroy, self-heal tkg_nodes
Studio's "delete group" was calling hard_delete which physically removed
_faces points, tkg_nodes and trace_profiles (and silently failed to back
up to a non-existent _faces_trash collection, making undo impossible).
This permanently lost face groups and broke face-groups/cluster-results
(which are based on tkg_nodes) for any trace without a node row.

Changes:
- delete_trace hard-delete now means "restore to unassigned": keep
  _faces/tkg_nodes/trace_profiles, only reset name to "Face Trace {id}".
  Data is never destroyed so groups can be rebuilt and undo works.
- schema::ensure_face_track_node: create the face_track tkg_nodes row on
  write so a trace that lost its node (old hard-delete) reappears in
  face-groups/cluster-results (self-healing). Called from
  update_trace_profile_handler, update_trace_profile_group_handler and
  merge_groups_handler; the group handler also syncs tkg_nodes.label.
- restore_trace / undo_hard_delete_trace: when _faces_trash is empty
  (new semantics), rebuild the named group from the operation snapshot
  (tkg_nodes ON CONFLICT UPDATE + trace_profiles UPSERT) instead of 404.

Verified live on port 3002 (file bfba056f...): delete -> unassigned with
_faces preserved (4 points), rebuild group -> self-healing creates node
and group shows up, restore -> name restored to original. Also fixed the
pre-existing missing tkg_nodes row for trace 4621 via the same path.
2026-07-31 13:14:23 +08:00
Accusys aab727b297 docs: trace_profile UPSERT fixes + Studio face group API gap analysis
- profile.rs: single/group/merge_groups/undo all use upsert_trace_profile
- trace_agent_api.rs: hard delete/merge snapshot + delete trace_profiles
- cluster_agent.rs, job_worker.rs: background name writes use UPSERT
- schema.rs: upsert_trace_profile helper (backfill from tkg_nodes)
- Studio 3 API gaps documented (cluster-results/identity-matches/similar)
2026-07-31 11:16:18 +08:00
Accusys 85d5e1fe51 feat: trace_id i64→i32 fix, OCR search filter, Rule1 OCR trigger
- Fix trace_id SQL type mismatch: i64 → i32 in profile.rs structs and queries
- Add /ocr /asr /asrx search filter suffix to keyword/semantic/smart search
- Fix fetch_ocr_texts to handle both OCR data formats (string array + object array)
- Add has_ocr trigger for Rule1 chunk ingestion in job_worker.rs
- Add search_bm25 chunk_type filter parameter
- Fix single-frame video clip duration (0-frame → 1-frame minimum)
- Re-run Rule1 for 14 files with stuck OCR in pre_chunks
2026-07-30 19:34:35 +08:00
Accusys 39a2cbc65b fix: face group name read consistency, sync_file_status fix, cleanup ghost records, identity_agent replaced with face_dedup
- get_face_groups_handler: COALESCE(tp.name, tn.label) for name consistency
- sync_file_status: compare JSON vs pre_chunks (not chunk table)
- face consistency: compare frames.len() not total_faces
- cleanup 2 ghost records with NULL file_name/file_path
- replace identity_agent with face_dedup in pipeline stages
- remove identity_agent_api.rs and all references
- update required_processors to match actual processors
- update AGENTS.md with team responsibilities
- add Studio pipeline changes documentation
2026-07-27 02:15:51 +08:00
Accusys fcdeab82e6 feat: save key_frame.jpg and key_face.jpg for each face trace during TKG build
- Extract full frame at best confidence frame using ffmpeg
- Crop face region using average bbox coordinates
- Save to .faces/{file_uuid}/{trace_id}/key_frame.jpg and key_face.jpg
- TKG node properties store full file paths for UI display
- Supports future extension for cut representative frames
2026-07-21 04:08:16 +08:00
Accusys 6f5d71763f feat: auto-populate key_frame and key_face in TKG face_track nodes
- FacePoint now includes confidence and point_id from Qdrant
- TKG build tracks best face (highest confidence) per trace
- key_frame = frame number of best face, key_face = Qdrant point ID
- Every face trace now has representative frame and face for UI display
2026-07-21 03:56:25 +08:00
Accusys 52bec30c90 feat: unify TKG face_track external_id to trace_N, add trace restore endpoint
- tkg.rs: use trace_N as primary external_id, delete duplicate face_track_N nodes
- trace_agent_api.rs: add POST /trace/:id/restore to undo soft delete
- ensure 1:1 mapping: each trace has exactly one TKG node with full profile
2026-07-21 03:19:17 +08:00
Accusys 0ad6927d25 feat: fix TKG external_id mismatch, add trace delete/merge endpoints, fix no-faces progress update
- identity_binding.rs: match both face_track_N and trace_N external_id formats in bind/unbind/create_pending_person
- profile.rs: fix external_id matching and parameter ordering in trace profile updates
- trace_agent_api.rs: add DELETE /trace/:id (soft/hard delete) and POST /trace/:src/merge/:target endpoints
- qdrant_db.rs: add delete_points_by_filter method
- tkg.rs: add debug logging for scroll and parse operations
- job_worker.rs: update progress for no-faces TKG path
2026-07-21 02:45:34 +08:00
Accusys 29d2cc7315 fix: wait for Qdrant face points before TKG build
- Add Qdrant count verification before TKG build
- Wait up to 30 seconds for Qdrant to have all face embeddings
- Prevents race condition where TKG reads incomplete data
- Add count_points method to QdrantDb
2026-07-20 23:26:42 +08:00
Accusys 7dc910e2de feat: add cluster-agent endpoint, fix OCR labeling, fix ingestion blocking
- Add POST /api/v1/file/:file_uuid/cluster-agent endpoint for on-demand face clustering
- Fix OCR chunks being labeled as ASRX: use ChunkType.as_str() instead of {:?}
- Rule 1 now deletes old chunks before re-inserting to avoid stale data
- Add fallback face_traced.json when store_traced_faces.py fails
- ingestion_complete now handles status='error' to unblock jobs
- VLM describe tool now uses trace_id with pre-extracted face crops
2026-07-20 21:48:27 +08:00