Skip to content

fix(minimald): leave the host_ip QUIC cohort when a box's shell exits on its own (T64) - #2570

Merged
norrietaylor merged 2 commits into
mainfrom
agent/2556-leave-the-host-ip-quic-cohort-when-a-box-s-shell
Oct 25, 2026
Merged

norrietaylor merged 2 commits into
mainfrom
agent/2556-leave-the-host-ip-quic-cohort-when-a-box-s-shell

Conversation

@minimal-foundry

Copy link
Copy Markdown
Contributor

T64 — Leave the host_ip QUIC cohort when a box's shell exits on its own

slice: S9
kind: task
covers: BEP-018
size: S
est: 40 code, 80 tests
executor: agent
difficulty: needs care
model: standard
diagnostics: the daemon log tail carries one line when a box whose shell exited on its own leaves the cohort, naming the box and the members still blocking
observability: one info log line per departure through the exit path, with the blocking members left
layers:
- lifecycle:
- crates/minimald/src/box_actor/host.rs: the path that observes the host process's exit calls leave_quic443_cohort the way stop_running does, so a box whose shell exits on its own stops blocking the cohort and the remaining members move home when the last blocker goes
test: cargo nextest run -p minimald host_ip_cohort_shell_exit_leaves_and_lifts_the_block
produces: none
consumes: none
proof: A host_ip cohort whose only blocked member's shell exits on its own sends UDP 443 again without a Stop or destroy.
depends on:
- blocked by T53


Generated by Claude Code

Proof

A host_ip box with a blocked quic443 stance whose shell exits on its own now leaves the cohort when its host loop ends. When it was the only blocking member, the other members' processes move out of the blocked leaf and send UDP 443 again, with no Stop or destroy. The new test drives this over a stand-in cgroup tree, and the daemon log gets one info line that names the box and the members that still block.

Notes from the agent: The host loop that sees the process exit is in box_runtime.rs, outside the layers. So host.rs observes the exit at the loop's JoinHandle: launch_host wraps the handle of each host_ip member in a watcher task (watch_quic443_exit). When the loop ends by itself, the watcher calls leave_quic443_cohort, the same call stop_running makes. An abort of the watched handle aborts the loop through a drop guard, so the abort semantics of stop_running and mint_session_host do not change. A per-box launch number (Quic443Launches, a static in host.rs) is taken before each join. With it, a replaced host whose loop ends late, after kill_and_stop_loop detaches it on timeout, cannot remove a later launch's membership and lift its block. stop_running and the failed-join path now call stop_quic443_launch, which clears the number and departs. The two earlier cohort tests also pass. I did not run just ci, clippy-strict or the whole crate suite. cargo clippy -p minimald --all-targets shows no warning in host.rs.

Tests

line exit tail
cargo nextest run -p minimald host_ip_cohort_shell_exit_leaves_and_lifts_the_block 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-16af... Compiling ot v0.0.1 (/workbench/crates/ot) Compiling args v0.0.1 (/workbench/crates/args) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc

Verify

min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

the sandbox ran rustc (1.98.1), the repository pins 1.97.0 in rust-toolchain.toml; a failure here may be the newer toolchain's, not this change's
Applying loadouts: default
Running task runtime-implement-verify in session task-runtime-implement-verify-2914...
    Checking args v0.0.1 (/workbench/crates/args)
    Checking ot v0.0.1 (/workbench/crates/ot)
    Checking paths v0.0.1 (/workbench/crates/paths)
   Compiling stdlib v0.0.22 (/workbench/crates/stdlib)
   Compiling version v0.8.0 (/workbench/crates/version)
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking common v0.0.1 (/workbench/crates/common)
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking boxes v0.0.1 (/workbench/crates/boxes)
    Checking sandbox v0.0.1 (/workbench/crates/sandbox)
    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking mfile v0.0.1 (/workbench/crates/mfile)
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking checkouts v0.0.1 (/workbench/crates/checkouts)
    Checking decode v0.0.1 (/workbench/crates/decode)
    Checking graph v0.0.1 (/workbench/crates/graph)
    Checking lcache v0.0.1 (/workbench/crates/lcache)
    Checking rcache v0.0.1 (/workbench/crates/rcache)
    Checking op v0.0.1 (/workbench/crates/op)
    Checking check v0.0.1 (/workbench/crates/check)
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Closes #2556

