Summary
fix/dream-cli-apple-silicon-coverage adds five new GPU_BACKEND=apple code paths (_gpu_status, _gpu_topology, _gpu_validate, _gpu_reassign, cmd_status_json) plus a Darwin branch in scripts/dream-doctor.sh (RAM via sysctl hw.memsize, POSIX df -k). All paths were verified manually on an Apple M4 host, but no automated regression test locks the behavior in. A future refactor could silently re-break them.
Suggested additions
-
tests/contracts/test-dream-doctor.sh — add a Darwin fixture:
- Assert
.preflight.inputs.ram_gb is non-zero on Darwin when sysctl hw.memsize works.
- Assert
.preflight.inputs.ram_gb falls back to .env's HOST_RAM_GB when detection yields 0.
- Assert
.preflight.inputs.disk_gb is non-zero on Darwin when df -k "$HOME" succeeds.
- Assert
.autofix_hints contains zero incompatible with current GPU backend entries on Apple backend.
-
New tests/test-gpu-apple.sh — mock-based regression coverage:
GPU_BACKEND=apple dream gpu status: header renders, body contains "Chip:" / "Unified memory:" / "GPU cores:" / Apple footer line. Exit 0.
GPU_BACKEND=apple dream gpu topology: "Single integrated GPU" line. Exit 0.
GPU_BACKEND=apple dream gpu validate: "Result: 0 check(s) passed, 0 failed". Exit 0.
GPU_BACKEND=apple dream gpu reassign: "not applicable on Apple Silicon". Exit 1.
GPU_BACKEND=apple dream status-json: .gpu is an object with backend/chip/unified_memory_gb/gpu_cores keys. Exit 0.
-
Negative assertion — with GPU_BACKEND=nvidia or GPU_BACKEND=amd, the Apple branches do NOT fire (falls through to nvidia-smi-missing fallback on this macOS host).
The contract tests already gate on uname in fixtures, so the Darwin assertions should be skipped on Linux CI with a clean SKIP and fully run on any macOS runner.
Priority
Medium. Silent regressions on macOS install are user-facing.
Origin
Surfaced by the Critique Guardian during the PR fix/dream-cli-apple-silicon-coverage review (W4 in the verdict).
Summary
fix/dream-cli-apple-silicon-coverageadds five newGPU_BACKEND=applecode paths (_gpu_status,_gpu_topology,_gpu_validate,_gpu_reassign,cmd_status_json) plus a Darwin branch inscripts/dream-doctor.sh(RAM viasysctl hw.memsize, POSIXdf -k). All paths were verified manually on an Apple M4 host, but no automated regression test locks the behavior in. A future refactor could silently re-break them.Suggested additions
tests/contracts/test-dream-doctor.sh— add a Darwin fixture:.preflight.inputs.ram_gbis non-zero on Darwin whensysctl hw.memsizeworks..preflight.inputs.ram_gbfalls back to.env'sHOST_RAM_GBwhen detection yields 0..preflight.inputs.disk_gbis non-zero on Darwin whendf -k "$HOME"succeeds..autofix_hintscontains zeroincompatible with current GPU backendentries on Apple backend.New
tests/test-gpu-apple.sh— mock-based regression coverage:GPU_BACKEND=apple dream gpu status: header renders, body contains "Chip:" / "Unified memory:" / "GPU cores:" / Apple footer line. Exit 0.GPU_BACKEND=apple dream gpu topology: "Single integrated GPU" line. Exit 0.GPU_BACKEND=apple dream gpu validate: "Result: 0 check(s) passed, 0 failed". Exit 0.GPU_BACKEND=apple dream gpu reassign: "not applicable on Apple Silicon". Exit 1.GPU_BACKEND=apple dream status-json:.gpuis an object withbackend/chip/unified_memory_gb/gpu_coreskeys. Exit 0.Negative assertion — with
GPU_BACKEND=nvidiaorGPU_BACKEND=amd, the Apple branches do NOT fire (falls through to nvidia-smi-missing fallback on this macOS host).The contract tests already gate on
unamein fixtures, so the Darwin assertions should be skipped on Linux CI with a cleanSKIPand fully run on any macOS runner.Priority
Medium. Silent regressions on macOS install are user-facing.
Origin
Surfaced by the Critique Guardian during the PR fix/dream-cli-apple-silicon-coverage review (W4 in the verdict).