rebuild-vm never runs the guest bootstrap, so repos added after provisioning are never cloned #71

Closed
opened 2026-10-01 14:53:26 +01:00 by allod-agent · 2 comments
Member

rebuild-vm never runs the guest bootstrap, so a repo added to a machine's definition after provisioning is never cloned on that machine.

Evidence (allod-dev, 2026-10-01): the private memory fork agent-memory was wired into the machine's config, and a rebuild-vm switch re-pointed the Claude memory symlink to ~/work/agent-memory — but no clone happened, leaving a dangling link and failing memory reads on every agent session. scripts/bootstrap-vm-guest.sh already renders clone_or_pull / git_clone_or_pull (clone if missing, pull if present), but its only caller is scripts/provision-vm; scripts/rebuild-vm is a bare nixos-rebuild switch with no bootstrap step, so the clone-if-missing capability is unreachable outside first provisioning.

Primary goals:

  • A rebuild completes the machine's declared repos — after rebuild-vm, every repo in the machine's repos list exists at its declared checkout path, cloned if it was missing.
  • No behavior change for present repos — a checkout that already exists is at worst pulled, matching the bootstrap's existing clone-or-pull contract; a clean, up-to-date checkout is untouched.

Current state and specifics

rebuild-vm resolves the machine's facts and runs nixos-rebuild switch against the target host; it never invokes the guest bootstrap, and nothing else re-runs the clone calls after provisioning. The gap is invisible at eval time because the activation asserts in allod/archetypes modules/ai-agents.nix check registry and repos consistency, not on-disk state.

Scope

In scope: teaching rebuild-vm (or a step it invokes) to run the same clone calls the bootstrap renders, for repos missing on the target. Out of scope: changing what the bootstrap clones, provisioning flow, and any eval-time behavior. Related but separate: the activation-level loud failure on a missing memory checkout is filed in allod/archetypes; this issue is the provisioning-side fix that removes the cause.

Issue: allod/archetypes#127.

`rebuild-vm` never runs the guest bootstrap, so a repo added to a machine's definition after provisioning is never cloned on that machine. Evidence (allod-dev, 2026-10-01): the private memory fork `agent-memory` was wired into the machine's config, and a `rebuild-vm` switch re-pointed the Claude memory symlink to `~/work/agent-memory` — but no clone happened, leaving a dangling link and failing memory reads on every agent session. `scripts/bootstrap-vm-guest.sh` already renders `clone_or_pull` / `git_clone_or_pull` (clone if missing, pull if present), but its only caller is `scripts/provision-vm`; `scripts/rebuild-vm` is a bare `nixos-rebuild switch` with no bootstrap step, so the clone-if-missing capability is unreachable outside first provisioning. Primary goals: - **A rebuild completes the machine's declared repos** — after `rebuild-vm`, every repo in the machine's `repos` list exists at its declared checkout path, cloned if it was missing. - **No behavior change for present repos** — a checkout that already exists is at worst pulled, matching the bootstrap's existing clone-or-pull contract; a clean, up-to-date checkout is untouched. ### Current state and specifics `rebuild-vm` resolves the machine's facts and runs `nixos-rebuild switch` against the target host; it never invokes the guest bootstrap, and nothing else re-runs the clone calls after provisioning. The gap is invisible at eval time because the activation asserts in `allod/archetypes` `modules/ai-agents.nix` check registry and `repos` consistency, not on-disk state. ### Scope In scope: teaching `rebuild-vm` (or a step it invokes) to run the same clone calls the bootstrap renders, for repos missing on the target. Out of scope: changing what the bootstrap clones, provisioning flow, and any eval-time behavior. Related but separate: the activation-level loud failure on a missing memory checkout is filed in allod/archetypes; this issue is the provisioning-side fix that removes the cause. Issue: allod/archetypes#127.

Two corrections from checking this against the scripts, and one scoping note.

Clone-if-missing is already reachable after provisioning. verify-vm <vm> runs lib/vm-health-check.sh, which fails when any checkout the machine declares is missing on disk, and verify-vm --repair <vm> reruns the idempotent bootstrap-vm and verifies again (docs/vm-provisioning-test-plan.md). So the gap is narrower than stated: rebuild-vm does not run the verifier after its switch, and nothing prompted a hand run after today's rebuild. verify-vm allod-dev would have reported the missing checkout.

