Repository navigation
T65 — Answer the box zone from the VM host daemon on a VM-backed host - #1813
norrietaylor merged 34 commits into
Conversation
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.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
/revise
|
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.
|
Round 1 of 10 on a /revise note, pushed as
Verify Outside the task's
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 — Notes from the agent: Deferred (lane: vm): |
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.
…-box-zone-from-the-vm-host-daemon-on-a
|
Round 2 of 10 on a failed check suite, pushed as
Verify Outside the task's
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 |
|
/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.
|
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.
|
/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
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.
|
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:
That completes the chain from the declaration to the live table. The T78 log line stays as the registration-time evidence. |
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.
|
Round 5 of 6 on a conflict with the base branch, pushed as Resolved conflicts in:
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
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] |
|
/revise Round 6, the last under the cap. Main's T78 (#1852) already keys
Out of scope: crates/sessions, crates/minimald, crates/minvmd, the CI lane args, and any |
|
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 |
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
|
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 |
|
Round 6 of 6 on a /revise note, pushed as Resolved conflicts in:
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
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 Notes from the agent: Directive items 1 and 2 done; the one unresolved thread judged valid and fixed. Deferred: |
|
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 |
|
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 |
|
/review |
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 leaveszone.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.jsonand 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 isAnswererStatus. 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 outTests
cargo nextest run -p sessions zone_answer_decision_matches_contractcargo nextest run -p minimald vm_hosted_daemon_starts_no_answerercargo nextest run -p minvmd host_answerer_answers_zone_from_tablecargo nextest run -p minvmd host_answerer_non_a_is_nodatacargo nextest run -p minvmd host_answerer_unknown_name_is_nxdomaincargo nextest run -p minvmd host_answerer_short_ttl_and_local_addresses_onlycargo nextest run -p minvmd host_answerer_withdrawn_row_is_nxdomaincargo nextest run -p minvmd second_vm_host_daemon_registers_names_with_holderVerify
min task run agent-verifypassed ([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.
./scripts/session-e2e.sh native_resolution_from_host_answerer_on_vm_hostCloses #1710