Repository navigation
feat(esp32): fail fast on a disk too small for a cold ESP32 build - #1767
Merged
Merged
Conversation
fbuild could measure free disk space and never did: `volume_facts` had no caller outside platform/, so a full disk surfaced as a raw ENOSPC from whichever subprocess wrote next, with no statement of the path or the shortfall (#1750). Before package resolution the ESP32 build now measures every root it writes and turns a shortfall into one actionable error naming the path, free vs required bytes, the shortfall, and the largest reclaimable caches under the cache root. A healthy build logs a single info line. The check is measurement only: reclaiming caches stays an explicit, budgeted step, because #1341 showed a mid-build eviction can delete a warm esptool install. Builds that only free space (--clean, --clean-all) skip the check. FBUILD_MIN_DISK_BYTES overrides the cache requirement and 0 disables the check. Refs #1750
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
The ban_std_pathbuf dylint denies naming std::path::PathBuf in new code, so DiskRoot/RootSpace store fbuild_core::path::NormalizedPath instead. Std-only free-space probing still takes &Path.
ban_unrooted_tempdir denies std::env::temp_dir() in production code: fbuild's scratch tree is <cache root>/tmp, so the pre-flight measures that instead of $TMPDIR.
This was referenced Oct 28, 2026
Merged
Merged
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.
What this is
Gives a client's agent a way to fix a machine that needs root (a wedged graphics
driver, a package that will not repair) without blanket root. Every
escalation is a Telegram approval the human taps, and every attempt is logged.
The sudoers entry grants exactly one command to one user:
No argument wildcards. The root helper refuses unless the exact argv was
approved by the configured Telegram user, inside the TTL, once; it writes one
JSON line per attempt (allowed and denied) to
/var/log/hermes-consent.log(0600 root). The fragment is validated with
visudo -cfand swapped inatomically;
/etc/sudoersis never edited.What state it leaves the machine in
/usr/local/libexec/hermes-consent-exec(root:root 0755)/etc/hermes-consent/config.json(root:root 0644) — approver id + TTL/etc/sudoers.d/90-hermes-consent(root:root 0440) — the single rule/var/lib/hermes-consent(0700) and/var/log/hermes-consent.log(0600)~<agent>/.hermes/consent/(0700) — request/approval records--uninstallremoves the rule, helper and config and keeps the audit log.Three targets
bosn run --task e2e-ubuntubosn run --task e2e-archsecurity.sudo.extraRules,/etcconfig, tmpfilesnix build .#checks.x86_64-linux.consent-sudo(VM test)How it was tested
/etc/sudoers.dis0750 there, so the unprivileged phase cannot stat the fragment; the root audit
phase verifies its content and mode — the skip prints that reason).
runNixOSTest, real boot,/dev/kvm): passed all subtests.The suite proves, from real command output:
sudo -n truefails before installand still fails after;
sudo -n /usr/bin/idand/bin/share refused; anunapproved id, a wrong-Telegram-user approval, an expired approval, a replayed
approval and tampered argv are all refused with distinct reason codes; one
correct approval runs the exact argv as root (
id -u→0) exactly once; theaudit log has one allowed line and every denied line; uninstall leaves sudo
still requiring a password.
The container Dockerfiles grant the unprivileged test user only the
installer (so the suite can prove the before/after state); everything else still
demands a password. That is harness-only and commented as such.
Limitation (also in the skill and README)
This stops prompt injection and silent escalation. It does not stop a fully
compromised gateway process: the approval record is written by a user-level
process running as the same user as the agent, so a process that can call
approvecan mint one. Only splitting the approval and execution acrossprivilege domains would close that; this design deliberately does not attempt it.
Flagged deviation
bosn run --task e2e-allruns the full assertion set on the default (Ubuntu)stack plus the repo's skill gate. A single container cannot host the Arch
container, so Arch remains its own task — the task comment says so rather than
pretending otherwise.