- Add logic to read and execute .sql migration files
- Replace schema placeholders (public. -> current schema)
- Track applied migrations in schema_migrations table
- Support both public and dev schema environments
- Fixes B-4: 27/40 migrations failed on M5Max128
Ref: docs_v1.0/M4_workspace/2026-10-04_B-4_Migration_Fixed.md
Found 4 dev paths in momentry binary via strings:
1. pose.rs (2 paths) - CRITICAL
- Line 250, 410: swift_pose path
- Impact: processor execution path
- Fix: Use path_utils::cli_dir() + relative path
2. docs.rs (2 paths) - MEDIUM
- Line 11, 24: doc_wasm path
- Impact: documentation service
- Fix: cfg(debug_assertions) + env var
3. markbase_compat.rs (2 paths) - MEDIUM
- Line 31, 58: Studio data path
- Impact: SFTP service
- Fix: MOMENTRY_STUDIO_DATA_DIR env + fallback
Verification:
- cargo check passes
- All paths now runtime-resolved or dev-only
- D-4 Gate should pass after rebuild
Issues: 6 P1 locations with hardcoded model paths
- asr.rs:81 - whisper model
- scene_classification.rs:68 - resnet18 model
- qwen_vl_manager.rs:25,26 - Qwen model + mmproj
- rust_vad.rs:18 - silero_vad model
- facenet_embedding.swift:24 - already fixed (A-11)
Impact: Missing models cause silent degradation (A-12)
No embeddings → TKG 0 nodes (020.mp4 root cause)
Solution: Use path_utils::resolve_asset_path for all model paths
- Resolves via MOMENTRY_MODELS_DIR env var
- Falls back to current_exe sibling
- Final fallback to models/ directory
Changes:
1. asr.rs: Resolve whisper model dir
2. scene_classification.rs: Resolve resnet18 model path
3. qwen_vl_manager.rs: Resolve Qwen model + mmproj paths
4. rust_vad.rs: Resolve silero_vad model via env or relative
Benefits:
- All P1 models now configurable via MOMENTRY_MODELS_DIR
- No more silent failures when models missing
- Models can be placed in release bundle
Verification:
- cargo check --lib passes
- cargo build --release --bin rust_vad passes
Next steps: Address P2 (41 locations) and P3 (35 locations)
References:
- A-4.2 P1 in Momentry_Release_Requirements_20261004.md v1.1
- A-11, A-12
- G-3 gate condition
- Decision: POST /api/v1/re-scan is canonical API
- Important: auto_pipeline=false by default (customer requirement)
- Provides manual control and safety over processing pipeline
- Includes workflow examples and Studio Team recommendations
Addresses: A-7 from Momentry_Release_Requirements_20261004.md
The hardcoded processors array in create_monitor_job was missing
'face_cluster', causing jobs to never run face clustering and thus
never complete ingestion (face_cluster.json never created).
Successful jobs (e.g. 1250) have face_cluster in processors, but
newly created jobs (e.g. 1251) were missing it due to this hardcoded
array being incomplete.
Config-driven swift/python branches in run_face_with_config were
saving face.json but not storing embeddings to Qdrant. This caused
TKG spawn to wait indefinitely for Qdrant face points that never
arrived, blocking ingestion completion.
The fallback hardcoded path had store_face_embeddings_to_qdrant
call, but config-driven path returned early without it.
Fix: call store_face_embeddings_to_qdrant after save_to_file in
both swift and python config-driven branches.
compute_status() updates FaceResult in memory but didn't write back
to the file. Ingestion gate checks face.json directly, so it still
saw status=null and skipped TKG/face_cluster/Qdrant.
Now calls save_to_file() after compute_status() in swift/python
config-driven branches, matching the 'existing file' path behavior.
The config-driven swift/python branches in run_face_with_config parsed
face.json into FaceResult without calling compute_status(). swift_face
outputs frames[].faces but no top-level 'status'/'total_faces' fields,
so the resulting FaceResult always reported 0 total faces and status=None
even when the file contained faces (e.g. 212 faces in 020.mp4).
This broke the whole downstream pipeline for any file processed via the
config-driven swift path:
- worker logged 'FACE completed, status=, 162 frames, 0 total faces'
- has_faces=false in P4 TKG trigger (face.json status mismatch)
- face_cluster / qdrant_face ingestion gates never satisfied
- job stuck in 'waiting for ingestion' forever
Fix: call compute_status() after parsing in both swift and python
config-driven branches, matching the existing face.json / mediapipe paths.
Adds test_compute_status_recalculates_total_faces to lock the behavior.
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.
The swift_face/swift_pose CLIs take positional <input> <output> paths,
but processor_tools_v3.json passed an unsupported --output flag, so the
config-driven path always failed (exit 64, 'Unknown option --output')
and fell back to hard-coded logic for every face/pose run.
- config/processor_tools_v3.json: drop --output, use positional args
- face.rs/pose.rs: expand {video_path}/{output_path}/{file_uuid}
placeholders in config args before executing
Verified: positional args exit 0 and produce face.json; old args exit 64.
- 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
- 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