Skip to content

T65 — Answer the box zone from the VM host daemon on a VM-backed host - #1813

Merged
norrietaylor merged 34 commits into
mainfrom
agent/1710-answer-the-box-zone-from-the-vm-host-daemon-on-a
Oct 4, 2026
Merged

norrietaylor merged 34 commits into
mainfrom
agent/1710-answer-the-box-zone-from-the-vm-host-daemon-on-a

Conversation

@minimal-foundry

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

Copy link
Copy Markdown
Contributor

T65 — Answer the box zone from the VM host daemon on a VM-backed host

slice: S9
kind: task
covers: NET-124, NET-125, NET-126, NET-127, NET-128, NET-138
size: L
est: 500 code, 400 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the bundle carries the VM host daemon's zone table with every name, its address and its liveness, and the daemon log names the host answerer's listener at start or the holder it registered with
observability: one debug log line per answered lookup with the name, the type and the answer class; one info line at start naming the listener or the holder
layers:
- core:
- crates/sessions/src/core/zone_answer.rs (new): the pure answer decision over an owned lookup (name, type, origin) and an owned zone view (held names, their host-answerable addresses, liveness): A for a held live name, NODATA for a held name without an A or a non-A type or a stopped shared-address box, NXDOMAIN for an unknown name, REFUSED off-zone, every negative with the SOA, TTL at most 15 s
- crates/sessions/src/core/mod.rs: declares the module
test: cargo nextest run -p sessions zone_answer_decision_matches_contract
- daemon:
- crates/minimald/src/net/answerer.rs: the daemon's answerer calls the shared decision over its registry; the answerer is not started in a microVM
- crates/minimald/src/server.rs: in a microVM neither starts the answerer nor publishes it through the forwarder
test: cargo nextest run -p minimald vm_hosted_daemon_starts_no_answerer
- vmhost:
- crates/minvmd/src/net/answerer.rs (new): the host answerer bound on the host loopback at the answerer port, answering the zone from the box registry with the shared decision, on-machine lookups only; when the port is held by another VM host daemon on the machine this daemon registers its table's names with the holder over the answerer's channel and answers nothing itself
- crates/minvmd/src/box_registry.rs: exposes the zone view: each row's name, host loopback address and liveness
- crates/minvmd/src/cmd/run.rs: starts the answerer, or the registration, beside the switch
- crates/minvmd/src/diag.rs: writes the zone table into the VM host daemon's state dump
- crates/minvmd/Cargo.toml: takes the DNS message library
test: cargo nextest run -p minvmd host_answerer_answers_zone_from_table
test: cargo nextest run -p minvmd host_answerer_non_a_is_nodata
test: cargo nextest run -p minvmd host_answerer_unknown_name_is_nxdomain
test: cargo nextest run -p minvmd host_answerer_short_ttl_and_local_addresses_only
test: cargo nextest run -p minvmd host_answerer_withdrawn_row_is_nxdomain
test: cargo nextest run -p minvmd second_vm_host_daemon_registers_names_with_holder
- e2e:
- scripts/session-e2e.sh: the native-resolution case resolves a VM box's name through the host answerer with the guest daemon's answerer absent
test (deferred: vm): ./scripts/session-e2e.sh native_resolution_from_host_answerer_on_vm_host
produces:
- crates/sessions/src/core/zone_answer.rs
- crates/minvmd/src/net/answerer.rs
consumes:
- crates/minvmd/src/box_registry.rs
- crates/minimald/src/net/answerer.rs
proof: On a VM-backed host the box zone is answered by the VM host daemon on the host loopback from the host-authored table, with the same answer semantics the native daemon's answerer gives, and the in-VM daemon no longer publishes an answerer through the switch's forwarder.
depends on:
- blocked by #1708

State at b789661

The "out of time" note from round 1 no longer applies: rounds 2 to 6 finished the work. Every lane aggregator is green at b789661, and macOS e2e ran native_resolution_from_host_answerer_on_vm_host, including the withdraw half (the destroyed box's row leaves zone.json, and its name answers NXDOMAIN). The Tests table below is round 1's in-runtime evidence; CI at the head supersedes it. The one red check, commitlint, is on a merge commit's subject, which the squash discards.

Moved to T84

The T78 architecture requirement has two halves. This PR proves the name map: create fills the row in zone.json and the name answers; destroy withdraws it and the name answers NXDOMAIN. The other half is the gate's table: after create, read the box's live row and assert its switch address and its derived egress allow-list; after destroy, the same read shows the row gone. This PR can't prove that half, because the box control protocol has no row read. Its only read verb is AnswererStatus. That half moves to T84 #1897, which already adds verbs on the same table and now also carries a read-only row verb and the e2e assertions.

Proof

On a VM-backed host the box zone is answered by the VM host daemon on the host loopback from the host-authored table, with the same answer semantics the native daemon's answerer gives, and the in-VM daemon no longer publishes an answerer through the switch's forwarder.

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(minvmd): the coder's uncommitted work as it stood when its 7200s ran out

Tests

line exit tail
cargo nextest run -p sessions zone_answer_decision_matches_contract 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-a4f5... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/2cdb5/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/2cdb5/tree/crates/ot) C
cargo nextest run -p minimald vm_hosted_daemon_starts_no_answerer 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-abbb... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/a967c/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/a967c/tree/crates/ot) C
cargo nextest run -p minvmd host_answerer_answers_zone_from_table 4 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-b73a... Compiling parking_lot_core v0.9.12 Compiling rustls v0.23.45 Compiling tracing-log v0.2.0 Compiling rustix v1.1.4 Compiling parking_lot v0.12.5 Compiling tracing-subscr
cargo nextest run -p minvmd host_answerer_non_a_is_nodata 4 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-6982... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/0ed5a/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/0ed5a/tree/crates/
cargo nextest run -p minvmd host_answerer_unknown_name_is_nxdomain 4 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-3968... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/f3da8/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/f3da8/tree/crates/
cargo nextest run -p minvmd host_answerer_short_ttl_and_local_addresses_only 4 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-53c6... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/85c3f/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/85c3f/tree/crates/
cargo nextest run -p minvmd host_answerer_withdrawn_row_is_nxdomain 4 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-0f30... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/84671/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/84671/tree/crates/
cargo nextest run -p minvmd second_vm_host_daemon_registers_names_with_holder 4 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-c227... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/a5414/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/a5414/tree/crates/

Verify

