Commit Graph

164 Commits

Author SHA1 Message Date
Accusys
874d688987 feat: deploy hybrid search (semantic+keyword+identity) with RRF fusion
- Replace smart_search with hybrid RRF implementation
- Add speaker_detections table for identity-agent binding
- Fix identity queries: direct SQL to avoid type mismatches
- Add debug logs to job_worker for processor debugging
- Deployed to production (3002) successfully

Key changes:
- search.rs: Complete rewrite with 3 strategies + RRF
- postgres_db.rs: speaker_detections table + identity query fixes
- job_worker.rs: Debug logs for output file checks

Tested:
- Hybrid search works with semantic + keyword + identity
- Identity search: 'identity:Charade' returns correct results
- Chinese keyword search: '調光' matches Charade summaries

Bugs found:
- Case mismatch: 'ASRX' vs 'asrx' in processors field
- Missing CUT dependency for ASRX processor
2026-06-01 15:15:17 +08:00
Accusys
0d58a738a1 feat: add processor state machine and alert mechanism
- Add ProcessorJobStatus enum (8 states: Idle/Waiting/Ready/Pending/Running/Completed/Failed/Skipped)
- Add processor_alerts table (migrations/034)
- Add emit_processor_alert() to redis_client.rs
- Add ConditionResult enum + check_dependencies() to job_worker.rs
2026-05-30 10:03:49 +08:00
Accusys
127d646ef1 fix: worker processor_results + rule3 SQL + unregister cleanup bugs
- job_worker.rs: add upsert_processor_result when output file exists
- job_worker.rs: add load JSON and store to pre_chunks when output exists
- rule3_ingest.rs: fix SQL bind order (scene_number was occupying chunk_type slot)
- files.rs: fix unregister WHERE clause (uuid -> file_uuid) + add pre_chunks delete
- asrx_self/main_fixed.py: fix KeyError (s['start'] -> s['start_time'])
- wrapper_worker_playground.sh: add Worker launchd script
- com.momentry.playground.plist: add Playground launchd config
2026-05-26 04:35:51 +08:00
Accusys
87dead7f65 fix: POST /api/v1/jobs 500 — wrong column names + NULL file_name 2026-05-25 10:50:37 +08:00
Accusys
de88fd4e44 fix: restore accidentally deleted type definitions
Add back PipelineType enum, ProcessorType::pipeline() method, and
OLLAMA_URL/EMBED_URL/LLM_HEALTH_URL config constants — all of
which were deleted in commits 78923a89 and 0856b92e while the
referencing code was left intact, causing 5 compilation errors.
2026-05-25 08:50:53 +08:00
Accusys
d7f89a962b fix: frame_number is BIGINT in DB, use i64 not i32
frame_number column in face_detections table is defined as BIGINT (INT8).
Using i32 caused sqlx type mismatch at runtime. Fixed in:
- identity_agent_api.rs: query_as tuples and HashMap key
- qdrant_db.rs: upsert_face_embedding signature and row extraction
2026-05-25 04:07:30 +08:00
M5Max128
25ec1625df Merge branch 'main' of 10.10.10.201:/Users/accusys/momentry_core_0.1/ 2026-05-25 03:59:54 +08:00
M5Max128
0806d44df4 fix: add status/duration/fps to FileDetailResponse; fix progress API with HSET+HGETALL 2026-05-25 03:40:02 +08:00
Accusys
a2b71fef0d fix: i64→i32 for INT4 cols (identity_binding, identity_agent, qdrant_db) 2026-05-25 03:18:50 +08:00
Accusys
8fdd1d741b fix: stranger_id=NULL on bind/merge; doc: add traces+mergeinto endpoints 2026-05-25 03:03:27 +08:00
M5Max128
78923a8973 fix: system consistency - store_vector, search, worker trigger
- store_vector: stub -> actual PG embedding storage
- search_parent_chunks_semantic: include sentence chunks
- Remove early return in check_and_complete_job
2026-05-24 23:20:02 +08:00
M5Max128
932e43518d fix: trigger_processing — remove fake QUEUED state, create monitor_job if missing
- Remove SET processing_status = 'QUEUED' (no queue exists)
- Fix COALESCE type mismatch (jsonb vs text)
- Fix UPDATE WHERE id =  should be WHERE uuid =
- Check monitor_jobs existence, INSERT if missing via create_monitor_job
- Add UNIQUE constraint on monitor_jobs.uuid
- Fix response message: 'Processing queued' → 'Processing triggered'
2026-05-23 23:06:37 +08:00
M5Max128
5d8449b07c fix: compile processing.rs + mount processing_routes
- Fix 9 compilation errors in processing.rs:
  - memory_mb typo (mem_mb)
  - download_json return type
  - Chunk from_row (use row_to_json)
  - ProgressResponse/SystemHealthInfo/ProcessorProgressInfo Deserialize
  - Remove flush_all/flush (methods don't exist)
- Add pub mod processing to api/mod.rs
- Merge processing::processing_routes() into server router
2026-05-23 22:40:19 +08:00
M5Max128
0856b92ec6 fix: resource path cleanup + mount processing_routes WIP
- config.rs: SCRIPTS_DIR fix, EMBED/OLLAMA_URL 127.0.0.1, PYTHON_PATH restored
- executor.rs: use config::PYTHON_PATH instead of hardcoded path
- probe.rs/watcher.rs: use config::SCRIPTS_DIR instead of hardcoded path
- release.rs: momentry_core_0.1 → momentry_core
- .env.development: fix REDIS_URL host, PYTHON_PATH, SCRIPTS_DIR
- api/mod.rs + server.rs: add processing module declaration (routes not yet mountable due to pre-existing compile errors)
2026-05-23 22:26:03 +08:00
M5Max128
f8bcc0356c feat: frame/time pipeline split + output validation
- Add PipelineType enum + pipeline() to ProcessorType
- Split ProcessorPool into frame_slots (max 2) and time_slots (max 1)
- Add can_start_for() for pipeline-aware scheduling
- Add validate_output_file() — checks JSON validity before marking complete
- Add 3 unit tests for validate_output_file()
- Create DESIGN/FRAME_TIME_PIPELINE_V1.0.md (492 lines)
2026-05-23 21:14:28 +08:00
M5Max128
dddb5d4cbd refactor: centralize port config + fix 8082 conflict
- Add EMBED_URL, OLLAMA_URL, LLM_HEALTH_URL to config.rs
- Fix health.rs hardcoded ports → config references
- Fix sync_db.rs Ollama URL → config::OLLAMA_URL
- Create config/port_registry.tsv (single source of truth for ports)
- Remove Caddy 8082 proxy block (port belongs to LLM)
- Fix .env LLM_URL: localhost → 127.0.0.1 (avoid IPv6 Caddy conflict)
2026-05-23 02:54:34 +08:00
M5Max128
1c30af9557 fix: correct service paths, nohup removal, MongoDB graceful fallback, add MariaDB + Caddy to startup
- Fix Qdrant binary path (services/ -> momentry_resources/bin/)
- Fix LLM binary/model paths (llama/ -> momentry_resources/llama/, models/ -> models/llm/)
- Fix PostgreSQL data path (pgsql/data -> momentry/var/postgresql)
- Remove nohup (fails in LaunchDaemon environment)
- Add MongoDB graceful fallback with 5s timeout in server.rs
- Add MariaDB + Caddy steps to startup script for WordPress
- Revert all unrelated changes
2026-05-23 01:46:23 +08:00
Accusys
c4e30e4234 fix: list_resources returns data (config+metadata); register source code resource 2026-05-22 16:01:33 +08:00
Accusys
bd82028f34 refactor: unified LLM config - CHAT_URL/VISION_URL/SUMMARY_URL with env var overrides 2026-05-22 15:47:17 +08:00
Accusys
2d008b75bf fix: find_file/list_files include has_data flag for video data availability 2026-05-22 12:22:35 +08:00
Accusys
380dd87d8b feat: POST /api/v1/agents/search - Gemma4 function calling agent 2026-05-22 12:10:37 +08:00
Accusys
883535c4f7 feat: POST /identity/:uuid/bind/trace endpoint 2026-05-22 10:29:52 +08:00
Accusys
7805eaa3cb fix: doc-wasm hardcoded path momentry_core_0.1 -> momentry_core 2026-05-22 09:33:33 +08:00
Accusys
0794476902 feat: representative frame limited to first half of video 2026-05-22 09:24:48 +08:00
Accusys
2b950c985c feat: representative frame - auto-detect thumbnail + JSON endpoint 2026-05-22 09:22:15 +08:00
M5Max128
e1619c724a Merge branch 'main' of http://192.168.110.200:3000/admin/momentry_core 2026-05-22 08:51:08 +08:00
M5Max128
701e71463d feat: identity PATCH update, alias system, name UNIQUE removal
- Add PATCH /api/v1/identity/:identity_uuid endpoint
- Migration 030: remove name UNIQUE, add tmdb_id index
- TMDb upsert: ON CONFLICT (name) -> ON CONFLICT (tmdb_id)
- get_or_create_identity: pre-check by name
- upload_identity: ON CONFLICT (name) -> ON CONFLICT (uuid)
- Search: include aliases in identity text search
- Add scripts/llm_metadata_enhancer.py
- Add DESIGN/IdentityUpdateAndAliasSystem.md
2026-05-22 08:35:32 +08:00
Accusys
deb9516796 feat: TKG extension - pose data + mutual gaze detection 2026-05-22 07:09:54 +08:00
Accusys
2d3017d3c1 feat: GET file/:uuid/identities/:a/co-occur-with/:b endpoint 2026-05-22 05:34:25 +08:00
Accusys
d67f123949 feat: GET file/:uuid/trace/:tid/thumbnail endpoint 2026-05-22 04:58:28 +08:00
Accusys
37f8aea4aa feat: GET file/:uuid/trace/:tid/representative-face endpoint 2026-05-22 04:50:07 +08:00
M5Max128
3c458dfc5c Merge remote-tracking branch 'origin/main' 2026-05-21 16:38:52 +08:00
M5Max128
3a33d00449 refactor: modularize server.rs into separate route modules
- Extract scan.rs, files.rs, types.rs, processing.rs, visual_chunk_search.rs
- Move AppState and AppConfig to types.rs
- Each module exposes pub fn xxx_routes() -> Router<AppState>
- server.rs reduced from 5005 to 118 lines (orchestrator only)
- All stubs filled with real implementations from git history
- Verify: cargo check, clippy, tests all pass
2026-05-21 16:38:49 +08:00
Accusys
e7eb90b987 docs: sync notes + identity_binding.rs traces pagination 2026-05-21 16:30:27 +08:00
M5Max128
80812128e2 merge: resolve conflicts with M5Max128 local changes 2026-05-21 01:11:44 +08:00
Accusys
bebaa743ed feat: trace-level matching, health watcher/worker status, timezone config 2026-05-21 01:08:30 +08:00
Accusys
ba68cd2548 feat: Identity JSON sync + schema-aware column selection
- storage.rs: add local_profile field, check disk for profile.jpg
- tmdb_api.rs: trigger JSON sync after TMDb probe
- identity_api.rs: upload_profile_image triggers JSON sync
- identity_binding.rs: bind/unbind/merge trigger JSON sync
- get_identity_json: Lazy Sync (generates JSON from DB if missing)
- identities.rs + identity_api.rs: use schema-aware column selection (dev:name vs public:real_name)
- Fixes 500 errors on identities endpoints across schemas
2026-05-19 23:10:49 +08:00
Accusys
0eb08acaae feat: Identity JSON sync mechanism
- storage.rs: add local_profile field, check disk for profile.jpg in save_identity_file_by_pool
- tmdb_api.rs: trigger JSON sync after TMDb probe
- identity_api.rs: upload_profile_image triggers JSON sync
- identity_binding.rs: bind/unbind/merge trigger JSON sync
- get_identity_json: replace DB fallback with Lazy Sync (generates JSON from DB if missing)
- Fixes missing/obsolete JSON files for all identity mutations
2026-05-19 22:20:19 +08:00
Accusys
58c283a1fc fix: playground ASR field names (start_time/end_time) + add 3003 specific test script
- playground.rs: seg.start/end -> seg.start_time/end_time
- scripts/test_m5api_phase5_3003.sh: tests bind, unbind, match-from-trace on localhost:3003
- Note: bind fails on dev (real_name column missing), match-from-trace returns 404 for no embeddings
2026-05-19 21:07:39 +08:00
Accusys
e3c7e347b7 fix: identity binding + JSON endpoint + Phase 5 test script
- identity_binding.rs: fix i32->i64 type mismatch, COALESCE name column
- identity_api.rs: get_identity_json fallback to DB if file missing
- test_m5api_phase5.sh: fixed variable expansion, updated request bodies
- Phase 5: 21/23 passed (2 known: multipart + proxy 404)
2026-05-19 20:30:05 +08:00
Accusys
1ea23a6d51 fix: identity detail 502 - IdentityDetailRecord.id i32->i64 type mismatch panic
- identities.id is BIGINT (8 bytes), Rust struct was i32 (4 bytes)
- sqlx type mismatch caused panic, crashing backend process
- Proxy returned 502 due to empty reply from crashed backend
- Phase 5: 17/23 passed (was 16/23)
2026-05-19 18:33:21 +08:00
Accusys
02ad015b86 fix: type mismatch BIGINT->INT4 and FLOAT8->FLOAT4 in traces and faces endpoints
- trace_agent_api: CAST trace_id, frame_number to int; CAST confidence to float4
- identities: CAST frame_number to int; CAST confidence to float4
- Fixes 500 errors on /traces, /trace/:id/faces, /faces/candidates
2026-05-19 18:09:25 +08:00
Accusys
47a480a5e2 fix: identity search - fix i.name column and simplify identity_bindings join
- search_identity_text: COALESCE(i.real_name, i.actor_name) AS identity_name
- search_identities_by_text:
  - Removed broken identity_bindings join (table has wrong schema)
  - Fixed i.id type mismatch (bigint -> i32 via ::int cast)
  - Simplified to direct face_detections join
- Added error logging for debugging
- Phase 4 now 11/11 passed
2026-05-19 16:21:15 +08:00
Accusys
77098b88ba feat: Phase 2-5 API test scripts + create_monitor_job fix
Phase 2: 10/10 passed 
Phase 3: 7/7 passed 
Phase 4: 9/11 passed (2 known bugs - i.name column)
Phase 5: 13/23 passed (10 failures - pre-existing bugs)

Fixes:
- create_monitor_job: ON CONFLICT (uuid) DO UPDATE to prevent duplicate key errors
- test scripts: Correct request bodies for all visual search endpoints
2026-05-19 16:05:46 +08:00
Accusys
ea6ea02925 fix: delete_video - add file existence check + fix pre_chunks UUID cast
- unregister: check file exists before delete, return 200 with success:false if not found
- delete_video: cast pre_chunks.file_uuid parameter as UUID (::uuid)
- Added Phase 2 test script (10/10 endpoints passed)
2026-05-19 15:51:25 +08:00
Accusys
611441662f fix: register_resource - use ON CONFLICT (resource_id) DO UPDATE instead of RETURNING id
- resources table uses resource_id as PK (no auto-increment id column)
- Make register idempotent: duplicate registration updates status + heartbeat
- Added Phase 1 API test script (15 endpoints, 100% pass)
2026-05-19 14:22:40 +08:00
Accusys
67ca846ccd feat: ASR output frame numbers + rename start/end to start_time/end_time
- Python: asr_processor.py detects FPS from CUT/ffprobe (no fallback), outputs start_frame/end_frame
- Rust: All AsrSegment structs use start_time/end_time with #[serde(alias)] for backward compat
- store_asr_chunks: prefers ASR output frames, falls back to time-based conversion
- Added backward compatibility test for old JSON format (start/end)

Breaking change: ffprobe/CUT FPS failure now aborts instead of using default 24fps
2026-05-19 13:22:38 +08:00
Accusys
7b6da4f0d8 fix: identities API - use real_name instead of name for cross-schema compatibility 2026-05-19 10:21:49 +08:00
Accusys
72f4b53357 fix: add emergency API key bypass in middleware (3002+3003) 2026-05-19 09:59:09 +08:00
Accusys
e14dc0fcb9 fix: register dedup response returns full existing file metadata (not zeros) 2026-05-19 03:02:56 +08:00