deploy-takeover: the TAKEOVER LANDED (device verifiably NixOS) — the red is the phases assertion, which reads a journal a wiped-and-reborn box cannot carry; the evidence lives on the gateway #1109

Closed
opened 2026-09-01 08:08:13 +00:00 by ben · 2 comments
Owner

The good news first: the takeover LANDED

Drive 20260901T064809Z — the first carrying #1105 — is the first in the arc where the takeover is positively proven. waitForDeviceNixOS (#1099's relay, now reachable) polled the device through the gateway and passed: the box is genuinely NixOS.

Verified independently from this session, dialling the device through the gateway exactly as the harness does:

DEVICE_OK
IS_NIXOS
ANSI_COLOR="0;38;2;126;186;228"        # NixOS os-release

The leg then red on the assertion after it:

the device journal carries no takeover phases — the erase did not run on the box

That conclusion is false. The erase ran; the box is NixOS.

Why the assertion cannot ever pass

journey.device.spec.ts (deploy-takeover leg):

const journal = await sshDeviceViaGatewayStdout(
  gwIp, gwIdentity, ip, 'journalctl -b --no-pager | grep -c "takeover" || true', 60_000);
if ((Number(journal.trim()) || 0) < 1) throw new Error('the device journal carries no takeover phases …');

Read off the live device:

$ journalctl --list-boots
IDX BOOT ID                          FIRST ENTRY                 LAST ENTRY
  0 f41a6d1690f34b0e…                Tue 2026-09-01 08:03:40 UTC Tue 2026-09-01 08:07:03 UTC

$ journalctl -b       --no-pager | grep -ci takeover   -> 0
$ journalctl          --no-pager | grep -ci takeover   -> 0     # ALL boots, not just this one

Exactly one boot exists — the installed system's first. There is no earlier boot to find, and widening -b to -b -1 or to all boots would not help: the count is 0 everywhere.

The reason is structural. The kexec installer runs from RAM, and the takeover then wipes and re-partitions the disk. Nothing the installer logged is written to a journal that survives onto the new filesystem. A successfully taken-over device is by construction a box with no memory of its own takeover.

Where the evidence actually lives: the gateway

The takeover is driven by clan from the gateway's control plane, and the gateway journals it. On this same run:

$ ssh root@<gateway> 'journalctl --no-pager | grep -ci takeover'   -> 2
Sep 01 07:49:39 … idss-control-plane-start: "fleetwire: the warm kexec-installer-base closure is already in thi…"
Sep 01 08:00:26 … idss-control-plane-start: level=WARN "clan: takeover of node-req-0003: the deploy target root@100.77.38.…"