A host_ip box whose shell exits on its own ends its host loop with no
Stop, so it stayed a cohort member and kept the cohort's UDP 443 block
in place. launch_host now wraps the loop's handle in a watcher. When
the loop ends, the box leaves the cohort, and the other members move
home when it was the last blocker. An info line names the box and the
members that still block.

A launch number taken before each join keeps a replaced host's late
loop end from removing a later launch's membership. An abort of the
watched handle still aborts the loop.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0c3c542f-4ebf-43fd-bd4c-adea0a0b90b5

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@minimal-foundry

minimal-foundry Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Approved: every review thread resolved at 99971d931de5.

@norrietaylor resolved the last thread, which releases the approval this review had withheld.

Nothing to do.

@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.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread crates/minimald/src/box_actor/host.rs Resolved

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: CONDITIONS · 1 condition · the full ruling

The exit-path departure conforms to §5.3 line 150. A box whose shell exits on its own is no longer a resident member, and the cohort's block lifts only when no blocker is left. The new log line is also emitted on every Stop and Destroy of a host_ip member. kill_and_stop_loop awaits the watched handle, and the watcher departs while the launch number is still current. So the log says that the shell exited on its own when a Stop ended it. Make the change in C1: retire the launch number before the kill, and keep the departure after it. Then the change conforms.

Ruled at fee4db0 against gominimal/arch@109541a48c31 by claude-opus-5-5.

Comment thread crates/minimald/src/box_actor/host.rs Resolved
Comment thread crates/minimald/src/box_actor/host.rs Resolved
The watcher resumed a panic from the host loop before it left the
cohort, so a blocking member kept UDP 443 blocked until a Stop. It now
leaves first and then resumes the unwind.

@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 — approval withheld

Verdict COMMENT — APPROVE withheld: 3 unresolved threads — minimal-foundry[bot] crates/minimald/src/box_actor/host.rs, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:621, minimal-arch[bot] crates/minimald/src/box_actor/host.rs:168. No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@minimal-arch minimal-arch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arch-review: PASS · the full ruling

The change conforms to Networking §5.3 line 150. A host_ip box whose shell exits on its own leaves the cohort through the same depart call as a Stop. The cohort lifts the block only when no resident member blocks. At this head the box also leaves when its host loop panics, and the box's own pids stay in the blocked leaf. No condition is open.

Ruled at 99971d9 against gominimal/arch@109541a48c31 by claude-opus-5-5.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 99971d931de5.