min task run agent-verify passed ([tasks.verify]).

Deferred

The plan marked these test lines deferred: the executor lacks the lane, so nothing here ran them and they still owe evidence.

line lane
./scripts/session-e2e.sh native_resolution_from_host_answerer_on_vm_host vm

Closes #1710

The box zone's answer semantics leave the two answerers that must not
drift and land in the core: decide() is pure over an owned lookup (the
name as the wire rendered it, the record type as A or other, and
whether the lookup originated on this machine) and an owned zone view
(the held names, each with the host-answerable address a lookup may be
told and whether its namespace is running).

Off-machine lookups get nothing at all; the apex is held; a name
outside the zone is REFUSED; a held name answers A only when it is
live with an address to give — a non-A type, a name without one, or a
stopped namespace all answer NODATA, held, never NXDOMAIN for a box
that exists (NET-124, NET-125, NET-127, NET-128). Every negative
carries the zone's SOA; every record the answerers emit carries a TTL
of at most ANSWER_TTL_SECS, pinned as a compile-time fact (NET-126).
… the native one

The answer semantics — zone grammar, NODATA, NXDOMAIN, the TTL bound, the
off-host silence — move to sessions::core::zone_answer, where a test states
them as a contract the wire layer must not drift from. The native answerer
now maps that decision onto DNS wire; a daemon inside a microVM starts no
answerer at all and publishes none, so on a VM-backed host the zone is the
VM host daemon's to answer from the host-authored table (NET-138). The
hostname proxy still starts in a microVM exactly as before.
… 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.
@coderabbitai

coderabbitai Bot commented Oct 2, 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: a28f9b9e-ed4e-415c-a5e8-e3b63711fc40

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.

@norrietaylor

Copy link
Copy Markdown
Member

/revise

  1. Declare the host answerer: add pub mod answerer; to crates/minvmd/src/net.rs and add hickory-proto.workspace = true to crates/minvmd/Cargo.toml. Then make crates/minvmd/src/net/answerer.rs compile: rename one of the two struct Registration types (wire message vs. registrant handle, lines 154 and 706), and replace the matches!("…") at line 897 with a plain message string. just clippy must build the file. Scope: minvmd only.
  2. Start it: in crates/minvmd/src/cmd/run.rs, call net::answerer::spawn(boxes.clone(), DEFAULT_ANSWERER_PORT) beside the switch, after register_node_namespace. Scope: VM host start path only. Do not change the native daemon.
  3. Fix the holder's table split in acquire_loop (net/answerer.rs:845-850): create one Arc<RegisteredTables> and pass the same Arc to both HostAnswerer::new and hold_channel, so registered rows are answered.
  4. Fix startup latency in acquire_loop: attempt the bind before waiting on pings.recv_timeout. The wait belongs at the end of each non-holder pass, so a lone daemon holds the port at start, not 30 s later or at the first box registration.
  5. Make a name clash between the holder's own table and a registered row deterministic: the first writer keeps the name and the later one is refused and logged at warn, naming both sources. Currently ZoneView::hold lets the registrant overwrite, which contradicts the doc at net/answerer.rs:403. Keep the change inside crates/minvmd/src/net/answerer.rs; the shared core's hold stays as is.
  6. When the answerer port is held and there is no channel socket (a native minimald or a foreign process), log one warn at start naming the port and saying this VM's box names are not answered on the host. Keep retrying as now. Scope: logging only; do not add a fallback port.
  7. Write the six plan tests in crates/minvmd/src/net/answerer.rs under #[cfg(test)], each named exactly as the plan says: host_answerer_answers_zone_from_table, host_answerer_non_a_is_nodata, host_answerer_unknown_name_is_nxdomain, host_answerer_short_ttl_and_local_addresses_only (the TTL on the A record and the SOA is ≤ 15; a registered row at a non-local address answers NODATA), host_answerer_withdrawn_row_is_nxdomain, and second_vm_host_daemon_registers_names_with_holder. The last one runs two registries in-process on a free loopback port and a temp channel socket, asserts the second's name answers through the first's UDP socket, and asserts it goes NXDOMAIN after the registrant drops. Drive HostAnswerer::respond for the pure cases and a real socket for the last. Every test must fail if the behaviour is removed.
  8. Write the zone table into minvmd's state dump: each row's name, address and liveness, from BoxRegistry::zone_view(). The plan names crates/minvmd/src/diag.rs, which does not exist yet: create it, or add the dump where minvmd's state dump is written today and say which in the PR. Log one info line at start naming the listener or the holder (already present; keep it).
  9. Add the e2e case native_resolution_from_host_answerer_on_vm_host to scripts/session-e2e.sh. On a VM lane it resolves a VM box's name via dig @127.0.0.1 -p 7656 (or the port the host answerer logged), asserts the guest daemon has no zone-answerer listener, and fails rather than skips when E2E_VM is set and the answer is missing. Register it in the case list and the usage text.
  10. Do not change crates/minimald or crates/sessions in this round, except as item 9 needs. The minimald changes are accepted. The min ls and advisory discovery question (the answerer port the CLI shows on a VM host) is waiting on an architecture ruling and is not part of this round.

Declare the answerer module and take the DNS wire library, rename the
registration wire message apart from the registrant's held connection,
and make the file build clean under clippy.

The acquisition loop now attempts the bind before any wait, so a lone
daemon holds the machine's answerer port the moment it starts rather
than after the recheck cadence, and the wait sits at the end of every
pass that did not take the port. The holder shares one table of
registered rows between the answers and the channel that fills them,
so a row another daemon registers is the row a lookup is answered by.

A name two sources both hold is now deterministic: the first writer
keeps it and the later one is refused, one warn per clash naming the
name and both sources, instead of the last row to arrive overwriting.
When the port is held and no channel answers, the one warn names the
port and says this VM's box names are not answered on the host.
The six plan cases: a published box's name answers its table address, a
non-A type is NODATA with the zone's SOA, an unknown in-zone name is
NXDOMAIN, every emitted record and the SOA's minimum sit at or under the
15 s ceiling while a registered row at a non-local address answers
NODATA, a withdrawn row takes its name to NXDOMAIN, and a second VM
host daemon's registered rows answer through the first's real UDP
socket — until its connection drops, when they go NXDOMAIN again. One
further case pins the first-writer rule for a name two sources hold.

