Expand description
Pre-drain disk-footprint check (ticket mission-build-footprint).
A mission builds a full target/debug in its integration worktree, the
validation snapshot copies a warmed subset on top of that, and the merge
gate may build again in a scratch worktree. On a disk with less free space
than that ladder needs, the run dies mid-command with os error 28
(ENOSPC) — burning feature respawn budgets on Partial runs (observed on
m-a5a8fd and m-eee81f). This module refuses to START a mission when the
free space under the repo is below the estimated footprint, naming the
number, instead of dying mid-feature. It is deliberately a drain-time
refusal, not an in-mission guard: the honest failure is up front.
Enums§
- Disk
Preflight - The decision a pre-drain disk check reaches.
Functions§
- available_
bytes - Free bytes available to unprivileged users on the volume containing
path(statvfsf_bavail×f_frsize).Nonewhen the call fails — the check then degrades to “proceed” rather than inventing a number. - check
- The pre-drain check: compare free space under
repo_rootagainst the estimated build footprint. - estimate_
build_ footprint_ bytes - Estimated bytes a mission’s build ladder needs: the primary checkout’s
current
target/size × [FOOTPRINT_MULTIPLIER], floored so a target-less repo still gets a sane bound. The walk is capped atcapbytes — once the running total passes it the estimate is already “too big”, so a multi-GiB tree is not priced to the last file. - gib
- Render a byte count as
N.N GiBfor the refusal reason.