Skip to content

Add cross-platform health check fallbacks#27

Open
daxia778 wants to merge 2 commits into
weilixiong:mainfrom
daxia778:fix/health-check-fallbacks
Open

Add cross-platform health check fallbacks#27
daxia778 wants to merge 2 commits into
weilixiong:mainfrom
daxia778:fix/health-check-fallbacks

Conversation

@daxia778

@daxia778 daxia778 commented Jun 27, 2026

Copy link
Copy Markdown

Addresses #1

Summary

Adds cross-platform fallback paths for tools/health_check.py so memory and load checks no longer degrade to generic /proc read warnings on non-Linux hosts.

Changes

  • Keeps the existing /proc/meminfo and /proc/loadavg behavior as the first path on Linux.
  • Adds memory fallback support for macOS (sysctl + vm_stat), Windows (GlobalMemoryStatusEx), and generic POSIX os.sysconf.
  • Adds load average fallback via os.getloadavg() when /proc/loadavg is unavailable.
  • Adds focused unittest coverage for missing-/proc memory/load fallback behavior and health-check output shape.
  • Commits matching diagnostic artifacts for the code commit:
    • diagnostic/build-f1cce566-metadata.json
    • diagnostic/build-f1cce566-part001.logd
    • diagnostic/build-f1cce566-part002.logd

Testing

  • python3 -m py_compile tools/health_check.py tests/test_health_check_fallbacks.py — passed.
  • python3 -m unittest discover -s tests -v — 4 tests passed.
  • Manual macOS check: check_memory_usage() now returns a measured value instead of a /proc warning.
  • /opt/homebrew/bin/python3.12 build.py — ran full build and finalized diagnostics. Local result was 6 passed / 4 failed: frailbox fails on an existing C compile error, and nfc-scanner, openapi-haskell, and openapi-tools fail because luac/ghc are not installed locally. The diagnostic metadata and .logd chunks from that run are committed.
  • Reassembled and unpacked the diagnostic chunks locally with the recorded password to confirm they are decryptable.
  • git diff --check — passed.

Checklist

  • Relevant Python validation passes locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

  • I would like to request that my diagnostic build log is removed before merging

Payment preference after acceptance: USDC on Base to 0xB54Ec1F0905186553FaB1763409e1CC127b874F9. If the project uses a different approved payout rail, I can follow that flow.

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.

1 participant