Commit Graph

1061 Commits

Author SHA1 Message Date
Accusys 2a8bd88a3e fix: appearance API per-library output path(與 trace_profile/face_cluster 同樣的 per-library fallback 模式)
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 19:46:13 +08:00
Accusys be16a588c2 feat: 自動產生 face_id(face_{frame}_{idx})於 face.json 儲存前
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 19:29:14 +08:00
Accusys 4100d5c77a fix: per-library output path for cluster_agent, profile, trace_agent
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
- cluster_agent: resolve_output_path per-library + fallback
- profile.rs: materialize_auto_groups + get_cluster_results + trace_profile filesystem fallback
- trace_agent_api.rs: read_trace_profile per-library + fallback
All now check output/demo/ before falling back to global output/
2026-11-17 19:14:15 +08:00
Accusys a16a2981e1 fix: unregistered 卡片確保有 size/mdate — MarkBase fallback + 磁碟掃描補齊 + formatSize/formatDate 顯示 '—' 替代空白
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 18:12:21 +08:00
Accusys 953d677c8e feat: DELETE API /api/v1/file/delete-unregistered — 永久刪除殘留 entry(磁碟檔 + DB + Qdrant + Redis),路徑限縮 storage root
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 17:56:06 +08:00
Accusys 5b5c1d9563 fix: face pipeline 三項修復
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
1. face_clustering: 先試 Rust binary,Python script 缺失不再提前返回空結果
2. face.rs: facenet model 查找加 fallback ( -> momentry_core/models),config 路徑補 --model 參數
3. rust_store_traced_faces: embedding 缺失時退回純 IoU 追蹤(不再強制要求 similarity);trace_profile.json 補上真實 avg_bbox/best_bbox/capture_quality
2026-11-17 17:26:00 +08:00
Accusys 5056c20667 fix: embedding port 全部改為 11436(plist + svc_def + server_type + test-embedding) 2026-11-17 13:31:20 +08:00
Accusys 8f0315e588 fix: embedding port 11437 → 11436 (correct system port)
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 13:26:56 +08:00
Accusys 6ba4ee1e06 fix: Redis service label sh.brew.redis → com.momentry.redis
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 12:48:51 +08:00
Accusys b4b84dc797 feat: composite scoring for best face selection (0.4 frontal + 0.4 confidence + 0.2 quality)
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 10:56:42 +08:00
Accusys 7fd7df2913 fix: scripts_dir() 恢復正確路徑 resolve_asset_path('MOMENTRY_SCRIPTS_DIR', 'scripts'); embedding port 11436→11437
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 08:41:34 +08:00
Accusys eac827d932 fix: scripts_dir() 恢復正確路徑 resolve_asset_path('MOMENTRY_SCRIPTS_DIR', 'scripts') → ~/momentry/scripts/ 2026-11-17 04:31:03 +08:00
Accusys a85e31ff16 fix: embedding default port 11436 → 11437 (llama-server GGUF) 2026-11-17 04:26:33 +08:00
Accusys 646d2a1361 fix(P0): face_cluster_done 雙路徑檢查 + run_processor 改用 async get_output_dir_for_file; 補 ingestion_complete output_dir
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 03:03:16 +08:00
Accusys d01e456ae5 fix(P0): per-library output dir for worker ingestion/verification (face_cluster guard, verifier, TKG, qdrant_face, ASR/ASRX); fix face_cluster serde default for empty output; fix face_cluster dependencies in pipeline_flows.json
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-17 02:46:57 +08:00
Accusys db790e2c89 fix: face_cluster guard checks both global OUTPUT_DIR and demo subdirectory for face_traced.json
Cross-Project Integration / integration (push) Has been cancelled
Core Test / lint-and-test (push) Has been cancelled
2026-11-17 01:29:28 +08:00
Accusys 75cbaa3302 feat: rebuild embeddings endpoint + standalone tool (API + binary), clear collection before rebuild, fix upsert_scene_embedding args
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-16 21:56:43 +08:00
Accusys 083d73d287 feat: real service test endpoints (proxy 7-route round-trip, core/chat/vlm/markbase/embedding), unified log paths + errorLog, pipeline tools/import/export/folder APIs, face pipeline check, dynamic concurrency tuning
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
2026-11-16 18:16:46 +08:00
Accusys d21d1ab960 fix: Library Re-run 完整重建搜尋索引 (ASR/ASRX/OCR/Scene VLM)
- trigger_processing: force 時僅刪除指定 processor 的輸出檔與 processor_results
  (其他 processor 資料保留),並設定 rerun_rebuild Redis flag 要求重建索引
