Skip to content

feat(self-update): non-elevated update skips the broker (+ zero-UAC docs)#466

Merged
githubrobbi merged 4 commits into
mainfrom
feat/non-elevated-update-skips-broker
Jun 20, 2026
Merged

feat(self-update): non-elevated update skips the broker (+ zero-UAC docs)#466
githubrobbi merged 4 commits into
mainfrom
feat/non-elevated-update-skips-broker

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

What

Completes the zero-UAC update story on Windows and documents the broker's no-admin narrative.

Code — non-elevated update skips the broker

The broker is the one elevated component (a LocalSystem service). A non-elevated uffs --update can neither stop its service (to unlock uffs-broker.exe) nor restart it without admin — so it would fail at the broker quiesce. But the broker wire protocol is fixed and back-compatible, so a slightly-older broker keeps serving a newer daemon.

So when not elevated, drop the broker from the apply: update the other five binaries, leave the running broker alone, and print a hint that a full refresh (incl. the broker) needs one elevated uffs --update. Elevated runs are unchanged (all six).

  • uffs-winsvc: add is_elevated() (TokenElevation query; false off Windows) — no new deps.
  • plan: Snapshot::drop_broker() removes the broker running entry + every uffs-broker binary target, returning its version for the hint.
  • run_apply: skip the broker when non-elevated; print the elevated-refresh hint. No-op away from Windows.

Docs — Access Broker = zero-UAC

  • updating.md: a non-elevated update skips the broker (elevated run refreshes it).
  • installation.md + daemon.md: lead with uffs-broker --install (one-time elevation → no UAC on later search, daemon start/stop/restart, and non-elevated updates); Administrator terminal / gsudo become fallbacks. Updates the §3 privileges tables and the "Permission denied" troubleshooting row.

Verification

macOS + x86_64-pc-windows-msvc builds, macOS + Windows clippy, drop_broker unit tests, full pre-push gate green (after a cargo clean to clear pre-existing E0514 stale-target artifacts).

🤖 Generated with Claude Code

githubrobbi and others added 4 commits June 19, 2026 17:48
…efresh hint)

The broker is the one elevated component — a LocalSystem service. A
non-elevated `uffs --update` can neither stop its service (to unlock
`uffs-broker.exe`) nor restart it without admin, so it would fail at the broker
quiesce. But the broker wire protocol is fixed and back-compatible, so a
slightly-older broker keeps serving a newer daemon.

So when NOT elevated, drop the broker from the apply: update the other five
binaries, leave the running broker alone, and print a hint that a full refresh
(including the broker) needs one elevated `uffs --update`. Elevated runs are
unchanged (they update all six). This completes the zero-UAC update story: with
the broker installed, a non-elevated update now succeeds instead of erroring at
the broker.

- uffs-winsvc: add `is_elevated()` (TokenElevation query; `false` off Windows),
  the natural home for this Windows-privilege check (no new deps).
- plan: `Snapshot::drop_broker()` removes the `broker` running entry + every
  `uffs-broker` binary target, returning its version for the hint.
- apply: skip the broker when `!is_elevated()`; print the elevated-refresh hint
  on success. No-op away from Windows (no broker in the snapshot there).

Verified: macOS + windows-msvc builds, macOS + windows clippy, and unit tests
for `drop_broker` (removes broker / reports version / None when absent).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reflect the new behavior: a non-elevated `uffs --update` updates every binary
except the LocalSystem broker (which keeps serving and is refreshed by a later
elevated run). Replaces the now-imprecise "later updates keep it current".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A multi-line `#[expect(unsafe_code, …)]` (an over-long reason that fmt
reflowed) hid the `// SAFETY:` comment from `undocumented_unsafe_blocks`,
failing windows clippy. Shorten the reason so the attribute stays single-line,
matching every other unsafe block in the file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…on guides)

installation.md and daemon.md presented "Administrator required" as the only
Windows model, predating the Access Broker. Update both to lead with the broker:
install it once (`uffs-broker --install`, elevated) and search, daemon
start/stop/restart, and non-elevated updates all run with no UAC — Administrator
terminal / gsudo become the fallbacks. Covers the §3 privileges tables, the
Windows options block, the daemon live-access note, and the "Permission denied"
troubleshooting row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@githubrobbi githubrobbi enabled auto-merge (squash) June 20, 2026 01:18
@githubrobbi githubrobbi merged commit fb12114 into main Jun 20, 2026
21 checks passed
@githubrobbi githubrobbi deleted the feat/non-elevated-update-skips-broker branch June 20, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant