fix: resolve P2 hardcoded paths to use runtime resolution (A-4.2 P2)

Issues: Direct hardcoded paths without fallback
- proxy.rs:108 - audio_track_probe.py
- tool_selector.rs:136 - output_dir
- ocr.rs:241 - swift_ocr binary
- files.rs:1190 - legacy output dirs

Impact: These paths don't exist on release machines

Solution:
1. proxy.rs: Use path_utils::scripts_dir()
2. tool_selector.rs: Use config::OUTPUT_DIR
3. ocr.rs: Use swift_processor_path() helper
4. face.rs: Make swift_processor_path() public
5. files.rs: Reduce duplicate legacy paths

Changes:
- src/core/proxy.rs: Resolve audio_track_probe.py
- src/core/processor/tool_selector.rs: Use OUTPUT_DIR from config
- src/core/processor/ocr.rs: Use swift_processor_path()
- src/core/processor/face.rs: Export swift_processor_path()
- src/api/files.rs: Deduplicate legacy paths

Verification: cargo check --lib passes

Remaining: P3 (unwrap_or_else type, ~89 locations)

References:
- A-4.2 P2 in Momentry_Release_Requirements_20261004.md v1.1
- G-3 gate condition
This commit is contained in:
Accusys
2026-10-04 16:06:41 +08:00
parent 2f5e2c1314
commit e0eb7b9ce8
5 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -1185,9 +1185,10 @@ struct ReScanResponse {
fn delete_output_files(uuid: &str) -> u64 {
let mut deleted_count = 0u64;
// Check multiple output directories
let output_dirs = [
config::OUTPUT_DIR.to_string(),
"/Users/accusys/momentry/output".to_string(),
// Legacy paths for backward compatibility during migration
"/Users/accusys/momentry/output".to_string(),
];