Commit Graph

1001 Commits

Author SHA1 Message Date
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 095df145d6 wip: additional processor improvements
- Update face clustering processor
- Update TKG processor
- Update Rust face cluster and trace storage
- Add M4 workspace documentation

Note: Work in progress, not yet tested
2026-10-17 18:31:08 +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 0361510a05 feat: add trace profile API path parameter support
- Add TraceProfilePath struct for path parameters
- Refactor get_trace_profile_handler to support both formats:
  - Query parameters: /api/v1/trace-profile?file_uuid=...&trace_id=...
  - Path parameters: /api/v1/trace-profile/:file_uuid/:trace_id
- Maintain backward compatibility with existing query parameter format
- Fix 404 error when Studio calls trace profile API with path format

Fixes: Studio right-click key frame trace profile error

Deployment: Released to production (3002) on 2026-10-17
2026-10-17 00:16:03 +08:00
Accusys 93006fd299 feat: add Qdrant trace_id update to Rust Face Tracing
## Problem
- Rust Face Tracing only generated face_traced.json
- Did not update trace_id in Qdrant
- Caused trace_id to remain null in Qdrant
- Face Clustering failed due to missing trace_ids

## Solution
Added two functions:
- build_trace_mapping(): Build (frame, bbox) -> trace_id mapping
- update_qdrant_trace_ids(): Batch update Qdrant points with trace_ids

## Flow
1. Read embeddings from Qdrant
2. Calculate traces (IoU + Similarity)
3. Generate face_traced.json
4. Update trace_ids in Qdrant (NEW)

## Testing
- Previous: trace_id=null in Qdrant
- After: trace_id correctly set
- Face Clustering now works

## Files Changed
- tools/cli/rust/src/bin/rust_store_traced_faces.rs

Closes #QDRANT_TRACE_ID_NULL
2026-10-16 22:11:41 +08:00
Accusys 81ba3ae6e8 feat: improve Face Tracing with IoU + Embedding similarity matching
## Changes

### Face Tracing Improvements
- Replace bbox distance matching with IoU (Intersection over Union)
- Add embedding similarity matching from Qdrant _faces collection
- Add Qdrant HTTP client to load face embeddings
- Fix Qdrant data format reading (x, y, width, height directly, not in bbox object)
- Add debug logging for trace matching
- Add --similarity-threshold and --iou-threshold parameters

### Results
- Before: 374 traces (each face a separate trace)
- After: 22 traces (continuous face sequences)
- Matching validation: IoU 0.819-1.000, Similarity 0.976-1.000

### Pipeline Configuration
- Add face_trace tool configuration with Rust implementation
- Set default parameters: similarity_threshold=0.85, iou_threshold=0.3
- Document usage notes for trace definition

### Face Clustering
- Update threshold to 0.15 for correct male/female separation
- Add auto-filtering for low-quality clusters (face_count<20, bbox_area>150000)

## Testing
- Test video: Accusys-WD_FilmRiot_test.mp4 (374 faces, 188 frames)
- Final result: 2 persons (104 + 79 = 183 faces assigned)
- All faces correctly assigned with cluster_id

## Documentation
- Add test report: docs_v1.0/M4_workspace/2026-10-16_face_tracing_fix_test_report.md

## Files Modified
- tools/cli/rust/src/bin/rust_store_traced_faces.rs
- config/pipeline_flows.json
- scripts/face_clustering_processor.py
- docs_v1.0/M4_workspace/2026-10-16_face_tracing_fix_test_report.md (new)

Closes #FACE_TRACE_IMPROVEMENT
2026-10-16 19:52:17 +08:00
Accusys dbd9efc8f5 docs: add Face Tracing improvement plan
Comprehensive plan to fix Face Tracing quality issues:

Problem:
- Python version: low thresholds (0.7, fallback 0.65)
- Rust version: incomplete implementation (bbox only, no embedding check)
- Result: 16 traces for 2 persons, internal similarity as low as 0.18

Solution:
- Improve Rust version to use embedding similarity (threshold=0.85)
- Add Qdrant integration to read embeddings
- Add quality control (trace internal similarity check)
- Expected: 2-4 traces, similarity > 0.85

