Skip to content

T71 — Hold the box-zone answerer as a host service installed by the privileged step - #1924

Merged
norrietaylor merged 39 commits into
mainfrom
agent/1803-hold-the-box-zone-answerer-as-a-host-service-ins
Oct 4, 2026
Merged

norrietaylor merged 39 commits into
mainfrom
agent/1803-hold-the-box-zone-answerer-as-a-host-service-ins

Conversation

@minimal-foundry

@minimal-foundry minimal-foundry Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

T71 — Hold the box-zone answerer as a host service installed by the privileged step

slice: S9
kind: task
covers: NET-122
size: M
est: 360 code, 320 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the bundle's VM host daemon log tail says at start whether the node published its rows into the manager-held answerer or hosted the answerer itself as the interim, with the hook port and the channel path; the answerer service's own log names each node that connected and each row it published or withdrew
observability: one info line at daemon start naming publish-or-host and the hook port; one info line per node connection and disconnection at the answerer service; one warn line per refused channel peer naming its uid
layers:
- vmhost:
- crates/minvmd/src/cmd/answerer.rs (new): the answerer subcommand the service manager runs as the operator's uid, never root: the host's one box-zone answerer on the host loopback at the hook port, its listener socket and its channel socket both held by the service manager and inherited (launchd socket activation on macOS, a systemd system socket unit with User set to the operator on Linux, never a user-session unit), answering with the shared zone decision from rows that node helpers write over the channel, a unix socket whose peer uid must match the service's; the hello carries a node id and a channel protocol version; a name belongs to the connection that first published it and a second node's publish of the same name is refused and reported; every published A address must fall inside the reserved range, the node's addresses or 127.0.0.1 and is refused otherwise; rows live only while the node's connection is up, so a restart holds nothing until nodes reconnect and re-publish
- crates/minvmd/src/net/answerer.rs: hosting the answerer in the daemon becomes the recorded interim: at start the daemon connects to the channel socket first and publishes its rows there (a connect starts a socket-activated service, so a present socket path that refuses or times out is an error surfaced at session start, never a reason to host), hosts the answerer itself only when the channel socket path is absent and the hook port is free (a port held by anything but the service is a surfaced collision, not a fallback), never both; it keeps the channel connection for the session, reconnects with backoff on loss and re-publishes idempotently, so a service restart is a short absence window and never a session restart; one publish path either way
- crates/minvmd/src/cmd/run.rs: makes the publish-or-host choice at start and surfaces the interim at session start beside the resolver advisory
test: cargo nextest run -p minvmd answerer_service_answers_rows_from_two_nodes
test: cargo nextest run -p minvmd helper_publishes_when_service_holds_the_port
test: cargo nextest run -p minvmd answerer_channel_refuses_foreign_uid
test: cargo nextest run -p minvmd answerer_service_forgets_rows_of_a_gone_node
test: cargo nextest run -p minvmd second_node_publishing_a_held_name_is_refused
test: cargo nextest run -p minvmd answerer_refuses_an_address_outside_the_answer_rule
test: cargo nextest run -p minvmd nodes_republish_after_a_service_restart
test: cargo nextest run -p minvmd present_channel_that_refuses_is_an_error_not_a_host
- cli:
- crates/minimal/src/resolver.rs: the advisory's privileged step also copies the answerer program to a root-owned, non-user-writable path and installs the service unit pointing at that copy (a launchd plist with socket activation on macOS, a systemd system socket and service pair running as the operator on Linux), never at a user-writable binary; the hook probe reports whether the answerer is manager-held or session-held and compares the installed copy's channel protocol version with the daemon's, re-surfacing the advisory on a mismatch so an upgrade re-runs the step
test: cargo nextest run -p minimal advisory_installs_manager_held_answerer
test: cargo nextest run -p minimal hook_probe_resurfaces_advisory_on_protocol_mismatch
- docs:
- docs/specs/18-spec-box-networking/18-spec-box-networking.md: NET-122 gains the sub-requirement "WHERE the host is hooked THE SYSTEM SHALL install, by the privileged step, the box-zone answerer as a host service whose listener and channel sockets the service manager holds, running as the operator, from a root-owned non-user-writable program", and NET-138's interim sentence points at it
- e2e:
- scripts/session-e2e.sh: adds the case answerer_survives_session_stop, run where a lane can install the unit (the KVM lane as root with the systemd variant; the macOS lane only if it can install a LaunchDaemon, else it fails rather than self-skips so the pin is never silent): with the service installed, stopping the session leaves a sibling node's name answering, a service restart under two connected nodes answers both names again without a session action, and a session started afterwards publishes instead of binding
test: ./scripts/session-e2e.sh answerer_survives_session_stop
produces:
- crates/minvmd/src/cmd/answerer.rs
consumes:
- crates/minvmd/src/net/answerer.rs
- crates/minimal/src/resolver.rs
proof: Two VM nodes on one host answer their names from the one answerer the service manager holds, a stopped session leaves that answerer answering, a node that finds the hook port held publishes its rows over the channel instead of binding and says so at start, a channel peer with another uid is refused, a second node's claim on a held name is refused and reported, an address outside the answer rule is refused, both names answer again after a service restart with no session action, and the advisory's privileged step installs the service as the operator from a root-owned copy.
depends on:
- blocked by #1710

