Issue: Previous edit missed L11 hardcoded path
Solution: Use same env var + current_exe() pattern as L24
Verification: strings shows 0 dev paths in binary
D-4: ✅ Complete
Final cleanup:
1. main.rs:35 - Remove hardcoded .env fallback
- Rationale: L30-34 already provide correct current_exe() resolution
- Removes dev path, aligns with A-14.3 "禁止读取 dev 设定"
2. docs.rs:11,24 - Use current_exe() resolution
- Replace hardcoded doc_wasm paths
- Add MOMENTRY_DOCS_DIR env var support
- Fallback to relative path
Result:
- All hardcoded dev paths removed from release binary
- D-4 Gate satisfied
- Zero momentry_core/nextorageai paths in source
Impact:
- Binary fully portable
- No dev environment assumptions
- All paths runtime-resolved
- 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