Timeline: 2-3 days
Priority: P0 (core feature defect)
2026-10-16 15:42:27 +08:00
Accusys 4dbaf69a3e docs: add Studio integration guide for trace-profile API
- Complete solution documentation for Studio team
- API endpoint usage examples
- Testing results
- Integration guide
- Benefits and deployment status
2026-10-16 13:37:44 +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 e8b26f997f docs: add Studio bug report for trace_profile not found issue 2026-10-16 13:21:39 +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 667e279768 release: v1.3.5 - merge Phase 1 (health/queue API + timeout_at self-heal) onto v1.3.4 base
- Add /api/v1/health/queue queue-health endpoint (public, like /health/detailed)
- Add timeout_at column + index (migration 20261012_add_command_timeout.sql)
- consume() stamps timeout_at; pipeline_worker self-heals timed-out commands every 5m
- Bump version 1.3.4 -> 1.3.5
2026-10-13 00:12:05 +08:00
Accusys dc6081fcaf release: v1.3.4 - File Metadata Display & Queue Monitoring
Phase 1 Features:
- Add file_size and modified_time to videos table
- Display file metadata in /api/v1/files
- Queue monitoring script (auto-cleanup stuck commands)

Improvements:
- 188 files updated with metadata
- Queue monitoring runs every 5 minutes
- Auto-reset stuck commands (>1 hour)
- Auto-cleanup orphan commands

Documentation:
- Pipeline worker architecture analysis
- Refactor plan (Phase 2)
- Release checklist and test reports

Tested:
- All P0 tests passed
- API response time < 100ms
- Data coverage 99.5%
2026-10-12 23:29:47 +08:00
Accusys fd28677d66 fix: 修复 file_size 类型转换错误
问题: 数据库中 file_size 是 i64,API 中是 Option<u64>,导致类型不匹配

修复: 添加类型转换 size.map(|s| s as u64)
2026-10-12 18:48:47 +08:00
Accusys be8333d8f3 docs: 添加 pipeline worker 分析和监控脚本
添加文件:
- docs_v1.0/M4_workspace/2026-10-12_pipeline_worker_analysis.md: 架构分析和问题诊断
- docs_v1.0/M4_workspace/2026-10-12_pipeline_worker_fix_execution.md: 修复执行报告
- docs_v1.0/M4_workspace/2026-10-12_pipeline_worker_complete_solution.md: 完整解决方案
- scripts/monitor_command_queue.sh: 队列监控脚本(每 5 分钟自动检查)

更新:
- Cargo.lock: 依赖版本更新
2026-10-12 18:40:33 +08:00
Accusys b47f473db6 fix: 添加 file_size 和 modified_time 到 videos 表和 API
问题:
- /library 页面已注册文件卡片不显示 size 和 mdate
- 数据库 videos 表缺少 file_size 和 modified_time 列
- API 查询未返回这些字段

修复:
- 添加数据库迁移 (migrations/20261012_add_file_size_columns.sql)
- 修改 register_single_file() 获取并保存 file_size 和 modified_time
- 修改 list_files() API 查询包含新字段
- 创建脚本更新历史数据 (scripts/update_file_metadata.py)

影响:
- 新注册文件自动填充 size 和 mtime
- API 正确返回 file_size 和 modified_time
- 历史数据已批量更新 (188 个文件)

测试:
- API 测试通过
- 数据库验证通过
- 文件大小匹配验证通过
2026-10-12 17:07:48 +08:00
Accusys 8074bee4a1 docs: M4ProMini worker offline root cause analysis
- Identified plist hardcoded paths as root cause
- v1.3.2 code improvements insufficient (plist not modified)
- Added fix script: scripts/fix_m4promini_plist.sh
- Proposed v1.3.3 solution: plist templates
2026-10-12 15:44:32 +08:00
Accusys 3d441a1c76 release: v1.3.2 - Cross-Machine Deployment Support
Major Changes:
- Removed all hardcoded paths for cross-machine deployment
- Added unified path management module (path_utils.rs)
- Supports arbitrary user home directories
- Environment variable configuration for all paths

