Repository navigation
T19 — Default own-address boxes to deny-all, with the announcement, the opt-out, and task runs under the same rules - #1727
Conversation
The deny-all egress default (NET-074..NET-077) needs one place that says what an absent egress section resolves to. Add the build-time rollout phase (this build ships it in force), the EffectiveEgress answer (deny-all, allow-all, or the declaration verbatim), and the resolver that decides between them: deny-all only for an own-address box, once in force, without the daemon opt-out; the shipped allow-all of 03-spec R2.1 everywhere else. A declared section survives every phase untouched. EgressPolicy::deny_all() materializes the deny-all arm as the section whose compiled rules admit nothing, so the gate compiles the default through the same path a declaration takes.
GetEffectiveSessionPolicy answers the same lookup GetSessionPolicy does, with the egress half resolved to what the gate enforces: deny-all for an own-address box with no egress section once the default is in force (NET-074/NET-075), the shipped allow-all behind the daemon's opt-out (NET-077), or the declaration verbatim. A separate response rather than a field on SessionPolicy, so the strict declaration a client reads back stays exactly what the box was launched with.
The daemon now enforces what the rollout decides: the session launcher passes the box's effective policy to the gate, so an own-address box created with no egress section reaches nothing once the deny-all default is in force (NET-074), while the record keeps the declaration untouched for the strict GetSessionPolicy reply. A --egress-deny-all-opt-out flag (NET-077) threads from the server config through the sessions manager into each session actor, and the task path reads it through a new handle accessor so a task runs under its session's effective egress instead of none. Every session start logs one line naming the rollout phase, the opt-out state, and the effective egress (NET-076's companion diagnostic), so a diagnostics bundle's log tail can explain the box's posture without the daemon's flags. serve_get_effective_ session_policy serves the new rpc-layer response, and the harness gains an opted-out TestServer for the opt-out's tests.
…n-address-boxes-to-deny-all-with-the-a
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
Babysitter review against T19's plan block (covers NET-074..NET-077; six test lines, all exit 0; verify exit 0). Nothing blocking. Un-drafting: the four out-of-layer files are forced by the layered edits or host the plan's own test line ( Coverage
Findings
Observability line met: one |
|
Approved: no findings at Nothing to do. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none: |
|
Direction for the round on the macOS e2e failure (run 36193357011): the failing proof is NET-001, "an own-address box's published port routes to its lease", curl exit 28. The daemon log shows why: The cause is
Do not weaken the e2e case, and do not add a carve-out for the daemon address to make |
The deny-all egress NET-074 brings in force drops the box's own replies to connections its ingress gate admitted, so a published port could never complete under the new default: the proxy proof's own-address half timed out at NET-001 (curl exit 28) on the VM lanes. Track admitted inbound flows the way the egress leg already tracks outbound UDP: the ingress leg records the reverse tuple of every packet it admits to a port the box declared, and the egress leg consults that window before a drop stands. A peer that reached a declared port can be answered; the box still cannot initiate anything - the window is keyed to the remote's port on the box's declared one, so a new connection from the box never matches it, and talking at an undeclared port opens nothing. The pure verdict in sessions::core::egress is untouched; the window lives in the relay, like the UDP one.
With the deny-all default in force a bare own-address box resolves host.min.internal and reaches nothing, so the proxy proof's NET-003 and NET-004 steps - which are about name routing, not the egress default - must run against a box that declared the address they dial. The box now asks for the switch's host alias the way a box that wants the host would, while its published port keeps needing no egress at all: NET-001 stays the bare-egress assertion it always was.
|
Round 1 of 10 on a failed check suite, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. An own-address box with no egress section reaches nothing and shows deny-all in Notes from the agent: Revise round 1 for PR #1727: the failed checks (ci-macos-success, e2e) were the macOS lane's e2e job, whose annotation read 'NET-001: an own-address box's published port routes to its lease: curl did not complete the request (exit 28)'. Root cause: the deny-all default (this task's earlier commits, already on the branch) is applied by the launcher to the relay gate, and the pure egress verdict then dropped the box's own SYN-ACK/replies to connections its ingress gate had admitted to a declared port, so a published port could never complete on a VM lane; NET-003's and NET-004's own-address steps would have failed next for the same reason (a bare deny-all box resolves host.min.internal and reaches nothing). Two fixes, both in files OUTSIDE the task's layers — named here, not touched quietly: (1) crates/minimald/src/net/switch.rs — an inbound-flow window mirroring the existing UdpConntrack: the ingress leg records the reverse tuple of every packet it admits to a DECLARED port and the egress leg consults that window before a drop stands; the pure verdict in sessions::core::egress is untouched (the Kani purity contract holds, the window lives in the relay like the UDP one), nothing the box initiates matches the window, and talking at an undeclared port opens nothing; pinned by the new unit test deny_all_still_answers_a_declared_port through a real spawned relay. (2) scripts/session-e2e.sh — the proxy proof's…[truncated] |
|
/revise Round 1 fixed the failing lanes by keeping the deny-all default in force and adding a reply-window conntrack to the relay plus an
Every test line stays green under |
…n-address-boxes-to-deny-all-with-the-a
Reverts d2e599d and ae0e28e. The window existed so a declared exposure kept answering once the deny-all default bound a bare own-address box; the default ships announced instead (NET-076), and a published port answering under deny-all belongs to the slice that puts the default in force, not to this one. Removing the whole window also removes its flow key, which carried no transport protocol: a window a TCP peer opened on a declared port admitted the box's UDP datagrams to that same peer tuple, traffic that was no reply to any flow.
Reverts 377c85c. The declaration existed to keep the proxy proof's NET-003/NET-004 steps reachable once the deny-all default bound the bare box; with the default shipped as announced the bare box reaches the host alias as it does on main, so the case stays the bare-egress assertion it was cut as.
The daemon resolved the egress default through an implicit phase: effective_egress_section and effective_session_policy read nothing but their arguments, so the phase the build ships lived in every caller. Give the resolution seam an explicit sessions::EgressDefaultPhase parameter. Production callers (the session gate, task_network, the GetEffectiveSessionPolicy handler) pass sessions::EGRESS_DEFAULT_PHASE; the unit tests that prove the in-force posture the requirements name pass EgressDefaultPhase::InForce explicitly, and the session starts log-line assertions follow the constant, so a future cutover flips one constant and every reader follows.
NET-074/075 name the in-force posture; NET-076 the one before it. The release that turns the default in force is a plan fact, and no plan has named one yet, so ship EGRESS_DEFAULT_PHASE = Announced: an own-address box that declares no egress section keeps the shipped allow-all, min session activate prints the coming change, and the opt-out flag is how a deployment keeps the prior default when the cutover lands. The in-force behaviour stays proven beside it: the unit tests pass the phase explicitly, and policy_shows_deny_all_default renders the in-force resolution through format_policy while the wire reply follows the shipped constant. deny_all_announcement_printed proves the shipped path through the real binary: the notice on a bare own-address activate, nothing on a host-address one, and no notice under InForce. When a release turns the default in force, the constant is the whole cutover - every reader of it (the session gate, the session-start line, min session policy, the activate notice) follows.
|
Round 2 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:
An own-address box with no egress section reaches nothing and shows deny all in Notes from the agent: Directive items 2 and 3 touched two files outside this task's layers, on the directive's instruction: crates/minimald/src/net/switch.rs (reverts of d2e599d + ae0e28e, commit c8e5c36 — the round-1 InboundConntrack reply window is gone entirely) and scripts/session-e2e.sh (revert of 377c85c, commit e45a350 — the e2e box's |
|
Round 3 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:
T19's behaviour holds and this round closed its one review finding: an own-address box with no egress section shows deny-all in Notes from the agent: Round 3 addressed the single review thread (valid, fixed): the notice was decided client-side with no opt-out term, and no fact available to the client could supply one — GetEffectiveSessionPolicy answers allow_all under the Announced phase whether or not the daemon opted out — so the opt-out now travels on CreateSessionResponse.deny_all_opt_out (Option, serde-defaulted and omitted when None so pre-field daemons decode and keep printing, which is correct since a daemon that predates the field cannot have the flag). All four changed files are named in the task's layers (minimald-rpc/lib.rs, minimald/rpc.rs, minimal/cmd/session.rs, minimal/tests/cli.rs); the announcement test's opted-out daemon builder lives inside cli.rs so tests/common/mod.rs, which no layer names, stayed untouched. The other layer files (server.rs, main.rs, test_harness.rs, session.rs, exec.rs) were already in place at head from earlier rounds and are untouched this round. Also ran: cargo clippy -p minimald-rpc -p minimald -p minimal --all-targets --locked -- -D warnings (clean) and cargo fmt --all -- --check (clean); the full-crate/workspace suites were not run, only the named lines plus the narrow tests above. |
|
/revise One open minimal-review thread on
The four files outside the task's |
|
/revise Re-posting: the round this note opened at 06:18Z never got a container (job f9c5244e, capacity refusal) and no job exists for it now. Same directive: One open minimal-review thread on
The four files outside the task's |
…n-address-boxes-to-deny-all-with-the-a
#1738 threaded the box's lease into `EgressRules::from_policy` and `EgressRules::new`, and the merge that brought it in left this branch's two deny-all proofs calling the two-argument shape, so neither crate's test target compiled. Pass the lease the frames each proof builds carry — the source `ipv4_frame` writes in one, a labelled constant in the other — so the verdicts still turn on the egress dimension alone.
A task PTask is a second client beside its session's on the same switch, and the gate built from a policy with no ingress declaration blocks inbound as well as outbound — `allowed` and `udp_allowed` come up empty, so unsolicited TCP and UDP are denied. Passing `Some(SessionPolicy::new(egress, None))` for every own-address task run therefore changed a task's inbound under the announced phase too, where the effective egress is allow-all and nothing else about the box moves: behaviour an announcement is not allowed to change. Resolve the task's effective egress as before, but attach a gate only where it has rules to enforce — the deny-all section the in-force default resolves an absent declaration to, or the box's own declaration. An absent section, what the announced phase and the opt-out both leave in place, passes `None`, exactly as every task did before the deny-all default. `task_network` now takes the rollout phase by name — the pattern `effective_egress_section` already set — so the new `a_task_gate_follows_the_egress_default` can prove both postures: under Announced with no opt-out a bare own-address task run gets no gate, under InForce it gets the deny-all gate. The existing mode test now derives its gate expectation from the shipped phase, so a cutover keeps it honest.
The diff-scoped strict gate landed with #1724 and holds the lines a branch changes to a stricter lint set than the workspace's. Ten hits were on lines this branch itself had added, in files the task's layers name. Give the `unwrap`s named `expect`s, and carry `#[expect]` with a reason where the new code keeps its neighbours' idiom on purpose: a discarded oneshot send is the asker already being gone, and a closed oneshot carries no cause beyond the actor being gone.
…n-address-boxes-to-deny-all-with-the-a
|
Round 4 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:
At this branch an own-address box with no egress section reaches nothing and shows deny-all in Notes from the agent: Directive addressed: exec.rs |
|
/revise Round 4 addressed the earlier task-gate thread; it is outdated now and can be resolved. Two threads are open on
CI is green on |
…n-address-boxes-to-deny-all-with-the-a
The announcement defers the *default* for a box that declared no egress section; a box that declared one is enforced on its session's own PTask in every phase, so the task path inherits that declaration's gate even while the shipped build is only announcing the change. The gate follows the rule the in-force case already accepts: a task PTask holds no ingress of its own, so its gate default-blocks unsolicited inbound. `a_task_gate_follows_the_egress_default` gains that case: a record carrying a declared section resolves to the declaration verbatim under both phases (not the deny-all section, and not nothing), and the network it gets under the shipped phase carries a policy.
`new_opted_out_in`'s doc claimed every other harness server runs the default this build ships "in force", but the build ships it as announced (NET-076), so a bare box on any of them still allows all. Say that, and where the in-force posture is proven instead: passed by name to `effective_egress_section`, not asked of a harness server.
|
Round 5 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:
An own-address box with no egress section still reaches nothing and shows deny-all in Notes from the agent: Revise round 5. This round touched only the two files above, both inside the daemon layer; the branch's earlier-round files (env.rs, net/provider.rs, session/tests.rs, sessions.rs) were left exactly as the directive said they stay, and the four out-of-layers names in the diff are those. Two commits on top of 5bedb61: d569c6f (the declared-egress task-gate proof, exec.rs) and 1b5ea2d (the harness doc, test_harness.rs). Working tree clean, nothing uncommitted. The declared-section behaviour was kept, not changed, per the directive: the announcement defers the default for boxes that declared nothing, while a declaration is enforced on the session's own PTask in every phase. Tests were run through |
`just fix` is the innermost loop, and the gate failed there. Three agent rounds on the NET walk then rewrote lines their task never named to clear it (#1737 round 3, #1730 round 5, #1727 round 4), two of them in conflict rounds whose only directive was the merge. A command that fails in the edit loop outranks a sentence in AGENTS.md telling you to leave the hit alone, so the sentence this branch added needs the recipe to agree with it. CLIPPY_STRICT_REPORT_ONLY=1 prints the diagnostics and exits 0. `fix` sets it; `clippy-strict` and `ci` do not, so "before opening a PR" stays the round that owns the judgement. Only hits are demoted — a build or tooling failure still exits non-zero, which is what the cargo check above the filter is for.
…l ref The base was `git merge-base main HEAD`, and a branch that merges `origin/main` leaves the local ref where it was — agent sandboxes and worktrees never check main out at all. The merge-base against a ref that stale predates the main commits the branch merged in, so every line of those commits reads as a line this branch changed, and the gate reports diagnostics on other people's code under a heading saying they are yours. Three agent rounds fixing lines their task never named is what that looks like from the outside (#1737, #1730, #1727). Measured on this branch: a local `main` ten commits behind turned a change touching no Rust at all into 14 changed Rust files across `minimald`, `sessions` and `switch`. With `origin/main` it is nought, and the gate says "no Rust changes" as it should. The remote ref is the safe one by construction: it cannot be behind anything the branch merged, because merging it required fetching it, and a fetch only moves it forward. Stale means the base is older than the newest main, never older than this branch's first commit. The local ref stays as the fallback for a clone without a remote.
norrietaylor
left a comment
There was a problem hiding this comment.
Gates met: reviewed against T19's plan block and test lines (the four out-of-layer files are the second task-path call site and its plumbing); minimal-review concluded on 1b5ea2d and resolved its threads; CodeRabbit posted; every revise round landed with no open threads; CI green on the head.
…d take it out of just fix (#1749) * docs(agents): say the strict clippy gate is local and bounded by the directive Three agent rounds since #1724 landed rewrote lines beyond their task to satisfy `just clippy-strict`, two of them in conflict rounds whose only directive was the merge, and two coders wrote that the PR lanes would have gone red otherwise. They would not: the gate is local, no CI lane runs it. Say so where AGENTS.md names the gate, and say what a revise or conflict round does with its hits: report them in `notes`, not fix them. * chore(lint): report the strict gate in just fix, enforce it in just ci `just fix` is the innermost loop, and the gate failed there. Three agent rounds on the NET walk then rewrote lines their task never named to clear it (#1737 round 3, #1730 round 5, #1727 round 4), two of them in conflict rounds whose only directive was the merge. A command that fails in the edit loop outranks a sentence in AGENTS.md telling you to leave the hit alone, so the sentence this branch added needs the recipe to agree with it. CLIPPY_STRICT_REPORT_ONLY=1 prints the diagnostics and exits 0. `fix` sets it; `clippy-strict` and `ci` do not, so "before opening a PR" stays the round that owns the judgement. Only hits are demoted — a build or tooling failure still exits non-zero, which is what the cargo check above the filter is for. * fix(lint): demote only the filter's hits, and never inherit report-only Two false-success paths in the report-only mode added a commit ago, both of them the thing this gate exists to avoid: exiting 0 without having checked. The filter's exit was read as "hits" whatever it was, so no python3 on PATH or a crash inside it made `just fix` pass having reported nothing. It now exits a distinct 2 for hits and only that is demoted; 1 from an unhandled exception, 127 from a missing interpreter, and the cargo failure above the filter all still leave non-zero. CLIPPY_STRICT_REPORT_ONLY was read from the ambient environment, so one export in a shell profile would have turned the gate off in `just clippy-strict` and therefore in `just ci`, silently. The enforcing recipe clears it. * fix(lint): take the strict gate's base from origin/main, not the local ref The base was `git merge-base main HEAD`, and a branch that merges `origin/main` leaves the local ref where it was — agent sandboxes and worktrees never check main out at all. The merge-base against a ref that stale predates the main commits the branch merged in, so every line of those commits reads as a line this branch changed, and the gate reports diagnostics on other people's code under a heading saying they are yours. Three agent rounds fixing lines their task never named is what that looks like from the outside (#1737, #1730, #1727). Measured on this branch: a local `main` ten commits behind turned a change touching no Rust at all into 14 changed Rust files across `minimald`, `sessions` and `switch`. With `origin/main` it is nought, and the gate says "no Rust changes" as it should. The remote ref is the safe one by construction: it cannot be behind anything the branch merged, because merging it required fetching it, and a fetch only moves it forward. Stale means the base is older than the newest main, never older than this branch's first commit. The local ref stays as the fallback for a clone without a remote. * fix(lint): report-only never fails, whatever stopped the gate `just fix` is the autofix loop: safe to run any number of times and never stopping on the strict gate. Report-only demoted hits but still exited 101 on a build failure and 127 with no python3, so the loop failed on the gate it was told only to report. Under report-only every failure is now printed with its exit code and demoted; enforcing (`just ci`) keeps every one fatal, so a gate that did not run still cannot pass there. Driven through cargo and python3 shims: hit 2/0, cargo 101/0, no python3 127/0 (enforcing/report-only), and report-only twice gives the same output. * chore(lint): take the strict gate out of just fix `just fix` is the edit loop, and everything it prints is something to fix, so a strict hit printed beside fmt and clippy --fix reads as work whatever a doc sentence says. Report-only kept the hits in that loop and only removed the failure. Remove the gate from the recipe instead: it runs in `just clippy-strict` and `just ci`, the round that owns the judgement, and nowhere else. With no caller, the report-only mode and the recipe that cleared it go too; the script's exit codes are 0 clean, 2 hits, anything else a failure to run, none read as clean. AGENTS.md's tight-loop bullet says the loop prints only what to fix.
T19 — Default own-address boxes to deny-all, with the announcement, the opt-out, and task runs under the same rules
slice: S4
kind: task
covers: NET-074, NET-075, NET-076, NET-077
size: L
est: 300 code, 360 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the bundle's daemon log tail names at session start the default in force, the opt-out state and the effective posture
observability: one info log line per session start naming the rollout phase, the opt-out state and the effective egress
layers:
- schema:
- crates/sessions/src/lib.rs: a rollout-phase constant and an effective-egress function returning deny-all, allow-all or rules
test: cargo nextest run -p sessions effective_egress_by_phase_and_opt_out
- daemon:
- crates/minimald/src/server.rs: Config gains the opt-out; its test literal follows
- crates/minimald/src/main.rs: a daemon flag sets the opt-out; the Config literal follows
- crates/minimald/src/test_harness.rs: its Config literal follows
- crates/minimald/src/session.rs: the launcher applies the effective egress
- crates/minimald/src/exec.rs: task runs get the session's effective egress instead of none
- crates/minimald/src/rpc.rs: the policy handler reports deny-all
test: cargo nextest run -p minimald own_ip_default_deny_all
test: cargo nextest run -p minimald deny_all_opt_out_keeps_prior_default
- rpc:
- crates/minimald-rpc/src/lib.rs: a new effective-policy response carries deny-all without changing the strict session policy shape
test: cargo nextest run -p minimald effective_policy_response_round_trips
- cli:
- crates/minimal/src/cmd/session.rs: activate prints the coming change while announced; session policy shows deny-all
- crates/minimal/tests/cli.rs: hosts the policy and announcement tests
test: cargo nextest run -p minimal policy_shows_deny_all_default
test: cargo nextest run -p minimal deny_all_announcement_printed
produces: none
consumes: none
proof: An own-address box with no egress section reaches nothing and shows deny-all in
min session policyonce the default is in force, activate prints the coming change before it is, and the opt-out keeps the shipped allow-all.depends on:
- blocked by #1629
Proof
An own-address box activated with no egress section now reaches nothing: the session launcher and every task run under the resolved deny-all section (NET-074), and
min session policyprints 'deny all' for it — via the new GetEffectiveSessionPolicy RPC, so the strict policy the session was activated with keeps its absent section — while a box under a daemon started withminimald listen --egress-deny-all-opt-outkeeps the shipped allow-all (NET-077), as does a bare host-address box. The rollout constant ships as InForce, so the announcement path is phase-gated:deny_all_default_noticecarries the coming-change sentence for the Announced phase and activate prints it only there; at InForce nothing prints, and the session-start log line names the phase, the opt-out state and the effective egress. Whole-crate runs after the last commit: -p sessions -p minimald-rpc 595 passed, -p minimald 457 passed, -p minimal 280 passed.Notes from the agent: Three files outside the layers were touched, each mechanically, because the daemon plumbing passes through them: crates/minimald/src/sessions.rs (the sessions Manager carries deny_all_opt_out from server Config into SessionConfig — the Manager owns session_config construction), crates/minimald/src/env.rs (one line: the SessionChannel reads the session's opt-out via the new SessionHandle accessor and passes it to task_network — the second call site after exec.rs), and crates/minimald/src/net/provider.rs (one doc sentence on network_for that the change would otherwise have made false: task launches pass the session's effective egress). Follow-up for a later task: crates/minimal-tui/src/render.rs still renders the strict 'allow all' for a bare own-address box in
min dash's detail pane (minimal-tui is not in this task's layers); switching it to the GetEffectiveSessionPolicy RPC is the natural next slice. Rollout note: EGRESS_DEFAULT_PHASE is one constant away from Announced — flipping it activates the notice and not…[truncated]Tests
cargo nextest run -p sessions effective_egress_by_phase_and_opt_outcargo nextest run -p minimald own_ip_default_deny_allcargo nextest run -p minimald deny_all_opt_out_keeps_prior_defaultcargo nextest run -p minimald effective_policy_response_round_tripscargo nextest run -p minimal policy_shows_deny_all_defaultcargo nextest run -p minimal deny_all_announcement_printedVerify
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/env.rscrates/minimald/src/net/provider.rscrates/minimald/src/session/tests.rscrates/minimald/src/sessions.rsCloses #1636