rehearsal: scope the systemctl preflight gate (and guest teardown) to local-guest — the droplet target must not require a user bus #379

Closed
opened 2026-08-10 00:45:56 +00:00 by ben · 1 comment
Owner

Part of the #183 rehearsal ratchet. Follow-on from #377's clean negative: the droplet target (--target droplet, 6829b21) was built to shed the local-guest substrate requirements, and mostly does — the /dev/kvm gate is scoped to local-guest (scripts/smoke-private-path.sh:113-115), the memory floor drops to 2048 MiB for droplet (line 137), and the payload demand shrinks to control-plane + dashboard (line 210). But one gate is over-broad:

  • scripts/smoke-private-path.sh:117 — command -v systemctl || die_host "...the guest runs under the operator's user systemd (ADR 0129)" fires for EVERY target. The own-VPS journey never stands up ourcloud-guest.service; its guest is the droplet. On the Sandcastle substrate (PID1=sleep, no systemd — #377 comment host facts) this is an immediate refusal even though the droplet drive-stack needs nothing from systemd.
  • oc_teardown_guest (lines 90-108) likewise calls systemctl --user — hygiene that only matters on hosts that ran local-guest drives.

What to do

  1. Scope the systemctl hard gate to [[ "$target" == "local-guest" ]], same shape as the kvm gate.
  2. Scope the oc_teardown_guest call (or its body) to local-guest.
  3. VERIFY the assumption first: confirm the app's own-VPS wizard path never touches the user bus (no systemctl --user / guest-unit codepath reachable from the own-VPS branch in app/tests/e2e/journey.droplet.spec.ts + the manager). If it does, this ticket's premise is wrong — say so on the ticket instead of landing it.
  4. Local-guest behaviour must be byte-identical (--target local-guest --dry-run output unchanged — the Task-6 seam's own invariant).

Acceptance

  • scripts/smoke-private-path.sh --target droplet --dry-run passes in an environment WITHOUT systemctl (e.g. the Sandcastle container), given the droplet prerequisites (doctl/token, broker URL, 2-artifact payload).
  • --target local-guest preflight refusals unchanged (kvm, systemctl, 6144 floor, 5-artifact payload).

Evidence trail: #377 comment 5152 (substrate host facts), #378 comment 5188 (Tasks 5+6 landing).

Part of the #183 rehearsal ratchet. Follow-on from #377's clean negative: the droplet target (`--target droplet`, `6829b21`) was built to shed the local-guest substrate requirements, and mostly does — the `/dev/kvm` gate is scoped to local-guest (`scripts/smoke-private-path.sh:113-115`), the memory floor drops to 2048 MiB for droplet (line 137), and the payload demand shrinks to `control-plane` + `dashboard` (line 210). But one gate is over-broad: - `scripts/smoke-private-path.sh:117` — `command -v systemctl || die_host "...the guest runs under the operator's user systemd (ADR 0129)"` fires for EVERY target. The own-VPS journey never stands up `ourcloud-guest.service`; its guest is the droplet. On the Sandcastle substrate (PID1=`sleep`, no systemd — #377 comment host facts) this is an immediate refusal even though the droplet drive-stack needs nothing from systemd. - `oc_teardown_guest` (lines 90-108) likewise calls `systemctl --user` — hygiene that only matters on hosts that ran local-guest drives. ## What to do 1. Scope the `systemctl` hard gate to `[[ "$target" == "local-guest" ]]`, same shape as the kvm gate. 2. Scope the `oc_teardown_guest` call (or its body) to local-guest. 3. VERIFY the assumption first: confirm the app's own-VPS wizard path never touches the user bus (no `systemctl --user` / guest-unit codepath reachable from the own-VPS branch in `app/tests/e2e/journey.droplet.spec.ts` + the manager). If it does, this ticket's premise is wrong — say so on the ticket instead of landing it. 4. Local-guest behaviour must be byte-identical (`--target local-guest --dry-run` output unchanged — the Task-6 seam's own invariant). ## Acceptance - `scripts/smoke-private-path.sh --target droplet --dry-run` passes in an environment WITHOUT `systemctl` (e.g. the Sandcastle container), given the droplet prerequisites (doctl/token, broker URL, 2-artifact payload). - `--target local-guest` preflight refusals unchanged (kvm, systemctl, 6144 floor, 5-artifact payload). Evidence trail: #377 comment 5152 (substrate host facts), #378 comment 5188 (Tasks 5+6 landing).
Author
Owner

Landed in c1c1073 (on origin/main).

What changed: scripts/smoke-private-path.sh:117 — the command -v systemctl hard gate is now scoped to [[ "$target" == "local-guest" ]], same shape as the /dev/kvm gate directly above it. The local-guest check order stays byte-identical (kvm → nix → systemctl — the Task-6 seam invariant): nix remains an all-target gate between them, only systemctl moved inside a local-guest guard.

Step 2 (oc_teardown_guest): its call was already local-guest-scoped as of 6829b21 (if [[ "$target" == "local-guest" ]]; then oc_teardown_guest; fi), so its systemctl --user body only runs on that path. No change needed there.

Premise VERIFIED (step 3): the app's own-VPS wizard branch (s4AccessOwnVPS → install-own-vps in journey.droplet.spec.ts) emits an install command that runs ON the VPS over ssh and never touches the user bus. The guest-unit codepath (Manager.Create laying ourcloud-guest.service) is the local-guest path's alone — grep for systemctl/--user/guest.service across app/src finds no wizard/manager own-VPS user-bus reach. The only app-side systemctl --user calls are best-effort evidence collectors (app/tests/e2e/fixtures/evidence.ts, afterAll, failure-tolerant). Premise holds.

Proven both directions on this systemd-less host (no systemctl on PATH — the exact Sandcastle substrate #377 named):

  • Before: --target droplet --dry-run → PREFLIGHT: systemctl not found … (exit 3).
  • After: --target droplet --dry-run clears the systemctl gate and dies later at PREFLIGHT: the electron binary is not installed … — electron is a droplet drive-stack prerequisite, out of scope here (acceptance says "given the droplet prerequisites"). The systemctl refusal is gone.
  • --target local-guest --dry-run keeps its refusal (no /dev/kvm fires first here; kvm→nix→systemctl order unchanged).

bash -n clean; no new shellcheck findings (the two pre-existing SC2034/SC1091 on lines 52/64 are untouched). STATUS.md carries a milestone-log entry + date bump.

Landed in `c1c1073` (on `origin/main`). **What changed:** `scripts/smoke-private-path.sh:117` — the `command -v systemctl` hard gate is now scoped to `[[ "$target" == "local-guest" ]]`, same shape as the `/dev/kvm` gate directly above it. The local-guest check order stays byte-identical (kvm → nix → systemctl — the Task-6 seam invariant): `nix` remains an all-target gate between them, only `systemctl` moved inside a local-guest guard. **Step 2 (oc_teardown_guest):** its call was already `local-guest`-scoped as of `6829b21` (`if [[ "$target" == "local-guest" ]]; then oc_teardown_guest; fi`), so its `systemctl --user` body only runs on that path. No change needed there. **Premise VERIFIED (step 3):** the app's own-VPS wizard branch (`s4AccessOwnVPS` → `install-own-vps` in `journey.droplet.spec.ts`) emits an install command that runs ON the VPS over ssh and never touches the user bus. The guest-unit codepath (`Manager.Create` laying `ourcloud-guest.service`) is the local-guest path's alone — `grep` for `systemctl`/`--user`/`guest.service` across `app/src` finds no wizard/manager own-VPS user-bus reach. The only app-side `systemctl --user` calls are best-effort evidence collectors (`app/tests/e2e/fixtures/evidence.ts`, `afterAll`, failure-tolerant). Premise holds. **Proven both directions on this systemd-less host (no `systemctl` on PATH — the exact Sandcastle substrate #377 named):** - Before: `--target droplet --dry-run` → `PREFLIGHT: systemctl not found …` (exit 3). - After: `--target droplet --dry-run` clears the systemctl gate and dies later at `PREFLIGHT: the electron binary is not installed …` — electron is a droplet drive-stack prerequisite, out of scope here (acceptance says "given the droplet prerequisites"). The systemctl refusal is gone. - `--target local-guest --dry-run` keeps its refusal (`no /dev/kvm` fires first here; kvm→nix→systemctl order unchanged). `bash -n` clean; no new shellcheck findings (the two pre-existing SC2034/SC1091 on lines 52/64 are untouched). STATUS.md carries a milestone-log entry + date bump.
ben closed this issue 2026-08-10 00:51:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#379
No description provided.