The two behaviours this round changed are also proven to bite: with the
refusal removed the registrant overwrites, and with the address
re-gate removed the switch lease reaches the zone.
The VM host start path starts the answerer beside the switch, before the
guest boots, on the machine's answerer port: a lone daemon holds it the
moment it starts, and one that finds it held registers its rows with the
holder and answers nothing itself. Both starts are best-effort, like the
control socket beside them.

The daemon's own table is also dumped to zone.json in its state dir —
one row per published namespace, its name, the address a lookup may be
told, and its liveness — written once at start and on every change from
the registry's pings, atomically, so a reader never sees a torn table.
native_resolution_from_host_answerer_on_vm_host: on a VM-backed
lane the VM host daemon's answerer holds the machine's answerer
port (its start record names the listener, or the registration
with a holder), dig resolves the node namespace row — the name
the host authors itself at start, so no session is needed — at
127.0.0.1 within the short TTL, and `min ls` carries no ZONE
ANSWERER line because the in-VM daemon starts none (NET-138). A
lane that cannot produce the answer fails, not skips.

The accepted minimald change also removed the guest daemon's
answerer, so native_resolution_without_proxy_env — which waited
on the guest's ZONE ANSWERER line and read the advisory a create
response carries a port for — would fail every VM lane. Guard it
to the native lane and drop the VM arms its body no longer
reaches; the VM lane's answerer subject is the new case.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a /revise note, pushed as 31279583ac46.

line exit tail
cargo nextest run -p sessions zone_answer_decision_matches_contract 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-6d4a... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/5fc00/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/5fc00/tree/crates/ot) C
cargo nextest run -p minimald vm_hosted_daemon_starts_no_answerer 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-d1a5... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/f1175/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/f1175/tree/crates/args) C
cargo nextest run -p minvmd host_answerer_answers_zone_from_table 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-4055... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/c1b1b/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/c1b1b/tree/crates/args) C
cargo nextest run -p minvmd host_answerer_non_a_is_nodata 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-caa1... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/ffb71/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/ffb71/tree/crates/
cargo nextest run -p minvmd host_answerer_unknown_name_is_nxdomain 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-bdb8... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/26795/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/26795/tree/crates/
cargo nextest run -p minvmd host_answerer_short_ttl_and_local_addresses_only 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-03ae... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/02ea9/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/02ea9/tree/crates/
cargo nextest run -p minvmd host_answerer_withdrawn_row_is_nxdomain 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-f71a... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/4dee8/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/4dee8/tree/crates/
cargo nextest run -p minvmd second_vm_host_daemon_registers_names_with_holder 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-0345... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/a7e0a/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/a7e0a/tree/crates/

Verify min task run agent-verify passed.

Outside the task's layers::

  • crates/minvmd/src/lib.rs
  • crates/minvmd/src/net.rs

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

On a VM-backed host the box zone is now answered by the VM host daemon's answerer on the host loopback (127.0.0.1:7656, or whichever daemon holds that port) from the host-authored table, with the native daemon's answer semantics over the shared zone decision (A for a held live name, NODATA for non-A/stopped/foreign addresses, NXDOMAIN for withdrawn names, REFUSED off-zone, SOA on every negative, TTL at most 15 s); a second VM host daemon on the machine registers its rows with the holder over the answerer channel (first writer keeps a clashing name), and the in-VM daemon starts no answerer and publishes none through the forwarder — min ls for a VM session carries no ZONE ANSWERER line.

Notes from the agent: Deferred (lane: vm): ./scripts/session-e2e.sh native_resolution_from_host_answerer_on_vm_host is written and registered (header case list, whole-lane order, case-name arm, usage text) but was not run — this box has no KVM/libkrun. On it the case is VM-gated: it fails rather than skips when E2E_VM is set and the answer is missing, resolves the node namespace row via dig @127.0.0.1 -p <port the host answerer logged>, and asserts min ls shows no ZONE ANSWERER line. Verified on this box only up to its guard path (standalone run: clean skip, exit 0). dig is absent here; the case gates it (CI lane without dig fails, dev host warns and skips). Item 8 choice: created crates/minvmd/src/diag.rs — the table is written as zone.json into the daemon's per-VM provider instance dir at start and on every table ping, atomically (temp + rename). The diagnostic bundle's fixed provider file list (crates/minimal/src/diag/collect.rs, provider_files) names the file in its dir listing but does not bundle its contents; adding that one entry is outside this round's layers and is what the diagnostics: field still owes. Collateral in the same e2e file: the accepted minimald change (in-VM daemon starts no answerer, so a VM session's create response carries no ans…[truncated]

The macOS lane failed the new host-answerer case twice over, and the
Linux KVM lane masked both: the log candidate list used `find
-maxdepth`, which BSD find rejects as an unknown primary — with the
error swallowed, the case read only run.log, which carries no tracing
records — and nothing on the macOS lane ever wrote the answerer's
start record: the record is INFO, the lane's daemon runs at warn, and
the only commands that autospawn a daemon with minvmd at info are the
Linux-only install proofs, so the KVM lane passed by reading the
record one of those left behind in the shared log dir.

Take the VM down first and let the one command that autospawns carry
minvmd at info — command-local, like drive_installed_vm_pair's — and
drop the -maxdepth from the find; the plain form is the idiom
recover_minvmd_log already runs on that lane, and the logs dir is
flat.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a failed check suite, pushed as 37c11176155d.

line exit tail
cargo nextest run -p sessions zone_answer_decision_matches_contract 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-0263... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/2b099/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/2b099/tree/crates/ot) C
cargo nextest run -p minimald vm_hosted_daemon_starts_no_answerer 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-1924... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/f9e89/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/f9e89/tree/crates/ot) C
cargo nextest run -p minvmd host_answerer_answers_zone_from_table 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-78a9... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/e8b5c/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/e8b5c/tree/crates/args) C
cargo nextest run -p minvmd host_answerer_non_a_is_nodata 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-a4ca... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/6d719/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/6d719/tree/crates/
cargo nextest run -p minvmd host_answerer_unknown_name_is_nxdomain 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-bafd... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/2f761/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/2f761/tree/crates/
cargo nextest run -p minvmd host_answerer_short_ttl_and_local_addresses_only 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-ebb7... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/207fa/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/207fa/tree/crates/
cargo nextest run -p minvmd host_answerer_withdrawn_row_is_nxdomain 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-2091... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/3530e/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/3530e/tree/crates/
cargo nextest run -p minvmd second_vm_host_daemon_registers_names_with_holder 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-1f94... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/39e58/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/39e58/tree/crates/