line exit tail
cargo nextest run -p minimald host_ip_cohort_shell_exit_leaves_and_lifts_the_block 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-a640... Compiling args v0.0.1 (/workbench/crates/args) Compiling ot v0.0.1 (/workbench/crates/ot) Compiling paths v0.0.1 (/workbench/crates/paths) Compiling stdlib v0.0.22 (/workbenc

Verify min task run agent-verify exited 101 under rustc 1.98.1, which the repository does not pin (1.97.0 in rust-toolchain.toml); the PR is not a draft on that alone — CI, which honours the pin, is the gate.

    Checking mlog v0.0.1 (/workbench/crates/mlog)
    Checking moka v0.12.16
    Checking argon2 v0.6.0-rc.8
    Checking compression-codecs v0.4.45
    Checking bcrypt-pbkdf v0.11.0
    Checking ssh-cipher v0.3.0
    Checking ed25519-dalek v3.0.0
    Checking generic-array v0.14.7
    Checking sha3 v0.11.0
    Checking p256 v0.14.0
    Checking p521 v0.14.0
    Checking p384 v0.14.0
    Checking module-lattice v0.2.3
    Checking kem v0.3.0
    Checking object v0.40.0
    Checking hashbrown v0.14.5
    Checking sponge-cursor v0.1.0
    Checking tinyvec_macros v0.1.1
    Checking data-encoding v2.11.1
    Checking tinyvec v1.12.0
    Checking sha3 v0.12.0
    Checking dashmap v6.2.1
    Checking check v0.0.1 (/workbench/crates/check)
    Checking ml-kem v0.3.2
    Checking ssh-key v0.7.0-rc.11
    Checking generic-array v1.4.4
    Checking async-compression v0.4.50
    Checking orchestrator v0.0.1 (/workbench/crates/orchestrator)
    Checking russh-cryptovec v0.62.0
    Checking vsock v0.5.4
    Checking vte v0.15.0
    Checking async-tar v0.6.1
    Checking num-bigint v0.5.1
    Checking russh-util v0.52.0
    Checking serde_bytes v0.11.19
    Checking constcat v0.6.1
    Checking hex-literal v1.1.0
    Checking russh-sftp v2.4.0
    Checking minimald-rpc v0.0.1 (/workbench/crates/minimald-rpc)
    Checking russh v0.64.1
    Checking diagnostics v0.0.1 (/workbench/crates/diagnostics)
    Checking mctx v0.0.1 (/workbench/crates/mctx)
    Checking vt100 v0.16.2 (https://github.com/gominimal/vt100-rust.git?rev=9b8cce5a6798daf061948259ebcb073bb1ea54a6#9b8cce5a)
    Checking tokio-vsock v0.7.2
    Checking hickory-proto v0.26.3
    Checking clap_complete v4.6.11
    Checking async-dialog v0.0.1 (/workbench/crates/async-dialog)
    Checking wait-timeout v0.2.1
    Checking sysinfo v0.39.6
    Checking switch v0.0.1 (/workbench/crates/switch)
    Checking bit-vec v0.10.1
    Checking quick-error v1.2.3
    Checking bit-set v0.11.1
    Checking rusty-fork v0.3.1
    Checking rand_xorshift v0.5.0
    Checking core_detect v1.0.0
    Checking unarray v0.1.4
    Checking serial_test v4.0.1
    Checking proptest v1.12.0
error: using `chunks_exact` with a constant chunk size
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    |
help: consider using `as_chunks::<2>()` instead
   --> crates/minimald-rpc/src/trace.rs:199:46
    |
199 |     for (byte, pair) in out.iter_mut().zip(s.chunks_exact(2)) {
    |                                              ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#chunks_exact_to_as_chunks
    = note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::chunks_exact_to_as_chunks)]`

error: could not compile `minimald-rpc` (lib) due to 1 previous error

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/box_actor/host.rs: watch_quic443_exit now calls exit_quic443_launch before resume_unwind, and the test proves a panicking loop lifts the block.

A host_ip cohort whose only blocked member's shell exits on its own sends UDP 443 again without a Stop or destroy. The same now holds when that member's host loop panics: the box leaves the cohort before the panic reaches the watched handle.

Notes from the agent: Revise round 1: watch_quic443_exit now calls exit_quic443_launch before it resumes a panic. The test gains a case where the loop panics and the block lifts. The doc comment on watch_quic443_exit says an aborted loop leaves nothing, but the code calls exit_quic443_launch on every outcome. The launch number keeps that safe. This round did not change that behaviour.

@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 — every review thread is resolved; @norrietaylor closed the last one. The review of 99971d931de5 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.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 25, 2026
@norrietaylor norrietaylor changed the title T64 — Leave the host_ip QUIC cohort when a box's shell exits on its own fix(minimald): leave the host_ip QUIC cohort when a box's shell exits on its own (T64) Oct 25, 2026

@norrietaylor norrietaylor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babysitter approval at 99971d9: every merge gate passes at this head (arch PASS at 99971d9, zero open threads, every lane aggregator green). Squash title fix(minimald): leave the host_ip QUIC cohort when a box's shell exits on its own (T64) and the squashed message pass commitlint. Queued for squash merge.


Generated by Claude Code

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 0bf6bac Oct 25, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the agent/2556-leave-the-host-ip-quic-cohort-when-a-box-s-shell branch October 25, 2026 19:25
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.

T64 — Leave the host_ip QUIC cohort when a box's shell exits on its own

1 participant