Drop the -from-host suffix from the nexus host scripts #67

Merged
vnprc merged 2 commits from agent/rename-host-scripts into master 2026-09-26 21:49:35 +01:00
Member

Every nexus provisioning script loses its -from-host suffix. On a running nexus, once the deploy pin picks this up, the operator types rebuild-vm <vm>, provision-vm <vm>, verify-vm <vm>, and bootstrap-vm <vm>; the old names are gone, not aliased. The guest payload that bootstrap-vm streams over SSH is now bootstrap-vm-guest.sh, so the only script that does not run on the host is the one whose name says where it runs. Script bodies, arguments, and the environment pointers (DEPLOY_FLAKE, INVENTORY_CHECKOUT, KNOWN_HOSTS_VMS, NIXOS_REBUILD, ...) stay identical; only the two test-facing env seams follow the rename (BOOTSTRAP_VM_FROM_HOST to BOOTSTRAP_VM, VERIFY_VM_FROM_HOST to VERIFY_VM). The flake check proves it: shellcheck and every test suite pass over the renamed files, and the check asserts the installed bin/ binary for each of the four host commands. If it is wrong, revert the two commits; nothing outside this repo changes.

Closes allod/nexus#66

What changes

Old New Role
scripts/rebuild-vm-from-host scripts/rebuild-vm host command (first commit)
scripts/provision-vm-from-host scripts/provision-vm host command
scripts/verify-vm-from-host scripts/verify-vm host command
scripts/bootstrap-vm-from-host.sh scripts/bootstrap-vm host command, called by provision-vm and verify-vm --repair
scripts/bootstrap-vm.sh scripts/bootstrap-vm-guest.sh guest payload streamed over SSH, never typed
tests/rebuild-vm-from-host.sh tests/rebuild-vm.sh
tests/provision-vm-from-host.sh tests/provision-vm.sh
BOOTSTRAP_VM_FROM_HOST / VERIFY_VM_FROM_HOST BOOTSTRAP_VM / VERIFY_VM env seams in provision-vm used by its test

Every usage line, printed hint, call site, flake check entry, package assertion, option description, test pattern, and doc in this repo follows. Two small additions beyond the pure rename: the flake check gains test -x .../bin/bootstrap-vm alongside the other three host commands, and docs/provisioning-scripts.md lists bootstrap-vm among the operator's commands.

Not in this PR, tracked in the issue's Scope: the rebuild hint printed by allod secret rotate in allod/tools, the provisioning commands quoted in allod/vm docs, and the provision-vm-from-host mention in allod/memory. Those keep printing the old names until their follow-ups land after this reaches the host through the deploy pin.

Risk

R1. Refactor-only rename of five scripts and two test files; behavior untouched; rollback is a straight revert of two commits. The worst credible failure after validation is an operator or a private note typing an old name and getting command not found, which is the intended outcome of dropping the aliases. No secrets, host-only commands, provisioning behavior, persistent state, or cross-repo ordering are touched.

Validation

  • nix build .#checks.x86_64-linux.provisioning-contract: passed. That check runs bash -n and shellcheck -x --source-path=SCRIPTDIR over the full script list, every test suite, and the test -x bin/<name> assertions for bootstrap-vm, provision-vm, rebuild-vm, and verify-vm.
  • Direct runs: tests/bootstrap-orchestration.sh 9 passed, tests/provision-vm.sh 8 passed, tests/forge-ssh-key.sh 10 passed, tests/registry-resolver.sh 15 passed, tests/provisioning-contract.sh 3 passed.
  • nix build .#packages.x86_64-linux.provisioning-scripts and ls bin/: bootstrap-vm, bootstrap-vm-guest.sh, provision-vm, rebuild-vm, verify-vm; no -from-host name present.
  • grep -rn from-host and grep -rn FROM_HOST over the worktree: no matches.
Every nexus provisioning script loses its `-from-host` suffix. On a running nexus, once the deploy pin picks this up, the operator types `rebuild-vm <vm>`, `provision-vm <vm>`, `verify-vm <vm>`, and `bootstrap-vm <vm>`; the old names are gone, not aliased. The guest payload that `bootstrap-vm` streams over SSH is now `bootstrap-vm-guest.sh`, so the only script that does not run on the host is the one whose name says where it runs. Script bodies, arguments, and the environment pointers (`DEPLOY_FLAKE`, `INVENTORY_CHECKOUT`, `KNOWN_HOSTS_VMS`, `NIXOS_REBUILD`, ...) stay identical; only the two test-facing env seams follow the rename (`BOOTSTRAP_VM_FROM_HOST` to `BOOTSTRAP_VM`, `VERIFY_VM_FROM_HOST` to `VERIFY_VM`). The flake check proves it: shellcheck and every test suite pass over the renamed files, and the check asserts the installed `bin/` binary for each of the four host commands. If it is wrong, revert the two commits; nothing outside this repo changes. Closes allod/nexus#66 ## What changes | Old | New | Role | |---|---|---| | `scripts/rebuild-vm-from-host` | `scripts/rebuild-vm` | host command (first commit) | | `scripts/provision-vm-from-host` | `scripts/provision-vm` | host command | | `scripts/verify-vm-from-host` | `scripts/verify-vm` | host command | | `scripts/bootstrap-vm-from-host.sh` | `scripts/bootstrap-vm` | host command, called by `provision-vm` and `verify-vm --repair` | | `scripts/bootstrap-vm.sh` | `scripts/bootstrap-vm-guest.sh` | guest payload streamed over SSH, never typed | | `tests/rebuild-vm-from-host.sh` | `tests/rebuild-vm.sh` | | | `tests/provision-vm-from-host.sh` | `tests/provision-vm.sh` | | | `BOOTSTRAP_VM_FROM_HOST` / `VERIFY_VM_FROM_HOST` | `BOOTSTRAP_VM` / `VERIFY_VM` | env seams in `provision-vm` used by its test | Every usage line, printed hint, call site, flake check entry, package assertion, option description, test pattern, and doc in this repo follows. Two small additions beyond the pure rename: the flake check gains `test -x .../bin/bootstrap-vm` alongside the other three host commands, and `docs/provisioning-scripts.md` lists `bootstrap-vm` among the operator's commands. Not in this PR, tracked in the issue's Scope: the rebuild hint printed by `allod secret rotate` in `allod/tools`, the provisioning commands quoted in `allod/vm` docs, and the `provision-vm-from-host` mention in `allod/memory`. Those keep printing the old names until their follow-ups land after this reaches the host through the deploy pin. ## Risk R1. Refactor-only rename of five scripts and two test files; behavior untouched; rollback is a straight revert of two commits. The worst credible failure after validation is an operator or a private note typing an old name and getting `command not found`, which is the intended outcome of dropping the aliases. No secrets, host-only commands, provisioning behavior, persistent state, or cross-repo ordering are touched. ## Validation - `nix build .#checks.x86_64-linux.provisioning-contract`: passed. That check runs `bash -n` and `shellcheck -x --source-path=SCRIPTDIR` over the full script list, every test suite, and the `test -x bin/<name>` assertions for `bootstrap-vm`, `provision-vm`, `rebuild-vm`, and `verify-vm`. - Direct runs: `tests/bootstrap-orchestration.sh` 9 passed, `tests/provision-vm.sh` 8 passed, `tests/forge-ssh-key.sh` 10 passed, `tests/registry-resolver.sh` 15 passed, `tests/provisioning-contract.sh` 3 passed. - `nix build .#packages.x86_64-linux.provisioning-scripts` and `ls bin/`: `bootstrap-vm`, `bootstrap-vm-guest.sh`, `provision-vm`, `rebuild-vm`, `verify-vm`; no `-from-host` name present. - `grep -rn from-host` and `grep -rn FROM_HOST` over the worktree: no matches.
The host-side VM rebuild command becomes rebuild-vm. The script and its
test file move, and every in-repo reference follows: the flake check's
script list, test invocation and installed-binary assertion, the usage
line, the operator hints printed by vm-ssh-host-key, bootstrap-vm.sh and
bootstrap-vm-from-host.sh, the deployFlake option description, and the
provisioning-scripts doc. Script behavior is unchanged.

Refs allod/nexus#66
provision-vm-from-host becomes provision-vm, verify-vm-from-host becomes
verify-vm, and bootstrap-vm-from-host.sh becomes bootstrap-vm. The guest
payload that bootstrap-vm streams over SSH moves from bootstrap-vm.sh to
bootstrap-vm-guest.sh so the one script that does not run on the host is
the one whose name says where it runs. The provision test file follows,
and its env seams BOOTSTRAP_VM_FROM_HOST and VERIFY_VM_FROM_HOST become
BOOTSTRAP_VM and VERIFY_VM.

Every in-repo reference follows: usage lines, the bootstrap-vm
self-identification line, the call sites in provision-vm and verify-vm
--repair, the hints printed by vm-ssh-host-key, the flake check's script
list, test invocations and installed-binary assertions, the package
assertion in nix/provisioning-scripts.nix, the option descriptions in
nix/configuration.nix, the call-site patterns in the tests, and the
docs. The flake check gains a test -x for the installed bin/bootstrap-vm
and the commands doc lists it. Script bodies, arguments, and environment
pointers are otherwise untouched.

Refs allod/nexus#66
vnprc approved these changes 2026-09-26 21:49:28 +01:00
vnprc merged commit 7c9f7db9dd into master 2026-09-26 21:49:35 +01:00
vnprc deleted branch agent/rename-host-scripts 2026-09-26 21:49:36 +01:00
Sign in to join this conversation.
No description provided.