Skip to content

Fix disk-space boundary logic and add regression tests#6

Merged
Joshua-Ward1 merged 1 commit intomainfrom
fix/doctor-exit-codes
Jan 22, 2026
Merged

Fix disk-space boundary logic and add regression tests#6
Joshua-Ward1 merged 1 commit intomainfrom
fix/doctor-exit-codes

Conversation

@Joshua-Ward1
Copy link
Owner

Summary

Fixes a boundary bug in DiskSpaceCheck where percent_free == warn_limit (e.g. 0.15 with threshold 0.10 and margin 0.05) was incorrectly reported as pass instead of warn.

The logic is now explicit and deterministic:

  • percent_free <= disk_threshold → fail
  • disk_threshold < percent_free <= warn_limit → warn
  • percent_free > warn_limit → pass

Changes

  • Removed redundant branch and math.isclose logic.
  • Simplified disk threshold comparison.
  • Added regression tests for boundary cases.
  • Hardened CLI exit code handling for malformed summaries.

@Joshua-Ward1 Joshua-Ward1 self-assigned this Jan 22, 2026
@Joshua-Ward1 Joshua-Ward1 added the bug Something isn't working label Jan 22, 2026
@Joshua-Ward1 Joshua-Ward1 merged commit 9331655 into main Jan 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant