Repository navigation
T87 — Refuse a host-address declaration the classifier cannot enforce on a host that decides per box - #1955
Conversation
NET-079's per-box vocabulary is the two subtrees — deny-all, and refuse nothing — so a host-address declaration that asks for anything between the two (a deny_subnets entry, a narrowing allow list) names rules no per-box verdict enforces. unenforceable_rules names each by field, entry by entry; refuses_unenforceable_declaration folds the host's can_decide_per_box in, and is the one predicate the create and launch paths will share. An absent section and the deny-all shape name nothing, and the module comment now says why such a declaration never reaches the allow subtree on a per-box host.
NET-079's two subtrees are the whole vocabulary a loaded table decides per box: boxes/deny refuses everything but the answerer, boxes/allow refuses nothing on a box's behalf. A host-address box whose declaration asks for more — a deny_subnets entry, a narrowing allow list — names rules no per-box verdict enforces, so a host that decides per box refuses it rather than run it placed and looking decided while its rules go unenforced. One predicate, two call sites, both reading their own decision: - the create (sessions.rs) refuses over the daemon's node fact, before anything is allocated, as a typed InvalidInput whose words name each unenforced rule by field and say own-address boxes enforce them — the same arm the incompatible-policy refusal already rides; - the launch (session_host.rs) re-reads the host for itself and refuses before the leaf is allocated, closing the create-then-install race and reaching records persisted before this gate existed; the box never lands in boxes/allow; - the launch record derives per_box from the placement plus the same pure function, never from the node fact alone. On a host that cannot decide per box nothing changes — NET-079's exception is that host's to keep — and own-address boxes are untouched. Each refusal logs one info line naming the box, the per-box value and each unenforced rule, and a counter of refused creates rides the line (refused_unenforceable_creates).
the coder's uncommitted work as it stood when its 7200s ran out The coder was stopped at the end of its time with these changes not committed. The runtime committed its working tree as it stood so the work is kept: this commit is a snapshot, not a finished step, and may not build or pass its tests.
…ost-address-declaration-the-classifier
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
/revise Apply two design conditions and one pinning test, staying inside this task's layers (classifier.rs, sessions.rs, rpc.rs, session_host.rs and its tests module, session-e2e.sh).
Keep every existing test line green. |
The create returned InvalidInput over the refusal's words while the launch returned io::Error::other over the same words, so the one NET-079 refusal reached a client as two machine-mode failures: a typed one at a create, an unspecified one at a launch. Both paths now return the one typed error, unenforceable_declaration_refusal, spelled once in the classifier beside its words: the create's RPC answer keys on this kind, and the kind is what the launch's io::Error carries to whatever reads it downstream, so the same declaration's refusal maps to the same machine-mode code wherever it meets a client. The words also end with what to do, after the why: remove these rules, or declare deny-all egress instead — the box's egress section, all three allow lists present and empty, no deny entries, since the CLI has no flag that writes an empty list — or run the box with --network own_ip, which enforces them. The why stays named: the host-address classifier enforces only deny-all until declared address rules are supported. Pinned beside both: a lone present-but-empty allow list names its own rule (allow_subnets present and empty with the other two absent is not the deny-all shape), the classifier test holds the words' remedy tail and the one typed error, the launch test asserts the surfaced refusal is the create's own kind, and the create test names the arm it rode and the remedy it named.
The daemon-fetch proof's refused-create leg already greps the stderr a person reads for the rule the refusal named and the mode that enforces it; it now also greps the remedy the words end with, so the end-to-end proof pins what a person is left to type, not only what they typed wrong.
|
Round 1 of 1 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. On a native host whose classifier decides per box, activating a host-address box with Notes from the agent: Revise round: all three directive items applied inside the task's layers, two commits (fix(minimald) 7d36984 for the five rust files, test(e2e) 3b74861 for the script). Item 1 route: no launch-path consumer keys on io::ErrorKind (the attach channel prints the Display text, the exec bridge maps every spawn error to exit 1, FinalizeSession maps every error to Errorable::Err), and the consumers that would have to — crates/minimald/src/session.rs, exec.rs, connection.rs — are outside this task's layers, so the fix is the error's construction: one unenforceable_declaration_refusal in the classifier, InvalidInput — the create's own kind — returned by both call sites, pinned at all three ends (classifier: the one error; launch: the surfaced error's kind; create: the refusal rides the RPC's InvalidInput arm, where any other kind answers as a transport error and never yields Errorable::Err). The e2e line ran as written and exited 0; its proof skips on this hos…[truncated] |
|
The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove |
|
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: the PR's own commits sit on a merge of |
norrietaylor
left a comment
There was a problem hiding this comment.
Approved at 3b74861. It implements NET-079's interim refusal: one predicate serves create and launch, a single typed InvalidInput reaches the client on both paths, the error names the remedy, and a lone empty allow list is pinned. ARCH passed it, minimal-review approved with no findings, and every lane is green.
T87 — Refuse a host-address declaration the classifier cannot enforce on a host that decides per box
slice: S11
kind: task
covers: NET-079
size: M
est: 150 code, 280 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the daemon log keeps one info line per refused create or launch naming the box, the host's per_box value and each unenforced rule; the launch record line is unchanged
observability: a counter of creates refused for an unenforceable host-address declaration
layers:
- classifier:
- crates/minimald/src/net/classifier.rs: adds a pure function beside
verdict_ofthat names each rule of a host-address declaration the classifier cannot enforce: everydeny_subnetsentry, and every allow list when the declaration is not the deny-all shape (all three allow lists present and empty); an absent section and the deny-all shape name nothing; the module comment that says the allow subtree refuses nothing on a box's behalf stays true and now says why such a declaration never reaches it on a per_box hosttest: cargo nextest run -p minimald unenforceable_rules_names_deny_subnets_and_partial_allow_lists
test: cargo nextest run -p minimald unenforceable_rules_empty_for_absent_section_and_deny_all
- daemon:
- crates/minimald/src/sessions.rs: the create path refuses a host-address box whose declaration names any unenforceable rule WHILE the box host decides per box (the same
can_decide_per_boxfact the launch reads, taken at create), with a typed error carrying every unenforced rule by field name, before anything is allocated; on a host that cannot decide per box nothing changes: the box is created, runs unenforced and is recorded as such, never refused on that ground; own-address boxes are untouched- crates/minimald/src/rpc.rs: the typed error reaches the client as a create failure whose message names each unenforced rule and says own-address boxes enforce them
- crates/minimald/src/session_host.rs: the launch path calls the same pure function, gated on the classifier decision the launch has just re-read (the probe
host_ip_enforcementtakes itscan_decide_per_boxfrom), and refuses the launch with the same typed error when the host decides per box and the declaration names an unenforceable rule; one predicate, two call sites, no second copy; this closes the create-then-install race and boxes persisted before this task that are relaunched after it; the launch record derivesper_boxfrom the placement plus that function, never from the node fact alone, so it can never recordper_boxfor a declaration the function marks unenforceabletest: cargo nextest run -p minimald per_box_host_refuses_unenforceable_host_ip_declaration
test: cargo nextest run -p minimald per_box_host_creates_host_ip_box_with_no_section_or_deny_all
test: cargo nextest run -p minimald unenforcing_host_still_creates_host_ip_box_with_any_declaration
test: cargo nextest run -p minimald launch_refuses_unenforceable_host_ip_declaration_after_host_gains_per_box
test: cargo nextest run -p minimald launch_record_never_per_box_for_unenforceable_declaration
test: cargo nextest run -p minimald create_session_rejects_policy_incompatible_with_network_mode
- e2e:
- scripts/session-e2e.sh: the daemon-fetch proof's host-address box drops
--deny-subnets 0.0.0.0/0(refused under the loaded table now) and runs with no section, its comment corrected (that flag is not a deny-all spelling, the box lands in boxes/allow either way); the proof adds one leg under the loaded table:--network host_ip --deny-subnets 0.0.0.0/0and--network host_ip --allow-subnets 10.0.0.0/8are each refused at activate, with the error naming the ruletest: ./scripts/session-e2e.sh daemon_fetch_under_deny_all_host_address_box
produces: none
consumes:
- crates/minimald/src/net/classifier.rs
proof: On a native host whose classifier decides per box, activating a host-address box with
--deny-subnets 0.0.0.0/0or a narrowing allow list fails with an error naming each rule the classifier cannot enforce; a box created while the host could not decide per box and launched after the classifier is installed is refused at launch with the same error and never lands in boxes/allow; a box with no section and a deny-all box are still created; a host that cannot decide per box still creates and runs every host-address box unenforced.depends on:
- blocked by #1806
Requirement text. This quoted text is authoritative for this task: the spec 18 amendment stays a draft (#1916) until after this run, a sub-requirement of NET-079:
This is interim and is retired when the classifier enforces a host-address box's declared address rules. It stays distinct from the sub-requirement for a host that cannot decide per box, where the box runs unenforced and is never refused.
Out of time
The coder ran out of its 7200s before it finished. If it left work uncommitted, its last commit is the runtime's snapshot of that work as it stood — the commit message says so — and not a finished step: it may not build or pass its tests. So this PR is a draft.
Proof
On a native host whose classifier decides per box, activating a host-address box with
--deny-subnets 0.0.0.0/0or a narrowing allow list fails with an error naming each rule the classifier cannot enforce; a box created while the host could not decide per box and launched after the classifier is installed is refused at launch with the same error and never lands in boxes/allow; a box with no section and a deny-all box are still created; a host that cannot decide per box still creates and runs every host-address box unenforced.Commit headers reworded by the runtime to fit commitlint. The header the coder wrote is the first paragraph of each of these commits' bodies:
feat: the coder's uncommitted work as it stood when its 7200s ran outTests
cargo nextest run -p minimald unenforceable_rules_names_deny_subnets_and_partial_allow_listscargo nextest run -p minimald unenforceable_rules_empty_for_absent_section_and_deny_allcargo nextest run -p minimald per_box_host_refuses_unenforceable_host_ip_declarationcargo nextest run -p minimald per_box_host_creates_host_ip_box_with_no_section_or_deny_allcargo nextest run -p minimald unenforcing_host_still_creates_host_ip_box_with_any_declarationcargo nextest run -p minimald launch_refuses_unenforceable_host_ip_declaration_after_host_gains_per_boxcargo nextest run -p minimald launch_record_never_per_box_for_unenforceable_declarationcargo nextest run -p minimald create_session_rejects_policy_incompatible_with_network_mode./scripts/session-e2e.sh daemon_fetch_under_deny_all_host_address_boxVerify
min task run agent-verifyexited 101, so this PR is a draft.Base
The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:
crates/minimald/src/rpc.rscrates/minimald/src/session_host/tests.rsscripts/session-e2e.shOut of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimald/src/session_host/tests.rsCloses #1917