fix: D-4 hardcoded paths in release binary (critical)

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
This commit is contained in:
Accusys
2026-10-04 20:22:34 +08:00
parent 08c2eb5c9c
commit aa621b874c
2 changed files with 24 additions and 8 deletions
+8 -6
View File
@@ -246,9 +246,10 @@ let mediapipe_script = executor.script_path("pose_processor_mediapipe.py");
}
// Swift processor path (preferred over Python)
let swift_pose_path = std::path::Path::new(
"/Users/accusys/momentry_core/scripts/swift_processors/.build/release/swift_pose"
);
let swift_pose_path = crate::core::path_utils::cli_dir()
.join("swift/.build/release/swift_pose");
tracing::info!("[POSE] Looking for Swift processor at: {:?}", swift_pose_path);
if swift_pose_path.exists() {
tracing::info!("[POSE] Using Swift processor: {:?}", swift_pose_path);
@@ -406,9 +407,10 @@ let mediapipe_script = executor.script_path("pose_processor_mediapipe.py");
}
// Swift processor path (Apple Vision - faster but lower accuracy)
let swift_pose_path = std::path::Path::new(
"/Users/accusys/momentry_core/scripts/swift_processors/.build/release/swift_pose"
);
let swift_pose_path = crate::core::path_utils::cli_dir()
.join("swift/.build/release/swift_pose");
tracing::info!("[POSE] Looking for Swift processor at: {:?}", swift_pose_path);
if swift_pose_path.exists() {
tracing::info!("[POSE] Using Swift processor: {:?}", swift_pose_path);