* verify the Hex Microphone driver's signature before installing it
The driver install copied whatever bundle validated: the app's own copy,
or, when that was missing, scripts/build-hex-microphone-driver.sh's
output in ~/Library/Caches/hex-mic, a user-writable path. Nothing checked
the code signature, so an admin-approved install could plant a driver
from outside Hex's trust anchor into the HAL folder.
A published build (stable or dev channel) now checks the chosen bundle
with codesign --verify --deep --strict -R (src/codesign.rs) against
app/driver-requirement.txt: anchor apple generic, identifier
anomaly.hex.microphone.driver, Developer ID, and Anomaly's team
5NZ4Q7NXJ4. The check runs in the install worker before the admin prompt
and reports through DriverActionState::Failed.
dev_build::is_local_build is the gate: debug, test, HEX_LOCAL_BUILD,
HEX_TEST_BUILD, or an unmarked 0.0.0-dev checkout. It is narrower than
is_dev_build, whose dev-channel builds are published and signed with the
same Developer ID, so a dev-channel driver is verified too.
The candidate selection is a pure function: a bundle copy that is present
but broken fails the install instead of falling through to the cache, and
only local builds consider ~/Library/Caches/hex-mic at all, so an ad-hoc
or other-team signed driver still installs there.
The updater is untouched.
* read the bundled driver version without checking its signature
status() asks for the bundled driver's version on the UI thread (the macOS
host's platform poll), and the version read went through
bundled_driver_path(), which spawns codesign in a shipped build. The
version read now shares the install's candidate order and cache policy but
never verifies; only the install worker, before the admin prompt, checks
the signature.
Also says exactly what the requirement test pins (the driver's identifier
and the team ID the updater's requirement uses), and lists every kind of
local build the cache fallback covers in the feature map.
* driver install: re-check the signature as root and refuse symlinked copies
Addresses the second review of #2767.
The user-side codesign check ran before the admin prompt, so a bundle
swapped while the prompt was up was copied anyway. The requirement now
travels to osascript as its own argv item (empty for local builds) and
the root shell checks the staged copy with codesign --verify before it
replaces the driver or restarts coreaudiod. The copy refuses a symlinked
or non-directory source, drops ACLs and quarantine flags, and leaves the
staging copy root:wheel with no group or other write.
Candidate inspection uses symlink_metadata: a symlink (dangling included)
or a non-directory fails the install instead of reading as missing, and
only a real Hex.app's Contents folder counts as the running bundle. The
user home comes from app_paths.
is_local_build no longer treats a hand-stamped 0.0.0-dev-<N> build (what
scripts/release-app.sh makes, signed and notarized) as local; only
build.rs's -dev-local marker is local. is_dev_build is unchanged.
nix/package.nix's fileset now carries the two app/*-requirement.txt files
the Linux build and tests include, and the codesign helper compiles on
macOS only.