8000 T14 — Accept the four egress fields on own-address and host-address boxes and show the effective rules by minimal-foundry[bot] · Pull Request #1569 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

T14 — Accept the four egress fields on own-address and host-address boxes and show the effective rules - #1569

Closed
minimal-foundry[bot] wants to merge 4 commits into
mainfrom
agent/1461-accept-the-four-egress-fields-on-own-address-and
Closed

minimal-foundry[bot] wants to merge 4 commits into
mainfrom
agent/1461-accept-the-four-egress-fields-on-own-address-and

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

T14 — Accept the four egress fields on own-address and host-address boxes and show the effective rules

slice: S4
kind: task
covers: NET-060, NET-061, NET-065, NET-102, NET-120
size: M
est: 350
executor: agent
difficulty: routine
model: standard
diagnostics: the bundle's session policy dump shows the four egress fields as the daemon parsed them, with the box's network mode beside them
observability: one info log line per session start with the parsed egress rule counts per field
layers:
- schema: crates/sessions/src/lib.rs
test: cargo nextest run -p sessions spec_accepts_egress_fields
test: cargo nextest run -p sessions egress_on_none_box_is_validation_error
test: cargo nextest run -p sessions egress_on_host_ip_box_accepted
- cli: crates/minimal/src/cli.rs, crates/minimal/src/cmd/session.rs
test: cargo nextest run -p minimal policy_shows_effective_egress
- tui: crates/minimal-tui/src/render.rs
test: cargo nextest run -p minimal-tui policy_lines_show_deny_subnets
- daemon: crates/minimald/src/sessions.rs, crates/minimald/src/rpc.rs
test: cargo nextest run -p minimald get_session_policy_returns_effective_egress
- switch: crates/switch/src/lib.rs
test: cargo nextest run -p switch unenrolled_self_allocates_default_plan
produces: none
consumes: none
proof: A box spec with allow_subnets, allow_protocols, allow_dns_hosts and deny_subnets is accepted on an own-address or host-address box, rejected on a none box, and min session policy shows the effective rules.

Proof

A box spec carrying allow_subnets, allow_protocols, allow_dns_hosts and deny_subnets is now accepted for both own-address and host-address boxes, rejected for none boxes, and min session policy returns the effective egress rules as JSON for own-address and host-address sessions.

Tests

line exit tail
cargo nextest run -p sessions spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-4840... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/10ce4/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/10ce4/tree/crates/ot) C
cargo nextest run -p sessions egress_on_none_box_is_validation_error 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-b5e9... Finished 'test' profile [unoptimized] target(s) in 0.31s ──────────── Nextest run ID c4a78ac4-c107-4911-9219-2fe87bc2a0f0 with nextest profile: default Starting 1 test across 3
cargo nextest run -p sessions egress_on_host_ip_box_accepted 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-d86e... Finished 'test' profile [unoptimized] target(s) in 0.35s ──────────── Nextest run ID 90fdcb86-ed3f-4a74-905d-7c0fc26e5064 with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimal policy_shows_effective_egress 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-76da... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/1b333/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/1b333/tree/crates/ot) C
cargo nextest run -p minimal-tui policy_lines_show_deny_subnets 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-1fa1... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/4f180/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/4f180/tree/crates/ot) C
cargo nextest run -p minimald get_session_policy_returns_effective_egress 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-e125... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/a66fa/tree/crates/ot) Compiling args v0. 8000 0.1 (/home/runner/.local/state/minimal/sessions/a66fa/tree/crates/args) C
cargo nextest run -p switch unenrolled_self_allocates_default_plan 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-d376... Compiling switch v0.0.1 (/home/runner/.local/state/minimal/sessions/51e46/tree/crates/switch) Finished 'test' profile [unoptimized] target(s) in 0.58s ──────────── Nextest run ID

Verify

min task run verify passed ([tasks.verify]).

Out of scope

These files are outside the task's layers:, so this PR is a draft:

  • crates/minimal-tui/tests/snapshots.rs
  • crates/minimal-tui/tests/snapshots/snapshots__detail_pane_with_policy.snap
  • crates/minimal/src/main.rs
  • crates/minimal/tests/cli.rs
  • crates/sessions/src/store.rs

Closes #1461

- Add deny_subnets to EgressPolicy and validate allow/deny CIDRs.

- Accept egress on OwnIp and HostNet boxes; keep rejecting it on NoNet.

- Extend GetSessionPolicy tests to cover own-address and host-address boxes.

- Add session-start logging with parsed egress rule counts.

- Render deny_subnets in the TUI policy pane.

- Route min session policy stdout through the data-contract logger and add an

  end-to-end test proving all four fields round-trip as JSON.

- Add switch Enrollment type and default plan for unenrolled hosts.

NET-060, NET-061, NET-065, NET-102, NET-120
@coderabbitai
coderabbitai Bot commented Sep 20, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

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

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0a26539c-e974-4ea9-a17c-b649a89cef4a

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

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

@CLAassistant
CLAassistant commented Sep 20, 2026 •
Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 3 on a failed check suite, pushed as d11256470be8.

line exit tail
cargo nextest run -p sessions spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-d3b2... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/f59da/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/f59da/tree/crates/ot) C
cargo nextest run -p sessions egress_on_none_box_is_validation_error 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-daa6... Finished 'test' profile [unoptimized] target(s) in 0.35s ──────────── Nextest run ID 0d5dec24-02a9-424f-861f-ebce427f3174 with nextest profile: default Starting 1 test across 3
cargo nextest run -p sessions egress_on_host_ip_box_accepted 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-883a... Finished 'test' profile [unoptimized] target(s) in 0.34s ──────────── Nextest run ID ce43b58b-3e13-42db-852f-459da9a94b7f with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimal policy_shows_effective_egress 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-49ed... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/ef73b/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/ef73b/tree/crates/args) C
cargo nextest run -p minimal-tui policy_lines_show_deny_subnets 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-8174... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/7f07a/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/7f07a/tree/crates/ot) C
cargo nextest run -p minimald get_session_policy_returns_effective_egress 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-9233... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/884c8/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/884c8/tree/crates/ot) C
cargo nextest run -p switch unenrolled_self_allocates_default_plan 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-b557... Compiling switch v0.0.1 (/home/runner/.local/state/minimal/sessions/c1fbb/tree/crates/switch) Finished 'test' profile [unoptimized] target(s) in 0.56s ──────────── Nextest run ID

Verify min task run verify passed.

Outside the task's layers::

  • crates/minimal-tui/tests/snapshots.rs
  • crates/minimal-tui/tests/snapshots/snapshots__detail_pane_with_policy.snap
  • crates/minimal/src/main.rs
  • crates/minimal/tests/cli.rs
  • crates/sessions/src/store.rs

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

A box spec with allow_subnets, allow_protocols, allow_dns_hosts and deny_subnets is accepted on an own-address or host-address box, rejected on a none box, and min session policy shows the effective rules. Each session start now logs the parsed egress rule counts, the TUI policy pane renders deny_subnets, and the switch crate provides the unenrolled default plan.

Notes from the agent: The functional implementation was already present on the branch from the prior commit (dd01f37). The only remaining change was a clippy fix: removing a redundant .into() in crates/minimal/tests/cli.rs. All seven task tests pass and clippy is clean for the scoped crates.

The HostNet path now accepts egress declarations (NET-120) but must
still reject ingress port forwarding, since host-address boxes share
their node's address and static mappings would collide. Restructure
validate_policy so OwnIp allows both egress and ingress, HostNet
allows only egress, and NoNet rejects both.

NET-060, NET-065, NET-120
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 3 on a failed check suite, pushed as 38b96279e580.

line exit tail
cargo nextest run -p sessions spec_accepts_egress_fields 0 Applying loadouts: default Running task runtime-implement-test-0 in session task-runtime-implement-test-0-055a... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/64dbb/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/64dbb/tree/crates/ot) C
cargo nextest run -p sessions egress_on_none_box_is_validation_error 0 Applying loadouts: default Running task runtime-implement-test-1 in session task-runtime-implement-test-1-59c4... Finished 'test' profile [unoptimized] target(s) in 0.36s ──────────── Nextest run ID 7b50fe1c-9506-4f4c-8bcf-2da8060554f5 with nextest profile: default Starting 1 test across 3
cargo nextest run -p sessions egress_on_host_ip_box_accepted 0 Applying loadouts: default Running task runtime-implement-test-2 in session task-runtime-implement-test-2-a6c0... Finished 'test' profile [unoptimized] target(s) in 0.33s ──────────── Nextest run ID 45cc51a1-d79d-4315-a534-79c920ccdb5b with nextest profile: default Starting 1 test across 3
cargo nextest run -p minimal policy_shows_effective_egress 0 Applying loadouts: default Running task runtime-implement-test-3 in session task-runtime-implement-test-3-5daa... Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/05af9/tree/crates/ot) Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/05af9/tree/crates/args) C
cargo nextest run -p minimal-tui policy_lines_show_deny_subnets 0 Applying loadouts: default Running task runtime-implement-test-4 in session task-runtime-implement-test-4-d207... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/c605d/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/c605d/tree/crates/ot) C
cargo nextest run -p minimald get_session_policy_returns_effective_egress 0 Applying loadouts: default Running task runtime-implement-test-5 in session task-runtime-implement-test-5-88cb... Compiling args v0.0.1 (/home/runner/.local/state/minimal/sessions/3f012/tree/crates/args) Compiling ot v0.0.1 (/home/runner/.local/state/minimal/sessions/3f012/tree/crates/ot) C
cargo nextest run -p switch unenrolled_self_allocates_default_plan 0 Applying loadouts: default Running task runtime-implement-test-6 in session task-runtime-implement-test-6-c14d... Compiling switch v0.0.1 (/home/runner/.local/state/minimal/sessions/bf684/tree/crates/switch) Finished 'test' profile [unoptimized] target(s) in 0.69s ──────────── Nextest run ID

Verify min task run verify passed.

Outside the task's layers::

  • crates/minimal-tui/tests/snapshots.rs
  • crates/minimal-tui/tests/snapshots/snapshots__detail_pane_with_policy.snap
  • crates/minimal/src/main.rs
  • crates/minimal/tests/cli.rs
  • crates/sessions/src/store.rs

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

A box spec with allow_subnets, allow_protocols, allow_dns_hosts and deny_subnets is accepted on an own-address or host-address box, rejected on a none box, and min session policy shows the effective rules; the regression that also allowed ingress port mappings on host-address boxes is fixed.

Notes from the agent: Revised Record::validate_policy in crates/sessions/src/lib.rs so HostNet allows egress but still rejects ingress port forwarding and dynamic ranges, fixing the failing ingress_mappings_on_host_net_are_rejected test that was blocking the macOS and Linux unit lanes. No files outside the task's layers were changed.

@norrietaylor
norrietaylor deleted the agent/1461-accept-the-four-egress-fields-on-own-address-and branch September 23, 2026 15:40
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.

T14 — Accept the four egress fields on own-address and host-address boxes and show the effective rules

3 participants

0