New Features:
- path_utils module with 15+ path resolution functions
- Dynamic user home directory detection
- Environment variable overrides for all paths
- Default paths using $HOME/momentry and $HOME/momentry_core

Fixed Files:
- Rust code: 8 core files (release.rs, service.rs, markbase_compat.rs, etc.)
- Python scripts: 10 files (ASR, ASRX, Face, Identity, VLM, Migration)
- Configuration: production.env (removed hardcoded paths)

Environment Variables Supported:
- HOME - User home directory
- MOMENTRY_ROOT - Momentry root directory
- MOMENTRY_CORE_DIR - Momentry_core directory
- MOMENTRY_OUTPUT_DIR - Output directory
- MOMENTRY_BACKUP_DIR - Backup directory
- MOMENTRY_STORAGE_ROOT - Storage root directory
- MOMENTRY_SCRIPTS_DIR - Scripts directory
- MOMENTRY_CLI_DIR - CLI tools directory

Breaking Changes:
- None (backward compatible with environment variables)

Deployment:
- Can now deploy to any machine with any username
- No hardcoded /Users/accusys paths in core functionality
- Ready for M4ProMini deployment (/Users/nextorageai)
2026-10-12 13:20:45 +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 0a18e70639 feat: 添加 file_size 和 modified_time 到 FileItem 结构
问题:
- unregistered 文件只显示文件名
- 缺少文件大小和修改时间显示

修复:
- FileItem 结构添加 file_size 和 modified_time 字段
- 转换 MarkBase 文件时填充这些字段
- 已注册文件暂时设为 None(后续可从数据库获取)

影响:
- unregistered 文件现在显示完整信息
- 文件名、大小、修改时间都正确显示
- 提升用户体验

测试:
✅ 编译通过
✅ 字段正确映射
2026-10-10 21:00:41 +08:00
Accusys b639291585 feat: 添加 Scene VLM 到 Pipeline Progress 阶段
问题:
- Scene VLM 是必要处理步骤(当有 CUT 时)
- 但在 PipelineProgress 中没有对应的阶段
- 前端无法看到 Scene VLM 的处理进度

修复:
- 添加 scene_vlm 阶段(权重 3%)
- 调整 vlm_summary 权重从 4% 到 3%
- 确保 Scene VLM 在处理流程中有明确的进度显示

阶段权重:
- processors: 30%
- rule1_ingestion: 5%
- face_tracing: 5%
- face_dedup: 10%
- tkg_nodes: 20%
- tkg_edges: 15%
- rule2_ingestion: 10%
- vlm_summary: 3%
- scene_vlm: 3%
- moment_chunks: 1%
总计: 100%

影响:
- 深度扫描文件会显示 Scene VLM 处理进度
- 用户可以看到完整的处理流程
- 更好的透明度和用户体验

测试:
✅ 编译通过(cargo build --bin momentry)
2026-10-10 14:57:13 +08:00
Accusys 3d7d5cf684 feat: integrate MarkBase API for file list
- Core API now calls MarkBase API instead of scanning filesystem
- Returns file_uuid and file_path from MarkBase
- Merges Core database registration status
- Returns 176 files (116 from MarkBase + 60 registered but deleted)
- Tested and verified on M5Max128

Related: #markbase-integration
2026-10-10 02:40:08 +08:00
Accusys 42edfedb3f docs: Release v1.0.20261009 报告
Release 内容:
- FaceFilterSettings 三段式统一结构
- 透明文件管理(自动迁移)
- 零配置迁移
- 向后兼容

测试结果:
- ✅ 自动迁移成功
- ✅ 数据完整
- ✅ API 正常工作

部署状态:
- ✅ Production (3002) 已部署
- ✅ Server & Worker 运行正常

文档:
- docs_v1.0/M4_workspace/2026-10-09_release_v1.0.20261009.md
- docs_v1.0/DESIGN/FACE_FILTER_FILE_STORAGE.md
2026-10-09 21:44:45 +08:00
Accusys 9d0f85c048 fix: 修复 GET /file-profile 中的类型转换问题
修复内容:
- width: i32 → u32
- height: i32 → u32
- total_frames: i64 → u64
- db_face_filter: 移动语义改为克隆

