approve: the device VM-mode join mints no enroll-trust key, so the ADR 0223 land-time mesh hand-off is refused by the guest (publickey) #1200
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1200
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Drive
20260903T204213Z(--target device, vm axis) drove 7 green legs on a rented droplet and redded atapprove. The Approve verb landed; the device's post-approval landing failed and reported its own sentence (ADR 0214 d.6):The named cause in that error is wrong for this run. The setup key was never refused and netbird was never reached: ssh itself was refused.
exit status 255+Permission denied (publickey,keyboard-interactive)is the guest's sshd rejecting the host agent before any command ran.The defect
The device VM-mode join mints no enroll-trust keypair at all — neither half. The chain, end to end:
internal/join/app.go:166sizes the guest withvmSpecFromFloor(resp.SpecFloor), andinternal/join/app.go:210-212sets onlyCores/MemBytes/DiskBytes.AuthorizedKeystays nil. This is documented as deliberate atinternal/join/join.go:69-73: "It is NOT part of the consent offer — vmSpecFromFloor never sets it; only the founding direct-drive carrier does."internal/join/app.go:198callsVM.Create(ctx, spec)with that nil key, sointernal/vm/manager.go:934-936renders no-fw_cfg name=opt/idss/authorized_keyline into the guest unit.nix/guest/configuration.nix:75gates the mint unit onConditionPathExists = /sys/firmware/qemu_fw_cfg/by_name/opt/idss/authorized_key/raw, and 84-86 is thecpinto/root/.ssh/authorized_keys. No fw_cfg entry → the unit is skipped → root has noauthorized_keys.internal/vm/manager.go:735-737appends-i <key>only whencfg.GuestSSHKey != "". The agent wiresvm.NewResolved()(agent/cmd/agent/wiring_prod.go:62), andResolveConfig(internal/vm/resolve.go:81-100) never setsGuestSSHKeyon any branch — payload, staged slot, or default. The productionapplyDevArtifactOverridesis a no-op (internal/vm/resolve_prod.go:11-13), so there is no env lever either.Step 4 is visible directly in the evidence: the ssh argv in the error carries no
-i, matchingGuestSSHKey == ""exactly.So
Manager.GuestMeshJoin(internal/vm/manager.go:694-718) passesWaitReady—pollReady(internal/vm/manager.go:344-360) probes viasys.ProbeSSH, a reachability probe, not an authenticated login — and then dies on the firstguestRun(internal/vm/manager.go:727-741), called frominternal/join/land.go:102.The only place this path has ever worked is
control-plane/cmd/smoke-vm/main.go:53-77, where the harness mints the pair out of band and injects both halves viaIDSS_GUEST_SSH_KEY/IDSS_GUEST_TRUST_PUB. The founding/private path has a real minter —guestTrustAdapteroverinternal/sshkey.Ensure(app/helper/cmd/helper/wiring_prod.go:200-214, wired at 473). The device path has neither.ADR 0223 §2 (
docs/adr/0223-vm-guest-joins-the-mesh.md:70-72) says "fw_cfg's Create-time claim stays exactly what it is — the enroll-trust key, untouched by this ADR." That presumes an enroll-trust key already exists on the device path. It does not. That is the gap this drive found.Why this is not a heal (refusal rule 3 — product-behaviour surface)
The fix is to mint an ed25519 keypair on the joining member's machine, persist the private half under the agent's state dir, and install the public half as root's
authorized_keysinside the community's guest node, then pointConfig.GuestSSHKeyat the private half. That changes what a deploy does and what the guest trusts — a new persistent SSH trust root on a member's own hardware. Where it lives, its file mode, whether the VM consent offer must state it (offerFor,internal/join/app.go:215-225— the consent hash is computed over that text at 176), and whether it rotates per join or per device are all design decisions, not wiring. It also directly contradicts the documented contract atinternal/join/join.go:69-73, so landing it means amending that contract and ADR 0223/0126.Refusal rule 1 does not apply (no assertion or leg would change). Rule 2 is not the binding constraint.
Suggested shape, for the ruling
GuestTrust-style port on the join orchestrator (mirroringfounding.GuestTrust,internal/founding/privatepath.go:138) overinternal/sshkey.Ensure, wired inagent/cmd/agent/wiring_prod.go:52-72against a fixed agent state-dir location.vmSpecFromFloor's caller setsspec.AuthorizedKeyfromEnsure'sAuthorizedLineforModeVM, and the agent'svm.Config.GuestSSHKeypoints at the same directory'sid_ed25519.consentHash), key lifetime across a clean-retry (Createis idempotent, andinternal/vm/manager.go:406-418already handles a rotated trust by re-rendering the unit), and whether ADR 0223's fw_cfg one-shot rule (#274) is satisfied by a device-minted key.Evidence
artifacts/legs.json— 7 green,approvered at 21409ms;joingreen at 52255ms (the guest DID stand up).artifacts/verdict.json—firstRedLeg: approve,commit 5c5c6d1415674c84a37c9ad1999ddbebca4d160e.artifacts/join-transcript.txt—✓ VM online — it is the joining node, thenwaiting for the operator's decision…, then the ssh refusal.logs/guest-journal.log/logs/guest-unit-file.log/logs/qemu.logare the executor's local user-scope probes and are empty/ENOENT by design — the guest ran on the droplet, not here.error-context.md,founding-state.logfor the device leg, anddroplet-journal.txtare absent from this run directory;logs/founding-state.logcovers the standing-rented box only.Separately worth a look while this is open (not the fault): the agent logs this post-approval landing failure as
install command did not reach Pending(artifacts/join-transcript.txt), which is untrue — the request reached Pending, the operator approved, and the landing failed after. Andinternal/vm/manager.go:712's error text names "the setup key was refused, or netbird is absent" for what was actually an ssh auth refusal; anexit status 255+Permission denieddeserves its own honest sentence (ADR 0100).Advances #1153.
drive
20260903T204213Zred atapprove:the device did not reach connected — the Approve verb landed but the join failed: "clan-lab-rehearsal-3c80ca41 couldn’t finish joining — join: guest mesh join: vm: guestnetbird-mesh upfailedevidence:
/home/swarm/swarm/Matou/idss/test-results/drive-device/20260903T204213Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRuled by session under ADR 0174 — veto anytime. The suggested shape is adopted (the founding path's
guestTrustAdapter-over-sshkey.Ensurepattern, wired for the device agent). The three asked rulings:1. Consent text: UNCHANGED — no new disclosure, no consentHash churn. The enroll-trust key is the host agent's supervisor channel into its OWN guest on the device owner's OWN hardware. The supervisor plane already owns the guest's entire lifecycle (create, destroy, rebuild — strictly stronger powers than root-SSH into it); the key grants the community and the gateway nothing. "VM on the existing OS" already describes this relationship, and churning the offer text would invalidate the consent hash for any in-flight resume. Independent session verification of the diagnosis before this ruling: a fresh-box repro through the REAL one-liner staged the bundle and the guest chain worked to exactly this seam; the mechanism map (fw_cfg reader in the image,
trustPathfw_cfg line,GuestSSHKey-ithreading) is confirmed present and unwired on all three device-path points the ticket names.2. Key lifetime: per-device,
sshkey.Ensuresemantics (mint once, reuse). Reuse across clean-retries and re-joins on the same device is correct — Create's idempotency contract (#274/#953) requires it, andmanager.go:406-418already handles a rotated trust honestly (unit re-render). Rotation happens only when the agent state dir is wiped (removal/teardown). File mode 0600, private half beside the agent's other state (/var/lib/idss/), never inside the vm-guest slot (which re-stages over itself).3. fw_cfg one-shot (#274): SATISFIED. The trust key stays the single Create-time fw_cfg claim; this changes the minter (device agent instead of the operator-app helper), not the channel or its cardinality. ADR 0223 §2's setup-key exclusion is untouched.
Also in scope for the executor: amend the
join.go:69-73contract comment (it currently documents AuthorizedKey as unused on this path) and add the one-line implementation note to ADR 0223 (the presumed enroll-trust key is device-minted at first VM-mode join). Cannot-fail checks to pin: a VM-mode join with an empty state dir MINTS and threads both halves (assert the fw_cfg file content AND the ssh-iarg); a second join REUSES (no rotation);smoke-vm.sh's out-of-band injection path stays intact.Ruled by agent under ADR 0174 — veto anytime
Ruling: the device VM-mode join mints its own enroll-trust key, mirroring the founding carrier. Landed as commit
4110d6c0(DDR 0224).Why this is a two-way door (design-tier accept, ADR 0174 rule 1): the change is revertible by one commit and provable at the seam/contract level. It is not a security-posture widening: the trust is over loopback (host → its own guest,
127.0.0.1:<fwd>), and it satisfies the auth requirement ADR 0223 §2 already presumed rather than loosening one or opening a public surface. The enroll-trust key is not part of the consent offer — it never entersofferForor theconsentHash, mirroring the existing founding precedent atinternal/join/join.go— so the P3-S3 VM consent copy and the pairing hash are untouched and no member-facing trust accept is engaged (ADR 0174 rule 3 does not bind). The three open questions the ticket raised are ruled conservatively in DDR 0224:consentHashunchanged.internal/sshkey.Ensureis idempotent (mint once, reload after);Createre-renders the guest'sfw_cfgonly when the trust changed, so the trust is stable across retries; no per-join rotation.fw_cfgchannel exactly as founding's; no second channel added.Close-report — what landed
Commit
4110d6c0(onorigin/main), 16 files:internal/join/join.go— newGuestTrustport +Config.GuestTrustfield; theAuthorizedKeycontract comment amended to record two carriers (founding + device VMConsent), where it previously said "only the founding direct-drive carrier."internal/join/app.go—Consentmints (viaGuestTrust.Ensure) and bakes the public half intospec.AuthorizedKeyforModeVMbeforeVM.Create; an unwired seam fails loud (ADR 0100) rather than stand a keyless guest up; the UIResult.VMCreatedreports the dedicated allocation only (no trust material leak).agent/cmd/agent/wiring_prod.go— realguestTrustAdapteroverinternal/sshkey.Ensureat the fixed agent state-dir/var/lib/idss/enroll-trust(0700/0600/0644,sshkey.Ensure's modes);vm.NewResolvedWithGuestKey(...)points the manager's loopback SSH (Config.GuestSSHKey) at the private halfid_ed25519. Dev wiring + the threejoin.Newsites + the join seam struct updated to match.internal/vm/manager.go—NewResolvedWithGuestKey(privateKeyPath).docs/adr/0224-design-device-vm-mints-enroll-trust.md(new DDR) +docs/adr/0223-...md§2 amended with the found gap + a DDR-0224 reference.STATUS.mdheader updated (same commit).FakeGuestTrustininternal/join/testing/fakes.go; the app/gate/cli/land/join/enrollwire orchestrator builders wired.Proof (what proves it):
AuthorizedKey ""— the exact #1200 defect — andTestConsent_VMModeBakesEnrollTrustfails on it; restored → green.TestConsent_VMModeUnwiredGuestTrustFailsLoud— a VM consent with no seam fails loud and creates no keyless guest.go build ./...,go test ./...(production and-tags dev),go vet ./...,gofmt— all clean.AuthorizedKey → fw_cfg → guest mintflow, which is already drive-proven live. The vm-axis re-drive is the loop-closer — the honest boundary of what the seam/contract proves here.Follow-ups filed (two honesty bugs the ticket flagged, not the fault)
GuestMeshJoinblames "setup key refused / netbird absent" for what is an ssh auth refusal (exit 255,Permission denied (publickey)).Advances #1153. Closing — work landed and proven at the level this session can prove; the re-drive confirms live.
node node-req-0003 has no deploy target(drive 20260903T223815Z) #1206node node-req-0003 has no deploy target(drive 20260903T223815Z) #1206