Verify min task run agent-verify passed.

Outside the task's layers::

  • crates/minvmd/src/lib.rs
  • crates/minvmd/src/net.rs

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

On a VM-backed host the box zone is answered by the VM host daemon on the host loopback from the host-authored table, with the same answer semantics the native daemon's answerer gives, and the in-VM daemon starts no answerer — and after this round the e2e case that proves it on a VM lane (native_resolution_from_host_answerer_on_vm_host) can actually do so on the macOS lane: the case now restarts the lane's VM host daemon under a command-local RUST_LOG so the answerer's INFO start record reaches the daemon's file log, and reads its log candidates with a plain find BSD find accepts, so ci-macos no longer burns the case's 20 s poll finding no record and failing.

Notes from the agent: Revise round 2; the two failed checks (ci-macos-success, e2e) are the ci-macos workflow's unit and e2e jobs, and both broke on the branch's new VM-lane e2e case in two places, both masked on the green Linux KVM lane. (1) The case's log candidate list used find -maxdepth, an unknown primary on BSD find, with the error swallowed by 2>/dev/null — on macOS the list read only run.log, which carries no tracing records, and the poll failed as though the daemon had said nothing; dropped the -maxdepth (the logs dir is flat, and the plain find is the idiom recover_minvmd_log already runs on that lane). (2) The answerer's start record is INFO but the lane's daemon runs at the harness default RUST_LOG=warn,..., so nothing on the macOS lane ever wrote one — the KVM lane passed only by reading the record its Linux-only install proofs (drive_installed_vm_pair's RUST_LOG="warn,minvmd=info" spawns) left in the shared log dir; the case now stops the VM first and lets its single autospawning min ls carry the same command-local RUST_LOG, so the daemon the case drives writes its own record. Deferred (lane: vm): ./scripts/session-e2e.sh native_resolution_from_host_answerer_on_vm_host — this box cannot boot a microVM; the case exists in the script and is what the ci-macos/ci-linux-kvm e2e lanes …[truncated]

@norrietaylor

Copy link
Copy Markdown
Member

/revise Round 3. Round 2's e2e fix and lanes are green, and the decision core and the daemon layer are accepted. The architecture review confirms items 1–3 below with the conditions folded in.

  1. Retire the node's zone-answerer port (NET-138 on main: the node's admitted set is the hostname proxy only). An admitted port with nothing behind it is a standing grant. In crates/minvmd/src/cmd/run.rs, stop probing and handing the UDP answerer port to the guest (assign_node_ports at :458, NODE_ANSWERER_PORT_ENV at :633). In crates/minvmd/src/box_registry.rs (:793–796), register the node row with the proxy port only, and update the node-port tests. Scope is minvmd only; leave minimald's handoff reader and AnswerScope::Microvm alone. Check that, with the env absent, minimald under AnswerScope::Microvm binds nothing on 7656 and makes no answerer claim (server.rs:1016's early return). If no test pins this, add one assertion to vm_hosted_daemon_starts_no_answerer.
  2. Surface the host answerer from the host, at session start and in min ls (plan block: "surfaced at session start"). Add the answerer's state to minvmd's control status: holder at 127.0.0.1:, registered with a holder, or port held by a process with no channel. On a VM-backed host the CLI reads that state from minvmd's control socket. It never goes through minimald, because a guest relaying a host fact is forgeable from inside the escape boundary. Conditions:
    (a) The read is read-only over the existing 0600 control socket, with the peer uid checked like the socket's other calls, and it adds no mutating verb.
    (b) answerer_bound in the name-surface verdict still comes from the CLI's own A query for host.min.internal at the reported port, expecting 127.0.0.1. The status says where to look and who holds the port; the query proves the answerer is live.
    (c) "Port held by a process with no channel" surfaces at every session start, TTY and non-TTY. It says that this VM's names are not answered on the host and the proxy remains the surface, and the verdict for this node reads Proxy.
    (d) min ls's ZONE ANSWERER line says "answered by the VM host daemon (single-operator interim)" and names the holder, either this VM's minvmd or another daemon.
    Change the e2e assertion at scripts/session-e2e.sh:4135–4141 to expect that line instead of its absence. Scope is minvmd's control status plus the CLI read in crates/minimal (list and session start), with nothing in minimald.
  3. Do not send the node row through the answerer channel. Every VM's node row is minimald.min.internal (box_registry.rs:48), so a second VM is refused and clash-warns by construction. Exclude the node namespace in zone_rows (crates/minvmd/src/net/answerer.rs:865). In second_vm_host_daemon_registers_names_with_holder, assert that both VMs' box names are registered and that no row is refused. Keep the first-writer refusal for box names, and keep refusing host.min.internal from any node through the channel. Inside the guest, the node's DNS layer may keep answering minimald.min.internal. If a host-side node name is ever needed, it is named by the provider host, never a fixed literal; this round adds none.
  4. Bundle carries the dump. In crates/minimal/src/diag/collect.rs (:393), add zone.json (the name from minvmd::diag::ZONE_TABLE_FILE) to the per-provider files copied beside run.log and boot.log, treated as absent the same way. Add an assertion to the existing provider collection test. Today only its name reaches dir-listing.txt. Scope is that file only.
  5. e2e resolves real names. native_resolution_from_host_answerer_on_vm_host loses its current target once item 3 lands. At the answerer port, it should dig:
    • host.min.internal, expecting A 127.0.0.1 with TTL ≤ 15;
    • one live VM box name (create or reuse a session), expecting an A at that box's host-loopback address with TTL ≤ 15;
    • an unknown name, expecting NXDOMAIN.
      Fail, rather than skip, when E2E_VM is set. Also delete the comment at scripts/session-e2e.sh:4150–4156: BSD find accepts -maxdepth, and the same lane runs it at :6533. The fix was the RUST_LOG.
  6. Out of scope this round: crates/sessions and crates/minimald (beyond item 1's assertion). A native minimald writing into the answerer channel is T71 (T71 — Hold the box-zone answerer as a host service installed by the privileged step #1803).

The supervisor no longer probes, hands or admits a zone-answerer port
for the guest node. On a VM-backed host the in-VM daemon starts no
answerer (NET-138) — the host answerer serves the zone from the
host-authored table — so the UDP port the supervisor resolved and put
on the kernel command line and the node row was an admitted port with
nothing behind it, a standing grant.

The handoff is now the hostname proxy port alone: the boot line carries
one token, the decode is one variable, and the node row admits one port.
The registrar and the egress-gate call sites follow the new signature.

minimald's half is pinned where it lives: with nothing handed and
nothing configured, a VM-hosted daemon binds no answerer on the default
port either and makes no discovery claim.
The answerer channel no longer carries the node namespace's row: every
VM host daemon's table holds the same name (minimald.min.internal), so
a second VM's registration of it was refused and clash-warned by
construction — the holder answers its own, and inside the guest the
node's DNS layer keeps answering the name for its own VM. The
registration wire now carries the second VM's box names with nothing
refused, and the multi-VM test proves it: every sent row answers
through the holder at the address its table holds.

The answerer also holds the host's own row now (NET-003's host half):
host.min.internal at the host loopback, held by the answerer itself —
not a namespace any table publishes and nothing the shared decision
special-cases. It is the name the CLI's liveness query and the session
e2e's dig read, held before the fold so a registration for it from any
node is refused like every name the answerer holds first, and over any
box named host: the row the answerer answers is the host's.
The machine's zone answerer is a host fact, and the CLI needs it at
session start and on `min ls` to say where the names answer from. Add
the acquisition loop's state — holder at the port, registered with a
holder, or a port held by a process with no channel — to a cell the
loop writes at every pass, and a read-only `answerer_status` verb on
the 0600 control socket that answers it. The wire type lives in
minimald-rpc so the client and the daemon share one shape; the read
touches no row and adds no mutating verb, and it never goes through
the in-VM daemon, because a guest relaying a host fact is forgeable
from inside the escape boundary.
On a VM-backed host the zone's answerer is the VM host daemon's, so
the facts the naming lines print come from the host: the answerer's
state read over minvmd's control socket — never through the in-VM
daemon, because a guest relaying a host fact is forgeable from inside
the escape boundary — and this CLI's own bounded A query for
host.min.internal at the port that read named, the proof the answerer
is live rather than merely reported held.