原因:
- 数据库查询返回 i32/i64
- FileProfile::from_db_record 需要 u32/u64

测试:
- ✅ 编译通过
- ✅ 自动迁移成功
- ✅ 数据完整

Git: 1379cf59 (fix)
2026-10-09 21:43:11 +08:00
Accusys 1379cf59cf feat: FaceFilterSettings 透明文件管理(自动迁移)
核心特性:
- 读取优先级: 文件 > 数据库 > 默认值
- 自动迁移: 数据库数据自动迁移到文件
- 向后兼容: 旧数据透明处理
- 用户无感知: 不需要手动迁移脚本

工作原理:
1. GET /file-profile
   - 优先从文件读取
   - 文件不存在时从数据库读取
   - 自动创建文件(透明迁移)

2. PUT /file-profile
   - 直接写入文件
   - 数据库不再存储新数据

优势:
- ✅ 零配置迁移(第一次访问自动迁移)
- ✅ 架构简化(文件即 primary source)
- ✅ 跨设备同步(只需同步文件)
- ✅ 调试方便(直接编辑 JSON)

删除:
- ❌ migrate_face_filter_to_files.py(不需要)

文档更新:
- docs_v1.0/DESIGN/FACE_FILTER_FILE_STORAGE.md
- 说明透明管理机制
- 添加自动迁移流程图

Git: 3658c288 (enhanced)
2026-10-09 16:38:20 +08:00
Accusys 3658c2888e feat: FaceFilterSettings 改用文件存储而非数据库
架构变更:
- GET /api/v1/file-profile: 从 .profile.json 读取 face_filter
- PUT /api/v1/file-profile: 写入 .profile.json 而非数据库
- 数据库不再存储 face_filter (仅存储路径/文件名)

优势:
- 文件是 primary source of truth
- 架构更简单、更清晰
- 便于跨设备同步
- 避免 DB 迁移复杂度

新增工具:
- migrate_face_filter_to_files.py: 迁移现有数据库数据到文件
- 支持增量迁移(只迁移有变化的文件)
- 支持 dry-run 测试

测试:
- ✅ 编译通过
- ⏳ 功能测试待进行

对应设计文档:
- .opencode/plans/persistence_design/01_overview.md
- 三段式实体文件持久化架构
2026-10-09 16:30:50 +08:00
Accusys 86c776ce41 feat: 更新 FaceFilterSettings 为三段式统一结构
数据模型更新:
- 新增 UiFilterRules 结构(UI 过滤规则)
- 新增 ProcessingThresholds 结构(处理阈值)
- 新增 TraceSettings 结构(Trace 配置)
- FaceFilterSettings 整合三个子结构
- min_confidence 范围从 0-100 改为 0.0-1.0
- min_size 重命名为 min_bbox_size
- 新增字段: max_confidence, max_bbox_size, source, backend_status

向后兼容性:
- 新增 from_legacy() 方法自动转换旧格式
- defaults() 方法自动转换 0-100 到 0.0-1.0

测试:
- 更新 test_face_filter_roundtrip
- 更新 test_face_filter_defaults_match_detection_defaults
- 新增 test_face_filter_new_method
- 新增 test_face_filter_from_legacy
- 所有测试通过 ✅

文件修改:
- src/core/file_profile.rs: 数据结构定义(+150 行)
- src/core/processor/vlm_summary.rs: 字段访问更新
- src/api/identities.rs: 字段访问更新
- src/api/profile.rs: 字段访问更新(3 处)
- migrations/20261009_face_filter_v2.sql: 数据库迁移脚本

状态: P0 第 1 个文件完成
2026-10-09 14:42:26 +08:00
Accusys ed95c447a9 feat: 三段式实体文件持久化设计文档和迁移工具
设计文档 (2458 行):
- 01_overview.md: 架构总览
- 02_file_profile_model.md: File Profile 数据模型
- 03_identity_profile_model.md: Identity Profile 数据模型
- 04_trace_profile_model.md: Trace Profile 数据模型
- 05_face_filter_model.md: Face Filter 统一模型
- 06_implementation_plan.md: 实施计划
- 07_progress_report.md: 进度报告

