You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Intern] Audit hanzo start / hanzo up / hanzo down resource flags & prerequisite error messages #110
Audit --cpus, --memory, --disk on hanzo start and --cloud-only / --vm on hanzo up/down. Ensure missing runtime prerequisites (KVM permissions, Virtualization.framework, stale kubeconfig) produce clear, actionable error messages instead of raw OS errors.
Taking this on: #128 — start/up/restart: validate --cpus/--memory/--disk before booting; down --vm no-ops when idle.
What the PR does against the acceptance criteria:
Flag validation with tests. New src/commands/lifecycle/shape.rs: bounds for --cpus (2..=128), --memory (>= 2048 MiB), --disk (>= 8192 MiB), plus a host-capacity check (--cpus 16 on an 8-CPU host is rejected with --cloud-only named as the way out). Six unit tests cover each rejection and the host-probe-unknown case.
Actionable messages instead of raw OS errors. Every rejection names the flag, the bound that failed and a value that works, e.g. `--memory 1024` is below the 2048 MiB minimum Cloud needs to start (the API server is OOM-killed below it) — run with `--memory 4GiB`. The KVM / Virtualization.framework prerequisites already had messages in this tree (vm::require_kvm, vm::check_linux_x86_64_host); the missing half was the shape, which used to fail inside the guest as an OOM kill or a full root filesystem.
--cloud-only / --native are untouched by design: they never create the microVM whose shape is being validated, so the check is skipped for them.
hanzo down --vm on an idle machine now prints · no local runtime is running — nothing to stop (start it with hanzo start) instead of entering the stop path with no pid.
cargo clippy --locked --all-targets -- -D warnings passes on the branch. That needed one small extra commit: eight dead_code items under up/ and in vm.rs that are only reachable from unit tests already failed -D warnings on main; they now carry #[allow(dead_code)] with a one-line note. Nothing was deleted and no behaviour changed.
Reproducible output is pasted in the PR description: real cargo test --locked --bin hanzo shape:: and release-binary runs of each rejection message, plus the Windows note that ten sh/PATH-dependent tests in the suite fail identically on clean main (verified in a worktree).
Also open from me: #127 for #111 (hanzo doctor self-checks).
Hi, I can audit the resource flags and prerequisite error messages in cmd/hanzo/flags.go and its associated unit test files. I will verify the changes locally by running the full test suite to ensure all flag validations and error paths pass successfully. Please confirm my assignment to this issue before I submit the pull request.
Activity
linear commentedon Nov 27, 2026
HAI-545
Jonesc2321601 commentedon Nov 29, 2026
Taking this on: #128 —
start/up/restart: validate --cpus/--memory/--disk before booting; down --vm no-ops when idle.What the PR does against the acceptance criteria:
src/commands/lifecycle/shape.rs: bounds for--cpus(2..=128),--memory(>= 2048 MiB),--disk(>= 8192 MiB), plus a host-capacity check (--cpus 16on an 8-CPU host is rejected with--cloud-onlynamed as the way out). Six unit tests cover each rejection and the host-probe-unknown case.`--memory 1024` is below the 2048 MiB minimum Cloud needs to start (the API server is OOM-killed below it) — run with `--memory 4GiB`. The KVM / Virtualization.framework prerequisites already had messages in this tree (vm::require_kvm,vm::check_linux_x86_64_host); the missing half was the shape, which used to fail inside the guest as an OOM kill or a full root filesystem.--cloud-only/--nativeare untouched by design: they never create the microVM whose shape is being validated, so the check is skipped for them.hanzo down --vmon an idle machine now prints· no local runtime is running — nothing to stop (start it withhanzo start)instead of entering the stop path with no pid.cargo clippy --locked --all-targets -- -D warningspasses on the branch. That needed one small extra commit: eightdead_codeitems underup/and invm.rsthat are only reachable from unit tests already failed-D warningsonmain; they now carry#[allow(dead_code)]with a one-line note. Nothing was deleted and no behaviour changed.cargo test --locked --bin hanzo shape::and release-binary runs of each rejection message, plus the Windows note that tensh/PATH-dependent tests in the suite fail identically on cleanmain(verified in a worktree).Also open from me: #127 for #111 (
hanzo doctorself-checks).linhsama commentedon Nov 29, 2026
Hi, I can audit the resource flags and prerequisite error messages in
cmd/hanzo/flags.goand its associated unit test files. I will verify the changes locally by running the full test suite to ensure all flag validations and error paths pass successfully. Please confirm my assignment to this issue before I submit the pull request.