min ls says the zone is answered by the VM host daemon and names the
holder; a port held by a process no channel reaches is said plainly at
every session start — the proxy remains the surface — and the verdict
for that node reads the proxy. A native host keeps the daemon's own
report and its lines unchanged.
The VM host daemon writes its zone table to zone.json at start and on
every change; a bundle collected only its name, via the dir listing.
Copy the file beside run.log and boot.log, absent the same way a log
that never appeared is, so a bundle holds the table the answers were
given by.
The proof read the node's row, which no longer travels the answerer
channel. Dig what a person resolving on the host actually gets at the
answerer's port: host.min.internal answering the loopback, one live VM
box's name answering the host-loopback address the daemon's own zone
dump records for it (the session is minted here because the warm-up
took the table down with the daemon), and an unknown name answering
NXDOMAIN. min ls is asserted to name the VM host daemon as the zone's
answerer, and a VM lane that cannot produce the answers fails rather
than skipping. The BSD-find comment was wrong: BSD find accepts
-maxdepth, and the lane runs it elsewhere; the fix was the RUST_LOG.
…branch

Resolves the conflicts with the multi-VM `min ls` (NET-057) and the
session-start proxy-port line. The selected VM's verdict and ZONE ANSWERER
line come from the VM host daemon's status; other VMs keep their daemon's.
@norrietaylor

Copy link
Copy Markdown
Member

/revise Round 4. Round 3's asks are in. The node row now carries the proxy port only. The node row stays off the channel. The status verb rides minvmd's control socket, the bundle carries zone.json, and the merge of main's multi-VM min ls is clean. Four items remain. Keep the scope to the files named below.

  1. The e2e box must be an own-address box. In scripts/session-e2e.sh, native_resolution_from_host_answerer_on_vm_host activates e2e-answerer (:4269) with the default network mode, host_ip. A host-address box registers no host row: register_box_for_activation returns early unless the mode is OwnIp (crates/minimal/src/cmd/session.rs:286). So zone.json never holds e2e-answerer.min.internal, and the case fails at :4289. Activate with --network own_ip, keeping ${E2E_ACTIVATE_ARGS:-} after it. The rest of the case stays as it is: the zone.json poll for the address, the dig expecting that A with TTL ≤ 15, the NXDOMAIN for an unknown name, and fail rather than skip on a VM lane. Scope: that function only.

  2. Surface the interim at every session start on a VM-backed host, not only in the no-channel arm. The plan block says "surfaced at session start". When the control-socket status is Holder or Registered, the session start prints nothing about who answers the zone. In crates/minimal/src/cmd/session.rs (the NET-138 block in activate_session), print crate::resolver::vm_host_answerer_line(status) on stderr, prefixed zone answerer: , at every start, TTY and non-TTY, before the advisory and the verdict. Do not change:

    • The no-channel warning and its Proxy verdict.
    • The native arm.
    • answerer_bound, which still comes from the CLI's own host.min.internal A query.

    Add a unit test that pins the start-line text for Holder and Registered, and that Starting prints nothing. Scope: crates/minimal only, nothing in minvmd or minimald.

  3. Multi-VM min ls: read each listed VM's own status. cmd_ls (crates/minimal/src/cmd/list.rs, the vm_answerer read) asks only the selected VM's control socket. Every other listed VM therefore gets no ZONE ANSWERER row, and its NAME SURFACE verdict comes from its own daemon's report, which on a VM-backed host is always "no answerer". Resolve each listed VM's control socket beside that VM's ssh socket, the socket enumerate_vm_sockets already yields for the listing. Read each one's status under the same bounded read. Then give each VM its own ZONE ANSWERER row and its own vm_host_name_surface verdict. Change format_ls_across_vms to take one optional status per listing in place of the single (vm, status) pair, and update its callers in src/tests.rs and list.rs. Keep these as they are:

    • --json and --raw stay machine-only, with no reads.
    • A VM whose daemon reports its own answerer port keeps the native line.
    • The single-listing path still renders through format_ls.

    Extend ls_shows_vm_per_box (or add a test beside it) with two VMs: one Holder, one Registered. Assert that each VM's row names its own holder. Scope: crates/minimal only.

  4. Fix the error string at crates/minimal/src/cmd/session.rs:108. It contains an embedded run of spaces (with its answerer status) where a line continuation lost its \.

Out of scope this round:

