```python
def crust_slice(name: str) -> str:
    """Return the part of the filename before its final dot, respecting path and hidden file rules."""
    # Find the last dot in the string
    last_dot_index = name.rfind('.')
    
    # If no dot exists, return the name unchanged
    if last_dot_index == -1:
        return name
    
    # If the only dot is at the very first character (index 0), return the name unchanged
    # This handles hidden files like ".hidden" where the dot is part of the name, not an extension separator
    if last_dot_index == 0:
        return name
    
    # Return the substring before the last dot
    return name[:last_dot_index]
```