/// Convert a file path to its top-level module name.
/// Operation: string manipulation logic, no own calls.
///
/// Examples:
/// - `main.rs` → `main`
/// - `config/mod.rs` → `config`
/// - `analyzer/types.rs` → `analyzer`
/// - `src/pipeline.rs` → `pipeline`