There is a second cause on this machine, and --repair would not have fixed it. bootstrap-vm-guest.sh resolves a registry remote that carries no owner against the VM's own forge user (repo_path="${FORGE_USER}/${repo}"). allod-dev's forge user is not the owner of the memory fork, so the fork's owner-less registry entry clones from the wrong owner, the clone fails, and under set -e the bootstrap stops there. A fresh provision of allod-dev fails the same way today. The fix is deployment-side, in the private registry: an owner-qualified remote, the shape this machine's traces repo entry already uses. It is being prepared there now.

Scope. Having rebuild-vm run the clone calls works against the issue's second goal: the bootstrap's clone_or_pull runs git pull on every checkout that exists, and on a dev VM where several agents work a pull into a dirty tree or a non-default branch fails or merges under an agent, after which set -e abandons the rest of the list. The smaller change that meets the need: rebuild-vm runs verify-vm after the switch, so the rebuild that advertises a new repo also reports it missing, and repair stays the explicit verify-vm --repair. If a rebuild should also clone, the bootstrap needs a clone-only-missing mode first.

Two corrections from checking this against the scripts, and one scoping note. **Clone-if-missing is already reachable after provisioning.** `verify-vm <vm>` runs `lib/vm-health-check.sh`, which fails when any checkout the machine declares is missing on disk, and `verify-vm --repair <vm>` reruns the idempotent `bootstrap-vm` and verifies again (`docs/vm-provisioning-test-plan.md`). So the gap is narrower than stated: `rebuild-vm` does not run the verifier after its switch, and nothing prompted a hand run after today's rebuild. `verify-vm allod-dev` would have reported the missing checkout. **There is a second cause on this machine, and `--repair` would not have fixed it.** `bootstrap-vm-guest.sh` resolves a registry remote that carries no owner against the VM's own forge user (`repo_path="${FORGE_USER}/${repo}"`). allod-dev's forge user is not the owner of the memory fork, so the fork's owner-less registry entry clones from the wrong owner, the clone fails, and under `set -e` the bootstrap stops there. A fresh provision of allod-dev fails the same way today. The fix is deployment-side, in the private registry: an owner-qualified remote, the shape this machine's traces repo entry already uses. It is being prepared there now. **Scope.** Having `rebuild-vm` run the clone calls works against the issue's second goal: the bootstrap's `clone_or_pull` runs `git pull` on every checkout that exists, and on a dev VM where several agents work a pull into a dirty tree or a non-default branch fails or merges under an agent, after which `set -e` abandons the rest of the list. The smaller change that meets the need: `rebuild-vm` runs `verify-vm` after the switch, so the rebuild that advertises a new repo also reports it missing, and repair stays the explicit `verify-vm --repair`. If a rebuild should also clone, the bootstrap needs a clone-only-missing mode first.

Correction to my comment above: the owner-qualified remote does not fix allod-dev, and neither would verify-vm --repair. This machine's forge identity is denied read access to the private memory fork by design, so no clone that runs on the guest with the guest's key can succeed, and with the repo in its repos list the bootstrap dies at that clone under set -e, which also makes the machine unprovisionable today. The fix is host-side injection and refresh from the hypervisor's own checkout: allod/strategy#62, with the bootstrap-vm work filed as its nexus child. The scoping point stands: this issue's smaller change is rebuild-vm running verify-vm after the switch.

Correction to my comment above: the owner-qualified remote does not fix allod-dev, and neither would `verify-vm --repair`. This machine's forge identity is denied read access to the private memory fork by design, so no clone that runs on the guest with the guest's key can succeed, and with the repo in its `repos` list the bootstrap dies at that clone under `set -e`, which also makes the machine unprovisionable today. The fix is host-side injection and refresh from the hypervisor's own checkout: allod/strategy#62, with the `bootstrap-vm` work filed as its nexus child. The scoping point stands: this issue's smaller change is `rebuild-vm` running `verify-vm` after the switch.
vnprc closed this issue 2026-10-01 21:00:08 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
allod/nexus#71
No description provided.