Repository navigation
test(disk-hygiene): cover least-observable engine paths (F8) - #1143
Conversation
dh 0.7.3 — test-only release for #1114. Adds LeastObservableEnginePathTests (21 tests) covering the engine paths a consumer can least verify live, each with mocked OS surfaces so both CI lanes exercise the same branches: - windows_handle_state: CreateFileW error mapping (32/33 -> open, 5/1314 -> needs_elevation, unknown -> unverified), handle closed on success, directory probes use FILE_FLAG_BACKUP_SEMANTICS - posix_handle_state: lsof parsing — missing lsof, stderr diagnostics, unexpected exit codes, and timeouts all fail closed; +D vs -- command shapes for directories vs files - windows_storage_sense_state: registry reads via a sys.modules winreg fake (set / zero / missing values, missing key) - _decode_mountinfo_path: octal escapes decoded; non-octal and truncated sequences left verbatim - non-Git VCS marker branch: nested, enclosing, and casefolded markers all flag vcs-state-unverified (fail closed) No latent engine bugs surfaced; hygiene.py is untouched. Suite: 151 tests passing on the Windows lane locally. Co-authored-by: Claude Fable 5 <[email protected]>
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
|
Warning Automated review did not complete — this is an infrastructure failure, not a review verdict. Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."
Re-running the job, or pushing a new commit, will retry the review. |
|
Warning Automated security review did not complete — this is an infrastructure failure, not a review verdict. Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."
Re-running the job, or pushing a new commit, will retry the review. |
Summary
dh 0.7.3 — test-only release for the disk-hygiene consumer-audit item (F8). Adds
LeastObservableEnginePathTests(21 tests) totest_hygiene.py, covering exactly the engine paths a consumer can least verify live. Every test mocks the OS surface, so both CI lanes exercise the same branches regardless of host platform:windows_handle_state— CreateFileW error-code mapping (32/33 →open, 5/1314 →needs_elevation, unknown codes fail closed asunverified), handle closed on success, directory probes useFILE_FLAG_BACKUP_SEMANTICSwhile file probes useFILE_ATTRIBUTE_NORMAL. Mocked via a fakectypesnamespace patched onto the module.posix_handle_state— lsof parsing: missinglsof, stderr diagnostics, unexpected exit codes, and timeouts all fail closed asunverified;+D(directory) vs--(file) command shapes asserted. Mocked viashutil.which+subprocess.runpatches (existing suite idiom).windows_storage_sense_state— registry reads via asys.moduleswinreg fake (works on both platforms since the function importswinreglazily): set / zero / missing values, and missing key → all-Noneunknown state._decode_mountinfo_path— octal escapes (\040,\011,\134, consecutive) decoded; non-octal (\81a) and truncated-at-end (\04) sequences left verbatim..SVN) markers all produce thenon-Git VCS state is not independently verifiederror andtracked_blockerfails closed withvcs-state-unverified.No engine behavior change —
hygiene.pyis untouched. No latent bugs surfaced while writing the tests (per the issue's acceptance criteria, none needed fixing or filing).Test plan
python -m unittest test_hygiene→ 151 tests, OK (4 platform skips)bash plugins/disk-hygiene/skills/clean/scripts/hygiene.test.sh→ OKscripts/check-changelog-parity.sh --check-bump origin/main→ pass (0.7.3 bump + CHANGELOG entry)Related
Closes #1114. Source: handoff-inbox item
20260723-021058-disk-hygiene-0-6-4-consumer-audit, finding F8.🤖 Generated with Claude Code