Repository navigation
fix(minimald): a native Linux host binds a box's declared ingress forwards at activation, before the - #3703
Conversation
The switch keeps the lease a native finalize draws for a box, with the declared forwards bound toward it. The box's first attach takes that lease and its forwards, and binds nothing again. A detach of a lease whose attach failed before it adopted them unbinds them.
On a native host the finalize draws the box's switch lease and binds the declared forwards toward it at publish, in place of the port probe. A program on the host reaches a declared port as soon as the activation returns. A stop or destroy unbinds forwards that no attach adopted, and a switch that cannot start falls back to the probe.
…inux-host-binds-a-box-s-declared-ingre
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
|
The maintainer accepts the change outside the task's layers: the one call in |
|
Approved: no findings at Nothing to do. Clobber: not checked in depth. If that was not intentional, restore the earlier change. |
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
A native finalize now binds the declared forwards before the box goes Active, and stop and destroy release them. That part conforms to the bind discipline in §7.1 line 255. Two paths break that line. When the switch does not start, finalize logs a warning and publishes the name with no bind. C1 makes that fail the finalize, as the VM-backed arm does. The first attach adopts the activation forwards without checking their address. After a publish move before the attach, the name answers at an address with no bound forward. C2 adopts only the forwards at the current address and binds the rest.
Ruled at 0062a4e against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 2 unresolved threads — minimal-arch[bot] crates/minimald/src/box_actor/setup.rs:971, minimal-arch[bot] crates/minimald/src/net/gvproxy_network.rs:432. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
/revise
Add a test for each: the switch-not-started finalize fails, and an attach after a moved address binds the missing forwards. Run both by name and record the results. |
…inux-host-binds-a-box-s-declared-ingre
A native box's first attach kept every forward its finalize bound, even when the publish moved before the attach. It now keeps only the forwards at the box's current address, unbinds the others, and binds the declared ports that are missing there.
|
Round 1 of 10 on a /revise note, pushed as
Verify Outside the task's
Review threads the coder judged:
On a native Linux host, a program on the host connects to a box's declared ingress port right after min session activate returns, before any attach. If the box's address moves before its first attach, the attach unbinds the forward at the old address and binds the declared port at the new address, so the box's name never answers at an address where a declared port is not bound. Notes from the agent: C2 is done: finish_own_ip_attach now calls adopt_activation_forwards. It keeps only the activation forwards that a declared mapping binds at the current published address, on a port the box does not yield now. It unbinds the other forwards and binds the missing mappings through apply_ingress_naming_holders. If that bind fails, it unbinds the kept forwards. The new test is native_attach_binds_the_forwards_a_moved_publish_left_unbound, and it passes. C1 is not done, and the C1 test is not written. I made the change: the native (false, _) arm returned Err when draw_for_activation failed, and host_ports_in_use was removed. Then |
There was a problem hiding this comment.
arch-review: CONDITIONS · 1 condition · the full ruling
The adopt path now meets C2. The first attach keeps only the forwards at the current publish, unbinds the others and binds the missing ports. C1 is still open. setup.rs did not change. When the switch does not start at activation, the finalize logs a warning, runs the old probe and continues with no declared port bound. Section 7.1 line 255 says that a failed bind is a surfaced error, never a silent fallback. Make the change in C1.
Ruled at 281e69b against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
|
Round 2 of 10 on the runtime's review findings: the coder changed nothing. This round changes no code. Both open threads describe tradeoffs that were made on purpose. The replies explain why. The three test lines pass at head 281e69b. To make a switch that cannot start fail the finalize (thread PRRT_kwDOPdfcxM66Q5VJ), every own-IP finalize in the suite needs a switch stand-in. That stand-in belongs in TestServer in test_harness.rs, which is outside this task's layers. A follow-up task can add a default switch stand-in to TestServer, then change the Some(Err) arm to return Err(e) and retire host_ports_in_use. Review threads the coder judged:
|
|
/revise
|
The maintainer deferred failing the native finalize when the switch does not start. The NET-121 note in spec 18 and the code comment on that arm now name the issue that tracks it.
|
Round 3 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: outside the task's On a native Linux host, a program on the host can connect to a box's declared ingress port right after min session activate returns, before any attach. If the publish moves before the first attach, that attach keeps only the forwards at the box's current address and binds the rest there. Notes from the agent: Item 2 (C2): the fix and its test were already on the branch in 281e69b. adopt_activation_forwards in gvproxy_network.rs keeps only the activation forwards at the current published address, unbinds the others, and binds the missing declared ports at attach. The test native_attach_binds_the_forwards_a_moved_publish_left_unbound covers an attach after a moved address. I ran it by name this round, and it passed (exit 0). Item 1 (residual): list #3716 as the residual for C1 in the PR body. The fail-the-native-finalize-when-the-switch-does-not-start change needs a switch stand-in in TestServer. I cannot edit the PR body, so the runner must add this. Out of scope: docs/specs/18-spec-box-networking/18-spec-box-networking.md. The maintainer asked for this edit. I added #3716 to the NET-121 note for the native switch-not-started case. I also cited #3716 in the code comment on that arm in setup.rs. crates/minimald/src/net/provider.rs was already in the branch diff from an earlier round. It is not in the layers, and I did not touch it this round. |
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 fix commit does not meet C1. The native finalize still logs a warning and continues when the switch does not start, so the box goes Active with no declared forward bound. Design §7.1 line 255 says a failed bind is a surfaced error, never a silent fallback. A comment that names #3716 does not change that. The new clause on NET-121 writes the fallback into the spec against the design. Make the edit in C1, and remove the spec clause in C2.
Ruled at 5288297 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
…inux-host-binds-a-box-s-declared-ingre
A native attach unbinds the forwards its activation left at an old address. When that unbind failed, the forwarder was dropped and its listener stayed bound with nothing to track it. The attach now keeps it, so the attach's teardown unbinds it again.
|
Round 4 of 10 on the runtime's review findings, pushed as
Verify Outside the task's
Review threads the coder judged:
On a native Linux host, a program on the host can connect to a box's declared ingress port right after min session activate returns, before any attach. A stale forward that the first attach fails to unbind now stays tracked, and the attach's teardown unbinds it again. Notes from the agent: Revise round 4. The only code change is in adopt_activation_forwards: a stale activation forward whose unbind_moved fails now stays in the returned set. The attach's teardown then retries the unbind. C1 and C2 are not changed. A maintainer deferred failing the native finalize when the switch does not start, and #3716 tracks that work. Commit 5288297 records that decision. Also ran native_attach_binds_the_forwards_a_moved_publish_left_unbound (exit 0) and cargo clippy -p minimald --all-targets (clean). |
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The native finalize still falls back to the host_ports_in_use probe when the switch does not start. Then the box goes Active with no declared port bound. Section 7.1 line 255 says a failed bind is a surfaced error, never a silent fallback. The new fix commit in adopt_activation_forwards conforms, but it does not touch C1 or C2. Return the error in the Some(Err(e)) arm (C1). Remove the spec clause that records the fallback (C2).
Ruled at f8b23f8 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
A gvproxy that exits after a native activation takes the activation forwards with it. The switch now counts its spawns, and a box's first attach drops activation forwards bound under an earlier spawn, so it binds every declared port on the switch that runs now.
|
Round 5 of 10 on the runtime's review findings, pushed as
Verify Outside the task's
Review threads the coder judged:
On a native Linux host, a program on the host connects to a box's declared ingress port right after min session activate returns, before any attach. If gvproxy restarts before the first attach, that attach binds the declared ports again on the new switch. Notes from the agent: Round 5. Fixed the foundry finding: SwitchClient counts gvproxy spawns, and claim_activation_lease drops activation forwards bound under an earlier spawn, so adopt_activation_forwards binds every declared port again. C1 and C2 stay invalid, for the same reason as in the earlier rounds: the maintainer deferred failing the native finalize when the switch does not start, and #3716 tracks it. The spec file in C2 is also outside this task's layers. cargo clippy -p minimald --all-targets and cargo fmt --check are clean. just clippy-strict was not run. |
|
The runtime will not revise this pull request again on its own: the diff is +1117/-56 (1173 lines), past 3x the plan's estimate of 380 lines (est: 220 code, 160 tests, as the triage comment pinned on #3646 reads), at round 5 (the last trigger was the runtime's review findings). A person decides now. Remove |
There was a problem hiding this comment.
arch-review: CONDITIONS · 2 conditions · the full ruling
The new commit handles a gvproxy restart before the first attach correctly. It does not touch the two open conditions. The native finalize in setup.rs still falls back to a warning and a probe when the switch does not start. Design §7.1 line 255 forbids that silent fallback. Make the edit in C1. Then remove the matching clause from the NET-121 spec comment, as C2 says.
Ruled at 6405b2d against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.
There was a problem hiding this comment.
minimal-review — approval withheld
Verdict COMMENT — APPROVE withheld: 10 unresolved threads — minimal-arch[bot] crates/minimald/src/box_actor/setup.rs:973, minimal-arch[bot] crates/minimald/src/net/gvproxy_network.rs:552, minimal-arch[bot] crates/minimald/src/box_actor/setup.rs:973, minimal-arch[bot] crates/minimald/src/box_actor/setup.rs:973, minimal-arch[bot] docs/specs/18-spec-box-networking/18-spec-box-networking.md:1059, …. No findings.
Panel: 3 of 3 personas ran (correctness, security, supply-chain).
|
/review |
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 6405b2d0b08c 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.
Follow-up
Fixes #3646
crates/minimald/src/box_actor/setup.rscrates/minimald/src/box_actor/host.rscrates/minimald/src/box_actor/tests.rscrates/minimald/src/net/policy.rscrates/minimald/src/net/gvproxy_network.rscrates/minimald/src/net/mod.rsTask marker
Proof
On a native Linux host, min session activate now binds each declared ingress port before the box goes Active. A program on the host can connect to the box's declared port at its published address right after the activation returns, before any attach. The box's first attach takes the same switch lease and keeps those forwards. A stop or destroy with no attach unbinds the port. a_native_activation_binds_declared_forwards_before_the_first_attach shows this against a stand-in switch that binds real host listeners.
Notes from the agent: Out of scope: crates/minimald/src/net/provider.rs changed by one call site. A native box with no handed address draws its lease in OwnIpNetwork::reserve, so the attach takes the activation lease only if that call passes the box id (attach() became attach_drawn(session_id)). No file in the layers can make that change. Deviation: the activation lease and forwards are held on the s 8000 hared SwitchClient, keyed by box id, and not in an actor field. The attach can reach the switch but not the actor, and box_actor.rs is not in the layers. host.rs releases them through the switch at stop or destroy. host_ports_in_use stays: when the native switch cannot start (gvproxy missing), finalize logs a warning, falls back to the old probe, and the first attach binds as before. ensure_running now refuses a missing absolute gvproxy path before it deletes the control socket. Without that check, a failed start at finalize deleted the socket of a stand-in switch that another test binds. Risk: on a host where gvproxy-min is installed, the test harness server now spawns a real gvproxy at a native own-IP finalize. Before this change it spawned one only at an attach, which the harness never does, so tests that bind a stand-in socket before finalize can see a different switch there. Known gaps: adopted forwards bound at activation are not in RuntimeIngress.record_attached until the attach, so a publish move (#2748) before the first attach does not move th…[truncated]
Tests
cargo test -p minimald a_native_activation_binds_declared_forwards_before_the_first_attachcargo test -p minimald activation_refused_when_declared_port_is_held_by_a_host_programcargo test -p minimald native_attach_adopts_the_forwards_bound_at_activationVerify
min task run agent-verifypassed ([tasks.verify]).Base
The base branch moved while the coder worked; it was merged in before the tests ran.
Out of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimald/src/net/provider.rs