Summary
After a successful pv ports:install, normal pv status and pv doctor can still report the active PF redirects as unreadable and fail overall health because inspecting /dev/pf requires root privileges.
At the same time, pv ports:status reports the prepared/system files as current but does not inspect loaded rules. The three diagnostic surfaces therefore disagree on a working machine.
Verified reproduction
After the user repaired the incident with pv ports:install:
- default and forced-IPv4
https://ai.test returned HTTP 200 through 127.0.0.1:443;
- direct Gateway HTTPS on 48443 also returned 200;
pv ports:status reported every prepared/system PF file as current;
pv status --json reported "ports":"unreadable";
pv doctor failed with active pf redirects could not be inspected and suggested running pv ports:install again.
The host behavior is deterministic:
$ /sbin/pfctl -s nat
pfctl: /dev/pf: Permission denied
$ sudo -n /sbin/pfctl -s nat
sudo: a password is required
$ ls -l /dev/pf
crw------- root wheel /dev/pf
Current code paths
pv status invokes active PF inspection after file state is current: status.rs.
- Active inspection tries
pfctl, then non-interactive sudo -n: pf.rs.
- An inspection error becomes
ports: unreadable and a system failure: status.rs.
- Doctor fails the same state and recommends reinstalling:
doctor.rs.
pv ports:status inspects only files and always exits success: ports.rs.
Expected behavior
Read-only diagnostics should provide a reliable, non-interactive health classification without depending on a warm sudo credential. Lack of permission to enumerate PF rules must not make a verified-working route look broken or recommend repeating an already-successful install.
The exact fallback mechanism requires a design decision; status/doctor must remain non-mutating and must not prompt for authentication.
Acceptance criteria
pv status, pv doctor, and pv ports:status agree about healthy, inactive, stale, and genuinely uninspectable routing states.
- A normal user with no cached sudo authentication can obtain useful status without a prompt.
- A working end-to-end low-port route is not reported as failed solely because
/dev/pf is unreadable.
- An inactive/missing route is still reported as repair-required with
pv ports:install.
- JSON output distinguishes verified health from any intentionally unknown/uninspectable state.
- Add coverage for permission-denied PF inspection with both working and broken low-port routing.
- Keep mutating PF operations foreground-only.
Related
Summary
After a successful
pv ports:install, normalpv statusandpv doctorcan still report the active PF redirects as unreadable and fail overall health because inspecting/dev/pfrequires root privileges.At the same time,
pv ports:statusreports the prepared/system files as current but does not inspect loaded rules. The three diagnostic surfaces therefore disagree on a working machine.Verified reproduction
After the user repaired the incident with
pv ports:install:https://ai.testreturned HTTP 200 through127.0.0.1:443;pv ports:statusreported every prepared/system PF file as current;pv status --jsonreported"ports":"unreadable";pv doctorfailed withactive pf redirects could not be inspectedand suggested runningpv ports:installagain.The host behavior is deterministic:
Current code paths
pv statusinvokes active PF inspection after file state is current:status.rs.pfctl, then non-interactivesudo -n:pf.rs.ports: unreadableand a system failure:status.rs.doctor.rs.pv ports:statusinspects only files and always exits success:ports.rs.Expected behavior
Read-only diagnostics should provide a reliable, non-interactive health classification without depending on a warm sudo credential. Lack of permission to enumerate PF rules must not make a verified-working route look broken or recommend repeating an already-successful install.
The exact fallback mechanism requires a design decision; status/doctor must remain non-mutating and must not prompt for authentication.
Acceptance criteria
pv status,pv doctor, andpv ports:statusagree about healthy, inactive, stale, and genuinely uninspectable routing states./dev/pfis unreadable.pv ports:install.Related
pv updateincurs a 10-second launchd throttle after switching app binary #300