Repository navigation
T76 — Reserve the local range on the macOS host by the advisory's privileged step - #1825
norrietaylor merged 24 commits into
Conversation
…s ran out 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.
…e-local-range-on-the-macos-host-by-the
|
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 |
…e-local-range-on-the-macos-host-by-the
…s ran out 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.
…e-local-range-on-the-macos-host-by-the
|
Round 1 of 10 on a failed check suite, pushed as 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.
Verify Converted to a draft: something above needs a person before review. On macOS, the one advisory command configures the resolver and installs a LaunchDaemon whose plist and program sit at root-owned, non-user-writable paths, read no configuration and apply exactly 127.0.64.0/24 as lo0 aliases now and at every boot; afterwards the bind probe the daemon runs at session start, read on the host, reads present, a session publishes from the range, and the 127.0.0.1 interim ends with no prompt; custody (owner root, not user-writable, the plist pointing at the root-owned copy) is checked and a failure re-surfaces the advisory; the range comes back after the unit is loaded again as at boot, the job is loaded and enabled for boot, and a real reboot is a manual check the PR body records with the date and macOS version it last ran on; the Linux command is unchanged, its routing-domain link keeping its routable-scope address. Commit headers reworded by the runtime to fit commitlint. The header the coder wrote is the first paragraph of each of these commits' bodies:
|
|
/revise Round 2. Both earlier rounds hit the 7200 s limit, so the branch holds partial work. It changes three files and contains none of the plan's tests. Finish the task to the plan block on #1817. Do these in order, and commit after each step so a timeout cannot lose finished work:
Leave the Linux command byte-identical ( In the round report, list each plan test line with its result. |
The one `sudo sh -c` NET-122's advisory names now carries NET-123's privileged step (design section 7.1): it writes the range unit's program and plist from bytes the command itself carries (quoted heredocs, no staged copy), converges both to root:wheel at 0755/0644, boots the old unit out and bootstraps the new one into the system domain — so the range is present on this boot and RunAtLoad re-applies it at every one after, and a re-run replaces the unit instead of dying on its label. Detection reads the step beside the hook (RangeStep: absent, installed, or custody failed with the check that failed) over the full custody walk: every directory component of both paths from `/` down, both files' owner and mode, the program path the plist's ProgramArguments names, and the program path the loaded job names in `launchctl print` — so files copied in without the unit behind them, or a job loaded from elsewhere under the label, fail custody. The advisory's quiet arm now needs custody holding beside the probe's present; a failed check re-surfaces it naming the check and the command that reinstalls both files. On macOS the interim fact says the command below installs the range and ends the interim; the lead-in says the command configures the resolver and reserves the local range. The Linux command is byte-identical to the one NET-122 shipped, and takes no range step. The session-start log line names the range unit's state and failed check beside the probe result and the surface chosen, and the `min bug` bundle carries the unit's state, its files' owner and mode, the program the plist runs, and the custody verdict.
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.
…e-local-range-on-the-macos-host-by-the
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
Round 2 of 10 on a /revise note, pushed as 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.
Verify Outside the task's
Converted to a draft: something above needs a person before review. On macOS, the one advisory command configures the resolver and installs a LaunchDaemon whose plist and program sit at root-owned, non-user-writable paths, read no configuration and apply exactly 127.0.64.0/24 as lo0 aliases now and at every boot; afterwards the bind probe the daemon runs at session start, read on the host, reads present, a session publishes from the range, and the 127.0.0.1 interim ends with no prompt; custody (owner root, not user-writable, the plist pointing at the root-owned copy) is checked and a failure re-surfaces the advisory; the range comes back after the unit is loaded again as at boot, the job is loaded and enabled for boot, and a real reboot is a manual check the PR body records with the date and macOS version it last ran on; the Linux command is unchanged, its routing-domain link keeping its routable-scope address. Commit headers reworded by the runtime to fit commitlint. The header the coder wrote is the first paragraph of each of these commits' bodies:
|
|
/revise Round 3. The step, the custody checks and all nine unit tests are in. Keep them. This round fixes the rendered macOS command and the e2e assertions only. Scope:
In the round report, list each plan test line with its result. Also say whether the macOS lane's runner has passwordless sudo. |
…e-local-range-on-the-macos-host-by-the
The advisory command wraps its payload in a single-quoted `sudo sh -c`,
so the apostrophe in the range program's header comment ("the range's
host addresses") closed the quote and left the pasted command
unparseable: `sh -n` rejects it with an unexpected EOF and zsh waits at
`quote>` forever. Remove every apostrophe from the program and plist
templates and pin that: the advisory test now asserts neither heredoc
body contains a single quote, that `/bin/sh -n -c` accepts the whole
command, and that it accepts the inner payload between the outer
quotes.
The lines after a heredoc are separate commands, so a failed write
underneath the heredocs previously could not stop the bootstrap: the
payload now begins with `set -e;`, which the same test pins by prefix.
The program itself now walks the range's host addresses in a for loop
over the rendered list and skips addresses lo0 already carries, rather
than re-adding them: the spike that claimed a re-add "re-applies
cleanly" never re-added a present alias (its guard skipped them), so
the skip is the shape the evidence supports, and a re-run now adds only
the missing aliases and removes nothing. The shape test pins the
walk's exact address list, the one guarded absolute-path `ifconfig`
alias form, and that the program substitutes nothing but its own two
reads.
Three of the local-range proof's launchctl reads asserted formats launchd never writes, so each one either failed a healthy host or passed a broken one: - `launchctl print` reports RunAtLoad as a bare `runatload` token in the job's `properties = …` line, never as `runatload = true`; the check now matches that line (case-insensitively, the plist key is `RunAtLoad`). - `launchctl print-disabled` rows read `"label" => enabled|disabled` with the label quoted, so matching the bare label never fired and every state passed, disabled included. The awk now matches the quoted label and the case accepts only no-row-or-`enabled`, failing on `disabled`. - the extracted command needed either the guarded bootout or the bootstrap to be present; both are now required separately. And the re-run a repeat install is: the proof now re-runs the advisory's command verbatim over the aliases it had already applied, without removing them first, and requires the re-loaded job's `last exit code = 0` (polled from launchctl print) with all 254 aliases still on lo0 — the re-run adds only missing aliases and removes nothing, which is what the program's skip guard promises and the spike's recorded runs never measured.
The two tests that read the rendered program's `for addr in` line
sliced the string by offset, which trips the strict gate's
string_slice lint on the lines this round changed. Read the list with
strip_prefix/strip_suffix instead, and scan the program's `$`
identifiers over split('$') rather than match_indices — same
iteration, no manual index.
…e-local-range-on-the-macos-host-by-the
|
Round 3 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. On macOS, the one advisory command now pastes and parses — its heredoc bodies carry no single quote, /bin/sh -n accepts both the whole command and the inner payload, and the payload begins with set -e, so a failed write stops the bootstrap — and it installs the root-owned LaunchDaemon whose program applies exactly 127.0.64.0/24 as lo0 aliases, skipping addresses lo0 already carries so a re-run adds only the missing ones, now and at every boot; afterwards the host-side bind probe reads present and the 127.0.0.1 interim ends; custody failures re-surface the advisory; the Linux command is unchanged. The macOS lane's e2e case now asserts what launchctl really prints (the properties line carrying runatload, the quoted label in print-disabled, both bootout and bootstrap present) and re-runs the command over the aliases it already applied, requiring the re-loaded job's last exit code = 0 with all 254 aliases still on lo0. Notes from the agent: Round 3 directive, item by item. (1) Both templates are apostrophe-free — the program header's possessive was the only one — and the advisory test pins no-quote, /bin/sh -n on the command and the payload. (2) |
|
/revise Round 4. Round 3's four asks are met: the command parses, both templates carry no apostrophe, the launchctl reads match what launchd prints, and the program skips present aliases. Keep all of it. The plan for #1817 now makes
The PR body is edited by hand; do not rewrite it. In the round report, list each plan test line with its result, and quote the SKIPPED line from the macOS lane. |
POSIX ignores -e for every command of an && list except its last, so a failed mkdir or printf in the advisory command payload short-circuited its list silently and the script ran on: the plist landed beside a resolver file that did not, launchctl bootstrap loaded the stale program, and the command exited 0 over a host it half-configured (reproduced by simulation). Separate the steps with ; instead — the guarded boot-out keeps its || true — and assert in the command test that no step hides in an && list outside that guard.
The case installs a root LaunchDaemon, and the macOS lane runner is a persistent shared host that is not given passwordless sudo, so the plan now runs it as an operator case: unless MINIMAL_E2E_PRIVILEGED=1 is set it prints its SKIPPED line and returns 0, so a whole-lane run continues past it, and only with the opt-in does a missing precondition fail rather than skip. The case-list, header and dispatch comments say so now. And the re-run exit-code poll no longer stops on the first non-empty value: launchd prints "last exit code = (never exited)" until the re-loaded job has actually run, so the poll waits for a numeric one before requiring 0.
The case self-skips unless MINIMAL_E2E_PRIVILEGED=1 is set, so no lane proves the command against a real launchd — the operator run does. Two test doc comments still credited the macOS lane with it.
…e-local-range-on-the-macos-host-by-the
|
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. On macOS, the one advisory command still configures the resolver and installs the range LaunchDaemon — root-owned, non-user-writable paths, no configuration read, exactly 127.0.64.0/24 applied as lo0 aliases now and at every boot — and its payload now fails closed for real: every step is its own statement under set -e, no step hidden in an && list (the unit test asserts it, /bin/sh -n still parses both halves, and a simulation of the rendered shape shows the old && form exiting 0 over a host with no resolver file and the stale program bootstrapped while the new form stops at the first failure); the e2e case is now operator-run — it prints its SKIPPED line and returns 0 unless MINIMAL_E2E_PRIVILEGED=1 is set, and with the opt-in a missing precondition still fails rather than skips — its re-run poll waits for launchd's last exit code to be numeric before requiring 0, and the whole minimal crate suite passes at the head (354 tests). The Linux command is byte-identical, its routing-domain link keeping its routable-scope address; the by-hand macOS run (custody, probe present, boot re-apply) and the real-reboot check remain what the PR body records, and the PR body was not touched. Notes from the agent: All three round-4 asks are addressed, each in its own commit. (1) The opt-in gate is the first thing in proof_local_range_reserved_by_privileged_step, before any uname/sudo/launchctl check: without MINIMAL_E2E_PRIVILEGED=1 it prints 'SKIPPED (privileged: set MINIMAL_E2E_PRIVILEGED=1 on a macOS host with passwordless sudo)' and returns 0 (verified: the case exits 0 and the lane continues); with it set the preconditions still fail rather than skip — verified here on Linux, where the opted-in run fails at the not-macOS check with exit 1. The proof's header comment and the whole-lane dispatch comment no longer claim the case is 'the macOS lane's alone' or that it 'fails rather than self-skips'; the case-list entry at the top of session-e2e.sh now names the opt-in …[truncated] |
…e-local-range-on-the-macos-host-by-the # Conflicts: # scripts/session-e2e.sh
|
Round 5 of 10 on a conflict with the base branch, pushed as Resolved conflicts in:
Verify Outside the task's
Converted to a draft: something above needs a person before review. On macOS the one advisory command configures the resolver and installs a LaunchDaemon — plist and program at root-owned, non-user-writable paths, carrying both files' bytes itself and reading no configuration — that applies exactly 127.0.64.0/24 as /32 lo0 aliases now and, with RunAtLoad and no KeepAlive, at every boot, so the daemon's session-start bind probe reads present, a session publishes from the range, and the 127.0.0.1 interim ends with no prompt; custody (every path component and both files owned by root with no group or other write, and the loaded job's ProgramArguments naming the root-owned program) is checked and a failed check re-surfaces the advisory naming it and the command that reinstalls both files; after the unit is loaded again as a boot would load it the range comes back with no user action. In CI the rendered command is proved by the unit tests, which parse it with /bin/sh -n; the Linux command is unchanged and its routing-domain link keeps its routable-scope /32 address. Notes from the agent: Revise round 5 was a conflict round with no review threads listed. The four conflict hunks in scripts/session-e2e.sh (the case doc list, the per-case variable block, the case-pattern list, and the usage listing) were additive on both sides — this branch's local_range_reserved_by_privileged_step case and main's new box_name_resolves_natively_without_proxy case — and were resolved by keeping both; the merge was completed in commit e9c2e5b and bash -n, the case dispatch, and the usage listing were re-verified. The merge commit also carries main's own changes (crates/sandbox2/src/lib.rs and main's new e2e case), which are main's, not this task's; the branch's diff against main is the six files listed in files_changed. No semantic conflict with main's new case exists: it is Linux-native-only (it skips unless Linux and non-VM) and greps the Linux advisory lead-in, which this task deliberately left unchanged — linux_advisory_command_is_unchanged p…[truncated] |
|
/revise Round 6. One defect, found by the by-hand privileged run. Scope: The operator ran The unit itself is correct.
Evidence for this round: The PR body is edited by hand; do not rewrite it. |
…e-local-range-on-the-macos-host-by-the
`launchctl bootstrap` returns before launchd runs the RunAtLoad job it loaded, so the alias count right after the command returned read 0 — the by-hand privileged run failed at 0 of 254 aliases on lo0. The new range_wait_unit poll, shared by the two steps that bootstrap the unit (the first install and the re-run), waits bounded at ~10 s until the job's `last exit code` is numeric and all 254 aliases are on lo0; each step then requires exit 0 and the whole range, failing with a line that names which half fell short.
Both comments claimed the bootstrap "runs the program now"; it loads the unit into the system domain and launchd starts it at once, asynchronously, so the range appears within about a second of the command returning — the wording the by-hand privileged run disproved. Comments only: no behaviour and no tests change.
…e-local-range-on-the-macos-host-by-the
|
Round 6 of 10 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review. The privileged macOS case now waits for launchd to run the bootstrapped range unit before it counts: a shared poll (bounded at ~10 s) runs after both bootstraps — the first install and the re-run — until Notes from the agent: Revise round 6, both directive items addressed, nothing else touched. (1) range_wait_unit, defined beside the other range helpers in scripts/session-e2e.sh, is applied at both sites that count aliases right after a bootstrap: the first install now gains the wait plus the exit-code check the directive asked for, and the re-run's inline poll is replaced by the same wait while keeping its own two bespoke verdicts (skip-don't-fail, remove-nothing). The kickstart re-apply keeps its existing poll (it follows a kickstart, not a bootstrap) and the removal check keeps its immediate count. (2) resolver.rs 1262/2542 reworded as directed; comments only, no behaviour and no tests changed — the nine resolver test lines pass against the edited file. Directive evidence reproduced here: |
|
/review |
|
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 runtime will not revise this pull request again on its own: round 7 would exceed the cap of 6 (the last trigger was the runtime's review findings). A person decides now. Remove |
|
/review |
norrietaylor
left a comment
There was a problem hiding this comment.
Babysitter review: both by-hand review fixes (custody mode bits, bounded launchctl read) are on c94325d. All required lanes are green on this head, including the macOS e2e, and minimal-review concluded on it. The architecture PASS at de2b4cc still holds; the changes since then are outside the design.
T76 — Reserve the local range on the macOS host by the advisory's privileged step
slice: S3
kind: task
covers: NET-123
size: M
est: 220 code, 300 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: the bundle's naming surface records whether the range unit is installed, the owner and mode of its plist and its program, the program path the plist runs, and the custody verdict beside the bind probe's result, so a macOS host still on the 127.0.0.1 interim, or holding a range unit whose custody fails, reads why in a bundle
observability: one info log line at session start naming the range unit's state (absent, installed, or custody failed and which check) beside the probe result and the surface chosen; the advisory stops re-surfacing for the range once the probe reads present and custody holds
layers:
- cli:
- crates/minimal/src/resolver.rs: on macOS the advisory command gains the range step in the same one
sudo sh -cthat writes the resolver file. The step writes the range program and its LaunchDaemon plist from bytes the command itself carries (no staged file, no user-writable source copied), to /Library/PrivilegedHelperTools/dev.minimal.local-range and /Library/LaunchDaemons/dev.minimal.local-range.plist, owned root:wheel, the program 0755 and the plist 0644, and bootstraps the unit into the system domain so it runs now and, with RunAtLoad and no KeepAlive, at every boot; a re-run boots the old unit out first, so the step is idempotent. The program is rendered from its template with the range's host addresses from switch::loopback::range_hosts filled in at render time, so it reads no argument, environment variable or file, and applies exactly the reserved range 127.0.64.0/24 as /32 lo0 aliases by absolute path (/sbin/ifconfig lo0 alias for host parts 1 to 254, the addresses the bind probe reads) and nothing else. Custody is checked where the hook is detected and covers the path, not just the two files: every directory component of both paths, from / down, is owned by uid 0 with no group or other write (never a path under $HOME or a user-owned Homebrew prefix), both files are owned by uid 0 with no group or other write, the plist's ProgramArguments names the root-owned program path, and the loaded job's Program/ProgramArguments inlaunchctl print system/dev.minimal.local-rangenames that same path, so a job loaded from elsewhere under the label fails custody; a failed check re-surfaces the advisory naming the failed check and the command, which reinstalls both files. The comment "The command rendered here does not carry that step yet" and advisory_at's doc line "not yet part of the command it renders here" are replaced: on macOS the interim fact says the command below installs the range and ends the interim, and the command line says it configures the resolver and reserves the range. The privileged step is shared with T71 as one command with two units: the range unit runs as root once per load, and T71's answerer unit runs as the operator under socket activation and must never be root, so neither unit is folded into the other, they share no file, label or program, and whichever of the two tasks lands second appends its step to the same command, which stays one command with exactly one privilege elevation (one sudo), never two invocations the user runs separately; T71's text is not changed. On Linux the command is unchanged: any 127/8 address binds on lo, so Linux takes no range step, and the dedicated link keeps its routable-scope /32 address (ZONE_LINK_ADDR), without which resolved never consults the routing domain. NamingSurface gains the range unit's state and custody verdict for the bundle- crates/minimal/src/resolver/reserve-local-range.sh (new): the range program's template, a /bin/sh script with no inputs that aliases each host address of the reserved range on lo0 by absolute path and exits non-zero on the first failure
- crates/minimal/src/resolver/dev.minimal.local-range.plist (new): the LaunchDaemon plist template: label dev.minimal.local-range, ProgramArguments the root-owned program path alone, RunAtLoad true, no KeepAlive, no UserName (it runs as root), no EnvironmentVariables
test: cargo nextest run -p minimal advisory_command_reserves_the_range_on_macos
test: cargo nextest run -p minimal range_program_applies_exactly_the_reserved_range
test: cargo nextest run -p minimal range_step_custody_is_root_owned
test: cargo nextest run -p minimal range_step_custody_walks_every_path_component
test: cargo nextest run -p minimal macos_advisory_command_elevates_exactly_once
test: cargo nextest run -p minimal range_step_custody_failure_resurfaces_the_advisory
test: cargo nextest run -p minimal linux_advisory_command_is_unchanged
test: cargo nextest run -p minimal bind_probe_reads_present_after_the_range_step
test: cargo nextest run -p minimal interim_advisory_says_the_command_ends_it_on_macos
- docs:
- docs/specs/18-spec-box-networking/18-spec-box-networking.md: NET-123 gains the sub-requirement "WHERE the host is macOS THE SYSTEM SHALL name, in NET-122's advisory command, a privileged step that installs a boot-time service, from root-owned non-user-writable paths and reading no configuration, which applies exactly the reserved local range to the host loopback at install and at every boot", tier T0, verify cargo nextest run -p minimal advisory_command_reserves_the_range_on_macos; its comment says Linux takes no range step and keeps the routing-domain link's address
- e2e:
- scripts/session-e2e.sh: adds the case local_range_reserved_by_privileged_step, a privileged, operator-run case that no CI lane runs: it installs a root LaunchDaemon, and the macOS lane's runner is a persistent shared host that is not given passwordless sudo. Unless MINIMAL_E2E_PRIVILEGED=1 is set it prints
SKIPPED (privileged: set MINIMAL_E2E_PRIVILEGED=1 on a macOS host with passwordless sudo)and exits 0; with it set, a missing precondition (not macOS, no launchctl, no passwordless sudo) fails rather than skips (Linux needs no range step, so it is never run there): it runs the advisory's command, asserts both files' custody and that the plist runs the root-owned copy, asserts the bind probe reads present and a session started afterwards publishes from the range with no interim and no advisory, assertslaunchctl print system/dev.minimal.local-rangeshows the job loaded with RunAtLoad true andlaunchctl print-disabled systemdoes not list it disabled, removes the aliases and kickstarts the unit as a boot would load it to show the range re-applied with no user action, then boots the unit out, removes both files and the aliasestest: ./scripts/session-e2e.sh local_range_reserved_by_privileged_step
produces: none
consumes:
- crates/minimal/src/resolver.rs
- crates/switch/src/loopback.rs
proof: On macOS, the one advisory command configures the resolver and installs a LaunchDaemon whose plist and program sit at root-owned, non-user-writable paths, read no configuration and apply exactly 127.0.64.0/24 as lo0 aliases now and at every boot; afterwards the bind probe the daemon runs at session start, read on the host, reads present, a session publishes from the range, and the 127.0.0.1 interim ends with no prompt; custody (owner root, not user-writable, the plist pointing at the root-owned copy) is checked and a failure re-surfaces the advisory; the range comes back after the unit is loaded again as at boot, the job is loaded and enabled for boot, and both this case and a real reboot are manual checks the PR body records with the date, macOS version and the case's transcript lines from the last by-hand run; in CI the rendered command is proved by the unit tests, which parse it with /bin/sh -n; the Linux command is unchanged, its routing-domain link keeping its routable-scope address.
depends on:
- blocked by #1656
- assumes T71 (#1803) appends its answerer unit to the same privileged command whichever of the two lands second; the range unit shares no file, label or program with it, so neither task blocks the other
Design ruling
Design §7.1 folds the reservation of the local range into the macOS advisory command NET-122 names, but the command the advisory renders today writes only the resolver file.
crates/minimal/src/resolver.rssays so itself ("The command rendered here does not carry that step yet"). Until the step exists, a macOS host stays on NET-123's127.0.0.1interim, and running the advisory's command never ends it. This task completes the advisory text #1656 (T15) reports from.The architecture ruling, binding on this task:
127.0.64.0/24, aslo0aliases, now and at every boot.127.0.0.1interim ends with no prompt.127/8address is bindable onlo. The Linux command stays unchanged, and so does the routable-scope address on its dedicated link, which systemd-resolved needs before it consults the routing domain. A test pins the Linux command.The privileged step is shared with T71 (#1803) as one command with two units. The range unit runs as root, once per load. T71's answerer unit runs as the operator under socket activation and must never be root. Neither unit is folded into the other, and they share no file, label or program. Whichever of the two tasks lands second appends its step to the same command, so neither blocks the other.
Acceptance:
Proof
On macOS, the one advisory command configures the resolver and installs a LaunchDaemon whose plist and program sit at root-owned, non-user-writable paths, read no configuration and apply exactly 127.0.64.0/24 as lo0 aliases now and at every boot; afterwards the bind probe the daemon runs at session start, read on the host, reads present, a session publishes from the range, and the 127.0.0.1 interim ends with no prompt; custody (owner root, not user-writable, the plist pointing at the root-owned copy) is checked and a failure re-surfaces the advisory; the range comes back after the unit is loaded again as at boot, the job is loaded and enabled for boot, and both this case and a real reboot are manual checks the PR body records with the date, macOS version and the case's transcript lines from the last by-hand run; in CI the rendered command is proved by the unit tests, which parse it with /bin/sh -n; the Linux command is unchanged, its routing-domain link keeping its routable-scope address.
Tests
cargo nextest run -p minimal advisory_command_reserves_the_range_on_macostests(ci-linux-native, job 111163197924)PASS [ 0.010s] ( 604/2657) minimal resolver::tests::advisory_command_reserves_the_range_on_macos… range_program_applies_exactly_the_reserved_rangePASS [ 0.011s] ( 619/2657) minimal resolver::tests::range_program_applies_exactly_the_reserved_range… range_step_custody_is_root_ownedPASS [ 0.009s] ( 621/2657) minimal resolver::tests::range_step_custody_is_root_owned… range_step_custody_walks_every_path_componentPASS [ 0.010s] ( 623/2657) minimal resolver::tests::range_step_custody_walks_every_path_component… macos_advisory_command_elevates_exactly_oncePASS [ 0.010s] ( 612/2657) minimal resolver::tests::macos_advisory_command_elevates_exactly_once… range_step_custody_failure_resurfaces_the_advisoryPASS [ 0.011s] ( 620/2657) minimal resolver::tests::range_step_custody_failure_resurfaces_the_advisory… linux_advisory_command_is_unchangedPASS [ 0.011s] ( 608/2657) minimal resolver::tests::linux_advisory_command_is_unchanged… bind_probe_reads_present_after_the_range_stepPASS [ 0.008s] ( 605/2657) minimal resolver::tests::bind_probe_reads_present_after_the_range_step… interim_advisory_says_the_command_ends_it_on_macosPASS [ 0.008s] ( 606/2657) minimal resolver::tests::interim_advisory_says_the_command_ends_it_on_macos./scripts/session-e2e.sh local_range_reserved_by_privileged_step: CI prints SKIPPED (privileged), by design per the plan; the by-hand run passed, see below.Out-of-layer file:
crates/minimal/src/cmd/session.rs(5 lines) addsrange_unit_stateandrange_unit_checkto the session-start info log, which is the plan'sobservability:line.Review fixes after the by-hand runs
fa8e8f49:file_custodyrecordsmode() & 0o7777, so the bundle'srange_stepmodes read 0755/0644, as the struct doc and the bundle test say. The custody verdict is unchanged.c94325d4:launchctl printruns under a 1 sLAUNCHCTL_BOUNDwithkill_on_drop. A wedged launchd reads as unverified custody instead of hangingmin session activateormin ls.Neither change touches the rendered command or the unit, so the by-hand privileged and reboot checks at
de2b4cc9still apply.Closes #1817
By-hand checks (head de2b4cc, 2026-10-03, macOS 26.7 25G229, Apple Silicon)
Privileged case:
MINIMAL_E2E_PRIVILEGED=1 ./scripts/session-e2e.sh local_range_reserved_by_privileged_steppassed locally:kickstartre-applied the range;Transcript of the case, verbatim:
Reboot:
127.0.64.xaliases were then removed (count 0).ifconfig lo0showed 254 aliases.launchctl print system/dev.minimal.local-rangeshowedruns = 1andlast exit code = 0, and the unit was not disabled.[enabled, allowed].