Repository navigation
T112 — The hostname proxy takes its preferred port back when it frees, and min ls lists every port it serves - #2832
Conversation
The hostname proxy that starts on a substitute port now watches its preferred port. When the port passes the assignment's checks, the watcher takes its reservation and asks the switch to publish it to the guest proxy, so both ports serve without a VM restart. The assignment line moves to net::proxy_reclaim and logs at warn when the preferred port was skipped. The control socket answers a proxy_ports read.
min ls reads the ports the VM's hostname proxy serves on from the VM host daemon's control socket. The HOSTNAME PROXY row names both ports while a reclaimed preferred port and the substitute serve, and --json carries them as hostname_proxy_ports.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter review of b883662 against T112. proxy_reclaim.rs watches the preferred port while the proxy serves on a substitute. Once the port is free it takes the reservation and asks the switch to publish it, without a VM restart. A failed publish warns once and then logs at debug, and a reclaim logs hostname proxy reclaimed its preferred port. The assignment line warns with skip_reason when the preferred port was skipped. min ls names every served port on the HOSTNAME PROXY row ("listening on 127.0.0.1:7654 and 127.0.0.1: …"), and --json carries hostname_proxy_ports. A daemon with no read prints exactly what it printed before. This matches the plan block's layers and test lines, and all lanes are green.
|
Approved: every review thread resolved at @norrietaylor resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
…me-proxy-takes-its-preferred-port-back
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The reclaim forward is outside the egress gate's publish ledger. Every other host-side forward is in it (SwitchMirrorBinder::bind). Section 7.1 line 244 says each forward the helpers bind comes from the records they hold. Line 254 says revocation unbinds the forward and ends its connections. The gate cannot do that for a forward it holds no record of. The publisher also accepts proxy already running with no record of who holds the listener. That fails open. Make the change in C1. The placement, the warn line and the min ls listing conform. The browser proof leg is still open.
Ruled at b883662 against gominimal/arch@8640f85e193d by claude-opus-5-5.
An unconfirmed publish or a port held after the start serves nothing the host can vouch for. The proxy-ports reply is now empty then, and the reclaim watcher does not take or publish the preferred port.
The --json listing now applies the same proxy-down verdict as the HOSTNAME PROXY row, on the single-VM and the multi-VM paths.
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The change conforms to §7.1 lines 244, 254 and 264. The compare resolves the proxy-down items from the last ruling. The reclaim forward comes from the host's own records and reaches the same guest proxy. A pinned port never moves, and min ls names no port while the proxy is down. One leg of the proof is open: nobody ran the browser check through both ports on a real VM. C1 asks for that run, or for an issue that tracks it.
Ruled at dd0daf3 against gominimal/arch@8640f85e193d by claude-opus-5-5.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
With another process on port 7654, the VM's proxy starts on a substitute port, and the VM host daemon's log warns which port it skipped and why. Free 7654 and the watcher publishes it beside the substitute without a VM restart, so http://web.min.internal:3000 opens through both ports and min ls lists both. A proxy that the VM host reports as down or unconfirmed now names no port in the min ls row, in --json, or in the control socket's proxy-ports reply. Notes from the agent: Revise round 1. The run_foreground path compiles only with the minvmd_libkrun cfg. This box has no libkrun, so I type-checked it with |
|
/revise Arch C1 and two review findings on b883662.
Run this task's test lines. |
The reclaim publisher now notes 127.0.0.1:<preferred> -> node:<substitute> in the gate's publish ledger before the expose, as the node mirror's binds do. A refused note fails the attempt. 'proxy already running' counts only when the ledger already held the same forward, and a failed expose drops the note. MirrorLedger gains note_forward, which takes a separate inside port.
The --json listing now reads each VM's answerer status, so the proxy-down verdict that hides the HOSTNAME PROXY ports also leaves hostname_proxy_ports out of the document.
|
Round 2 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
When another process holds port 7654, the VM's proxy starts on a substitute port and the VM host daemon's log warns which port it skipped and why. When 7654 frees, the watcher notes the 127.0.0.1:7654 forward in the egress gate's ledger, asks the switch to publish it, and the control socket and Notes from the agent: Revise round 2. Arch C1: proxy_reclaim_publisher now takes the BoxTable, notes the forward with a new MirrorLedger::note_forward (separate inside port), fails on a stopped gate or a refused note, accepts 'proxy already running' only when the note returned Ok(false), and calls forget_bind when the expose fails. Out of scope: crates/minvmd/src/net/egress_gate.rs is not in the task's layers. The directive asked for the note_forward change there, so I made it (note_bind now delegates to note_forward with inside = port). Review MEDIUM (item 2) and LOW (item 3) were addressed in round 1 (f933def, dd0daf3). This round also makes |
|
/revise One review finding on 8fc6ea8 (thread at
Drop the verdict parameter from |
cmd_ls reads no VM answerers for --json, so the verdict check never ran. The VM host daemon reports no ports while the proxy is down, and the empty served list leaves hostname_proxy_ports out.
|
Round 3 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. With another process on port 7654 the VM's proxy starts on a substitute port, and the VM host daemon's log warns which port it skipped and why. When 7654 frees, the proxy serves on both ports without a VM restart, and Notes from the agent: This round: insert_proxy_ports no longer takes a proxy-down verdict. Its doc comment now says that the VM host daemon reports no ports while the proxy is down. The unused |
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter review of daf96a0. The dead verdict parameter is gone, and the JSON leaves hostname_proxy_ports out on an empty served list, which is what the VM host daemon reports while the proxy is down (f933def). Arch C1 (the ledger note) is met at a87e0bd. The live-VM proof is residual #2837. commitlint flags one body line in dd0daf3. It is not a required check, and the squash commit takes the PR title.
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The reclaim forward now goes through the egress gate's ledger before the switch exposes it. This closes the code half of the earlier C1, as §7.1 line 254 requires. The --json listing now reads one source for a down proxy, and that source is correct. The live-VM proof is still not observed. C1 keeps it open as the filed residual #2837. The --json answerer read in cmd_ls is no longer used, and its comment is out of date. That is a code-quality item, not a design item.
Ruled at daf96a0 against gominimal/arch@8640f85e193d by claude-opus-5-5.
The JSON document reads no proxy-down verdict, so the per-VM control socket round trip bought nothing.
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The compare removes an answerer-status read from min ls --json. The JSON output never used that read. The proxy-down decision stays on the host side: minvmd returns no proxy ports while the proxy is down, as §7.1 line 244 requires. Everything outside the compare keeps the ruling on daf96a0. C1 stays open under #2837: a live VM leg must show that the reclaimed 7654 serves and keeps egress parity (§7.1 line 254).
Ruled at 7ad1fe1 against gominimal/arch@8640f85e193d by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 2 unresolved threads — minimal-foundry[bot] crates/minimal/src/cmd/list.rs, minimal-arch[bot] crates/minvmd/src/cmd/run.rs:2906. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
Round 4 of 10 on the runtime's review findings, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. Review threads the coder judged:
With another process on port 7654 the VM's proxy starts on a substitute port, and the VM host daemon's log warns which port it skipped and why. When 7654 frees, the proxy serves on both ports without a VM restart, and Notes from the agent: This round restores the |
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of 7ad1fe1e815a withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
T112 — The hostname proxy takes its preferred port back when it frees, and
min lslists every port it servesslice: S17
kind: task
covers: NET-150, NET-151, NET-154
size: L
est: 440 code, 240 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the substitute-port warning and the reclaim line land in the VM host daemon's log, which
min bugalready collects;min lsshows the ports the proxy serves, so a person reads where to point a browserobservability: a warn line
hostname proxy serving on a substitute portwith fields preferred, skip_reason, port_holder and port; an info linehostname proxy reclaimed its preferred portwith preferred and substitute; both in the VM host daemon's logdepends on:
- blocked by #2696
- blocked by #2705
layers:
- reclaim:
- crates/minvmd/src/net/proxy_reclaim.rs (new): watches the preferred proxy port while the proxy serves on a substitute; when the preferred port passes the same bind and loopback checks the assignment uses, it takes the reservation and asks the switch to publish
127.0.0.1:<preferred>to the guest proxy's port, so both ports serve without a VM restart; the substitute keeps serving; the node-port assignment's log line moves here and logs at warn whenever the preferred port was skipped- crates/minvmd/src/net.rs: declares the new module
- crates/minvmd/src/cmd/run.rs: starts the watcher after the VM boots when the proxy's port is a substitute, and calls the moved assignment log
- crates/minvmd/src/control.rs: the control socket answers a proxy-ports request with every host port the proxy serves, the preferred first
test: cargo nextest run -p minvmd proxy_reclaims_preferred_port_when_free
test: cargo nextest run -p minvmd proxy_substitute_port_logs_warning
- listing:
- crates/minimald-rpc/src/lib.rs: the proxy-ports request and reply on the VM host control channel
- crates/minimal/src/cmd/session.rs: a client helper beside
vm_host_answerer_status_atthat reads the proxy ports from a VM's control socket- crates/minimal/src/cmd/list.rs: the HOSTNAME PROXY row lists every port,
listening on 127.0.0.1:7654 and 127.0.0.1:65264 as the HTTP proxy for <box>.min.internal nameswhile both serve, and one port as today otherwise;--jsoncarries"hostname_proxy_ports": [7654, 65264]- crates/minimal/src/tests.rs: pins the one-port and two-port rows and the JSON field
test: cargo nextest run -p minimal ls_reports_every_proxy_port
produces: none
consumes: none
proof: With another process on port 7654 the VM's proxy starts on a substitute port and the VM host daemon's log warns which port it skipped and why; free 7654 and, without restarting the VM,
http://web.min.internal:3000opens through both ports andmin lslists both.Proof
A VM whose proxy starts on a substitute port because another process holds 7654 now logs a warn line,
hostname proxy serving on a substitute port, in the VM host daemon's log. The line carries preferred, skip_reason, port_holder and port. While the VM runs, a watcher probes 7654 every 5 seconds with the same bind and loopback checks the assignment uses. When 7654 is free, the watcher takes its reservation and asks the switch to publish 127.0.0.1:7654 to the guest proxy's substitute port. The substitute keeps serving, and the watcher logshostname proxy reclaimed its preferred port.min lsthen printsHOSTNAME PROXY: listening on 127.0.0.1:7654 and 127.0.0.1:65264 as the HTTP proxy for <box>.min.internal names, andmin ls --jsoncarries"hostname_proxy_ports": [7654, 65264]. The unit tests prove this with a real held port and a stand-in switch. Nobody on this box ran it against a real VM, so the browser half of the proof (http://web.min.internal:3000through both ports) is not observed.Notes from the agent: Outside the layers: a new BoxControlRequest::ProxyPorts and BoxControlReply::ProxyPorts each need one arm in an existing exhaustive match. The arms are in crates/minimald/src/rpc.rs (the native control socket refuses the verb like the other VM-host verbs) and crates/minimal-client/src/box_registration.rs (a registration that gets this reply fails). Without them those crates do not compile.
The spec excerpt in .implement/spec.md does not contain NET-150, NET-151 or NET-154. I worked from the task's layer notes and the observability line only.
This box has no libkrun, so run_foreground (where the watcher starts) is behind cfg(minvmd_libkrun) and the normal clippy run does not compile it. I type-checked it once with RUSTFLAGS="--cfg minvmd_libkrun" cargo check -p minvmd --lib in a separate target dir, and it passed. No VM end-to-end run was made.
Design points for review: (1) The reclaim publish is a host-side expose of 127.0.0.1:<pref…[truncated]
Tests
cargo nextest run -p minvmd proxy_reclaims_preferred_port_when_freecargo nextest run -p minvmd proxy_substitute_port_logs_warningcargo nextest run -p minimal ls_reports_every_proxy_portVerify
min task run agent-verifyexited 100 under rustc 1.99.0, which the repository does not pin (1.99.1 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.Out of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimal-client/src/box_registration.rscrates/minimald/src/rpc.rsResiduals
Closes #2709