- worker: 單一 processor Re-run 時強制 Rule 1 重新 chunk + vectorize
  (清除 momentry_rule1 舊 vectors,避免 stale 搜尋結果)
- Scene VLM Re-run: job_processors 含 scene_vlm 即 dispatch,
  scene-only job 完成條件改以 scenes.json 完整度判定
- 前端 redoProcessor 傳 force=true,Scene VLM 新增 🔄 Re-run 按鈕
2026-11-10 07:59:31 +08:00
Accusys 043dbbf24a fix: swift_ocr 支援日文識別
Cross-Project Integration / integration (push) Has been cancelled
- 加入 recognitionLanguages = ["ja", "en"] 使 Apple Vision Framework
  能識別日文和中文文字
- 使用 #available(macOS 12.0, *) 確保向後相容
- 兩處 VNRecognizeTextRequest 都已修改(主循環 + recognizeText 函式)

驗證: 065.mp4 從 0 幀 → 75 幀,1559 個日文文字區塊
(松原徳洲会病院、ここで検索、吹田市、寝屋川市 等)
2026-11-09 17:16:37 +08:00
Accusys 3d7ec83ec9 fix: Qdrant collection ensure + self-healing on clean install
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
- qdrant_db.rs: ensure_collection now uses PUT /collections/{name}
  (was POST /collections without name) and checks response status.
  Previous code silently no-op'd, so every upsert got 404 on clean
  installs with empty Qdrant.
- face.rs: store_face_embeddings_to_qdrant ensures _faces (512D)
  collection exists before upsert (fixes face→facenet→Qdrant broken
  link on fresh machines).
- pipeline/mod.rs: vectorize_chunks ensures main text collection
  (768D) before upserts.
- job_worker.rs: vectorize_chunks ensures main collection (768D)
  before upserts; also 3 additional lines of job_worker WIP fixes.

Verified: after these fixes, Qdrant collections are auto-created
on first upsert, resolving the face embedding + rule1 vectorize
failures on 203.
2026-11-09 15:55:01 +08:00
Accusys 70f5667adc fix: processor-counts resolves face_trace -> face_traced.json
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
get_processor_counts built the filename from the queue name
(face_trace.json) while rust_store_traced_faces writes face_traced.json
(per processor_tools_v3 output_file), so the API/UI reported
face_trace has_json=false and face_traced data was unreachable for
existing files. Map face_trace -> face_traced in both
get_processor_counts and get_processor_json.

Verified: dev (201) & 203 processor-counts now report face_trace
has_json=true and /api/v1/processor-json?processor=face_trace returns 200.
2026-11-09 12:39:44 +08:00
Accusys 8ff77d7dba fix: rust_asr_asrx extracts audio into ~/momentry/temp, auto-cleans
Core Test / lint-and-test (push) Has been cancelled
Cross-Project Integration / integration (push) Has been cancelled
The extracted wav used to be written next to the source video
(<video>.wav), polluting the /library listing (002.wav, 025.wav leftovers).
- extract_audio now writes into MOMENTRY_TEMP_DIR (default ~/momentry/temp)
  with a unique per-run name (<stem>_asr_<millis>.wav) so concurrent jobs
  with the same basename cannot collide and mlx_whisper sidecar JSON is
  unique as well.
- TempAudioGuard removes the temp wav + /tmp/<stem>.json sidecar on every
  exit path (success, early bail, error).
- Verified: /library source dir stays clean, temp dir empty after run.
2026-11-09 12:15:30 +08:00
Accusys c1ede4ade8 fix: rust_asr_asrx handles MLX Whisper non-finite JSON literals
- MLX Whisper emits 'avg_logprob: NaN' / 'compression_ratio: Infinity' when a
  clip has no intelligible audio (e.g. near-silent test clips). serde_json
  strictly refuses those literals, so rust_asr_asrx failed with
  'expected value at line 1 column 151' and asrx never completed.
- Sanitize NaN / Infinity / -Infinity literals outside strings into null
  before parsing (sanitize_json_nonfinite).
- Add no-audio-track early-out. Clean up .wav byproduct after success.