The box-registration refusal for a Status reply had a run of embedded
spaces where a string continuation lost its backslash, so the error a
user read was 'with its                  answerer status'. One line,
one space, same sentence.
The interim was surfaced only in the no-channel arm: a Holder or
Registered status — the two states a healthy VM-backed host is in —
printed nothing about who answers the zone, so the holder another VM's
minvmd took was discoverable only from 'min ls'. Every start now prints
vm_host_answerer_line(status) on stderr under a 'zone answerer: ' label,
TTY and non-TTY alike, before the advisory and the verdict; the
pre-acquisition state still prints nothing. Pure, so the new test pins
the wording without capturing stderr.
@norrietaylor

Copy link
Copy Markdown
Member

Architecture requirement carried from T78 (#1852): the live-table read in this PR's e2e

T78 proves registration from the VM host daemon's registration log line. That line now carries the declared egress and is emitted only after the row is inserted. T78 cannot read the row back yet, because the control socket has no read verb on main until this PR lands.

When this PR's e2e gains the read path, it must add a live-table read for an own_ip box:

  • after create, read the row back and assert it carries the box's switch address and its derived allow-list;
  • after destroy, read again and assert the row is gone.

That completes the chain from the declaration to the live table. The T78 log line stays as the registration-time evidence.

@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/minimald/src/server.rs Resolved
T65 stopped a VM-hosted daemon from starting an answerer and removed the
producer of the handoff: minvmd's boot line no longer carries
MINIMALD_ZONE_ANSWERER_PORT. The guest half was left behind — main read
the token and probed a UDP bind for it on the pid-1 boot path — reading a
port nothing hands it, so the read was always None and the probe bound
nothing.

Delete it: the token, the reader and the answerer half of the probe, the
answerer half of the handed-port tests, and the stale doc claim that
minvmd hands each VM an answerer port. A VM boot now resolves the
answerer's port to None by construction, which is the discovery shape a
VM-hosted daemon reports while the host answerer owns the zone
(NET-138).
Two nits from resolving the merge: the answerer-status doc's provider-kind
sentence read as four nested em-dash asides, and the guest probe's error
assert wrapped one line short of rustfmt's width.

@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

Round 5 of 6 on a conflict with the base branch, pushed as 45c4f92c105d.

Resolved conflicts in: crates/minimal/src/cmd/session.rs, crates/minimal/src/tests.rs, crates/minvmd/src/box_registry.rs, crates/minvmd/src/cmd/run.rs

line exit tail
cargo nextest run -p sessions zone_answer_decision_matches_contract 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-8f64... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/c7707/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/c7707/tree/crates/ot) C
cargo nextest run -p minimald vm_hosted_daemon_starts_no_answerer 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-2922... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/37c83/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/37c83/tree/crates/ot) C
cargo nextest run -p minvmd host_answerer_answers_zone_from_table 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-4c90... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/d839e/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/d839e/tree/crates/ot) C
cargo nextest run -p minvmd host_answerer_non_a_is_nodata 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-1c68... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/cc232/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/cc232/tree/crates/
cargo nextest run -p minvmd host_answerer_unknown_name_is_nxdomain 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-64d8... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/d63a9/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/d63a9/tree/crates/
cargo nextest run -p minvmd host_answerer_short_ttl_and_local_addresses_only 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-bb8d... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/45e6a/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/45e6a/tree/crates/
cargo nextest run -p minvmd host_answerer_withdrawn_row_is_nxdomain 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-4965... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/68077/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/68077/tree/crates/
cargo nextest run -p minvmd second_vm_host_daemon_registers_names_with_holder 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-ce80... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/3075b/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/3075b/tree/crates/

Verify min task run agent-verify passed.

Outside the task's layers::

  • crates/minimal/Cargo.toml
  • crates/minimal/src/cmd/list.rs
  • crates/minimal/src/cmd/session.rs
  • crates/minimal/src/diag/collect.rs
  • crates/minimal/src/resolver.rs
  • crates/minimal/src/tests.rs
  • crates/minimal/tests/bug.rs
  • crates/minimal/tests/cli.rs
  • crates/minimald-rpc/src/lib.rs
  • crates/minimald/src/guest.rs
  • crates/minimald/src/main.rs
  • crates/minvmd/src/control.rs
  • crates/minvmd/src/lib.rs
  • crates/minvmd/src/net.rs
  • crates/minvmd/src/net/bep_stub.rs
  • crates/minvmd/src/net/egress_gate.rs
  • crates/minvmd/src/vm.rs

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

Review threads the coder judged:

  • 👍 valid — PRRT_kwDOPdfcxM6omHNd: Deleted the dead guest-side handoff: HANDED_ANSWERER_PORT_TOKEN, handed_answerer_port and the answerer half of the probe are gone, a VM boot resolves the answerer's port to None by construction, and the stale doc claim that minvmd hands each VM an answerer port is fixed. (not posted on the thread: not an open thread on the pull request)

On a VM-backed host the box zone is answered by the VM host daemon on the host loopback from the host-authored table — A for a held live row, NODATA for a held name without a host-answerable address, a non-A type or a stopped shared-address box, NXDOMAIN for a name no row holds, REFUSED off-zone, every negative carrying the SOA, TTL at most 15 s — with the same answer semantics the native daemon's answerer gives over the same shared decision in crates/sessions/src/core/zone_answer.rs, and the in-VM daemon neither starts an answerer nor publishes one through the switch's forwarder: a VM boot now hands the guest only its hostname-proxy port and resolves the answerer's port to None by construction, with no answerer token, read or probe left on the pid-1 path. The proof is now held against current main: the merge kept it true beside main's T44 proxy attachments and T78 provider-kind rework, all eight task test lines pass, and the four crates' suites (1828 tests) pass.

