Repository navigation
CONDITIONS
Governs: architecture.md (arch 7a86ec7b). Box Spec [network.egress] lines 905–937: egress is default-deny (906), the keys are the ones NET-060 binds, the flat keys get a one-release hint (916–919), and deny_subnets is never reached (937). minimal.toml layout lines 1172–1173 ([default
44AF
s] and [defaults.<type>]), line 1178 (the implicit default entry is retired when the file declares a session entry) and Expansion lines 1196–1202 (one layer order, scalars and tables replaced, lists unioned, command-line overrides last). Exit codes line 364 (3 is an invalid minimal.toml). NET-060 itself is in docs/specs/18-spec-box-networking line 506. The flag semantics are in docs/specs/28-spec-box-cli line 442 (each egress flag "adds one item") and BOX-064 (29-spec, line 334, "unioning lists in that order").
Ruling: the placement conforms. create.rs is the task's only layer, and it reads the file through mfile::expand and mfile::network::canonicalize, the owners the task names. The four fields reach BoxPolicy.egress and the stored spec, and the flat keys get the hint that the design requires. Three deviations remain, and each has a condition. (C1) effective_egress replaces a file list with the flag's list field by field. Line 1196 and BOX-064 union lists through every layer, the command-line layer included, and BCLI line 442 says a flag adds an item. The replace has a fail-open edge: --deny-subnets X drops every deny range that the project declares (line 937). The task text says "replaces", and rubric rule 9 makes the plan change. (C2) A canonicalize error and a bad egress value exit 1, but line 364 requires 3. The NetworkError type already says "Each one exits 3". (C3) The read always takes [sessions.default]. In a file with only [sessions.dev.network.egress], that table is dropped without a message, and the box starts with an absent (allow-all) policy. That uses an implicit entry that line 1178 retires, and it fails open against line 906. (C4) The diagnostics line of the task (min session policy shows each field's source) is not met, and no issue names the gap.
Line 1202 and C1: line 1202 replaces a table wholesale. A flag writes one list item, not a network table, so the list-union clause of line 1196 governs it. No departure from precedent.
Not checked: no build, as the instructions require. I did not verify that toml::Value::try_into returns toml::de::Error in the pinned toml version, which C2 depends on. I did not verify the coder's claim that the 31 create tests pass. The PR's verify run failed on an unrelated resolver test under an unpinned rustc. The notes also say that [network] mode in minimal.toml does not set the box's mode. That gap is not NET-060's, and this ruling does not require it.
Conditions
- C1:
crates/minimal/src/cmd/boxes/create.rseffective_egress(): the command-line layer unions its lists with the file's lists. It does not replace them (line 1196). For each ofallow_subnets,allow_dns_hosts,allow_protocolsanddeny_subnets, the result is the file's items followed by the flag's items, with duplicates dropped. Replaceflags.x.or(project.x). When both set a field,sourcesrecordsProjectFileandFlagfor it.--deny-all-egresskeeps the three allow lists present and empty (NET-140). It keeps the file'sdeny_subnetswith sourceProjectFile, and records noFlagsource fordeny_subnets, becauseEgressPolicy::deny_all()leaves that fieldNone. Renameegress_flag_replaces_the_project_fieldtoegress_flag_adds_to_the_project_field. Assertallow_subnets == ["10.0.0.0/8", "192.168.0.0/16"], and assert that a--deny-subnetsflag keeps the file's deny ranges. Change the call-site comment ("replaced by the flag") and the T122 layer text "a flag replaces the file's value" to "a flag adds to the file's value" (rubric rule 9). - C2:
crates/minimal/src/cmd/boxes/create.rsproject_egress_from(): every refusal of the project'sminimal.tomlends with exit 3 (line 364). Thetry_intoerror of[network.egress](atoml::de::Error) returnsProjectFileInvalid { error: mfile::Error::Format(error) }. Do not useanyhow::anyhow!there. Themfile::network::canonicalizeerror returns themfile::network::NetworkErrorunwrapped.failure_exit_codeincrates/minimal/src/main.rsgets one arm: a downcastmfile::network::NetworkErrorreturns itsexit_code()(3). This one arm is outside the task's layers, and the condition admits it. Add a test that an unknownallow_protocolsvalue and a wrong-shapenetwork.egressboth reach exit 3. - C3:
crates/minimal/src/cmd/boxes/create.rsproject_egress_from(): do not read[sessions.default]when the file declares other session entries. Take the entry body that a baremin session startpicks (line 1178, BCLI-071). Read the entries withmfile::entry::read_entries. Use[sessions.default]when it is declared, else the only entry whosebox_typeissession. When the file declares two or more session entries, none of themdefault, and one of them carriesnetwork, refuse the start: name the entries andmin session start <entry>. Do not fall back to[defaults]and[defaults.session]alone. A declared egress table is never dropped without a refusal. Inproject_egress_table_reaches_box_policy, add a file whose only session entry is[sessions.dev.network.egress], and assert that its rules reach the policy. - C4: File an issue for the T122 diagnostics line that this head does not meet:
min session policyprints each egress field with its source,minimal.tomlor a flag (crates/minimal/src/cmd/boxes/policy.rs, outside the task's layers). Line 1178 gives the same provenance for every value to themin box specrender. Name the issue URL in aResidualssection of the PR body. The PR body states the gap but names no issue (rubric rule 6). The debug line "the create request's effective egress" records the sources, and stays.
Ruled at ca8c95f against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5; arch_rulings 1038, job e37ec2b2-a7f0-4bff-a877-9b533af6764b.