Verified on dev (m5max48): 002.mp4 asrx re-scan now completes and produces
output/df6376c8....asrx.json; processor_results asrx = completed.
2026-11-09 12:02:19 +08:00
Accusys 5caecb887f fix: rebuild binary without MongoDB health check dependency
- Removed check_mongodb() from health.rs
- Health endpoint now depends only on PostgreSQL + Redis + Qdrant
- Regenerated .sqlx offline query cache (was incomplete, only 3 files)
- Binary rebuilt: target/release/momentry (47M, arm64)
- Deployed to 203 (m4promini)

Full clean-install + sample data install verified:
- clean-install.sh: ✅ (23 PASS / 0 FAIL)
- sample data: ✅ 100 videos, 899 processor_results, 100 monitor_jobs
- Health endpoint: status=ok (no MongoDB hang)
2026-11-08 23:39:53 +08:00
Accusys 4f4aa27da8 refactor: remove MongoDB from health check
- Removed check_mongodb() function from health.rs
- Health endpoint no longer requires MongoDB (status depends on PG+Redis+Qdrant only)
- ServiceHealth struct: mongodb field commented out
- Both health() and health_detailed() updated
- Removed MongoCache import

Note: Binary rebuild blocked by missing .sqlx cache files for
command/queue.rs and vlm/consumer.rs. Once build env is fixed:
  cd momentry_core && SQLX_OFFLINE=true cargo build --release
  cp target/release/momentry ../momentry/bin/momentry
2026-11-08 23:24:02 +08:00
Accusys c6cbb5d1fb feat: asrx recovery + pipeline fixes + face trace improvements
- ASR-ASRX unified processor (asr_asrx → asrx), output .asrx.json
- ffmpeg -vsync → -fps_mode (swift_ocr, swift_hand, swift_pose, frame_cache)
- ffprobe absolute path for probe
- PYTHONPATH + PATH added to executor subprocesses
- cut processor path fix (cut/cut_processor.py)
- scene_vlm fallback when blur_scores empty + ffmpeg absolute path
- rust_store_traced_faces generates key_face.jpg with --video-path
- face group representative trace picks highest best_confidence
- Studio: move FS doesn't remove from unassigned, always reload after move
- Studio: confirmMoveFaceToNewGroup simplified to just rename
- Studio: scene_vlm added to processors list
- Studio: scene_vlm shows (0) when ready but no scenes
- admin_config asr_config block added
2026-11-06 10:00:24 +08:00
Accusys e56e2892d0 docs: gitea sync section - correct repo to m4mini warren/momentry_core (110.200 host defunct) 2026-11-05 16:14:22 +08:00
Accusys be3837ff06 feat: asrx garbled text recovery - first-sentence trigger, config-driven language rotation, VLM audio rescue
- rust_asr_asrx: 3-layer recovery (auto → language rotation → VLM second
  reference via llama.cpp input_audio); rotation order loaded from
  admin_config.json asr_config block (no hard code); skips silent retry
  when asr_config absent (= current behavior)
- output adds recovery{} block (attempts/final_result/no_intelligible_speech)
- pipeline_flows: fix skip_if_exists *.asr_asrx.json -> *.asrx.json
  (actual output name; prevents redundant re-ASR on reprocess)
- design note: docs_v1.0/DESIGN/ASRX_Garbled_Text_Language_Rotation_V1.0.md
- verified on demo 004 (auto_ok, zero cost) / 020 (rotation_hit ja) /
  forced all-miss rotation (no_intelligible_speech via VLM refusal signal)
2026-11-05 16:13:55 +08:00
Accusys 0cbb024411 feat: add ASR garbled text detection and retry mechanism
- Add is_garbled() function to detect transcription errors:
  * Repetitive character detection (>40% same char)
  * Language-script mismatch detection
  * Compression ratio check for long text
- Expand COMMON_LANGUAGES fallback list: ja, en, zh, ko, th, vi, fr, de, es
- Add get_vad_settings() to disable VAD for short audio (<15s)
- Fix VAD filter causing 0 segments for short clips
- Improve language detection retry logic with garbled output check

