Skip to content

docs(disk-hygiene): record that Get-DiskImage reads running WSL disks as detached - #5643

Merged
kyle-sexton merged 2 commits into
mainfrom
docs/5642-diskimage-wsl-detached-limit
Oct 1, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
docs/5642-diskimage-wsl-detached-limit

Conversation

@kyle-sexton

Copy link
Copy Markdown
Contributor

Closes #5642

Summary

On Windows, Get-DiskImage reports detached for disks that WSL2 and Docker Desktop hold open through their own virtual machine (a running distro's ext4.vhdx, docker_data.vhdx, swap.vhdx). A detached answer therefore does not mean the image is unused. The Get-DiskImage record in the safety model had no Windows observation.

Fix

safety-model.md documents the limit: detached is a reporting caveat, the image keeps virtual-disk and the block, nothing becomes deletable, and the record is now observed on Windows (attached plus drive letter for a host-mounted VHDX, detached for the WSL and Docker disks, an error for initrd.img). The plugin patch version goes to 0.41.3 with a matching CHANGELOG entry. No code changes.

Verification

  • scripts/check-changelog-parity.sh --check, --check-bump origin/main and --check-order pass.
  • python3 -m unittest discover -s plugins/disk-hygiene/skills/clean/scripts -p 'test_hygiene.py': 674 tests, OK (1 skipped).

Related

Parent investigation: #5228 (operator observation on melo-desk-001, comment 5922688274).

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits September 30, 2026 21:13
… detached limit

Refs: #5642

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… as detached

Refs: #5642

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 1, 2026 01:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T01:19:43.604672Z e67fd2a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 22s —— View job


Code review complete

  • Gather context (PR diff, changed files)
  • Review safety-model.md doc changes
  • Review CHANGELOG.md and plugin.json version bump
  • Post findings

Scope: doc-only change (safety-model.md, CHANGELOG.md, plugin.json). No findings to report.

What I checked:

  • The new Get-DiskImage observation (attached + drive letter for Dev.vhdx backing D:, detached for the WSL/Docker disks, exit-1 error for initrd.img) matches the code's actual reason-code mapping in plugins/disk-hygiene/skills/clean/scripts/hygiene.py: windows_disk_image_mounts (lines 803–830) raises ValueError on any non-zero return code or unexpected stdout, which virtual_disk_attachment propagates as virtual-disk-attach-unverified, and returns the drive-letter list for an attached image as attached-virtual-disk:<mount> — both consistent with the new doc text at plugins/disk-hygiene/skills/clean/reference/safety-model.md lines 116–138.
  • The old "unobserved" format list correctly dropped .img (now observed via initrd.img's error) while retaining .vmdk, .vdi, .qcow2 as still-unobserved — internally consistent.
  • The claim/basis/as-of/recheck four-part record (required by .claude/rules/skill-bodies-state-current-rules.md for volatile specifics) is present and well-formed.
  • plugin.json version bump (0.41.2 → 0.41.3) has a matching CHANGELOG.md entry, correctly ordered above the prior entry.
  • I did not independently re-run scripts/check-changelog-parity.sh or the test_hygiene.py suite in this sandbox (lacked shell approval) — the PR body's verification results are author-claimed and unverified by me.

No correctness or maintainability issues found in the changed lines.

@claude

claude Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 26s —— View job


Claude finished the security review

  • Gather context (PR diff, changed files)
  • Run /review:security-review for this PR
  • Post findings

Skip gate applied — no security review performed. This PR has no security-relevant surface:

  • Changed files are plugins/disk-hygiene/.claude-plugin/plugin.json (version bump only),
    plugins/disk-hygiene/CHANGELOG.md (new entry describing the same version bump), and
    plugins/disk-hygiene/skills/clean/reference/safety-model.md (documentation of an observed
    Get-DiskImage behavior).
  • No code changes anywhere in the diff.
  • The safety-model.md edit does not delete, narrow, or soften a standing instruction/guardrail —
    it replaces an "unobserved" placeholder with an actual Windows observation while keeping the
    same safety conclusion: detached disks still keep virtual-disk and the block, nothing
    becomes deletable, and reclaimable bytes stay 0 (safety-model.md#L113-L135). If anything, the documented conclusion is now stricter and better-evidenced, not looser.

No CRITICAL / IMPORTANT / SUGGESTION findings to report.

@kyle-sexton
kyle-sexton merged commit 8f5559d into main Oct 1, 2026
32 of 34 checks passed
@kyle-sexton
kyle-sexton deleted the docs/5642-diskimage-wsl-detached-limit branch October 1, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

disk-hygiene: Get-DiskImage reads a running WSL distro's disk as detached

1 participant