基础设施:
- 目录: config/global/, ~/momentry/identities/
- 迁移脚本:
  - generate_profiles.py (403 行)
  - generate_identities.py (210 行)
  - migrate_all.py (118 行)

测试验证:
- ✅ Dry-run 测试通过
- ✅ 找到 176 个文件
- ✅ 找到 117 个 Identity

关键改进:
- FaceFilterSettings 统一(前后端字段一致)
- 三段式架构(系统层/档案层/Identity层)
- 实体文件优先存储策略

状态: Phase 1 完成,Phase 2 开始
2026-10-09 13:26:36 +08:00
Accusys ca3e73b73a docs: OCR 跨机器状况检查报告
M5Max128 状况:
- 总视频: 176
- OCR 完成: 55 (31%)
- 未执行 OCR: 103 (59%)
- OCR 结果为 0: 2

问题:
1. 98 个文件在 registered 状态未处理
2. 1 个文件 completed 但无 OCR
3. 1 个文件视频丢失导致数据不一致
4. 置信度都是 1.0 (过于自信)

M5Max48: ❌ SSH 认证失败
M4ProMini: ❌ sshpass 工具不可用

需要:
- 配置远程机器访问权限
- 检查 Worker 状态
- 批量处理 registered 文件
- 清理丢失文件的数据库记录
2026-10-09 05:06:04 +08:00
Accusys 04e6bcb5a6 docs: OCR 工具状况检查报告
发现的问题:
1. 置信度过于自信 (都是 1.0)
2. 输出格式使用 frames 而非 segments
3. 重复文字 (同一字幕在多帧重复)
4. 64% 文件无 OCR 结果

统计:
- 55 个 OCR 文件
- 20 个有文字 (36%)
- 6,197 总 texts
- 平均 112.7 texts/文件

质量评估:
✅ 识别字幕准确
✅ 识别类型正确 (字幕/屏幕文字)
⚠️ 置信度需校准
⚠️ 需要优化去重

建议:
- 调整 Swift Vision confidence 阈值
- 实施存储前去重
- 统一输出格式为 segments
2026-10-09 05:00:22 +08:00
Accusys 84d25468b9 docs: ASRX V2 完整实现报告
最终状态:
✅ 多说话人检测 (297行)
✅ 主处理流程 (434行)
✅ 声纹提取 ECAPA-TDNN (191行)
✅ 说话人聚类 (153行)
✅ Qdrant 存储

总计: 1075 行代码

完整流程:
1. ASR 粗分割
2. VAD 多说话人检测
3. 重转录 (多说话人段)
4. 声纹提取 (192维)
5. 层次聚类
6. Qdrant 存储 (128维)

性能预期:
- 准确度: +15-20%
- 开销: +25%

状态: ✅ 完整实现
测试: ✅ 导入通过
部署: ⚠️ 待集成到主流程
2026-10-08 13:48:15 +08:00
Accusys c508c9ed72 feat: ASRX V2 - Pyannote 集成和真实特征向量
完成内容:
- ✅ Pyannote 集成 (ECAPA-TDNN 声纹提取)
- ✅ 真实特征向量 (192维声纹 → 128维降维)
- ✅ 层次聚类 (robust_speaker_clustering)
- ✅ Qdrant 批量存储

核心改进:
- 使用 SpeechBrain ECAPA-TDNN 模型
- 192维声纹特征提取
- 自动说话人数量估计
- 真实特征存储到 Qdrant

流程:
1. ASR 粗分割
2. VAD 多说话人检测
3. 重转录 (多说话人段)
4. 声纹提取 (ECAPA-TDNN)
5. 层次聚类
6. Qdrant 存储

状态: ✅ 完整实现
准确度: +15-20% (预期)
2026-10-08 13:45:21 +08:00
Accusys 43228bd7e1 docs: ASRX V2 实现完成报告
记录完整的实现细节:
- 多说话人检测模块 (297行)
- ASRX V2 主流程 (337行)
- Qdrant collection 创建
- 文档 (247行)

核心功能:
- 中断频率、音量变化、频谱特征分析
- 段落细分和重新转录
- VAD 结果存储到 Qdrant

预期改进:
- 准确度: +15-20%
- 开销: +15-20%

待完成:
- Pyannote 集成
- 真实特征向量
- 主流程集成
- 性能测试

Git: b1bb0511
状态: ✅ 基础实现完成
2026-10-08 13:33:13 +08:00
Accusys b1bb051160 feat: ASRX V2 - 多说话人检测和分段优化
实现内容:
- multi_speaker_detector.py: 多说话人检测模块
  - 中断频率分析
  - 音量变化检测
  - 频谱特征变化
  - 段落细分

- asrx_v2_processor.py: 主处理流程
  - ASR 粗分割
  - VAD 多说话人检测
  - 重新 Whisper (多说话人段)
  - 说话人分离
  - Qdrant 存储

- Qdrant _vad_segments collection: VAD 结果存储
  - 128维向量
  - 用于跨文件比对

新流程:
1. ASR → 粗粒度段落
2. VAD → 检测多说话人
3. 重转录 → 精细分段
4. 分离 → speaker_id
5. 存储 → Qdrant

预期改进:
- 多说话人检测: +20%
- 边界准确度: +15%
- 文本对齐: +10%

状态: ✅ 基础实现完成,待集成
开销: +15-20% 处理时间
2026-10-08 13:30:43 +08:00
Accusys a3a5bbdfa5 docs: Rust VAD 强制启用实施文档
记录完整的变更细节:
- 代码修改 (vad.py 默认值)
- 环境配置 (.env)
- 技术规格和性能指标
- 部署检查清单
- 回退机制
- 测试建议

状态: ✅ 已完成,生产就绪
影响: ASRX 处理流程默认使用 Rust VAD
性能: 1.9x faster (单独 VAD), 1.1x faster (完整 ASRX)
2026-10-08 13:08:26 +08:00
Accusys a738b2d974 feat: 启用 Rust VAD 作为 ASRX 默认实现
变更:
- vad.py 默认值: USE_RUST_VAD=true
- .env 添加: MOMENTRY_USE_RUST_VAD=true
- Binary 路径更新: tools/cli/rust/target/release/rust_vad

性能提升:
- 单独 VAD: 1.9x faster (Python 1.09s → Rust 0.58s)
- 完整 ASRX: 1.1x faster (62.48s → 56.91s)

部署要求:
- tools/cli/rust/target/release/rust_vad (26M)
- /Users/accusys/models/silero_vad.onnx (2.2M)

回退机制:
- export MOMENTRY_USE_RUST_VAD=false

状态: ✅ 生产就绪,默认启用
影响: ASRX 处理流程
向后兼容: 是
2026-10-08 13:05:10 +08:00
Accusys 9b8ce5c2c7 docs: Release v1.0.20261008 交付通知
交付内容:
- Production binary (44M)
- Database schema (95K)
- Release manifest
- Rust/Swift CLI 工具清单

关键修复:
- M4ProMini 文件卡死问题修复
- face_traced.json status=null 处理
- Path traversal security patch
- VLM/Agent search timeout 改进

验证状态:
- ✅ M4ProMini 已验证修复生效
- ✅ Binary 编译成功
- ✅ 所有工具完整

交付: Core Team → Admin Team
版本: v1.0.20261008
Commit: d55d3988
2026-10-08 11:52:18 +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 06a099e159 fix: 延長 VLM timeout 120s→300s(vlm_summary、agent analyze_frame、backfill_trace_vlm) 2026-10-08 09:30:48 +08:00
Accusys 0b7aaee110 docs: Deep Scan Queue clarification responses
Studio team confirmed:
1. Resource monitoring: cpu/ram/gpu only
2. Adjustment frequency: 3 seconds
3. Retry strategy: TBD (Phase 1 basic, Phase 3 advanced)
4. Frontend integration: Polling API + CLI + Redis access

Phase 1 implementation plan finalized:
- Database schema extension
- Queue status API
- Priority queue support
- Basic retry logic
- Resource monitoring foundation