Notes from the agent: Round 5 was a conflict round: main brought T44 (#1871, proxy attachments), T53 (#1865, min net expose), T78 (#1852, provider-kind keyed registration) and the gvproxy-pin test fetch. The merge is complete (commit f26e30e); no conflict markers remain, and rustfmt, shellcheck (48 scripts) and clippy -D warnings over -p sessions -p minimal -p minimald -p minvmd --all-targets are clean.

Conflict resolutions, so the PR reads coherently against main: (1) minimal/src/cmd/session.rs and tests.rs — took main's daemon_provider_kind rework (vm_host_control_sock now takes the provider kind and dir, and the macOS-only native-listing assertion is guarded by native_names_a_vm) while keeping this branch's control_sock_beside helper, the answerer-status read (now keyed on daemon_provider_kind, as main's rule requires) and the 5-arg format_ls; (2) minvmd/src/box_registry.rs — combined main's NET-133 attachment retirement with this branch's retired()/mark_stopped()/zone-view work in both w…[truncated]

@minimal-foundry
minimal-foundry Bot marked this pull request as draft October 3, 2026 11:35
@norrietaylor

Copy link
Copy Markdown
Member

/revise Round 6, the last under the cap. Main's T78 (#1852) already keys vm_host_control_sock and the box registration on the backend through daemon_provider_kind, and every lane is green at 45c4f92, macOS e2e included. Two items remain.

  1. min ls fallback listing gate. crates/minimal/src/cmd/list.rs:376 still sets control_sock from global.use_minvmd(). On macOS that flag is false while the backend is minvmd, so this path finds no control socket there. Key it on super::session::daemon_provider_kind(global) == paths::ProviderKind::Minvmd, the same rule list.rs:650-657 and session.rs already use. Add a unit test that runs on Linux: an unflagged GlobalArgs gets a control socket exactly when client_provider_kind(false) is Minvmd, and --provider local-minvmd always gets one.

  2. The e2e row must go after destroy. In proof_native_resolution_from_host_answerer_on_vm_host (scripts/session-e2e.sh), after mnl session destroy --force "$answerer_session", poll zone.json until $answerer_box has no live row, and fail if it is still there after the same 20 s bound the create-side poll uses. Then dig the destroyed name at 127.0.0.1:$host_answerer_port and assert status: NXDOMAIN. This proves the withdraw half of the live table (the T78 architecture requirement noted on this PR). The create-side read stays as it is. The row's switch address and allow-list are not in the zone view, so they are not asserted here; the T78 registration log line stays the evidence for them.

Out of scope: crates/sessions, crates/minimald, crates/minvmd, the CI lane args, and any --provider flag on the macOS e2e.

@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 3, 2026
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 7 would exceed the cap of 6 (the last trigger was a conflict with the base branch). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1710 by hand.

The acquisition loop's once-only flags were one: both the warn that
the port is held by something the channel cannot reach and the info
line naming the holder the daemon first registered with keyed on
`warned`, so a daemon that boots against a native minimald's hold
and later registers with the VM host daemon that takes the port
logged only the re-registration's debug line — its log named its
holder neither at a listener nor at a registration, and the bundle
greps and the e2e read the info level.

Give each line its own flag: `warned` keeps the warn,
`registered_once` the first successful registration. The regression
test holds the port with a foreign socket for its whole run and
brings up only the holder's channel beside it, so the daemon's next
pass can only register — no port race between daemons — and asserts
the info line in a log captured at info, where the suppressed
registration's debug line never appears.
`min ls`'s fallback entry — the one listing a host with nothing to
enumerate prints — keyed its VM-host control socket on `use_minvmd()`,
the one gate in the listing that still read the flag alone: on macOS
the flag is false while the backend is minvmd, so the entry there
carried no control socket and `min ls` had no answerer state to read
for it. Key it on `daemon_provider_kind` — the rule the fabric
display and every other VM-backed gate already key on — so the flag's
reading never decides a backend the platform already chose.

The unit test drives the gate through an unflagged `GlobalArgs` with
`client_provider_kind(false)` as its oracle, so it pins the rule on
every host it runs on: on Linux the native backend holds no VM host
daemon, while `--provider local-minvmd` always resolves one.
The host-answerer case proved the live table's fill half — the zone
dump holding the box's row, the name answering it — and stopped at
`destroy`, leaving the withdrawal unasserted: a row whose box is
gone would keep answering, and the lane would stay green.

Read the withdrawal: poll `zone.json` until the destroyed box's row
is no longer live under the same 20 s bound the create-side poll
uses, then dig the destroyed name at the answerer's port and assert
NXDOMAIN — waiting out the same holder-trail the create side waits
out, since a machine whose answerer is another daemon can trail the
dump by a poll. The create-side read stays as it is.
…-box-zone-from-the-vm-host-daemon-on-a

# Conflicts:
#	crates/minimal/src/resolver.rs
#	scripts/session-e2e.sh
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 7 would exceed the cap of 6 (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 #1710 by hand.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 6 of 6 on a /revise note, pushed as b789661f662b.

Resolved conflicts in: crates/minimal/src/resolver.rs, scripts/session-e2e.sh

line exit tail
cargo nextest run -p sessions zone_answer_decision_matches_contract 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-a5df... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/2a643/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/2a643/tree/crates/ot) C
cargo nextest run -p minimald vm_hosted_daemon_starts_no_answerer 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-0396... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/78fb9/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/78fb9/tree/crates/args) C
cargo nextest run -p minvmd host_answerer_answers_zone_from_table 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-b827... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/18d8a/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/18d8a/tree/crates/ot) C
cargo nextest run -p minvmd host_answerer_non_a_is_nodata 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-5877... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/20a14/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/20a14/tree/crates/
cargo nextest run -p minvmd host_answerer_unknown_name_is_nxdomain 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-b619... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/3943b/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/3943b/tree/crates/
cargo nextest run -p minvmd host_answerer_short_ttl_and_local_addresses_only 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-6691... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/b2197/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/b2197/tree/crates/
cargo nextest run -p minvmd host_answerer_withdrawn_row_is_nxdomain 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-82dd... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/fb166/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/fb166/tree/crates/
cargo nextest run -p minvmd second_vm_host_daemon_registers_names_with_holder 0 Applying loadouts: default Running task runtime-implement-test-7 in session task-runtime-implement-test-7-0d89... Compiling version v0.7.0 (/home/runner/.local/state/minimal/sessions/8d8a5/tree/crates/version) Compiling mlog v0.0.1 (/home/runner/.local/state/minimal/sessions/8d8a5/tree/crates/

Verify min task run agent-verify exited 101.

b57e41,libcmov-6902326bb283eb48,libzeroize-7aecb9fe53acdde7,libtypenum-0dcf7e8747d93cf1,libserde_json_lenient-7ce700bf09fa6a94,libitoa-17247a2c8a875a3d,libryu-f6fd534db2abdb2d,libglobset-8e5a20c73cf833cc,liblog-367969b2b60f5a63,libbstr-40b346963559cfa1,libregex_automata-15d52b09c1eb3da6,libregex_syntax-4a7e88b4afb8f2c4,libaho_corasick-4ecd245a8ac8a72e,libmemchr-f635c68eca474dfb,libwalkdir-1783cc240c3bc346,libsame_file-03dd95b0c5c6f8c9,libtoml-3ebd0a9c86a3c5bf,libtoml_writer-9b1a5b71b419fe3c,libtoml_parser-e6c116a049d0b8c3,libwinnow-99c1af2fb880a040,libserde_spanned-be80f269d4b6496f,libtoml_datetime-84ecc87c2d97e656,libtracing-d69d2e93d23e90b6,libpin_project_lite-e13bf5cc3a2893ba,libtracing_core-e3d9d07d66b344ca,libonce_cell-95bf9403d1811857,libportable_atomic-eb019a898abb5d0a,libnutype-5de32d6a6c3d6388,libpaths-637b95848fb67a52,libdirs-7b74faaf8c47e5cf,libdirs_sys-e816aac2461e3c7b,liboption_ext-c133e3a0e728f5f8,libthiserror-d480180f980aa8a1,libcamino-a3afdc3a0dd66bb1,libuuid-df55427de28109e2,libgetrandom-e6a96a028037d8a0,liblibc-836828b86c8ecf52,librand_core-487754200c3459ba,libcfg_if-e3caa094f03d0de5,libchrono-f6edb270f24ca652,libiana_time_zone-1079e7b338da537a,libnum_traits-5ec56d639a34aad8,libserde-75035935062ebae6,libserde_core-ee9647d9df6f413c,libanyhow-f3e9872018b8d373}.rlib" "<sysroot>/lib64/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/work/build-cache/cargo-home/build/debug/deps/rustcj2UWFW/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/work/build-cache/cargo-home/build/debug/build/zstd-sys-c7912bebb9979a47/out" "-L" "/work/build-cache/cargo-home/build/debug/build/tree-sitter-6d857ef690a7a05e/out" "-L" "/work/build-cache/cargo-home/build/debug/build/tree-sitter-nickel-3f36464d3516a3fb/out" "-L" "/work/build-cache/cargo-home/build/debug/build/blake3-bbcf47287b18f779/out" "-L" "/work/build-cache/cargo-home/build/debug/build/aws-lc-sys-ff63e510f19823f4/out" "-L" "<sysroot>/lib64/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/work/build-cache/cargo-home/build/debug/deps/minimal-7b04804b57b65ec0" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /usr/bin/ld: final link failed: No space left on device
          collect2: error: ld returned 1 exit status
          

