Skip to content

fix(mctx,minimald,minvmd): a task on a VM-backed host_ip box runs in the classifier leaf of its box - #3610

Draft
minimal-foundry[bot] wants to merge 9 commits into
mainfrom
agent/3582-a-task-on-a-vm-backed-host-ip-box-runs-in-the-cl
Draft

minimal-foundry[bot] wants to merge 9 commits into
mainfrom
agent/3582-a-task-on-a-vm-backed-host-ip-box-runs-in-the-cl

Conversation

@minimal-foundry

@minimal-foundry minimal-foundry Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up

Fixes #3582

Task marker
### D3574 — A task on a VM-backed host_ip box runs in the classifier leaf of its box and gets the egress of its box
  kind: task
  size: M
  est: 140 code, 160 tests
  executor: agent
  origin: bug
  epic: 1437
  layers:
    - placement:
      - crates/mctx/src/env.rs: The task sandbox config gets with_classifier_leaf from the context leaf, so the task invocations join the leaf of the box
      - crates/mctx/src/lib.rs: make_env_with_network carries the context classifier leaf into the env args. Add a test that a leaf-bearing context gives a leaf-bearing task env
      - crates/minimald/src/env.rs: run_task keeps the classifier leaf of the box on the context it uses for run_invocations_relayed, and logs the leaf that the task runs in
      - crates/minimald/src/exec/process.rs: task_network gives a host_ip task the verdict of its box leaf, not the no-leaf plan
      - crates/minimald/src/net/provider.rs: task_network_for builds the HostIpAddressNetwork of a task with the box verdict and decision
      - crates/minimald/src/net/classifier.rs: Add a helper that gives the existing box leaf for a task of a host-address box, and update the NET-079 note that a task places no leaf
      test: cargo test -p mctx task_env_carries_the_box_classifier_leaf
      test: cargo test -p minimald run_task_runs_in_the_box_classifier_leaf
    - gate:
      - crates/minvmd/src/net/egress_gate.rs: Log the first dropped opening packet of each box once, with the source, the destination and the port, for node-plane and host_ip drops
      test: cargo test -p minvmd node_plane_drop_is_logged_once_per_box
    - cache:
      - crates/op/src/cache_clean.rs: An entry with no recorded read is stale only when its write time is before the cutoff
      test: cargo test -p op clean_keeps_an_unread_entry_written_after_the_cutoff
  proof: On macOS with host_ip, a task that opens /dev/tcp/www.google.com/443 and /dev/tcp/1.1.1.1/443 connects, the same as min box exec in that box.

Proof

A task of a host_ip box now runs in the classifier leaf of its box. This applies to an in-box min task run and to a task run over the exec channel. The task sandbox joins that leaf, so on a VM host the guest filter decides the task connections with the box verdict, the same as for min box exec.