Timeline: Phase 1 (Oct 15), Phase 2 (Oct 22), Phase 3 (Oct 29)

Status: Ready to start Phase 1 development
2026-10-08 03:44:06 +08:00
Accusys c49707df0d docs: Deep Scan Queue feature request and evaluation
- Copy Studio team's feature request
- Provide technical evaluation
- Identify implementation approach
- List questions needing clarification
- Propose 3-phase implementation plan

Status: Feasible, awaiting clarification on:
- Resource monitoring scope
- Dynamic concurrency strategy
- Frontend integration method
- Retry strategy for failures

Timeline: 2-3 weeks (Phase 1: 1 week, Phase 2: 1 week, Phase 3: 1 week)
2026-10-08 02:06:31 +08:00
Accusys 66470f315b docs: Scene VLM summary fix documentation
- Document root cause: using reasoning_content instead of content
- Explain Gemma4 response structure
- Provide data repair options
- Add monitoring and verification steps

Related: M5Max48 deep scan VLM summary issue
2026-10-08 01:15:59 +08:00
Accusys 2ec0bc6706 fix: use content instead of reasoning_content for VLM
- Gemma4 returns both content and reasoning_content
- reasoning_content is the thinking process, not the final answer
- content contains the actual scene description
- Changed priority: content first, reasoning_content as fallback

Fixes: Scene VLM generated 0 descriptions issue
Root cause: Using reasoning_content (thinking) instead of content (answer)
2026-10-08 01:13:42 +08:00
Accusys 1bb8928ab6 docs: agent search timeout fix documentation
- Document 60s timeout implementation
- Provide frontend configuration guide
- List test results and query optimization tips
- Add monitoring and logging guidelines
2026-10-07 18:36:48 +08:00
Accusys d5786608f0 fix: add 60s timeout to agent search
- Wrap run_tool_loop in tokio::time::timeout
- Return 408 Request Timeout with JSON error
- Prevent infinite loops from blocking server
- Log timeout events for monitoring

Fixes: search_agents timeout issue
2026-10-07 18:19:13 +08:00
Accusys 9596cec7ba fix: prevent empty body on search API errors
- Add ErrorResponse struct with success/error/results fields
- Replace StatusCode returns with Json<ErrorResponse>
- Ensure all error paths return proper JSON response
- Prevent frontend crash when embedding service fails

Fixes: M4 Visual Search fault (500 empty body)
Related: embeddinggemma_server.py MPS crash
2026-10-07 18:09:12 +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 ab54382834 fix: add validation functions for A-6
Added is_valid_file_uuid() and is_valid_chunk_id() in validator.rs

- is_valid_file_uuid: 32 chars, lowercase hex
- is_valid_chunk_id: [a-zA-Z0-9_-]+, max 128 chars
- Blocks path traversal sequences
2026-10-05 04:34:05 +08:00
Accusys 060edda3ae fix: A-6 security patch - path traversal prevention
**Security Issue**:
- chunk_thumbnail: file_uuid/chunk_id unvalidated → path traversal
- chunk_thumbnail: cache-hit missing JPEG validation → content-type confusion
- scene_thumbnail: file_uuid unvalidated → path traversal

**Fixes**:
1. Added is_valid_file_uuid() in validator.rs
   - 32 chars, lowercase hex only
   - Blocks any path containing / or ..

2. Added is_valid_chunk_id() in validator.rs
   - [a-zA-Z0-9_-]+, length <= 128
   - Matches all 5226 existing chunks (cut_, time_, pure digits)
   - Blocks traversal sequences

3. chunk_thumbnail (media_api.rs:1162):
   - Added validation before path construction
   - Added JPEG validation for cache-hit
   - Returns 404 for invalid input

4. scene_thumbnail (media_api.rs:965):
   - Added file_uuid validation
   - filename already validated (scene_<N>.jpg)

**Verification**:
- Defense in depth: character whitelist + canonicalize
- No regression: all existing chunk_id formats pass
- Mitigation: both handlers behind protected_routes (auth required)
2026-10-05 04:32:28 +08:00