Out of time

The coder ran out of its 7200s before it finished. If it left work uncommitted, its last commit is the runtime's snapshot of that work as it stood — the commit message says so — and not a finished step: it may not build or pass its tests. So this PR is a draft.

Status at 12f51da (local fixer, architecture conditions applied)

  • Machine-global channel: /run/minimal/answerer.sock on Linux, /Library/Application Support/minimal/run/answerer.sock on macOS.
    • "Installed" is decided by the install marker (the systemd socket unit or the LaunchDaemon plist), not by the socket file. A stale socket with no marker falls back to hosting the interim.
    • Nodes try the global channel first, then the per-state-dir interim channel.
    • The node id is the canonical state dir plus the VM name.
  • Box addresses are allocated host-wide by the answerer (design §7.1). This is AddressBook in crates/minvmd/src/net/answerer.rs.
    • Addresses come from .2–.254, the lowest free one, recorded per node and box. Nodes never self-assign.
    • Publish refuses an address another node holds, and .0, .1 and .255.
    • Channel protocol is now 3. Test: two_nodes_never_share_a_box_address.
  • min-answerer is a separate crate (crates/min-answerer, minvmd default-features = false), so it doesn't link libkrun. just answerer-link-check, part of just ci, accepts only system libraries and no RPATH, RUNPATH or LC_RPATH. Its rule set is identical to T91's (T91 — Check that min-answerer links only system libraries #1947).
  • Handover: release and release-cancel go over the control socket, accepting only uid 0 or the operator (peer credentials). The daemon waits 15 s for the channel, and every failure path re-binds.
  • Status: min ls and the session-start line distinguish three states: manager-held service, hosting the interim, and publishing into another node's interim.
  • macOS whole lane: without MINIMAL_E2E_PRIVILEGED=1, it prints answerer_survives_session_stop: NOT RUN (no privileged LaunchDaemon install on this lane) and counts it in the NOT RUN summary.

Release-blocking follow-ups: T91 #1947 (link check) and T92 #1948 (dist build, staging, packages, installer, advisory signature check, release.yml patch). These supersede gominimal/inbox#869.

Outside the plan's layers:

  • crates/min-answerer/*
  • workspace Cargo.toml and Cargo.lock
  • crates/minimald-rpc (release variants and ManagerHeld)
  • crates/minimal/src/cmd/session.rs and tests/cli.rs
  • crates/minvmd/src/box_registry.rs (allocated addresses)
  • justfile (answerer-build, answerer-link-check)
  • scripts/check-answerer-links.sh

Spec: host-wide allocation and the reuse quarantine are added as a NET-010 sub-requirement in spec PR #1946, which merges after this PR. The operator decided on 2026-10-04 that this PR merges ahead of #1946, as T79 does.

Pending before merge: one run of answerer_survives_session_stop on a real Mac with MINIMAL_E2E_PRIVILEGED=1 (the launchd socket-activation handover).

Proof

Two VM nodes on one host answer their names from the one answerer the service manager holds, a stopped session leaves that answerer answering, a node that finds the hook port held publishes its rows over the channel instead of binding and says so at start, a channel peer with another uid is refused, a second node's claim on a held name is refused and reported, an address outside the answer rule is refused, both names answer again after a service restart with no session action, and the advisory's privileged step installs the service as the operator from a root-owned copy.

Tests

line exit tail
cargo nextest run -p minvmd answerer_service_answers_rows_from_two_nodes 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-001a... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/cc369/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/cc369/tree/crates/args) C
cargo nextest run -p minvmd helper_publishes_when_service_holds_the_port 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-df81... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/c3717/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/c3717/tree/crates/
cargo nextest run -p minvmd answerer_channel_refuses_foreign_uid 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-e36e... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/693a9/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/693a9/tree/crates/
cargo nextest run -p minvmd answerer_service_forgets_rows_of_a_gone_node 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-6a43... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/e17e6/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/e17e6/tree/crates/
cargo nextest run -p minvmd second_node_publishing_a_held_name_is_refused 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-3803... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/918d1/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/918d1/tree/crates/
cargo nextest run -p minvmd answerer_refuses_an_address_outside_the_answer_rule 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-e4f6... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/f010c/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/f010c/tree/crates/
cargo nextest run -p minvmd nodes_republish_after_a_service_restart 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-31f5... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/08dbc/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/08dbc/tree/crates/
cargo nextest run -p minvmd present_channel_that_refuses_is_an_error_not_a_host 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-5010... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/b7169/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/b7169/tree/crates/
cargo nextest run -p minimal advisory_installs_manager_held_answerer 4 fa3) Compiling derive_more-impl v2.1.1 Compiling compact_str v0.9.1 Compiling ssh-cipher v0.3.0 Compiling darling v0.24.0 Compiling unicode-truncate v2.0.1 Compiling kasuari v0.4.12 Compiling strum v0.28.0 Compiling lru v0.18.2 Compiling litrs v1.0.0 Compiling compressi
cargo nextest run -p minimal hook_probe_resurfaces_advisory_on_protocol_mismatch 4 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-5c7a... Compiling stdlib v0.0.21 (/home/runner/.local/state/minimal/sessions/5b6b7/tree/crates/stdlib) Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/5b6b7/tree/crate
./scripts/session-e2e.sh answerer_survives_session_stop 1 Applying loadouts: default Running task runtime-implement-test-10 in session task-runtime-implement-test-10-7414... ::error::no usable 'minimald' on this host: the 'min' this run drives autospawns it by bare name (crates/minimal/src/autospawn.rs), so it must be on PATH — the pair has to come from on

Verify

min task run agent-verify exited 101, so this PR is a draft.

Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-d522...
    Checking args v0.0.1 (/home/runner/.local/state/minimal/sessions/9eb17/tree/crates/args)
    Checking ot v0.0.1 (/home/runner/.local/state/minimal/sessions/9eb17/tree/crates/ot)
   Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/9eb17/tree/crates/version)
    Checking paths v0.0.1 (/home/runner/.local/state/minimal/sessions/9eb17/tree/crates/paths)
   Compiling minvmd v0.7.0 (/home/runner/.local/state/minimal/sessions/9eb17/tree/crates/minvmd)
    Checking switch v0.0.1 (/home/runner/.local/state/minimal/sessions/9eb17/tree/crates/switch)
    Checking mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/9eb17/tree/crates/mlog)
    Checking common v0.0.1 (/home/runner/.local/state/minimal/sessions/9eb17/tree/crates/common)
error: using `chunks_exact` with a constant chunk size
   --> crates/switch/src/refusal.rs:205:10
    |
205 |         .chunks_exact(2)
    |          ^^^^^^^^^^^^^^^ help: consider using `as_chunks` instead: `as_chunks::<2>().0.iter()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: using `chunks_exact` with a constant chunk size
   --> crates/switch/src/refusal.rs:209:31
    |
209 |     if let Some(tail) = bytes.chunks_exact(2).remainder().first() {
    |                               ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/switch/src/refusal.rs:209:31
    |
209 |     if let Some(tail) = bytes.chunks_exact(2).remainder().first() {
    |                               ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks

error: could not compile `switch` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Base

The base branch moved while the coder worked; it was merged in before the tests ran.

Out of scope

These files are outside the task's layers:, so this PR is a draft:

  • crates/minvmd/src/cmd/mod.rs
  • crates/minvmd/src/main.rs

Closes #1803

Local fixer round (head a465194)

  • Reuse quarantine: a released box address is held back for the answer TTL (REUSE_QUARANTINE = ANSWER_TTL_SECS, 15 s). Allocation takes the lowest free address that is not quarantined. The box that held an address may take it back. When the range is exhausted, allocation fails naming the wait. Test: released_address_is_not_reused_within_the_answer_ttl.

  • Per-user interim channel: every state dir of one user resolves the same interim answerer channel:

    • Linux: $XDG_RUNTIME_DIR/minimal/answerer-interim.sock, falling back to /tmp/minimal-<uid>/ (created 0700; refused if it has another owner or a wider mode).
    • macOS: ~/Library/Application Support/minimal/run/answerer-interim.sock.

    The peer credential check accepts the same uid, plus root for release. Tests: second_state_dir_publishes_into_the_first_ones_interim, interim_dir_is_created_private_and_a_wide_one_is_refused.

  • Channelless hook-port holder: registration fails loudly when port 7656 is held by something with no channel. The error names the holder and the remedy. Test: registration_fails_naming_a_channelless_hook_port_holder.

  • Handover: an allocation that arrives during a handover waits for the rest of the window instead of failing. Test: allocation_during_handover_waits_then_proceeds.

  • e2e: the case builds min-answerer when it is not beside min (just answerer-build, in its own invocation), so the case never reports NOT RUN on the Linux KVM lane. It also asserts that node B, from a second state dir, publishes into node A's interim before the service install.

Behaviour change and release note

On a Linux host that runs native minimald and VMs together without the answerer service installed, own-address box registration now fails with an error naming the hook port's holder and telling the operator to install the answerer service. Before this change such boxes self-assigned addresses that could collide. T90 closes this once native daemons publish into the channel.

Link check: T91 (#1954) owns scripts/check-answerer-links.sh. When main is merged into this branch, this PR takes T91's script and drops its own copy, and the answerer-link-check recipe keeps calling it.

Check Where Result
just test macOS 908 passed
minvmd / minimal tests Linux 308 / 394 passed
answerer_survives_session_stop (with min-answerer absent at start) Linux KVM (Lima) OK: handover, two nodes, restart, quarantine inside the TTL, reuse after it

Merge with main: the run-base privacy fix

Merging main brought in T93's node-port reservation (#1957), which created the per-user run base with mode 0755 before the zone answerer started. The interim answerer refuses a base that loose, so it held the hook port with no channel, and a second state dir's node could not publish into it. This happened on every run, not intermittently.

  • 305df67 creates the base 0700 when it is absent.
  • acf434c tightens an existing base this user owns to 0700, through sock::restrict_owned_dir.

Folding both callers into one helper is tracked in gominimal/inbox#883.

Follow-ups from review

  • gominimal/inbox#889: the macOS CI lane runs the privileged LaunchDaemon cases. It currently reports them not_run, which is how the plist's missing SockType and its SockNode key reached a real Mac.
  • gominimal/inbox#894: a second operator on a shared host is told the answerer service is held by another operator, and multi-operator support is decided. This PR already makes the uid gate's refusal name both uids.

… both

The daemon connects to the answerer channel first and publishes its
zone rows there — to the installed host service when the privileged
step put one in, or to another VM host daemon holding the port as the
recorded single-operator interim — and hosts the answerer itself only
when no channel socket exists and the hook port is free. A channel
that is present but refuses or times out is a surfaced error, never a
reason to host, and a node that loses its connection reconnects with
backoff and re-publishes, so a service restart is a short absence
window, never a session restart.

The new answerer subcommand is the one the service manager runs, as
the operator's uid, over the sockets the manager holds and hands it
(systemd LISTEN_FDS on Linux, launchd socket activation on macOS): it
answers the box zone from the names it holds itself plus the rows
nodes publish over the channel, gating each peer on its uid before a
byte is read, refusing a name a connected node already holds and any
address outside the host-answerable range, and holding each node's
rows only while its connection is up.
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b61c5f78-9819-4ef9-8abd-0250d15f6cb2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

The interim holder's death leaves its channel socket file on the disk
with nothing listening behind it, and the next daemon read that file as
a machine that has an answerer: the connect is refused, the channel is
'present but not answering', and the daemon sat in the surfaced error
forever, never hosting again — the KVM lane's fresh min ls after a
stopped session stopped naming the VM host daemon as the zone's
answerer. A refused connect now names the corpse for what it is: a
service manager's socket never refuses a connect (the manager accepts
it and starts the answerer) and a live holder never refuses one either,
so the file is nobody's and the daemon takes the machine's answerer,
replacing the leftover when it binds the channel. The refusal a live
answerer answers the hello or a publish with is PermissionDenied now,
so ConnectionRefused stays the connect's own kind.

The macOS arm of the channel's uid gate also never compiled: libc does
not export getpeereid on apple targets (the unit lane's Clippy step
exited 101 on it). It reads LOCAL_PEERCRED with an xucred instead —
the kernel's own answer for the peer's uid, decided at connect time —
the same gate the Linux arm keeps.

The pinned test keeps its name and its contract — a channel present
that refuses the hello is an error surfaced at start, never a reason to
host — against a channel that is alive and says no, the wire shape a
version-mismatched or misconfigured service answers with; the corpse
gets its own proof that the machine recovers.
…s ran out

the coder's uncommitted work as it stood when its 7200s ran out

The coder was stopped at the end of its time with these changes
not committed. The runtime committed its working tree as it stood so
the work is kept: this commit is a snapshot, not a finished step, and
may not build or pass its tests.
@minimal-foundry minimal-foundry Bot added the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Oct 4, 2026
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

3 similar comments
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite, pushed as 2983b690ce99.

The coder ran out of its 7200s before it finished. If it left work uncommitted, its last commit is the runtime's snapshot of that work as it stood — the commit message says so — and not a finished step: it may not build or pass its tests.

line exit tail
cargo nextest run -p minvmd answerer_service_answers_rows_from_two_nodes 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-f7cc... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/3c094/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/3c094/tree/crates/ot) C
cargo nextest run -p minvmd helper_publishes_when_service_holds_the_port 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-360c... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/3ab33/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/3ab33/tree/crates/
cargo nextest run -p minvmd answerer_channel_refuses_foreign_uid 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-065b... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/91455/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/91455/tree/crates/
cargo nextest run -p minvmd answerer_service_forgets_rows_of_a_gone_node 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-7c93... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/40cea/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/40cea/tree/crates/
cargo nextest run -p minvmd second_node_publishing_a_held_name_is_refused 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-72de... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/9806f/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/9806f/tree/crates/
cargo nextest run -p minvmd answerer_refuses_an_address_outside_the_answer_rule 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-69de... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/568a7/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/568a7/tree/crates/
cargo nextest run -p minvmd nodes_republish_after_a_service_restart 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-4bf8... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/7542d/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/7542d/tree/crates/
cargo nextest run -p minvmd present_channel_that_refuses_is_an_error_not_a_host 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-98e5... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/6db37/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/6db37/tree/crates/
cargo nextest run -p minimal advisory_installs_manager_held_answerer 101 Compiling russh v0.63.3 Compiling crossterm v0.29.0 Compiling async-compression v0.4.48 Compiling async-tar v0.6.1 Compiling tracing-serde v0.2.0 Compiling line-clipping v0.3.8 Compiling tagptr v0.2.0 Compiling ratatui-widgets v0.3.2 Compiling moka v0.12.16 Compiling trac
cargo nextest run -p minimal hook_probe_resurfaces_advisory_on_protocol_mismatch 101 Applying loadouts: default Running task runtime-implement-test-9 in session task-runtime-implement-test-9-f913... Compiling stdlib v0.0.21 (/home/runner/.local/state/minimal/sessions/03f7f/tree/crates/stdlib) Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/03f7f/tree/crate
./scripts/session-e2e.sh answerer_survives_session_stop 2 usage: ./scripts/session-e2e.sh [case] no argument: every proof, in the whole-lane order cases: lifecycle session_exec session_rename session_outbound_request own_ip own_ip_egress_declared_and_enforced task_run hooks skip_scaffold sandbox restart fresh_install_own_ip_ingress_publishes_l

Verify min task run agent-verify exited 101.

s/55e50/tree/crates/args)
    Checking bcrypt-pbkdf v0.11.0
    Checking argon2 v0.6.0-rc.8
    Checking ssh-cipher v0.3.0
    Checking ed25519-dalek v3.0.0
    Checking sha3 v0.11.0
    Checking generic-array v0.14.7
    Checking p384 v0.14.0
    Checking p256 v0.14.0
    Checking p521 v0.14.0
    Checking module-lattice v0.2.3
    Checking kem v0.3.0
    Checking common v0.0.1 (/home/runner/.local/state/minimal/sessions/55e50/tree/crates/common)
    Checking sponge-cursor v0.1.0
    Checking data-encoding v2.11.1
    Checking ml-kem v0.3.2
    Checking sha3 v0.12.0
    Checking ssh-key v0.7.0-rc.11
    Checking generic-array v1.4.4
    Checking russh-cryptovec v0.62.0
    Checking num-bigint v0.5.1
    Checking hash32 v0.3.1
    Checking russh-util v0.52.0
    Checking hex-literal v1.1.0
    Checking constcat v0.6.1
    Checking heapless v0.9.3
    Checking russh v0.63.3
    Checking tracing-serde v0.2.0
    Checking bitflags v1.3.2
    Checking tinyvec_macros v0.1.1
    Checking symlink v0.1.0
    Checking managed v0.8.0
    Checking tracing-appender v0.2.5
    Checking smoltcp v0.14.0
    Checking tinyvec v1.12.0
    Checking sessions v0.0.1 (/home/runner/.local/state/minimal/sessions/55e50/tree/crates/sessions)
    Checking json-subscriber v0.3.0
    Checking opentelemetry-semantic-conventions v0.33.0
    Checking is_executable v1.0.6
    Checking switch v0.0.1 (/home/runner/.local/state/minimal/sessions/55e50/tree/crates/switch)
    Checking mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/55e50/tree/crates/mlog)
    Checking clap_complete v4.6.11
    Checking hickory-proto v0.26.3
    Checking sysinfo v0.39.6
   Compiling minvmd v0.7.0 (/home/runner/.local/state/minimal/sessions/55e50/tree/crates/minvmd)
error: using `chunks_exact` with a constant chunk size
   --> crates/switch/src/refusal.rs:205:10
    |
205 |         .chunks_exact(2)
    |          ^^^^^^^^^^^^^^^ help: consider using `as_chunks` instead: `as_chunks::<2>().0.iter()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: using `chunks_exact` with a constant chunk size
   --> crates/switch/src/refusal.rs:209:31
    |
209 |     if let Some(tail) = bytes.chunks_exact(2).remainder().first() {
    |                               ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/switch/src/refusal.rs:209:31
    |
209 |     if let Some(tail) = bytes.chunks_exact(2).remainder().first() {
    |                               ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks

error: could not compile `switch` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Outside the task's layers::

  • crates/minvmd/src/cmd/mod.rs
  • crates/minvmd/src/main.rs

Converted to a draft: something above needs a person before review.

Two VM nodes on one host answer their names from the one answerer the service manager holds, a stopped session leaves that answerer answering, a node that finds the hook port held publishes its rows over the channel instead of binding and says so at start, a channel peer with another uid is refused, a second node's claim on a held name is refused and reported, an address outside the answer rule is refused, both names answer again after a service restart with no session action, and the advisory's privileged step installs the service as the operator from a root-owned copy.

Commit headers reworded by the runtime to fit commitlint. The header the coder wrote is the first paragraph of each of these commits' bodies:

  • feat(minimal): the coder's uncommitted work as it stood when its 7200s ran out

…visory

The coder's snapshot left the crate unbuildable. The answerer step now
reaches the advisory, and the clashes it left are resolved.

- The installed copy's protocol probe bound (1 s) is renamed
  ANSWERER_VERSION_PROBE_BOUND. It no longer collides with
  ANSWERER_PROBE_BOUND, the 250 ms liveness-datagram bound T65 shipped,
  which keeps its value.
- session_advisory_at takes the AnswererStep. Session start reads it
  beside the detection and logs whether the answerer is manager-held.
- The program path and unit paths split per platform, so both command
  renders compile under test without a duplicate definition.
- The two CLI tests the plan names are added. Tests that pinned the old
  lead-ins and the old Linux command now pin the new ones.
- The macOS-only build no longer warns on the LISTEN_FDS helpers that
  only Linux uses.
- The e2e lead-in greps follow the new wording.
… service

NET-122 gains the sub-requirement that the privileged step installs the
box-zone answerer as a host service. The service manager holds the
service's sockets, it runs as the operator, and it runs from a root-owned
copy. NET-138's interim sentence now points at that step.
The advisory command now also installs the box-zone answerer host
service. Each e2e case that runs it as root records the channel path it
binds first. The teardown and the trap then remove the service at the
exact paths the command writes. On macOS that is the LaunchDaemon and the
program copy. On Linux it is the socket and service units and the program
copy. The channel socket goes on both.

The Linux cases read only the first line of the command. That line has an
unterminated quote now that unit files ride inside the command as
heredocs. They now read the whole command, the way the range case does.
The answerer service is now its own program, `min-answerer`, which the
privileged step copies to a root-owned path. The units run it. Its two
client verbs, `release` and `release-cancel`, run as root and talk to
the operator's VM host daemons over their control sockets.

- The channel is machine-global: /run/minimal/answerer.sock on Linux,
  the socket unit's RuntimeDirectory. On macOS it is
  /Library/Application Support/minimal/run/answerer.sock. Test and debug
  builds may override it by env; release builds never do.
- "Installed" is decided by the unit file, never by the socket path. A
  stale socket with no unit file is logged and treated as absent.
- Nodes use the global channel when the service is installed. Otherwise
  they use the interim's per-state-dir channel, which only the hosting
  node binds.
- The node id is the canonical state dir plus the VM name, so name
  ownership is per node.
- The control socket gains release and release-cancel, accepted from
  root or the operator only. Release frees the port and waits up to
  15 s for the service's channel. Cancel re-binds at once, and the
  daemon re-binds on its own when the window runs out.
- The advisory offers the step only on VM-backed hosts. It installs the
  units, releases this CLI's own daemons, then starts the unit. On
  either timeout it rolls back, cancels, and exits non-zero.
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Spec lint

docs/specs/18-spec-box-networking/18-spec-box-networking.md — 11 finding(s)

docs/specs/18-spec-box-networking/18-spec-box-networking.md:159: P004 NET-009 names test 'native_resolution_without_proxy_env', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:304: P004 NET-040 names test 'fresh_install_own_ip_ingress_publishes_loopback', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:309: P004 NET-041 names test 'installer_switch_binary_executable', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:347: P004 NET-048 names test 'linux_amd64_manifest_ships_vm_stack', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:352: P004 NET-049 names test 'fresh_linux_kvm_activate_local_minvmd', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:357: P004 NET-050 names test 'linux_arm64_manifest_ships_vm_stack', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:362: P004 NET-051 names test 'fresh_arm64_kvm_activate_local_minvmd', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:652: P004 NET-139 names test 'vsock_rpc_refuses_non_host_cid', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:669: P004 NET-132 names test 'proxy_sees_each_vm_box_by_its_switch_address', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:695: P004 NET-134 names test 'deny_all_box_reaches_proxy_and_no_other_host_port', which was not found in the repository
docs/specs/18-spec-box-networking/18-spec-box-networking.md:719: P004 NET-107 names test 'session_outbound_request', which was not found in the repository

Advisory. None of this blocks the merge; the review decides.

Advisory, and never a merge gate. Linter: gominimal/foundry@b913de94, spec format: How Minimal Writes Specs.

The address book refuses another node's address but let a node's second row take the same
address as its first, overwriting the first box's holder record; releasing the second would then
free an address the first still answers at. A publish now refuses the later row.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Comment thread crates/minimal/src/resolver.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was the runtime's review findings). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

The channel's uid gate closed a foreign peer's connection without a reply, so another
operator's daemon surfaced only a closed channel. The gate now drains the peer's hello on a
thread of its own and answers a refusal naming the uid the service serves, the peer's uid,
and that multi-operator hosts are not supported.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Comment thread crates/minimal/src/resolver.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was the runtime's review findings). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

With no min-answerer to copy, or a path the command cannot quote, the advisory rendered
without the service step yet still said the command installs or reinstalls the service. The
state's fact now names the remedy only when the step is carried, and the missing-step fact
names which of the two left it out.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

1 similar comment
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Comment thread crates/minvmd/src/net/answerer.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was the runtime's review findings). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Comment thread crates/minvmd/src/net/answerer.rs Resolved
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was the runtime's review findings). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

Each foreign-uid connection to the world-connectable channel got its own refusal thread for
up to a second, so a non-operator process could grow the service's threads and fds without
bound. At most four refusals now answer at once; past that a foreign peer is closed bare.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1803 by hand.

@minimal-foundry minimal-foundry Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 4, 2026

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against T71's plan block. The real-Mac privileged e2e answerer_survives_session_stop passes (handover, two nodes, restart, sibling stop, later publish); KVM proves the Linux service and its loopback-only bind. ARCH PASS. Five review findings fixed in this PR. Follow-ups: gominimal/inbox#889, gominimal/inbox#894, gominimal/inbox#883.

@norrietaylor norrietaylor removed the needs-human An agent handed off; a human must act, then clear this label. Set by defer and handoffs. label Oct 4, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 4, 2026
@norrietaylor
norrietaylor removed this pull request from the merge queue due to a manual request Oct 4, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 4, 2026
Merged via the queue into main with commit a7e5220 Oct 4, 2026
34 of 35 checks passed
@norrietaylor
norrietaylor deleted the agent/1803-hold-the-box-zone-answerer-as-a-host-service-ins branch October 4, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T71 — Hold the box-zone answerer as a host service installed by the privileged step

1 participant