macOS VM run

  • Host: Apple M5 Max, macOS 27.2.1 (arm64)
  • Commit: 7a65a15d (this PR's head)
  • Provider: local-minvmd (libkrun microVM), every box --network host_ip
  • Binaries: min, minvmd and bep built from this head by just minimal-cli minvmd-build (codesign last). The guest minimald is from just initramfs on this head; its initramfs carries this branch's new running an in-box task in the box's classifier leaf line. The VM ran from a private state dir (min --minimal-dir), so no existing box or daemon was involved. The minvmd log reports service.version 0.8.0-dev.632.g7a65a15d. The cross-built guest reports plain 0.8.0, because the container build has no git describe, so the run set MINIMAL_ALLOW_VERSION_SKEW=1.

The probe is the scratch project's task probe:

[tasks.probe]
bash = """
exec 3<>/dev/tcp/www.google.com/443 && echo google ok; exec 4<>/dev/tcp/1.1.1.1/443 && echo cf ok
"""
leg command exit output tail
setup min session activate -n p3610 --network host_ip . 0 box 01a1f45d-b454-79bf-ad82-5153efb72311
control min box exec p3610 -- bash -c 'exec 3<>/dev/tcp/www.google.com/443 && echo google ok; exec 4<>/dev/tcp/1.1.1.1/443 && echo cf ok' 0 google ok / cf ok
1: exec channel, from the host min task run --network host_ip probe 0 Running task probe in box probe-1... / google ok / cf ok / Kept box probe-1. ...
2: in-box, in the activated session min box exec p3610 -- min task run probe 0 google ok / cf ok

Guest minimald log for leg 1 (task box probe-1, 01a1f45e-0003-7577-8106-0991e1f229c4):

minimald::box_runtime::enforcement: the host-address box's egress verdict is decided on its classifier leaf, in the allow subtree session="probe-1" classifier="allow" leaf=/sys/fs/cgroup/minimald.slice/boxes/allow/01a1f45e-0003-7577-8106-0991e1f229c4 host_ip_enforcement=per_box
minimald::exec::process: task box: the run relays the box's entrypoint drop_env=0 start_dir=None stdin=true
minimald::env: running an in-box task in the box's classifier leaf box_name=probe-1 task=probe leaf=/sys/fs/cgroup/minimald.slice/boxes/allow/01a1f45e-0003-7577-8106-0991e1f229c4
sandbox: sandbox launch: box joins its classifier leaf before its cgroup namespace is unshared onto it leaf=/sys/fs/cgroup/minimald.slice/boxes/allow/01a1f45e-0003-7577-8106-0991e1f229c4
minimald::env: relaying a task's exit code to the in-box min helper task=probe exit_code=0
minimald::exec::process: task run: returned the entrypoint's exit code box_id=01a1f45e-0003-7577-8106-0991e1f229c4 box_name=probe-1 task=probe exit_code=Some(0)

Guest minimald log for leg 2 (session p3610, 01a1f45d-b454-79bf-ad82-5153efb72311):

minimald::box_runtime::enforcement: the host-address box's egress verdict is decided on its classifier leaf, in the allow subtree session="p3610" classifier="allow" leaf=/sys/fs/cgroup/minimald.slice/boxes/allow/01a1f45d-b454-79bf-ad82-5153efb72311 host_ip_enforcement=per_box
minimald::env: running an in-box task in the box's classifier leaf box_name=p3610 task=probe leaf=/sys/fs/cgroup/minimald.slice/boxes/allow/01a1f45d-b454-79bf-ad82-5153efb72311
sandbox: sandbox launch: box joins its classifier leaf before its cgroup namespace is unshared onto it leaf=/sys/fs/cgroup/minimald.slice/boxes/allow/01a1f45d-b454-79bf-ad82-5153efb72311
minimald::env: relaying a task's exit code to the in-box min helper task=probe exit_code=0

In the minvmd log, each box is held as a host_ip box (holding the host_ip box's egress rules ... resident_host_ip_boxes 1, then 2). The log has no dropped the first opening packet line for either box.

Notes from the agent: Touched outside the layers: crates/minimald/src/rpc/tests.rs. The test clean_cache_streams_progress_then_a_terminal_done wrote two unread entries just now and expected a 1s clean to delete them. That contradicts the new cache rule, so the test now writes them with a write time one hour back. Two tests inside the cache layer file needed the same kind of change: deletes_only_unused_unkept_entries now keeps the just-written unread entry, and reports_deletions_as_events records an old read for its entry. Design choices: (1) task_network keeps its signature, because exec/tests.rs and box_actor/setup.rs call it and are outside the layers. A new task_network_in_box_leaf takes the box leaf. run_task and the exec-channel task path call it. (2) task_network_for takes the box verdict and a decision. The callers pass decision None, because the box launch does not keep its Decision anywhere a task can read it. A Decision::decided() with no carve-out would make a native deny-all task refuse on the stale carve-out check. The verdict comes from the leaf (deny or allow subtree). On a VM host the plan does not depend on the verdict, so the leaf placement is the part of the fix that matters there. (3) classifier.rs had no literal 'a task places no leaf' note. That note was in provider.rs and process.rs, and both are updated. classifier.rs gets the task_box_leaf helper wi…[truncated]

Tests

line exit tail
cargo test -p mctx task_env_carries_the_box_classifier_leaf 0 running 1 test test tests::task_env_carries_the_box_classifier_leaf ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 77 filtered out; finished in 0.00s warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: net
cargo test -p minimald run_task_runs_in_the_box_classifier_leaf 0 running 1 test test env::tests::run_task_runs_in_the_box_classifier_leaf ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1507 filtered out; finished in 0.38s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.00s runni
cargo test -p minvmd node_plane_drop_is_logged_once_per_box 0
cargo test -p op clean_keeps_an_unread_entry_written_after_the_cutoff 0 running 1 test test cache_clean::tests::clean_keeps_an_unread_entry_written_after_the_cutoff ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 59 filtered out; finished in 0.01s warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runt

Verify

min task run agent-verify timed out after 1800s, so this PR is a draft.

nch\u{1f}PATH=/tmp/.tmpV62N3X/replybin:/usr/bin:/bin:/usr/sbin:/sbin:/home/.local/bin\u{1f}PWD=/tmp/.tmpV62N3X/some dir\u{1f}RUSTC_WRAPPER=sccache\u{1f}SCCACHE_BUCKET=agent-runtime-sccache-gominimal-minimal\u{1f}SCCACHE_ENDPOINT=https://4103a6df4dd77276970745a22603bea9.r2.cloudflarestorage.com\u{1f}SCCACHE_REGION=auto\u{1f}SCCACHE_S3_USE_SSL=true\u{1f}SHELL=/usr/bin/bash\u{1f}SHLVL=2\u{1f}SSL_CERT_DIR=/etc/ssl/certs\u{1f}SSL_CERT_FILE=/etc/ssl/cert.pem\u{1f}XDG_CACHE_HOME=/state/cache\u{1f}XDG_CONFIG_HOME=/home/.config\u{1f}XDG_DATA_HOME=/home/.local/share\u{1f}XDG_RUNTIME_DIR=/run\u{1f}XDG_STATE_HOME=/home/.local/state\u{1e}stdin\n"
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.329s] ( 705/2436) minimald env::tests::task_entrypoint_relays_the_task_exit_code
        PASS [   3.459s] ( 706/2436) minimald env::tests::run_task_relays_exit_through_both_paths
        SLOW [> 60.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>120.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>180.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>240.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>300.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>360.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>420.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>480.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>540.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>600.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>660.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>720.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>780.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>840.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>900.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>960.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1020.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1080.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1140.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1200.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1260.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task

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/rpc/tests.rs

A context made for a host-address box carries the leaf of that box.
The task env args now take it, so the task sandbox joins the leaf and
the box egress verdict decides the task connections.
A task of a host-address box ran with no leaf. On a VM host the guest
filter then dropped its connections, while the same connection from
min box exec passed. run_task keeps the box leaf on its context and logs
it, and the task network follows the verdict of that leaf.
A node-plane or host_ip drop line is rate limited, so it can name a
later frame or an ACK in place of the packet that opened the flow. The
gate now logs the first dropped opening packet of each source once,
with the source, the destination and the port.
An entry with no recorded read was stale at once, so a clean could
delete a package written moments before. It is now stale only when its
write time is before the cutoff. The minimald clean RPC test writes
its cold entries an hour back to match.
@coderabbitai

coderabbitai Bot commented Nov 19, 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: ff54a122-3d13-4e43-8290-c93ab6caff1c

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

An unread cache entry now stays when its write time is after the
cutoff. The maintenance tests wrote their cold entries with the current
time, so a clean kept them. Write them twice UNUSED_FOR ago.
@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on a failed check suite, pushed as 8539c8fe8355.

line exit tail
cargo test -p mctx task_env_carries_the_box_classifier_leaf 0 running 1 test test tests::task_env_carries_the_box_classifier_leaf ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 79 filtered out; finished in 0.00s warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: net
cargo test -p minimald run_task_runs_in_the_box_classifier_leaf 0 running 1 test test env::tests::run_task_runs_in_the_box_classifier_leaf ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1514 filtered out; finished in 0.57s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.00s runni
cargo test -p minvmd node_plane_drop_is_logged_once_per_box 0
cargo test -p op clean_keeps_an_unread_entry_written_after_the_cutoff 0 running 1 test test cache_clean::tests::clean_keeps_an_unread_entry_written_after_the_cutoff ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 59 filtered out; finished in 0.00s warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runt

Verify min task run agent-verify timed out after 1800s.

nch\u{1f}PATH=/tmp/.tmpOu5H2E/replybin:/usr/bin:/bin:/usr/sbin:/sbin:/home/.local/bin\u{1f}PWD=/tmp/.tmpOu5H2E/some dir\u{1f}RUSTC_WRAPPER=sccache\u{1f}SCCACHE_BUCKET=agent-runtime-sccache-gominimal-minimal\u{1f}SCCACHE_ENDPOINT=https://4103a6df4dd77276970745a22603bea9.r2.cloudflarestorage.com\u{1f}SCCACHE_REGION=auto\u{1f}SCCACHE_S3_USE_SSL=true\u{1f}SHELL=/usr/bin/bash\u{1f}SHLVL=2\u{1f}SSL_CERT_DIR=/etc/ssl/certs\u{1f}SSL_CERT_FILE=/etc/ssl/cert.pem\u{1f}XDG_CACHE_HOME=/state/cache\u{1f}XDG_CONFIG_HOME=/home/.config\u{1f}XDG_DATA_HOME=/home/.local/share\u{1f}XDG_RUNTIME_DIR=/run\u{1f}XDG_STATE_HOME=/home/.local/state\u{1e}stdin\n"
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.385s] ( 714/2445) minimald env::tests::task_entrypoint_relays_the_task_exit_code
        PASS [   4.105s] ( 715/2445) minimald env::tests::run_task_relays_exit_through_both_paths
        SLOW [> 60.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>120.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>180.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>240.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>300.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>360.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>420.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>480.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>540.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>600.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>660.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>720.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>780.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>840.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>900.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>960.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1020.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1080.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1140.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1200.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1260.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task

Outside the task's layers::

  • crates/minimald/src/maintenance.rs
  • crates/minimald/src/rpc/tests.rs

Converted to a draft: something above needs a person before review.

On macOS with host_ip, a task in a box runs in the classifier leaf of that box and gets the same egress verdict. A task that opens /dev/tcp/www.google.com/443 and /dev/tcp/1.1.1.1/443 connects, the same as min box exec in that box. This round also makes the Linux test lane pass again: the minimald maintenance tests now agree with the new cache-clean rule.

Notes from the agent: The CI log excerpt did not name the failing test. I found it locally: three minimald maintenance::tests (clean_runs_with_no_sessions, clean_keeps_what_a_session_needs_and_drops_the_rest, concurrent_requests_are_serialized) failed. The cause is the op cache_clean change in this task. An unread entry now stays when it is written after the cutoff, and these tests wrote their 'cold' entries with the current time. The fix gives the test helper write_entry a write time of 2 * UNUSED_FOR ago. crates/minimald/src/maintenance.rs is outside the task's layers. I changed it only in its test module because the layer's behavior change requires it. crates/minimald/src/rpc/tests.rs is also outside the layers. An earlier round changed it for the same reason. Local environment issues that do not come from this branch: (1) MINIMAL_OTEL=off in this box makes env::tests::task_entrypoint_carries_env_cwd_and_args fail and two stdin tests hang, so I ran minimald tests with MINIMAL_OTEL unset. (2) rustdoc is missing here, so mctx doctests did not run. (3) Some net::switch, box_actor, connection and answerer tests fail in a full parallel run but pass when run alone. Those modules are unchanged on this branch. A full cargo test -p minimald --lib did not finish inside 30 minutes, so I ran the affected modules one by one. The proof needs a macOS host_ip VM run (just e2e), and this box cannot run it.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a failed check suite: the coder changed nothing. Revise round 2: I changed nothing. The directive gives two failed checks. ci-linux-kvm-success is only the aggregator of test-kvm. The test-kvm excerpt holds only the source lines of the workflow scripts that contain '::error::', and setup lines. It does not show the step that failed or its output. So I cannot tell which harness failed, or if the cause is this branch or a flake. This box has no /dev/kvm, so I cannot run 'just test-vm', the lifecycle script or scripts/session-e2e.sh. I read the branch diff against the KVM paths. Only host-address boxes get a classifier leaf (box_actor/setup.rs says an own-address box has none), so own_ip tasks keep their earlier sandbox and network. The new gate line is a WARN, and the e2e script says WARN drop lines pass either way. I found no e2e proof that the change breaks. All four test: lines pass at the merged head 807bebac. Next step: someone with access must read the full test-kvm log (run 44445651300, job 135300067912), find the fa…[truncated]

@norrietaylor
norrietaylor marked this pull request as ready for review November 19, 2026 06:38
@norrietaylor
norrietaylor requested a review from a team as a code owner November 19, 2026 06:38
@norrietaylor

Copy link
Copy Markdown
Member

Un-drafted: the failed job passed on a re-run of the same head (a timing flake in a test this diff does not touch), and every lane is now green.

@norrietaylor

Copy link
Copy Markdown
Member

/review

@norrietaylor

Copy link
Copy Markdown
Member

/arch-review

@minimal-foundry

minimal-foundry Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Not started at 7a65a15d43b0: this review was queued for capacity and never started: the pull request is a draft.

Nothing about this head was reviewed or found wrong. Comment /review to ask again.

@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 — 2 findings, 2 inline.

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

Comment thread crates/minimald/src/exec/process.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 · 2 conditions · the full ruling

The task placement conforms. A host_ip task now joins its box's classifier leaf, as §4.1 and the min box exec contract require. The new minvmd drop line does not record what it claims. It latches on the source address. On both rules that address is shared, by minimald or by the whole host_ip cohort. §4.1 says per-box attribution in the cohort is impossible. Fix the message, the doc comments and the marker text in C1. Run the macOS proof leg and record it, as C2 says.

Ruled at 8539c8f against gominimal/arch@8b824707cde6 by claude-opus-5-5.

Comment thread crates/minvmd/src/net/egress_gate.rs Resolved
Comment thread crates/minvmd/src/net/egress_gate.rs Resolved
Comment thread crates/minimald/src/env.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: PASS_WITH_CONDITIONS · 1 condition · the full ruling

The change conforms to the design. A task of a host_ip box now runs in the classifier leaf of its box. So its connections take the cohort address and not the node-plane address, as deployment-and-egress-gateway.md §4.1 line 54 requires. The gate log line and the cache-clean rule are design-silent. The task's own proof is not run: the PR body says no macOS VM run was made. C1 asks for that run on macOS with host_ip, for both task paths, and its result in the ## Proof section.

Ruled at 8539c8f against gominimal/arch@8b824707cde6 by claude-opus-5-5.

Comment thread crates/minimald/src/exec/process.rs Resolved
Comment thread crates/minimald/src/env.rs Resolved

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

I traced both task paths, the in-box run_task and the exec-channel task_producer. Each carries the box leaf into the task env: Context::task_env_args passes it to place_in_classifier_leaf, and the sandbox pre-exec join puts the task in the leaf. task_network_in_box_leaf builds the same HostIpAddressNetwork plan that the box launch builds. The None decision matches what tasks passed before, so this is not a regression. I found no correctness bug. The cache_clean write-time rule is sound: an entry whose meta is missing or unreadable still counts as old. The test updates in maintenance.rs and rpc/tests.rs match the new rule. The minenv_run_forwards_stdin_to_the_task hang in the Verify section uses a stub channel and does not reach the code changed here. One low note is inline, about test coverage of the wiring. The existing architect threads are still open and need answers before merge: the FirstOpeningDrops doc and message say "box", but the latch keys on (rule, node source address), and the macOS host_ip proof run is still owed.


Generated by Claude Code

Comment thread crates/minimald/src/env.rs Resolved
A task of a native deny-all host_ip box joins its box leaf. Its plan now
carries a decided decision with the carve-out the leaf's tree records, so
a task started after the answerer moved or stopped is refused, the same
as the box launch, and never falls back to the constant answerer.
@norrietaylor

Copy link
Copy Markdown
Member

The macOS host_ip proof the arch review asks for (C2, and the two C1 proof notes) is tracked in 3639 as #3639; the runtime's coder cannot run a macOS VM.

@minimal-foundry

Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on the runtime's review findings, pushed as 7a65a15d43b0.

line exit tail
cargo test -p mctx task_env_carries_the_box_classifier_leaf 0 running 1 test test tests::task_env_carries_the_box_classifier_leaf ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 79 filtered out; finished in 0.00s warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runtime-implement-test-1: net
cargo test -p minimald run_task_runs_in_the_box_classifier_leaf 0 running 1 test test env::tests::run_task_runs_in_the_box_classifier_leaf ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1515 filtered out; finished in 0.31s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.00s runni
cargo test -p minvmd node_plane_drop_is_logged_once_per_box 0
cargo test -p op clean_keeps_an_unread_entry_written_after_the_cutoff 0 running 1 test test cache_clean::tests::clean_keeps_an_unread_entry_written_after_the_cutoff ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 60 filtered out; finished in 0.00s warning: unknown fields in task runtime-implement-test-0: network warning: unknown fields in task runt

Verify min task run agent-verify timed out after 1800s.

e-sccache-gominimal-minimal\u{1f}SCCACHE_ENDPOINT=https://4103a6df4dd77276970745a22603bea9.r2.cloudflarestorage.com\u{1f}SCCACHE_REGION=auto\u{1f}SCCACHE_S3_USE_SSL=true\u{1f}SHELL=/usr/bin/bash\u{1f}SHLVL=2\u{1f}SSL_CERT_DIR=/etc/ssl/certs\u{1f}SSL_CERT_FILE=/etc/ssl/cert.pem\u{1f}XDG_CACHE_HOME=/state/cache\u{1f}XDG_CONFIG_HOME=/home/.config\u{1f}XDG_DATA_HOME=/home/.local/share\u{1f}XDG_RUNTIME_DIR=/run\u{1f}XDG_STATE_HOME=/home/.local/state\u{1e}stdin\n"
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

  Cancelling due to test failure: 3 tests still running
        PASS [   0.308s] ( 712/2447) minimald env::tests::search_finds_known_package
        PASS [   2.739s] ( 713/2447) minimald env::tests::run_task_relays_exit_through_both_paths
        SLOW [> 60.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>120.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>180.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>240.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>300.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>360.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>420.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>480.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>540.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>600.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>660.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>720.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>780.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>840.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>900.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>960.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1020.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1080.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1140.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1200.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1260.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1320.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task
        SLOW [>1380.000s] (─────────) minimald env::tests::minenv_run_forwards_stdin_to_the_task

Outside the task's layers::

  • crates/minimald/src/maintenance.rs
  • crates/minimald/src/rpc/tests.rs

Converted to a draft: something above needs a person before review.

Review threads the coder judged:

  • 👍 valid — crates/minimald/src/exec/process.rs: A task in a deny leaf now plans over the decision from classifier::task_box_decision. It carries the carve-out that the leaf's tree records, so a stale or missing answerer refuses the task, the same as the launch. A new test pins it: task_in_a_deny_leaf_refuses_a_stale_carve_out.

A task started in a host_ip box runs in the classifier leaf of that box and gets the same egress as min box exec in that box. On macOS with host_ip, a task that opens /dev/tcp/www.google.com/443 and /dev/tcp/1.1.1.1/443 connects. On a native deny-all host_ip box, a task started after the DNS answerer moved or stopped is refused, the same as the box launch.

Notes from the agent: Revise round 3. The review thread is valid. The fix adds classifier::task_box_decision: a native deny leaf of a running box exists only when its launch decided per box, so the task plans over a decided decision with the carve-out that the leaf's tree records now. The task does not run the table probe again. That probe binds a listener and forks a child, so it is too heavy for each task run. The macOS proof needs a VM host, and this box did not run it. cargo clippy -p minimald --all-targets and cargo fmt --check are clean.

@minimal-foundry
minimal-foundry Bot marked this pull request as draft November 19, 2026 07:27

@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_WITH_CONDITIONS · 1 condition · the full ruling

The code conforms to §4.1 line 54. A task of a host_ip box now runs in its box's classifier leaf, and a deny-leaf task repeats the stale carve-out check. That check fails closed. C1 stays open. The PR body still says that no macOS VM end-to-end run was made. On a VM host, §7.1 line 245 puts the split in the VM's netfilter, so only that run proves the fix. Run the task proof on macOS for both task paths. Then record the command, the exit code and the output tail in ## Proof.

Ruled at 7a65a15 against gominimal/arch@8b824707cde6 by claude-opus-5-5.

Comment thread crates/minimald/src/env.rs Resolved
Comment thread crates/minimald/src/exec/process.rs Resolved
@norrietaylor

Copy link
Copy Markdown
Member

/arch-review

@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_WITH_CONDITIONS · 1 condition · the full ruling

The task placement fix conforms to §4.1. A task of a host_ip box now joins its box's leaf and gets the box's verdict, and a deny leaf fails closed on a stale carve-out. The new first-opening drop line in egress_gate.rs claims a per-box record that the gate cannot make. Section 4.1 says per-box attribution in the cohort is impossible, and node-plane drops are minimald's own traffic. Make the edit in C1, so the line says it is once per rule and source address. The verify run is still open: it timed out with a test failure that this review cannot name.

Ruled at 7a65a15 against gominimal/arch@8b824707cde6 by claude-opus-5-5.

/// is named, and the rate-limited drop line still covers it.
const FIRST_OPENING_DROP_SOURCES: usize = 64;

/// The first dropped opening packet of each box, logged once (D3574). A

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · The source address does not name a box. Every host_ip member and the node plane leave from the node address (host_ip_verdict says so, and §4.1 line 54 says per-box attribution in the cohort is impossible). Say that the latch is one line per rule and source address on this relay.

destination = %Ipv4Addr::from(dst),
port = %if dst_port == 0 { "none".to_string() } else { dst_port.to_string() },
rule_matched = rule,
"dropped the first opening packet of a box leaving the VM; later drops of this \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · This message says "of a box" and "this box". A node-plane drop is minimald's own traffic, and a second host_ip box never gets a line. Use the message that C1 gives, and keep the four fields.

/// second opening packet of the same box under the same rule is not
/// named again.
#[test]
fn node_plane_drop_is_logged_once_per_box() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

C1 · This test uses two node addresses as if they were two boxes. The gate never sees that shape. Rename the test, and assert that a second opening under HOST_IP_BOXES_RULE from the same node address writes no line.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D3574 — A task on a VM-backed host_ip box runs in the classifier leaf of its box and gets the egress of its box

1 participant