Fixes: ASR producing garbled Sinhala text for Japanese audio
2026-11-05 04:52:32 +08:00
Accusys ada49d3491 fix: add DISTINCT ON to cluster-results handler to prevent duplicate group cards 2026-11-02 18:59:54 +08:00
Accusys eebaa11bfb fix: prevent duplicate face group cards - deduplicate tkg_nodes and DISTINCT ON in get_face_groups_handler 2026-11-02 17:30:29 +08:00
Accusys 6c85d2e871 feat: add upgrade_face_json_v2.sh and sync_face_data.sh scripts, fix SQLite path 2026-11-02 17:00:20 +08:00
Accusys f67219fe02 feat: add face_operations.rs SQLite module for face pipeline state management 2026-11-02 16:50:54 +08:00
Accusys 774ad4d820 feat: rust_store_traced_faces v2 schema - FaceTracedData with schema_version, stats, traces as Vec, TracePoint with timestamp/pose/landmarks 2026-11-02 15:52:11 +08:00
Accusys adcc5a1dc1 feat: face_tracker v2 schema - add schema_version, TraceBBox with x2/y2/center, TracePoint with pose/landmarks 2026-11-02 14:51:31 +08:00
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 2fca49b120 fix: update tkg_nodes.label when face_track node already exists
- ensure_face_track_node now UPDATEs label instead of returning early
- Fixes rename persistence - names are now stored in database
- Enables consistent names across all access points (localhost, DDNS)
2026-10-30 22:47:16 +08:00
Accusys b1bc83586f fix: fallback to MarkBase data for file_size and modified_time
- When videos table has null values, use MarkBase file info as fallback
- Ensures registered files display correct size and date
- Fixes issue where registered files showed '0B' and no date
2026-10-30 12:50:58 +08:00
Accusys d61d242f4e fix: use default SFTP root path for unregistered files
- Add fallback path when MOMENTRY_SFTP_ROOT env var is not set
- Default: /Users/accusys/momentry/var/sftpgo/data/demo
- Fixes 500 error when registering files (file_path was empty)
2026-10-30 12:26:51 +08:00
Accusys 6f97f4576f docs: 添加機器清單和 Studio API Key 修復需求
- 添加 m5max48 (192.168.110.201), m4promini (192.168.110.203), m4mini (192.168.110.210) 機器清單
- 創建 Studio API Key 修復需求文件 (register_file, unregister_file, merge_groups)
2026-10-30 09:00:56 +08:00
Accusys 70492235c7 docs: document MarkBase service management issue with launchd
- MarkBase is managed by launchd, auto-restarts after kill
- Stop API kills process but launchd restarts immediately
- Start API fails because port already in use
- Need to integrate launchctl commands into service API
- Documented problem analysis and proposed solutions
2026-10-24 15:08:58 +08:00
Accusys 7251a12469 feat: add comprehensive logging for scene VLM tags parsing
- Log VLM response content (first 500 chars)
- Log JSON extraction success/failure
- Log JSON parsing success/failure
- Log missing 'summary' field
- Log parsed objects and tags count
- Helps debug why vlm_tags may be empty in some cases
2026-10-24 13:44:42 +08:00
Accusys b6cf793e1b feat: add detailed logging for scene VLM tags generation
- Log tags count and content after generation
- Log JSON extraction and parsing status
- Log parsed objects and tags count
- Helps debug why vlm_tags may be empty in some cases
2026-10-24 12:55:51 +08:00
Accusys 78169c3bc0 docs: update service management API completion report
- Add issue found & fixed section
- Document route conflict problem and solution
- Clarify public vs protected endpoints
- Add authentication requirements for frontend
- Update version to 1.1
2026-10-24 11:55:30 +08:00
Accusys db12446a68 fix: resolve route conflict in service management API
- Remove duplicate health::health_routes() merge that was conflicting with public_health_routes
- Move service_management::router() to protected_routes for proper auth
- Service management now works correctly:
  - /api/v1/mbe/health (public) - shows VLM status
  - /api/v2/service/start (protected) - starts llama-server
  - /api/v2/service/stop (protected) - stops llama-server
2026-10-24 11:54:30 +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 d14cd9f3de fix: clear paused state on unregister/re-scan
- Added Redis SREM to clear jobs:paused set in unregister_internal
- Ensures re-scan always starts with clean state
- Fixes issue where paused files remain paused after re-scan
2026-10-19 03:24:50 +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 de507c7bc0 docs: add status sync migration guide for Studio team
- Explains new automatic trigger-based synchronization
- Provides code examples for removing manual cache updates
- Documents new status query and sync APIs
- Includes migration checklist and testing guide
2026-10-18 22:09:08 +08:00