error: could not compile `minimal` (lib test) due to 1 previous error
error: command `/usr/bin/cargo '--color=auto' test --no-run --message-format json-render-diagnostics --package minimal --package minimald --package minimald-rpc --package minvmd --package sessions --locked` exited with code 101

Outside the task's layers::

  • crates/minimal/Cargo.toml
  • crates/minimal/src/cmd/list.rs
  • crates/minimal/src/cmd/session.rs
  • crates/minimal/src/diag/collect.rs
  • crates/minimal/src/resolver.rs
  • crates/minimal/src/tests.rs
  • crates/minimal/tests/bug.rs
  • crates/minimal/tests/cli.rs
  • crates/minimald-rpc/src/lib.rs
  • crates/minimald/src/guest.rs
  • crates/minimald/src/main.rs
  • crates/minvmd/src/control.rs
  • crates/minvmd/src/lib.rs
  • crates/minvmd/src/net.rs
  • crates/minvmd/src/net/bep_stub.rs
  • crates/minvmd/src/net/egress_gate.rs
  • crates/minvmd/src/vm.rs

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

Review threads the coder judged:

  • 👍 valid — crates/minvmd/src/net/answerer.rs: split the acquisition loop's once-only gates — warned keeps the held-port warn, a new registered_once keeps the first-registration info line — with a regression test that holds the port with a foreign socket for its whole run and brings up only the holder's channel beside it

On a VM-backed host the box zone is still answered by the VM host daemon on the host loopback from the host-authored table, with the same answer semantics the native daemon's answerer gives, and the in-VM daemon still publishes no answerer through the switch — and this round keeps that true while min ls's fallback entry now finds its VM-host control socket on a flagless macOS invocation (the gate keys on daemon_provider_kind, like every other VM-backed gate), the e2e now proves the withdraw half (a destroyed box's row leaves zone.json inside the same 20 s bound and its name answers NXDOMAIN at the answerer's port), and a daemon whose first registration pass only warned now still names its holder in the one info line the diagnostics contract reads.

Notes from the agent: Directive items 1 and 2 done; the one unresolved thread judged valid and fixed. Deferred: test (deferred: vm): ./scripts/session-e2e.sh native_resolution_from_host_answerer_on_vm_host — the withdraw half this round adds is written into that proof, but this box has no KVM host, so the e2e was not run here (lane: vm still owes the evidence). Scope notes: crates/minimal/src/cmd/list.rs and crates/minimal/src/tests.rs are outside this task's layers:, but directive item 1 names them, so they are this round's delta. The thread's fix also lives in crates/minvmd/src/net/answerer.rs, which the directive's note calls out of scope: fixed anyway because the finding is real (verified against the diagnostics contract the task binds: a first-failed-then-successful registration logged only a debug line and named its holder neither at a listener nor at a registration), the file is one of the task's layers:, and a valid verdict is fixed in this round — the out-of-scope line scopes the note's two items, not the thread section the directive requires judged. commitlint failure: caused by pre-existing pushed commits (the 107-column merge-commit subject in 37c1117 and the three non-conventional merge subj…[truncated]

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 7 would exceed the cap of 6 (the last trigger was a conflict with the base branch). A person decides now. Remove needs-human from this pull request to let /revise <note> or the automatic rounds resume, or finish #1710 by hand.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

The runtime will not revise this pull request again on its own: round 7 would exceed the cap of 6 (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 #1710 by hand.

@norrietaylor

Copy link
Copy Markdown
Member

/review

@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 3, 2026
@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 marked this pull request as ready for review October 4, 2026 00:31
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 4, 2026
Merged via the queue into main with commit 08a4f36 Oct 4, 2026
32 of 34 checks passed
@norrietaylor
norrietaylor deleted the agent/1710-answer-the-box-zone-from-the-vm-host-daemon-on-a branch October 4, 2026 00:43
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.

T65 — Answer the box zone from the VM host daemon on a VM-backed host

1 participant