Skip to content

disk-hygiene: blanket 'any filesystem root' rejection has no reasoning; blocks legitimate non-OS volumes (e.g. Windows Dev Drive) #984

Description

@kyle-sexton

Summary

hygiene.py:254-255, inside hard_protection():

if path == target or path.parent == path:
    reasons.append("target-or-filesystem-root")

Purely structural — path.parent == path is true for any drive/filesystem root, with zero regard
for what that volume actually is. This exists alongside system_roots() (line 206), which already
does the reasoned, purpose-aware check (SystemRoot/ProgramFiles/ProgramData/per-drive Windows system
folders on Windows; /System, /Library etc. on macOS; /bin, /etc etc. on Linux) and correctly
produces a separate os-managed-root reason. The blunt check is redundant with the reasoned one where
the reasoned one already fires, and over-fires everywhere it doesn't — no OS content, no shared
system state, nothing.

Empirical reproduction (live, this session)

D: on the audited machine is a Windows Dev Drive — verified via Get-Volume -DriveLetter D:
FileSystemType: ReFS, FileSystemLabel: Dev, a dedicated user-provisioned volume for dev workloads
with zero OS-managed content. The skill hard-rejected it with no path to override, interrogate, or even
explain why beyond "it's a root."

User pushback (verbatim), confirmed correct on inspection: "D: drive should NOT be rejected - its a
dev drive, its not the entire home drive, in fact no drive should be explicitly rejected without
reasoning first... this is a BUG with the skill."

Suggested direction

  • Don't remove the structural root check outright (C:\ genuinely needs blocking) — replace the
    blanket branch with a reasoned one: reject a root only when it is (or is within) an OS-managed root
    per system_roots(), or — failing a confident classification — ask the user instead of silently
    hard-denying. A Dev Drive is discoverable (fsutil devdrv query, though that itself needs elevation
    Get-Volume's FileSystemType: ReFS + non-system FileSystemLabel is a workable unprivileged
    proxy) and should not require an unauthenticated structural veto to reach a human.
  • Composes with the large-target-confirmation issue (separate ticket) — a root target and a "large
    target" are overlapping but distinct concerns; the fix for one shouldn't silently paper over the
    other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumReal value, no hard deadline; normal backlog flow.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions