Add host: passwordless sudo as a user never offers root, or upgrades silently? (D139) #398
Open
opened 2026-11-06 12:47:59 +00:00 by kayg
·
14 comments
No Branch/Tag specified
main
mesh-compat-382
j444b-d381-key-wins-flood
j470b-server-mesh-rejoin
j461b-macos-utun-reader-thread
j475b-remove-host-motion
fix-reconnect-new-link
j481-d380
dev
j479-mesh-soak
fix/j476-host-facts
j475-motion-pill-split
j470-mac-node-join
root-upgrade-d376
j474-review-merge
latency-targets-120hz
nightly-suite-shards
gotatun-pin-j469
macos-utun-reader-thread
fix-flood-echo-stall
wip/j416
motion-fast-ease-out
mesh-addhost-j259
takeover-close-terminals-d368
kbd-instant-followups
fix-trust-key-double-click
nightly-suite-partial-report
appwin-icons-j207
rusqlite-slice1
swipe-content-first-d374
mesh-mtu-381
addhost-instant-open
glass-contrast-d365-mock
glass-contrast-d365
signout-followups-442
fix-startup-toast-red
research-gotatun-matrix-j317
themes-sync-j304
fix-load-flakes
fix-nix-zig-patch
fix-compute01-browser-baseline
ratchet-size-baseline-419
predict-auto-d130
revoke-coverage-d367
nightly-suite-queue-timeout
nightly-browser-suite
fix-rustsec-2026-0459
fonts-ioskeley-obel
log-retention-d375
fix-kbd-no-anim-427
fix-dev-red-specs-2
takeover-proof-305-j205
wip/j410-server-pump
ui-consistency-d372
fix-osc52-clipboard
libghostty-vt-1.0
forget-retired-host-d369
j404-merge-426
fix-setup-lock-race
fix-touch-select-426
revoke-access-report-ui
fix-predictive-echo-specs
fix-selinux-agent-exec
wip/j395-checkpoint2
wip/j395
j391-review-scratch
ui-consistency-j195-deferred-rebased
fix-rustc-paths-421
decisions-wording-341
fix-install-suite-red
fix-dev-rtt-specs
fix-pending-removal-align
fix-privileged-skip
fix-install-suite-404
review-j368
mesh-dns-j254
revoke-access-report-d356b
revoke-privilege-round5
fix-removal-confirm
review-j360
gotatun-rotation-367
deps-refresh-340
review-j354
review-J351
review-j350
addhost-takeover-d359
revoke-report-items-347
revoke-end-sessions-d362
review-j348
size-mesh-ssh-346
size-trim-337
revoke-access-diff-d356
j259-pre-rebase-b06c5a6
j305-ended-at-start-spec
addhost-sudo-consent
fix-layout-real-specs-411
fix-shell-open-411
fix-console-hosts-373
fix-shell-exit
fuzz-host-name-353
fix-host-details-410
macos-filter-j197
research-gotatun-tricks
revoke-p3-j216l
stale-state-pill
revoke-followups-j216k
revoke-progress-j216e
backup/macos01-20261106/lume/j197
backup/macos01-20261106/lume/appwin-icons-j207-stash0
backup/macos01-20261106/claude/stash-0
backup/macos01-20261106/claude/stash-1
backup/macos01-20261106/claude/J80-macos-s1
backup/macos01-20261106/claude/J80
backup/macos01-20261106/claude/J80-slice1-20261102
backup/macos01-20261106/claude/J16b-appwin-on-dev
backup/macos01-20261106/claude/appwin-launch-idle-146
backup/macos01-20261106/claude/J80-s1-run
wip/j259
trust-285-p3c
runtime-lock-j216f
mesh-ssh-p3-j175
tun-proof-p3b
trust-285-p3
terminal-polish-j271
tun-proof-p3
ssh-install-flakes-j216i
fuzz-fixes-j264
trust-285-a
trust-285-b
restart-oversized-fixture-j198
backup/macos01-20261106/lume/appwin-icons-j207
restart-bound-j216h
up-preflight-p3-j198
backup/macos01-20261106/lume/j251
up-preflight-j198
wip/up-preflight-j198-j245-p2
wip/up-preflight-j198-j245-p1
agent-fsync-offloop-j196
wip/up-preflight-j198-j245
settings-offscreen-j231
wip/up-preflight-j198-j226-inspection
wip/j103f
themes-j206
wip/up-preflight-j198-j226
flakes-j216c
backup/macos01-20261106/claude/j197
flakes-j216b
backup/macos01-20261106/claude/j197-red
wip/up-preflight-j198-review
flakes-j216
backup/macos01-20261106/claude/appwin-icons-j207
engineering-j208b
appwin-mock-j209
toast-stack-j165
engineering-j208
decisions-d351
decisions-d350
decisions-d349
appearance-presets-mock-j129
decisions-d348
docs-audit-spec
doc-coverage-baseline-raise
decisions-d347
decisions-d346b
decisions-d346
j88h-profile
ui-consistency-j195-deferred
ui-consistency-j195
engineering-practices-j194
preferred-login-ui-j166
signin-pools-263-j174
macos-node-265-s1
decisions-d345
decisions-d344
proxy-cgroup-j164
verify-quick-fuzz-329
proxy-start-io-j168
timing-flakes-j163
up-263-s1
mcp-events-j147
verify-quick-fuzz-j158
proxy-p3-j159
agent-resource-j157-detect
wip/j103d-final
remote-cancel-hang-j155
proxy-traefik-281-j62d
j149-verify-quick
proxy-traefik-281-j62b
j150-drop-unnamed
wip/j79d-red-r4
wip/j103d-d332
rootless-toast-j142
wip/j103d-head
wip/j103d
j125c-mcp
macos-build-j136
backup/macos01-20261106/claude/j136
wip/j79d-red-cli
wip/j79d-red-server
j121-link-liveness
j118c-tracer-failures
wip/j79c-head
release-desktop-j131
j124c-signed-macos
wip/j79c-red-p3
wip/j79c-red-p23
wip/j79c-red-p22
merge-j128-check
perf-deferred-j128
sidebar-toggle-260
j127-shortcut-changed-dot
j125-mcp
j118-tracer-failures
j126-account-summary
settings-sections-mock-j92
j120-pinch-lock
sidebar-292
backup/macos01-20261106/claude/j120
taste-2026-11-03
row-actions-242-215
backup/macos01-20261106/claude/stash-0-untracked
backup/macos01-20261106/claude/J80-265-s1-run
backup/macos01-20261106/claude/J80-macos-s1-20261102
j112-canvas-commands
ui-no-overshoot-scroll
fix-recovery-restart
backup/macos01-20261106/claude/stash-1-untracked
taste-2026-11-02
size-baseline-ratchet
machine-cards-structure-j108
j109-boot-copy-mockups
fix-dev-red
wip/up-263-s1
j95b-settings-rows
proxy-traefik-281
j95-option-rows
docs-human-j91
docs-keys-palette
fix-flood-1013-270-j38d
mesh-ssh-s1
mesh-ssh-s0
addhost-d291-tunnel
test-stability-load
mesh-relay-220
repro-296
shim-thp-off-24
mesh-pins-258-v2
mesh-dns
signin-d311-merged
docs-pages
ui-size-283
fix-ui-batch-specs
wip/j12b-edge-update
gate-on-arm
fix-rename-sync-293
trust-285-j60b
fix-focus-ring-clip
integ-ui-1101
edge-update-v2
signin-d311
taste-2026-11-01
layout-per-tab-250
ui-approved-splitopt-224
ui-approved-splitopt-224-on-dev
icon-text-centre-282
ui-approved-189-212-216
research-reverse-proxy
transfer-budget-320
review-mesh-pins-258-r2
sidebar-pill-259
review-mesh-relay-220
wip/j12-edge-update-v2
nix-package
status-crash-loop-237
fix-dev-test-failures
fix-fixture-socket-path
wip/mesh-relay-220-pre-dev-advance-rebase
fix-canvas-side-clip
research-head-to-head
frosted-real-256
review-mesh-pins-258
wip/mesh-relay-220-pre-final-rebase
review-layout-per-tab-250-r2
broad-suite-triage
nix-devshell
review-status-crash-loop-237-r3
wip/nix-devshell-pre-p3
taste-frosted-real
wip/code-serve-demo-2026-10-30
wip/code-serve-glass-2026-10-30
wip/code-serve-clusters-2026-10-30
wip/code-merge-release94-dev-2026-10-30
wip/rproxy-delta-scratch-2026-10-30
wip/stale-note-257-staged-2026-10-30
wip/d241-size-staged-2026-10-30
review-broad-suite-207
wip/mesh-pins-258-pre-split
wip/mesh-relay-220-pre-rebase
mesh-measure-220
plan-211-update
review-edge-autoupdate-r3
perf24-reconnect
review-stale-note-r2
release-prod-live
d241-shell-marker
review-mesh-pins-server-258
review-revocation-r3
review-setup-token-r2
review-sync-journal-r3
wip/review-mesh-pins-258-prune-review-1995fee46
frosted-scroll-256
sync-journal-r3
revocation-per-account-wip
review-tokio-asyncfd-0386
review-sync-p3s
wip/stash-8by64-stash0-2026-10-30
mesh-drag-r2
setup-token-data-wip
release-9-4
auth-busy-1013
mesh-view-overlap
sync-p3s
review-auth-busy-wake
review-readd-r8-wip
mesh-drag-bounds
audit-auth-93
app-windows-stream-start
review-authority-cap-r3
app-windows-r7-measure
readd-minimal-r6
readd-minimal-r5
app-windows-r7-soak
readd-minimal-r4
app-windows-r7
app-windows-r6
readd-minimal-r3
readd-minimal-r2
readd-minimal
merge-release8-dev
review-busy-page-liveness-r2
review-busy-page-liveness
mesh-view-trim
review-authority-read-retry-r2
review-remove-uninstall-r2
release-retry-reattach
release-retry
review-remove-uninstall
review-authority-read-retry
app-windows-ship
mesh-autoswitch-p2
mesh-ssh
mesh-relay
mesh-macos-node
screen-and-control
session-labels
review-real-logins-r5
review-real-logins-r4
review-real-logins-r3
shim-memory-r2
review-real-logins-r2
shim-memory
shadow-addhost-instant
shadow-real-logins
shadow-same-session-flood
shadow-prod-perf-fix
hosts-from-server
app-windows-real
app-windows-transport
release-prod-6w
mesh-policy-verify
quiet-close-toast
dev-merge-r4
review-mesh-agent-transport
review-app-windows-transport
settings-roundtrip
review-release-pipeline-r4
mesh-agent-transport
ended-strip-fix
review-audit-ca-update-d244
settings-rows
phone-width
signout-clear
fix-restart-tests
dev-merge-rp
signer-hardening
review-audit-ca-update
terminal-fidelity
review-audit-ca-update-wip
mesh-integrate
review-mesh-agent-transport-515d3712
review-mesh-dataplane-feec1988
mesh-dataplane
signout
research-canvas-node
wip/review-renderer-cost
wip/review-terminal-fidelity
padlock-glyph
review-release-pipeline-2e95b689
phone-polish
sidebar-polish
inbox-generic
review-mesh-dataplane-378d4055
prod-batch
ui-inbox
ui-ca-unlock
ui-machine-sections
review-mesh-dataplane-a5f744fb
tls-session-prod
session-bounds-prod
fix-dead-session
session-bounds
tls-session
palette-polish
shortcuts-d222
research-appmeta
phone-gutter
ui-centre-button
wip/ui-centre-button
wip/tls-session
review-addhost-breakit
ui-platform
renderer-cost
remote-agents
mesh-api
ssh-bootstrap
prod-hotfix2
prod-fixes
review-remote-agents
review-mesh-dataplane
session-life
research-browser
review-mesh-api
research-capture
review-mesh-api-round3
review-mesh-api-round1
gate-stability
review-gate-stability
review-relay-direct
review-mesh-api-findings
proto-sessions
font-picker
proto-addhost
proto-windows
mesh-core
latency-gate
research-bsd
research-discovery
keytray-mods
mock-core
ui-tweaks
fix-motion-sel
fix-motion
integrate2
fix-robust
t-web
t-server
vt-ghostty
fix-snap-echo
t-web-auth
review-vt2
t-agent
lane-protocol
lane-shim
lane-auth
s1-base
s1-contracts
s1-workspace
No results found.
No labels
launch-qa
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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.
Dependencies
No dependencies set
Reference
kayg/infraternal#398
Loading…
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?
J307: security and flow job.
The owner, on production
74b9c4d80, asked whether we silently upgrade to a root infraternal agent once passwordless sudo is detected:D139: "passwordless sudo is never taken as permission. Installing a root infraternal agent, and promoting an existing user agent to root later, always asks first."
Question: when a host is added as a normal user who has passwordless sudo, does the add (a) go root without the consent step (P1 against D139), or (b) install rootless and never offer root?
Plan (est. ~3 h):
sudo -n, and any root-owned file or unit.verify quick,verify fast, and the add-host browser specs (1 worker) with screenshots.Branch
addhost-sudo-consentfrom origin/dev7b14fbb664.Start: branch
addhost-sudo-consent, base origin/dev7b14fbb664cbfb9b2b9b8a56f724d924424accdb.Finding 1, from the code on dev (the live repro is building on compute01): the add-host flow never offers root to a normal user with passwordless sudo, and it does not go root silently either.
apps/tracer/src/canvas/addhost/wizard.ts:478rootCandidates()isentry.user === "root" || entry.discovered?.rootAvailable.rootAvailablecomes only fromroot_availableon discovery rows (real.ts:36), and no server code sendsroot_available(git grep root_availablematches only the tracer, its test double and a design doc). A typedkayg@host, or any real discovered row, therefore skips the consent page and starts with nomode, which means rootless.probe.rsrecordssudoas a fact only.Check::authorize_modeuses it only to refuseRootwithout sudo, andTarget::validate(model.rs:149) refusesRootwithoutroot_consent. In rootless mode the onlysudothe host sees is the sniff'ssudo -n true(CHECK_SCRIPT line 22). Theexec sudo -n sh -cwrapper (install.rs:977) is emitted only forInstallMode::Root, and linger usesloginctl --no-ask-passwordwithout sudo.Finding 2 (D139 "promote an existing user agent to root later"): there is no real path. The Access-level pane (
windows/access-level.on-demand.ts, #215/D286) is backed byPrivilegeService(sessions/privilege.ts), whose module doc says "There is no server endpoint behind this yet". Only the mock double (canvas/mock/privilege.ts) implements it. The production consent page still promises it, though: "You can also install as a user now and switch to root later." I'm dropping that sentence here and filing the promotion separately.Plan for the fix (in progress):
root_offer: trueon rootless targets that the person wasn't already asked about. Right after the read-only check, the server pauses only when the login is not root,sudo=yes, and nothing of ours is on the host yet. This reuses start-fresh's challenge/slot-release/15-minute mechanics. Thecheckevent carriesroot_offer.challenge, and the wizard shows the existing consent page for that host (with the tick, without Back).choose-mode {root:false}goes on rootless in place.{root:true}re-runs the check in root mode on the same SSH connection (no second sign-in, no retyped password) and goes on as a consented root install. Withoutroot_offer(CLI, MCP, old clients), nothing changes.Repro on compute01 (base origin/dev
7b14fbb66): confirms finding 1. Case (b), no P1.Setup:
/tmp/j307/repro.py, derived fromscripts/addhost-retry/native.py. It runs the real server-side bootstrap (breakit2_live_ssh_install_join_and_terminal,--features remote) as root, through an isolated sshd on 127.0.0.1:4947, against a throwaway accountj307a2(uid 30036) with/etc/sudoers.d/j307-j307a2=NOPASSWD: ALL(checked:sudo -n id -u→0). The request is rootless with no consent, which is exactly what the wizard sends forkayg@host. The sudo journal and root-owned artifacts were captured before cleanup.Result (log attached,
repro-a2.log):sudo -n true. Nosudo -n sh -c, no root files or units, and the infraternal agent is a user unit owned by the account./var/lib/infraternal.bootstrap-cacheexisted before the run (another job's) and was untouched. The system unitinfraternal-login-37566d14…-0.servicelisted there started at 14:13:34 CET, before this run, and belongs to another job's root agent.a1) ran zero tests (the lib test binary was built withoutremote), so I'm not counting it as evidence.Wizard side: with a typed
kayg@host(or any real discovery row, since no server sendsroot_available),proceed()skips the consent page, and the start carries nomode. So: installed rootless, never offered root. The fix is pushed (7913123d9server,2db4cb365tracer). Gates are next.Fix status (head
14fcb1c2f, origin/dev48358a5famerged in). Commits:e742de676ssh: ask before root when a normal login has passwordless sudoa64350ce0tracer: ask about root after sign-in for a sudo login03165472etest(bootstrap): live sudo login is asked about rootUnit and browser runs on compute01 (pre-merge head
6719bcc50; logs in~claude/j307/):cargo test -p infraternal-plugin-ssh --test root_offer --test model --test concurrency --test event_metadata: all ok.root_offer.rspasses 5/5: asked, and nothing privileged before the answer; root re-checks on the same connection with consent and a retry keeps root; no opt-in means no question; no sudo means no question; the offer is in the public event.bun x playwright test test/addhost-wizard.spec.ts --workers=1(production build): 43 passed, including the 4 new specs (question at 1440/393 with left edges ±0.5 px, Install as user, Install as root after the tick, no second question after the up-front consent page).verify quickfailed only onfmt. Three of the flagged files were not mine (bootstrap_retirement.rs,pending_removal_tests.rs,remote/src/uninstall.rs), so base7b14fbb66already failed workspace fmt. My two files are now formatted, and dev is merged.Live proof of the fix (root fixture, real sshd, NOPASSWD account
j307b1,BREAKIT2_ROOT_OFFER=keep), log attached:I did not run a live "Install as root" on compute01, because
/var/lib/infraternal.bootstrap-cachethere belongs to another job and a root install would touch it. The unit tests cover the root branch.The final
verify quick+verify faston the merge head are queued (compute01). Screenshots will come from that gate run.Finish: head
b1cbe2f4f(branchaddhost-sudo-consent, origin/dev48358a5famerged). Not merged.Commits since base
7b14fbb66:e742de676ssh: ask before root when a normal login has passwordless sudoa64350ce0tracer: ask about root after sign-in for a sudo login (also drops the false "switch to root later" promise)03165472etest(bootstrap): live sudo login is asked about root (BREAKIT2_ROOT_OFFER=keep)14fcb1c2fmerge origin/dev5356c55c5docs: D345 doc comments on the touched items; the twoinclude!d test files become#[path]modules so//!is validc9ee71fa3test(ssh): root_offer test clones the script log instead of holding its lock (clippyawait_holding_lock)b1cbe2f4fstyle: rustfmt the two test files that became modules (the D345/D351 items it moved)scripts/verify quick(compute01,b1cbe2f4f), verbatim:scripts/verify fast(compute01,b1cbe2f4f): exit 0, verbatim table:Static sizes from the gate (report only; the baseline is the gate's stored one, not dev head): x86_64 27,791,952 B, aarch64 25,009,584 B. This change adds one event field, one pause path and some wizard code.
Add-host browser specs,
bun x playwright test test/addhost --workers=1(production build,b1cbe2f4f):81 passed, 14 skipped, 1 failed. The one failure isaddhost-pill-stream.spec.ts:26("a failure after the prompt is explained in the pill…"):not.toContainTexton.ui-toasterrors with "element(s) not found". It also fails 2/2 on unmodified origin/dev37c93637e(--repeat-each=2,~claude/j307/pill.log). It's pre-existing and unrelated to this branch, which also fails it 2/2. Every spec inaddhost-wizard.spec.tspasses, including the 4 new ones.Screenshots (from that run, attached): the question at 1440 and 393, and ticked at 1440. Left edges of title, lede, text and tick are within 0.5 px (asserted).
Answers to the job:
sudo -n true. No P1. Fixed: the server pauses after the read-only check and asks; the wizard shows the D139 consent for that host; "Install as user" stays rootless; "Install as root" (after the tick) re-checks as root on the same SSH connection.For kayg: the question keeps the existing tick-then-button consent rather than two plain buttons, for consistency with the up-front consent page. Say if you'd rather have two buttons, where clicking one is the consent.
J321 review start: branch
addhost-sudo-consentat headb1cbe2f4f.Plan (about 3 h):
root_consentenforced on the server for the pause, and can a client skip the tick?echo ok.addhost-pill-stream.spec.ts:26.J321 progress (review of
b1cbe2f4f). Not the verdict yet.Live "Install as root", as root on compute01, in an owned disposable systemd container (
docs/verification/addhost-breakit2/Dockerfile, NOPASSWD accounttarget), driven bymeasure.py. The test server runs in a second owned container's network namespace, so the host network, the other jobs'/var/lib/infraternal*and the mesh are untouched. (J325 heldmesh-vm.claim. I waited one poll cycle, then went ahead because nothing on the host network is touched.) The breakit2 harness was patched locally, not committed, so that it answersroot=trueand then opens a terminal. Log:root@compute01:/root/j321/live-root.log.The sudo journal on the target shows only the sniff (
sudo -n true) before the answer, and nothing during the 5 s pause. The firstsudo -n sh -ccomes after the answer. Theecho okstep needs one more harness fix (my output loop waited for a trailing newline). The rebuild is queued, then "Install as root" and "Install as user" run again.Harness gap found on the way (not the branch): the breakit2 fixture trusts its throwaway CA with
export SSL_CERT_FILE=/tmp/…pemin front of the join-key preflight. In root mode, sudo'senv_resetdrops that variable, and a container target can't see the host's /tmp. A plain consented root install (--mode root, no question) failed in exactly the same way (live-direct-attempt1.log): "cannot verify the server's public HTTPS certificate". I worked around it on the disposable target only (env_keep += SSL_CERT_FILEplus a copy of the PEM).J321 review of
addhost-sudo-consentatb1cbe2f4f: REQUEST CHANGESD139 holds. Nothing runs as root without the consent click, either in code or live. Two P2s in how the question and its answer outlive one attempt are the reason for the changes. Both are small fixes, each with a reproducer. Screenshots and logs are attached below.
1. D139: holds
choose_mode(root: true)with that pause's own single-use challenge. It must come from the batch owner, on the socket that started the batch, while the host isrunningand paused. API keys are refused (bootstrap_api.rs, underremote). Only then does the attempt buildTarget { mode: Root, root_consent: true }and runvalidate()again.root_offeralone grants nothing:offers_rootneedsRootless, and the answer is the consent.mode:"root", root_consent:trueinstarttoday. The server's guarantee is "an explicit root answer from the signed-in person's own socket", and that is the right line. A malicious page can't get there: the WebSocket admission requires the exact pinnedOrigin(bootstrap_api.rs:337-344).sudo -n true) before the answer. Nothing ran in the 5 s pause, and the firstsudo -n sh -ccame 129 ms afterroot=true. A second answer with the same challenge was refused (second_answer_refused=true). "Install as user" ran exactly one sudo command, the sniff.2. The pause: bounded. Resume is by Retry, which has two bugs
CONFIRMATION_WAIT(15 min) covers both the answer and taking the add-host slot back. The slot is handed back during the wait. The pause holds no host-side lease, because the check is read-only, and it holds only its SSH connection. Socket close, batch cancel and revocation all drop the attempt future (bootstrap.rs~873-893), and the end of the attempt clearsstate.root_offer. Nothing can wait forever.P2-1: Retry after "Install as user" pauses on a question the wizard never shows.
choose_mode(false)leavesstate.target.root_offer = true, andschedule()retries withstate.target. So the next attempt pauses on the question again. The wizard hasasked = trueand never shows it, so the host sits on "Checking" for 15 minutes and then fails with "Host confirmation exceeded its time limit." This happens on any rootless failure that leaves nothing behind: payload refusal, upload, or a rolled-back install. The test double disagrees with the server ("never asked twice" per socket), so the browser specs can't see it. Red unit test on the real runner (red-root_offer.logattached, compute01~claude/j321/red.log):Fix: on
root: false, also setstate.target.root_offer = false, since the person answered for this host. Keep the double in line with it. The test, fortests/root_offer.rs:P2-2: if the socket ends while the question is showing, the answer is silently dropped.
onRunClosedmarks the host failed but leavesthis.askingset, so the question stays on screen with nothing to say the connection ended. Tick plus "Install as root" then goes throughanswerRoot:job.runis undefined, so nothing is sent, butasked = trueis set androotstays false. "Try again" then starts a fresh run that is rootless and asks nothing. It fails toward less privilege, so it isn't a D139 breach. But it overrides the person's explicit choice without telling them, and an iPhone that backgrounds the PWA ends the socket exactly like this. Browser repro (production build, 393×852):(
repro-after-close-393.png: the question is still up after the close.) Fix: inonRunClosed, ifthis.askingbelongs to that run, clear it and go back to progress. InanswerRoot, setasked/rootonly oncechooseModehas actually been sent. Add a spec that closes the socket during the question (wrappingWebSocketinaddInitScriptis enough to close it).3. Root re-check on the same connection: no TOCTOU; one leftover of the user-mode target
check/previous/absent/early, andchosen.is_some()stops a second question. If the host changed during the pause, for example another install appeared, the root check sees it, and the normal start-fresh and already-added flows run with consent.refreshed,earlyandmetadata.authenticationare recomputed per pass. A retry keeps root throughstate.target.aside.previous.restore_set_aside(aside.session.as_ref(), &target, aside.replaced)(bootstrap.rs~963).restore_set_asidebuilds its script withInstallation::script_for(target.mode, …), so after a root answer the put-back would run rootless and report "not put back". The commit already fixed this forrecord_failure(ran). Use the same state target here. Reaching it needs a root-scope stuck install that the user check didn't flag, which is narrow, so P3.4. Live run, as root on compute01: both modes done, terminal works
compute01's
/var/lib/infraternal*belongs to other jobs, so instead I used an owned, disposable systemd container fromdocs/verification/addhost-breakit2/Dockerfile(NOPASSWD accounttarget, uid 1101), driven bymeasure.py --fresh. The test server ran in a second owned container's network namespace, so the host network, the host's units and the mesh were untouched. The build was a /root clone through build-slot. The breakit2 harness was patched locally, not committed (harness-final.patch), so that it answersroot=true|false, tries a second answer, then opens a new terminal and typesecho ok; echo J321-$((6*7)) uid=$(id -u) user=$(id -un).live-root.log)live-keep.log)sudo -n trueonly (19:41:27.086)sudo -n trueonly (19:42:49.841)sudo -n sh -c32.253; 11 sudo commands in total/var/lib/infraternalroot 700, system unit active, agent runs as root, no user basetarget, user unit active, no root pathsok/J321-42 uid=0 user=rootok/J321-42 uid=1101 user=targetThe test exits 101 in both runs only because my own
okassertion matched\nok, while bash printsESC[?2004lbefore it. The raw bytes in the logs show theokline. That's a harness assertion, not the product.Harness gap (not this branch, worth a small follow-up): breakit2 trusts its throwaway CA with
export SSL_CERT_FILE=/tmp/…pemin front of the join-key preflight. In root mode, sudo'senv_resetdrops that variable, and a container target can't see the host's /tmp. A plain consented root install (--mode root, no question) failed in exactly the same way (live-direct-attempt1.log: "cannot verify the server's public HTTPS certificate"). To get through, I setenv_keep += SSL_CERT_FILEon the disposable target and copied the PEM in. So no breakit2 root run against a container could have passed before.5. UI (TASTE)
Captures from a production build with the provisioning double, at 1440×900, 393×852 and 375×667, in ink and paper, unticked and ticked (attached). The title, lede, text and tick share one left edge at every size (measured: 961.0 at 1440, 57.0 on phones). The wording says what happens and keeps to the vocabulary. Dropping "switch to root later" is right, because #399 doesn't exist yet.
P3-2 (TASTE "No control looks dead without a reason"): at 375×667 the tick is below the fold. The page opens with a greyed "Install as root" and nothing on screen says why (
question-375x667-ink.png). The up-front consent page already has the same problem, worse because of its extra Back row (upfront-375x667-ink.png), so this inherits it rather than introducing it. Fix both together, or take the two-button form below.Tick plus button, or two plain buttons? For this mid-run question I'd use two plain buttons, where pressing "Install as root" is the consent:
root@in D219: "one line explaining the effect, with no tick box and button".This changes a consent surface (D139/D219), so it's kayg's call. If adopted, the up-front page should change too, for consistency.
6.
addhost-pill-stream.spec.ts:26It's red on dev, and the cause is the test, not the product.
expect(page.locator(".ui-toast")).not.toContainText(/ready|added/i)(line 34) fails with "element(s) not found" when no toast node is mounted, even though the behaviour it checks (no "ready" toast) holds. J307's evidence: 2/2 on dev37c93637e(~claude/j307/pill.log). It needs its own issue, because every add-host job otherwise spends a slot proving it's pre-existing. Filed as #408, with the one-line fix.Smaller notes (not blocking)
choose-mode. They share start-fresh's code, but the P2-2 spec is a good place to add the socket-close case.Gate: as a reviewer I didn't rerun
verify. J307'sverify fastonb1cbe2f4fis quoted above (all PASS). My only runs werecargo test -p infraternal-plugin-ssh --test root_offerwith the red test added (5 passed, 1 failed, the red one), the screenshot spec (8 passed), and the live runs.Cleanup: the j321 containers and images are removed (compute01 had no Docker images before), the fixture PEMs are gone, and the /root clone's target and claude's worktree are deleted. Logs are kept in
root@compute01:/root/j321/andclaude@compute01:~/j321/.J307 round 2 start: branch
addhost-sudo-consent, base headb1cbe2f4f. Working through J321's 82852, one atomic commit each, test-first:root_offerfrom the host's target once the person answered "user" (J321's red test first).asked/rootare set only when the answer was actually sent; a Retry asks again (browser spec closes the socket during the question).restore_set_asideuses the mode that ran.root@choice and fixes the 375 px dead-looking button.Then
verify quick+ add-host specs (1 worker) + captures at 1440×900 / 393×852 / 375×667, ink and paper. Estimate ~2.5 h incl. queues.Round 2 progress: all four fixes are committed and pushed (head
565b82a4c; the twowip:P2-1 commits get squashed into one atomic commit after the run below has fetched them).3643f8791red test (J321's) +0ab63d27bfix (choose_mode(false)clears the host'sroot_offer) +565b82a4ccontract linefe1915b33restore uses the mode that ran38bc4c675socket loss takes the question down;asked/rootonly after a sent answer; spec closes the socket during the questione1647d2fbtwo plain buttons on both consent pages, no tick; capture matrix 1440×900/393×852/375×667 × ink/paper × both pagesOne compute01 slot run is queued (position ~13): red P2-1 (test on
3643f8791), red P2-2 (new spec onfe1915b33), then green root_offer,verify quick, andtest/addhostwith one worker (captures in~claude/j307/ev-r2).Round 2: the queued compute01 run (red/green/quick/specs, never started) was cut by the 02:15–02:45 IST maintenance restart. Not a test result. P2-1 is now squashed into one commit (
eb14f06c3, identical tree); head39dbca719. Resubmitted once after "compute01 back" (queue position 1).Round 2, red proofs (compute01, logs attached). Head is now
d417e1e79after a fmt-only fixup to the P2-1 commit:973be1bcfP2-1 ·75f2c8f8cP3-1 ·15ff3cb72P2-2 ·d417e1e79two buttonsP2-1 red (J321's test on
b1cbe2f4f,r3-red-rust.log):Green with the fix:
root_offer7/7 (r4-green-rust.log, on39dbca719, same code).P2-2 red (the new socket-loss spec on
dbfe42ccf, before the wizard fix,r3-red-browser.log):verify quick+test/addhost(1 worker, captures) ond417e1e79are queued (position ~8). An earlier attempt hit a stale tracer server from a run I had stopped (my own process on port 4737, now killed). Not a product failure.Round 2 progress. Head is now
aaba49692:973be1bcfP2-1 ·75f2c8f8cP3-1 ·15ff3cb72P2-2 ·aaba49692two buttonsd417e1e79(1 worker): 88 passed, 14 skipped, 1 failed. The failure is onlyaddhost-pill-stream.spec.ts:26, the known dev failure (#408).verify quickond417e1e79failed only on D345 (doc comments on two test helpers I touched:open,shots). Fixed in the buttons commit; the local diff-practices check is ok.white-space: nowrap; the three fit in about 400 of 420 px, and phones already stack). The capture matrix now asserts one text line per footer label.verify quick+test/addhost(1 worker, fresh captures) onaaba49692.Blocker (03:05 CET): compute01 build-slot is refusing admission:
/has 8.7 GB free, below the 25 GB floor. I deleted my own target (8 GB). My run (verify quick+test/addhoston head87b107445) is queued behind the floor. Orchestrator: other jobs targets need sweeping for anything to start.J307 round 2 finish: head
87b107445(branchaddhost-sudo-consent, not merged). One atomic commit per item:973be1bcfchoose_mode(false)clearsroot_offeron the host's target, so a Retry after "Install as user" stays rootless and asks nothing. Contract updated. J321's test added.75f2c8f8crestore_set_asidegets the target that ran (ran), not the request's rootless one. One argument; no practical red test (needs a root-scope stuck install the user check missed).15ff3cb72onRunCloseddrops a question that belongs to the closed run, returns to progress, clearsrootOffer;answerRootsetsasked/rootonly afterchooseModewas sent.87b107445root@keeps its single primary "Install as root". Footer labels never wrap; a three-action footer is tightened so the card keeps its width.Red → green
b1cbe2f4f):a retry after keep rootless asked about root again,5 passed; 1 failed. Green:root_offer7/7.dbfe42ccf):expect(question).toHaveCount(0),Expected: 0 Received: 1. Green in the run below. The spec wrapsWebSocketin an init script, closes the bootstrap socket during the question at 393×852, then checks: the question is gone, "The connection to the server ended before setup finished." is shown, nochoose-modewas sent, and Retry'sstartasks again (root_offer: true) and shows the question.scripts/verify quick(compute01,87b107445), verbatim:(
verify fastwas last run on round 1'sb1cbe2f4f, all PASS; not rerun for round 2, as asked.)Add-host specs,
bun x playwright test test/addhost --workers=1(production build,87b107445):88 passed, 14 skipped, 1 failed. The failure is onlyaddhost-pill-stream.spec.ts:26, the dev failure tracked as #408 (2/2 on unmodified origin/dev37c93637e). Log attached (r6-browser.log).Captures (attached, all 12 reviewed): both pages × 1440×900 / 393×852 / 375×667 × ink / paper. The spec asserts both buttons are enabled and inside the viewport, each footer label is one text line, and the card stays inside its flow window.
Ops notes: one run was cut by the 02:15–02:45 IST compute01 restart. A later attempt's checkout aborted because of my own
git checkout <sha> -- fileindex trap; I stopped it and its stray tracer server on port 4737. The disk floor (8.7 GB free) held admission for about an hour; I deleted my target. The target is deleted again now.