refactor: remove the dormant slot privilege seam (hal0-slotctl + euid routing)#954
Merged
Merged
Conversation
… routing) Follow-up to #953 (hardened mode removed). With hal0-api always root, the slot privilege seam is dead code. Removes: ContainerProvider._privileged() + the two euid!=0 branches (the root path is unchanged — behavior-preserving), the hal0-slotctl wrapper + sudoers + their install.sh writes (replaced with an upgrade cleanup that deletes any stale copies), the installer-route _privileged_systemctl_argv sudo fallback, and the now-obsolete seam test + conftest euid fixture. Kept: src/hal0/install/perms.py (still used by 'hal0 doctor' for root-only + agent ownership auditing; stale seam doc updated) and the agent env seam (hal0-agentenv / run-as-hal0.sh — agents still run as hal0). perms.py's non-root branches are now unwired — a candidate for a later cleanup alongside doctor. 289 targeted tests pass (providers + perms + installer routes); ruff + bash -n clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bogdan-d
pushed a commit
to bogdan-d/hal0
that referenced
this pull request
Jun 23, 2026
Bump version 0.8.0-beta.3 -> 0.8.1-beta.1 and add the CHANGELOG entry for the installer/privilege simplification (Hal0ai#953, Hal0ai#954) + Hermes durable memory on by default (Hal0ai#955: private:hermes + shared banks, agent-id hermes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #953 (hardened mode removed). Now that
hal0-apialways runs as root, the slot privilege seam that existed solely to let an unprivileged daemon write per-slot units + runsystemctlis dead code. This removes it — behavior‑preserving, since the kept path is exactly theeuid == 0(root) branch that already ran in production.Removed
ContainerProvider._privileged()and the twoif os.geteuid() == 0 … else <sudo -n hal0-slotctl …>branches incontainer.py(kept the root branch; dropped the_HAL0_SLOTCTLconstant).hal0-slotctlwrapper (installer/wrappers/hal0-slotctl) + its sudoers grant (packaging/sudoers/hal0-slotctl) + theinstall.shblock that wrote them — replaced with an upgrade cleanup that deletes any stale copies left by an older hardened install.sudo -nfallback ininstaller.py:_privileged_systemctl_argv(same dormant euid pattern; comfyui restart now goes direct).tests/providers/test_container_privileged_seam.py) and theconftest.pyautousegeteuid==0fixture (no longer needed —container.pynever callsgeteuidnow).Kept (intentionally)
src/hal0/install/perms.py— still used byhal0 doctorto audit root-only + agent (#843) ownership. Its stale "seam is the prerequisite" docstring is updated; its now-unwired non-root branches are left as a candidate for a later cleanup alongsidedoctor.hal0-agentenv,run-as-hal0.sh) — agents/Hermes still run ashal0, so this stays.Verification
289targeted tests pass (tests/providers+tests/install/test_perms.py+tests/api/test_installer_routes.py).ruff check+ruff format --checkclean;bash -n installer/install.shclean.Test plan
daemon-reload/restart directly (unchanged path).hal0-slotctl+/etc/sudoers.d/hal0-slotctl.🤖 Generated with Claude Code