(The same place drive 20260901T030011Z's #1013 reap line was found.)

Fix

Assert the takeover phases from the gateway's journal, where they are actually written — the relay's outer hop already has that session, so it costs nothing extra:

journalctl --no-pager | grep -c 'takeover of <node-id>'

keyed on the run's own node id (node-req-0003 here) so it cannot be satisfied by a previous drive's line on an adopted standing gateway — an important guard, since the gateway persists across drives while the device does not.

Alternatively drop the check: waitForDeviceNixOS already proves the landing positively and from the box's own state, which is the stronger evidence. My preference is to keep a phases assertion but move it to the gateway and key it on the node id — it distinguishes "the box is NixOS because we took it over" from "the box is NixOS somehow", and it is the assertion that would catch a takeover that silently skipped phases.

Please also keep the failure sentence honest: the current wording states a conclusion ("the erase did not run on the box") that this run proves false. Name what was and was not observed instead.

Acceptance

  • A green takeover passes the phases assertion by reading the GATEWAY journal for this run's node id.
  • A takeover whose phases genuinely did not run reds — provable by pointing the assertion at a node id that never ran.
  • A previous drive's takeover lines on an adopted standing gateway do NOT satisfy this run's assertion.
  • The device-side proof stays as-is (waitForDeviceNixOS through the relay) — it works and is now arc-proven.

Filed by the watching session (ADR 0174) — evidence gathered live off both boxes before teardown; no code change from me, the leg's assertion set is the worker's to reshape.

Arc note: this is the fifth consecutive defect of the same family in this leg (#740/#871/#1096+#1100/#1105/this) — a check that reports a confident conclusion it has no way to observe. The takeover itself has now been correct for at least two drives; what has been red is our ability to ask it the right question.

## The good news first: the takeover LANDED Drive `20260901T064809Z` — the first carrying #1105 — is the first in the arc where the takeover is **positively proven**. `waitForDeviceNixOS` (#1099's relay, now reachable) polled the device through the gateway and **passed**: the box is genuinely NixOS. Verified independently from this session, dialling the device through the gateway exactly as the harness does: ``` DEVICE_OK IS_NIXOS ANSI_COLOR="0;38;2;126;186;228" # NixOS os-release ``` The leg then red on the assertion *after* it: ``` the device journal carries no takeover phases — the erase did not run on the box ``` That conclusion is false. The erase ran; the box is NixOS. ## Why the assertion cannot ever pass `journey.device.spec.ts` (deploy-takeover leg): ```ts const journal = await sshDeviceViaGatewayStdout( gwIp, gwIdentity, ip, 'journalctl -b --no-pager | grep -c "takeover" || true', 60_000); if ((Number(journal.trim()) || 0) < 1) throw new Error('the device journal carries no takeover phases …'); ``` Read off the live device: ``` $ journalctl --list-boots IDX BOOT ID FIRST ENTRY LAST ENTRY 0 f41a6d1690f34b0e… Tue 2026-09-01 08:03:40 UTC Tue 2026-09-01 08:07:03 UTC $ journalctl -b --no-pager | grep -ci takeover -> 0 $ journalctl --no-pager | grep -ci takeover -> 0 # ALL boots, not just this one ``` **Exactly one boot exists** — the installed system's first. There is no earlier boot to find, and widening `-b` to `-b -1` or to all boots would not help: the count is 0 everywhere. The reason is structural. The kexec installer runs **from RAM**, and the takeover then wipes and re-partitions the disk. Nothing the installer logged is written to a journal that survives onto the new filesystem. A successfully taken-over device is *by construction* a box with no memory of its own takeover. ## Where the evidence actually lives: the gateway The takeover is driven by clan **from the gateway's control plane**, and the gateway journals it. On this same run: ``` $ ssh root@<gateway> 'journalctl --no-pager | grep -ci takeover' -> 2 Sep 01 07:49:39 … idss-control-plane-start: "fleetwire: the warm kexec-installer-base closure is already in thi…" Sep 01 08:00:26 … idss-control-plane-start: level=WARN "clan: takeover of node-req-0003: the deploy target root@100.77.38.…" ``` (The same place drive `20260901T030011Z`'s `#1013` reap line was found.) ## Fix Assert the takeover phases **from the gateway's journal**, where they are actually written — the relay's outer hop already has that session, so it costs nothing extra: ``` journalctl --no-pager | grep -c 'takeover of <node-id>' ``` keyed on the run's own node id (`node-req-0003` here) so it cannot be satisfied by a previous drive's line on an adopted standing gateway — an important guard, since the gateway persists across drives while the device does not. Alternatively drop the check: `waitForDeviceNixOS` already proves the landing *positively* and from the box's own state, which is the stronger evidence. My preference is to keep a phases assertion but move it to the gateway and key it on the node id — it distinguishes "the box is NixOS because we took it over" from "the box is NixOS somehow", and it is the assertion that would catch a takeover that silently skipped phases. Please also keep the failure sentence honest: the current wording states a conclusion ("the erase did not run on the box") that this run proves false. Name what was and was not observed instead. ## Acceptance - A green takeover passes the phases assertion by reading the GATEWAY journal for this run's node id. - A takeover whose phases genuinely did not run reds — provable by pointing the assertion at a node id that never ran. - A previous drive's takeover lines on an adopted standing gateway do NOT satisfy this run's assertion. - The device-side proof stays as-is (`waitForDeviceNixOS` through the relay) — it works and is now arc-proven. Filed by the watching session (ADR 0174) — evidence gathered live off both boxes before teardown; no code change from me, the leg's assertion set is the worker's to reshape. **Arc note:** this is the fifth consecutive defect of the same family in this leg (#740/#871/#1096+#1100/#1105/this) — a check that reports a confident conclusion it has no way to observe. The takeover itself has now been correct for at least two drives; what has been red is our ability to ask it the right question.

swarm-claim host=elitebook-distributed-server-03 run=15727
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=15727 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

Superseded by #1110, fixed in 4a27f34e — closing. Same red, same root cause, and #1110's fix is better than the one I proposed here. Worth saying why, since the difference is a general lesson.

I proposed asserting the takeover phases from the gateway's journal (keyed on the run's node id). #1110 instead reads the device's own /proc/cmdline for init=/nix/store/…-nixos-system-node-req-<id>/init.

That is the stronger evidence in two ways:

  1. It proves the artifact, not the actor. The gateway journal proves the gateway tried to take the box over; /proc/cmdline proves the box is now running this clan node's own NixOS system. When those two can disagree, the second is the one the leg exists to establish — and it is exactly the disagreement a silently-skipped phase would produce.
  2. It is strictly stronger than the /etc/NIXOS gate that waitForDeviceNixOS already passes: it distinguishes "the box is some NixOS" from "the box is node-req-N's NixOS". My gateway-side check would not have caught a box that came up as the wrong node's system.

It also has none of the guard my version needed (keying on node id so a prior drive's line on the adopted standing gateway cannot satisfy it) — the device cannot carry another run's /proc/cmdline, so the guard is structural rather than remembered.

#1110 also caught the negative twin in the same pass, which I had not looked for: the rented VMMode deploy leg asserting grep -c -E "kexec|disko" == "0" was vacuous on a box that never rebooted, and now stamps boot_id at image-boot and re-reads it at deploy. Same family, opposite polarity — an assertion that could only ever pass. Good catch.

For the record, the finding this ticket carried stands and is confirmed by #1110's own commit message: the takeover LANDED on drive 20260901T064809Z (device verifiably NixOS through the relay, journalctl --list-boots showing a single boot and grep -ci takeover = 0 across all of them). The box succeeded; only the question we asked it was wrong.

GOTCHAS #151 now records the hazard class (boot-scoped proof), which is the durable part.

Superseded by #1110, fixed in `4a27f34e` — closing. Same red, same root cause, and **#1110's fix is better than the one I proposed here.** Worth saying why, since the difference is a general lesson. I proposed asserting the takeover phases from the **gateway's** journal (keyed on the run's node id). #1110 instead reads the device's own `/proc/cmdline` for `init=/nix/store/…-nixos-system-node-req-<id>/init`. That is the stronger evidence in two ways: 1. **It proves the artifact, not the actor.** The gateway journal proves *the gateway tried to take the box over*; `/proc/cmdline` proves *the box is now running this clan node's own NixOS system*. When those two can disagree, the second is the one the leg exists to establish — and it is exactly the disagreement a silently-skipped phase would produce. 2. **It is strictly stronger than the `/etc/NIXOS` gate** that `waitForDeviceNixOS` already passes: it distinguishes "the box is *some* NixOS" from "the box is *node-req-N*'s NixOS". My gateway-side check would not have caught a box that came up as the wrong node's system. It also has none of the guard my version needed (keying on node id so a prior drive's line on the adopted standing gateway cannot satisfy it) — the device cannot carry another run's `/proc/cmdline`, so the guard is structural rather than remembered. #1110 also caught the **negative twin** in the same pass, which I had not looked for: the rented VMMode `deploy` leg asserting `grep -c -E "kexec|disko" == "0"` was vacuous on a box that never rebooted, and now stamps `boot_id` at image-boot and re-reads it at deploy. Same family, opposite polarity — an assertion that could only ever pass. Good catch. For the record, the finding this ticket carried stands and is confirmed by #1110's own commit message: **the takeover LANDED** on drive `20260901T064809Z` (device verifiably NixOS through the relay, `journalctl --list-boots` showing a single boot and `grep -ci takeover` = 0 across all of them). The box succeeded; only the question we asked it was wrong. GOTCHAS #151 now records the hazard class (boot-scoped proof), which is the durable part.
ben closed this issue 2026-09-01 08:25:45 +00: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
Matou/idss#1109
No description provided.