Repository navigation
feat(minimald): answer a macOS box's ports at the address its name resolves to (T98) - #2713
Conversation
Bring in the work of #2332 from its merge-queue commit. Allocation reads the whole box range through switch::loopback::probe and hands the 127.0.0.1 interim when the host cannot bind it, so the zone never answers an address that nothing listens at. A resume keeps the range or interim address the box was created at across an answerer restart.
A microVM daemon walked the host's loopback once, at its start. After `min finalize-install` the host binds the range, but the daemon kept the absent verdict, so new boxes stood at the 127.0.0.1 interim until the VM restarted. The create handler on a VM-backed daemon now asks the forwarder's walk, not the guest's own lo, so the reply's interim flag is the host's verdict. While the landed verdict is not present, each session start walks again. A present landing moves every box at the interim onto its range address through land_range_verdict's present arm. Walks run one at a time on the shared probe port.
The boxes in each_box_gets_own_loopback_address are now created after a session-start walk lands the range present over an absent daemon-start verdict. The test checks that each box's forwards bind at its own range address.
On the macOS lane the fresh-install case runs the script that min finalize-install runs on a running VM. It then asserts that a new own-IP box answers at <name>.min.internal:8080 and at its 127.0.64.N address, and that min ls names that address.
…x-s-ports-answer-at-the-address-its-na
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Reviewed: no findings; approval withheld, 4 threads unresolved at APPROVE withheld: 4 unresolved threads — minimal-arch[bot] scripts/session-e2e.sh:5065, minimal-arch[bot] scripts/session-e2e.sh:5064, minimal-arch[bot] scripts/session-e2e.sh:5065, minimal-arch[bot] scripts/session-e2e.sh:5065. Resolving the last thread releases the approval on this head. Resolve the open threads. Resolving the last one releases the approval on this head; no new review is required. Clobber: none seen. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 3 conditions · the full ruling
The forwarder walk at session start is in the right owner, fails closed to the interim, and logs what the task promises. One part deviates. RangeWalk::session_start stops the bind probe once the verdict is present. §7.1 line 258 and NET-123 require a bind probe at every session start. C1 removes that skip and updates the test that pins it. C2 keeps the deferred macOS e2e leg open until it runs. C3 amends NET-040, because its 127.0.0.1:8080 is the interim address, not the range address §7.1 line 255 gives an own-IP box.
Ruled at 3b32cf8 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
/revise Close arch conditions C1 and C3 from the ruling at
Generated by Claude Code |
…x-s-ports-answer-at-the-address-its-na
The range can go away under a running VM. A present verdict no longer skips the session-start walk, so a present-to-absent walk lands the absent arm and moves the boxes in the range onto the 127.0.0.1 interim.
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The session-start walk now probes the range each time, as §7.1 line 258 requires. The NET-040 amendment matches line 254. One defect is now reachable. The probe binds port 21064 on each range address and counts any refusal as an absent address. A box that holds port 21064 at its range address makes the next session start read the whole range absent. Then every box leaves its session-stable address (line 254). C1 fixes the probe. C2 asks for the macOS e2e run, or an issue that owns it.
Ruled at ef16170 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
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. Review threads the coder judged:
On a macOS host after Notes from the agent: Revise round 1 closes C1 and C3. C1: RangeWalk::session_start no longer returns early on a present verdict. Every session start that does not take a concurrent walk's answer calls walk_and_land(). The unused range_present helper is removed. The RangeWalk, RangeWalkAnswer, session_start_range_walk and init doc comments are updated. session_start_rewalks_range_after_finalize_install now expects three walks and walked=true for |
ef16170 to
533ccb2
Compare
|
/revise Close arch condition C1 from the re-ruling at
Generated by Claude Code |
…x-s-ports-answer-at-the-address-its-na
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The change now bind-probes the range at every session start, as §7.1 line 258 requires. NET-040 is amended. When the range goes away, the absent arm of land_range_verdict moves own-address boxes to 127.0.0.1. It leaves the node address in the range, so host_ip names answer an address that the host cannot bind. Make the change in C1 so that the node goes back to its pre-grant state, and add the test assertion. C2 corrects a stale doc comment. The macOS e2e leg stays open on #2717.
Ruled at 533ccb2 against gominimal/arch@109541a48c31 by claude-opus-5-5.
…x-s-ports-answer-at-the-address-its-na
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The two new commits close the open points from the last ruling. A held probe port now counts as a bound address. A walk that gets no answer keeps a present verdict, and §7.1 line 258 allows that because a fault does not show that the range is absent. One leg stays open: the macOS e2e case is deferred on #2717 and did not run. C1 tells you how to close it. The change can merge with C1 open as a filed residual.
Ruled at 8e65894 against gominimal/arch@109541a48c31 by claude-opus-5-5.
The forwarder answers 'already running' from its own forward table, so a probe forward that an earlier walk left bound read as a bound address on every later walk. The walk now marks each address before its expose and clears the mark once nothing of its own is held there. At a marked address an in-use answer releases the leftover and asks again.
There was a problem hiding this comment.
APPROVE withheld: 11 unresolved threads — minimal-arch[bot] crates/minimald/src/box_manager.rs, minimal-arch[bot] crates/minimald/src/rpc/tests.rs, minimal-arch[bot] scripts/session-e2e.sh:5065, minimal-arch[bot] scripts/session-e2e.sh:5171, minimal-arch[bot] crates/minimald/src/net/policy.rs, ….
minimal-review — advisory review
Verdict COMMENT — No findings.
Panel: 2 of 3 personas ran (correctness, security); did not complete: supply-chain.
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
The compare is a clean merge of main and one fix to the range walk in policy.rs. The fix makes the session-start bind probe fail closed. A probe forward that an earlier walk left bound no longer counts as a bound address. This agrees with §7.1 line 258. The ruling on 8e658947 stands for the rest. C1 stays open: the macOS e2e leg is deferred to the vm lane on #2717, and a SKIPPED run does not close it.
Ruled at 0a41402 against gominimal/arch@109541a48c31 by claude-opus-5-5.
|
Round 5 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:
On a macOS host after Notes from the agent: Revise round 5: addressed the one open thread in crates/minimald/src/net/policy.rs. RANGE_WALK_TURN now also holds, per control channel, the addresses where a walk may have left its own probe forward bound (an unexpose that failed, or a budget cut between expose and unexpose). At such an address an in-use answer releases the leftover and asks again. If that release fails, the address does not count as bound. A held address with no mark still counts as bound and gets no unexpose, so a box forward is never torn down. Deferred (lane: vm): ./scripts/session-e2e.sh fresh_install_own_ip_ingress_publishes_loopback was not run on this box. cargo clippy -p minimald --all-targets was clean. |
There was a problem hiding this comment.
arch-review: PASS_WITH_CONDITIONS · 1 condition · the full ruling
This head merges main and does not change the PR's files. The ruling on 0a414026 stands. The session-start walk agrees with §7.1 line 258. One condition stays open. Run the macOS e2e leg fresh_install_own_ip_ingress_publishes_loopback and record the result in #2717 (C1).
Ruled at 2ef9597 against gominimal/arch@109541a48c31 by claude-opus-5-5.
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter review at 2ef95978. This head is 0a414026 with main merged by update-branch (no hand resolution), so the code under review is 0a414026's.
- Design: arch re-review at this head is PASS_WITH_CONDITIONS against §7.1 lines 249-258. The walk now runs at every session start, a present-to-absent walk moves boxes and the node address to the 127.0.0.1 interim, and NET-040 is amended to publish at the address the name resolves to.
- Leftover probe forward (LOW 4407565379): fixed in
0a414026. A walk marks each address before its expose, releases its own leftover forward on an in-use answer at a marked address and asks again, and counts a failed release as a failure, not a bound address. That fails closed. - C1 (macOS leg
fresh_install_own_ip_ingress_publishes_loopback): the epic owner ruled it is carried by residual #2717, which the PR body's Deferred table names. The five threads that asked for the run are resolved with that ruling. - Threads: zero open. I checked each earlier arch condition against the code at
0a414026before resolving it. - CI: every lane aggregator is green at this head, with the trickle-test fix (#2737) in the base.
No further findings.
Generated by Claude Code
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter approval at 2ef9597: every merge gate passes at this head (arch PASS at 2ef9597, zero open threads, every lane aggregator green). Squash title feat(minimald): answer a macOS box's ports at the address its name resolves to (T98) and the squashed message pass commitlint. Queued for squash merge.
Generated by Claude Code
…olves to (#2713) T98. A microVM daemon walked the host's loopback once, at its start, so after min finalize-install new boxes stood at the 127.0.0.1 interim until the VM restarted. The create handler on a VM-backed daemon now asks the forwarder's walk, not the guest's own lo, and every session start walks again, so a present landing moves boxes at the interim onto their range addresses and a present-to-absent walk moves them back. Walks run one at a time on the shared probe port. A held probe port counts as bound, a leftover probe forward is released before it is read, and a walk that gets no answer keeps a present verdict. The absent landing also moves the node's own address to the interim. The NET-040 spec line and the macOS e2e case come with the change. Backport of #2713, folded from #2740. Adapted to the line: - box_manager.rs and box_manager/handle.rs hunks land in sessions.rs: RangeWalk, RangeWalkSource and RangeWalkAnswer, the range_walk cell on ManagerHandle and WeakManagerHandle, session_start_range_walk and install_range_walk_standin. - rpc/tests.rs hunks land in the inline tests in rpc.rs. - crate::traced::spawn becomes tokio::spawn in the stand-in forwarders. - ADDRESS_IN_USE_BODY is shared with #2352: one copy stays in net/policy.rs. (cherry picked from commit 64d3358)
…olves to (#2713) T98. A microVM daemon walked the host's loopback once, at its start, so after min finalize-install new boxes stood at the 127.0.0.1 interim until the VM restarted. The create handler on a VM-backed daemon now asks the forwarder's walk, not the guest's own lo, and every session start walks again, so a present landing moves boxes at the interim onto their range addresses and a present-to-absent walk moves them back. Walks run one at a time on the shared probe port. A held probe port counts as bound, a leftover probe forward is released before it is read, and a walk that gets no answer keeps a present verdict. The absent landing also moves the node's own address to the interim. The NET-040 spec line and the macOS e2e case come with the change. Backport of #2713, folded from #2740. Adapted to the line: - box_manager.rs and box_manager/handle.rs hunks land in sessions.rs: RangeWalk, RangeWalkSource and RangeWalkAnswer, the range_walk cell on ManagerHandle and WeakManagerHandle, session_start_range_walk and install_range_walk_standin. - rpc/tests.rs hunks land in the inline tests in rpc.rs. - crate::traced::spawn becomes tokio::spawn in the stand-in forwarders. - ADDRESS_IN_USE_BODY is shared with #2352: one copy stays in net/policy.rs. (cherry picked from commit 64d3358)
T98 — A macOS box's ports answer at the address its name resolves to
slice: S0
kind: task
covers: NET-010, NET-040, NET-123
size: L
est: 340 code, 460 tests
executor: agent
difficulty: unknown ground
model: strongest
diagnostics:
min bugbundles carry the daemon log, whose session-start probe line names the publish surface it picked (surface=reserved-rangeorsurface=127.0.0.1-interim) and, on a re-walk aftermin finalize-install, the boxes it moved off the interimobservability: one info line per session-start range walk with the surface and the first failing address, and one warn line per box moved between the interim and its range address, with the session id, the old and the new address
layers:
- host-allocation:
- crates/minvmd/src/net/answerer.rs: builds on open PR #2332: allocation bind-probes the resolved range address and hands the 127.0.0.1 interim when the host cannot bind it, so the zone never answers an address nothing listens at; finish that PR here rather than restart it
- crates/minvmd/src/control.rs: #2332's resume path keeps a box's recorded range or interim address across an answerer restart and releases a failed non-interim resume
test: cargo nextest run -p minvmd released_address_is_not_reused_within_the_answer_ttl
- guest-walk:
- crates/minimald/src/box_manager.rs: the forwarder-conducted range walk, today run once at daemon start, also runs at each session start while the landed verdict is absent; a present landing moves every box standing at the interim onto its range address through the existing
land_range_verdictpresent arm- crates/minimald/src/box_manager/handle.rs: exposes the re-walk to the create handler beside
land_range_verdict- crates/minimald/src/rpc.rs: the create handler's session-start probe on a VM-backed daemon asks for the forwarder walk instead of reading the guest's own
lo, so the reply's interim flag is the host's verdict- crates/minimald/src/net/policy.rs:
probe_publish_surfaceis callable per session start without holding the daemon-start path- crates/minimald/src/rpc/tests.rs: a create after the stand-in walk flips from absent to present publishes in the range and clears the interim flag
test: cargo nextest run -p minimald session_start_probes_reserved_range
test: cargo nextest run -p minimald absent_range_publishes_interim_and_readvises
test: cargo nextest run -p minimald session_start_rewalks_range_after_finalize_install
test: cargo nextest run -p minimal advisory_command_reserves_the_range_on_macos
- allocation:
- crates/minimald/src/box_actor/tests.rs: two boxes created after the range lands hold distinct range addresses and their forwards bind at those addresses
test: cargo nextest run -p minimald each_box_gets_own_loopback_address
- e2e:
- scripts/session-e2e.sh: the fresh-install case asserts on macOS that
http://<name>.min.internal:8080and the box's range address both return the in-box server's response, and thatmin lsnames that addresstest (deferred: vm): ./scripts/session-e2e.sh fresh_install_own_ip_ingress_publishes_loopback
produces:
- crates/minimald/src/box_manager/handle.rs
consumes: none
proof: On a macOS host after
min finalize-install, a new own-address box's declared port answers at the 127.0.64.N address its name resolves to, without restarting the VM.Proof
On a macOS host whose VM started before
min finalize-install, the nextmin session activate --network own_ipwalks the host's loopback through the forwarder again. It finds the range present and lands it. The new box's declared port then answers at the 127.0.64.N address its name resolves to, and boxes that stood at 127.0.0.1 move to their range addresses. The VM does not restart. Unit tests prove this with a stand-in walk. The macOS e2e case that proves it on a real host is written, but it was not run here.Notes from the agent: Host-allocation layer: PR #2332 was in the merge queue as commit 379c2f0, whose parent is this branch's head. I applied it whole, with no changes, as one commit (360d51a). It touches only answerer.rs and control.rs. If #2332 merges first, that commit is a duplicate and the merge will be clean or trivial.
Guest-walk layer: a new RangeWalk type in box_manager.rs owns the forwarder walk and the verdict landing. The daemon-start walk and every session-start walk use it, and it lets one walk run at a time. A session start that waits behind a walk takes that walk's answer. While the landed verdict is not present, each session start walks again. A present verdict is not walked again. land_range_verdict now returns how many boxes its present arm moved, and the session-start log line carries it as moved_off_interim. policy.rs adds a lock per process (RANGE_WALK_TURN), so two walks never bind the probe port at the same time. The create handler on a VM-backed daemon logs the same message as before ("session-start loopback probe picked the publish surface"), with via=forwarder, walked, moved_off_interim, surface and first_failure added. A native daemon keeps its local bind probe.
Cost: on a VM-backed daemon, a create that arrives while the daemon-start walk runs now waits for that walk, about 1 s on a dead control channel. While the range is absent, every create pays one walk of 254 expose/unexpose rounds.
Test seam: BoxManagerHan…[truncated]
Tests
cargo nextest run -p minvmd released_address_is_not_reused_within_the_answer_ttlcargo nextest run -p minimald session_start_probes_reserved_rangecargo nextest run -p minimald absent_range_publishes_interim_and_readvisescargo nextest run -p minimald session_start_rewalks_range_after_finalize_installcargo nextest run -p minimal advisory_command_reserves_the_range_on_macoscargo nextest run -p minimald each_box_gets_own_loopback_addressVerify
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.Base
The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:
crates/minvmd/src/control.rscrates/minvmd/src/net/answerer.rsDeferred
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 fresh_install_own_ip_ingress_publishes_loopbackLayer exception
docs/specs/18-spec-box-networking/18-spec-box-networking.mdis outside T98'slayers:. Arch condition C3 at3b32cf89(arch_rulings 497) asks for the NET-040 amendment by name: the box's port 8080 is published at the loopback address its name resolves to, its reserved-range address (NET-010) or127.0.0.1under NET-123's interim. The verify line is unchanged.Closes #2687
Generated by Claude Code