Skip to content

fix: drop the percentage free-space floor everywhere - #234

Merged
andersalm merged 6 commits into
developfrom
fix/drop-free-space-floor
Oct 6, 2026
Merged

andersalm merged 6 commits into
developfrom
fix/drop-free-space-floor

Conversation

@irzhywau

@irzhywau irzhywau commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Removes every free-space check that demanded a fixed share of the volume (10% or 15%) stay free.

Why

A share of capacity scales with the disk, not with the work. On a 460 GiB Mac the 10% rule demanded 46 GiB and blocked builds, tests, updates and model downloads; on large volumes it would demand terabytes. #123's review asked for this change to leave #123 and come as its own PR. #203 also drops the 10% floor, inside its cutover commit, and can take this version when it rebases.

What changes

  • Each check now requires only that the bytes it is about to write fit in the available space. Existing exact-byte accounting, overflow and consistency checks, and fixed safety margins stay.
  • Runtime: the update, model and content preparation, the IPFS provider's capacity check and the Runtime's recheck of it, Browser image preparation, hosted egress history, publication and release snapshots.
  • Behaviour change: an update now proceeds as long as its own bytes fit, so it can fill a volume almost completely. If they don't fit it still refuses with "not enough free space for the update; previous release preserved".
  • Tooling and CI: the release scripts and signer, image packaging, the media-tools build, update-hop comparison, Browser qualification, both workflows, and the local pre-push gate, which now always runs its Rust checks.
  • Unchanged: the absolute minimums stay. Source-Home setup keeps 16 GiB and the media build keeps 4 GiB.
  • Docs: AGENTS.md, TASKS.md, state.md, the content distribution contract and scripts/README.md drop the percentage. Dated audits are left as historical records.

Fixed 2 GiB reserve (5 October decision)

  • One shared constant, FREE_SPACE_RESERVE_BYTES (2 GiB) in elastos-common, kept free on top of the bytes a user-facing write needs, so a disk is never filled to zero.
  • require_update_space uses it, which covers update staging, support staging and the update controller's check (require_controller_update_space, formerly require_controller_disk_reserve).
  • install.sh keeps the same value and checks the download folder and the install folder for the binary's size plus the reserve before writing. A Rust test fails if the two values ever differ.
  • AGENTS.md keeps the housekeeping rule for development and staging volumes as a fixed, per-machine amount (ELASTOS_DEV_MIN_FREE_GB, default 15 GB), never a share of the volume.

Verification (local, macOS arm64, rebased on develop 0200582b)

  • just test-elastos (same as CI, with provider binaries), run with Chat and People with Home: connect, approve contacts and recover (#86) #123's commits on top: 4076 passed, 0 failed. Clippy with -D warnings and cargo fmt --check are clean, and the new capsule lint passes for ipfs-provider.
  • Script suites pass: install-bootstrap (56, including the new reserve test), prepare-release-platform (19), publish-platform-artifacts (18), ci-local-prepush (58), ci-release-policy (19), release-mac-capacity (14), product data.
  • Known failures not caused by this PR: release-signer-test.py fails the same 2 tests on unchanged develop in this environment (also seen through release-platform-input-test.py, which reruns it), and update-hop-compare-test.py has one Python 3.14 tarfile fixture error in a test this PR does not touch.

@irzhywau
irzhywau added this pull request to stack #235 October 5, 2026 11:11
@irzhywau
irzhywau force-pushed the fix/drop-free-space-floor branch 2 times, most recently from 171bd40 to 3fcae4d Compare October 5, 2026 19:20
@irzhywau
irzhywau requested a review from andersalm October 5, 2026 19:21
@andersalm

Copy link
Copy Markdown
Contributor

Decision (Anders, 5 October): drop the percentage floors as proposed, with one change: user-facing writes (update staging, installer, model and content downloads) keep one shared fixed reserve of 2 GiB on top of the bytes they write, so a disk is never filled to zero; require_update_space and the installer check use it. Keep AGENTS.md's 10% housekeeping rule for development and staging volumes. Please rebase after the update PRs (#243, #245, #246, #248) merge.

@andersalm andersalm mentioned this pull request Oct 5, 2026
10 of 27 tasks
@irzhywau
irzhywau force-pushed the fix/drop-free-space-floor branch 2 times, most recently from 90b6512 to a7c23c3 Compare October 6, 2026 09:26
@andersalm

Copy link
Copy Markdown
Contributor

Blocker for #108: the 2 GiB reserve from the 5 Oct decision is not in a7c23c3 yet (needed <= available). Please add one shared constant, used by require_update_space, require_controller_disk_reserve and install.sh.

irzhywau added a commit that referenced this pull request Oct 6, 2026
The 5 October decision on #234 keeps one shared, fixed reserve on top of the
bytes a user-facing write needs, so a disk is never filled to zero.

- FREE_SPACE_RESERVE_BYTES (2 GiB) lives in elastos-common. The update space
  check uses it, which covers update staging, support staging and the update
  controller's check.
- install.sh keeps the same value and checks the temporary download directory
  and the install directory for the binary's size plus the reserve before it
  writes anything. A Rust test keeps the installer's value equal to the
  Runtime's.
- AGENTS.md keeps a housekeeping rule for development and staging volumes as a
  fixed, per-machine amount (ELASTOS_DEV_MIN_FREE_GB, default 15 GB), never a
  share of the volume.

Part of #108.
@irzhywau
irzhywau force-pushed the fix/drop-free-space-floor branch from a7c23c3 to 901b76b Compare October 6, 2026 12:07
irzhywau added a commit that referenced this pull request Oct 6, 2026
The 5 October decision on #234 keeps one shared, fixed reserve on top of the
bytes a user-facing write needs, so a disk is never filled to zero.

- FREE_SPACE_RESERVE_BYTES (2 GiB) lives in elastos-common. The update space
  check uses it, which covers update staging, support staging and the update
  controller's check.
- install.sh keeps the same value and checks the temporary download directory
  and the install directory for the binary's size plus the reserve before it
  writes anything. A Rust test keeps the installer's value equal to the
  Runtime's.
- AGENTS.md keeps a housekeeping rule for development and staging volumes as a
  fixed, per-machine amount (ELASTOS_DEV_MIN_FREE_GB, default 15 GB), never a
  share of the volume.

Part of #108.
@irzhywau
irzhywau force-pushed the fix/drop-free-space-floor branch from 901b76b to 6d0390e Compare October 6, 2026 12:20
Disk checks across the Runtime, release tooling, CI and the local pre-push
gate demanded that a fixed share of the whole volume (10% or 15%) stay free.
That share scales with volume size, not with the work: on a 460 GiB Mac it
demanded 46 GiB and blocked builds, tests, updates and model downloads, and
on large volumes it demanded terabytes.

Each check now requires only that the bytes it is about to write fit in the
available space. Existing exact-byte accounting, overflow and consistency
checks, and fixed safety margins stay. An update that does not fit still
refuses with "not enough free space for the update; previous release
preserved". The local pre-push gate always runs its Rust checks, and the
hosted Mac release capacity check needs only its planned growth.

The absolute minimums stay unchanged: source-home setup keeps 16 GiB and the
media tools build keeps 4 GiB. AGENTS.md and the content distribution and
scripts docs drop the percentage requirement; dated audits
are left as historical records.
The 5 October decision on #234 keeps one shared, fixed reserve on top of the
bytes a user-facing write needs, so a disk is never filled to zero.

- FREE_SPACE_RESERVE_BYTES (2 GiB) lives in elastos-common. The update space
  check uses it, which covers update staging, support staging and the update
  controller's check.
- install.sh keeps the same value and checks the temporary download directory
  and the install directory for the binary's size plus the reserve before it
  writes anything. A Rust test keeps the installer's value equal to the
  Runtime's.
- AGENTS.md keeps a housekeeping rule for development and staging volumes as a
  fixed, per-machine amount (ELASTOS_DEV_MIN_FREE_GB, default 15 GB), never a
  share of the volume.

Part of #108.
@irzhywau
irzhywau force-pushed the fix/drop-free-space-floor branch from 6d0390e to 0c67287 Compare October 6, 2026 12:31
@irzhywau

irzhywau commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@andersalm the requested changes have been pushed, just waiting for the CI to complete now

SashaMIT added a commit that referenced this pull request Oct 6, 2026
The disk line now reports free space and applies no threshold of its own;
the shared free-space rule (#234) owns any warning. The header comment no
longer says setup fetches a model catalog, which is no longer part of the
release.

Co-authored-by: Cursor <cursoragent@cursor.com>
develop's refused-release work (#257) classifies a space refusal through
DiskReserveError, which this branch renamed to UpdateSpaceError; its test now
uses the branch's type. No textual conflicts.
The 5 October decision on #234: no percentage floors; user-facing writes keep
one fixed 2 GiB reserve on top of their own bytes.

- elastos-common owns FREE_SPACE_RESERVE_BYTES, NotEnoughFreeSpace and
  require_free_space (needed + 2 GiB <= available). The refusal reads
  "not enough free space: this needs N GB plus 2 GB kept free".
- Update staging, support staging, the update controller and the installer's
  install-release writer use it through require_update_space; the controller
  classifies NotEnoughFreeSpace as a space refusal (replaces UpdateSpaceError).
- Model and content preparation (inventory reservation and the private
  backend capacity check) and Browser image preparation use the same check.
- install.sh keeps the same value and wording; a Rust test keeps the value
  equal to the constant.
- AGENTS.md keeps its 10% housekeeping rule for development volumes, as
  decided; the per-machine ELASTOS_DEV_MIN_FREE_GB rule is dropped.

Boundary tests: exactly needed + 2 GiB is accepted and one byte less refused
for update staging/installer writer, model preparation, the backend capacity
check and install.sh.

Part of #108.
First-party component installs over Carrier and CID downloads wrote their
bytes during setup and Marketplace installs without a space check. Both paths
now admit the write with require_free_space before writing: a plain component
needs its own bytes on the destination volume; a tarball needs the archive and
its unpacked tree on the temp volume and the unpacked tree on the destination,
counted once per shared volume. install_transaction::volume_space reports the
nearest existing ancestor's device and available bytes. The refused .gguf
branch is unchanged.

Part of #108.
@andersalm

Copy link
Copy Markdown
Contributor

@irzhywau as agreed, the operator took over this rebase. On top of your 0c67287:

Tests: boundary tests at exactly bytes + 2 GiB; 108 setup tests pass; the pre-push gate passed. GPT-6 Sol review: PASS after one gap (setup component writes) was fixed. It merges when CI is green. #123 now targets develop; I'll rebase it after this merges.

@andersalm
andersalm merged commit e844fb5 into develop Oct 6, 2026
11 checks passed
andersalm added a commit that referenced this pull request Oct 6, 2026
…Home gets a controller (#89)

#234 dropped the percentage floor from this harness, so prepare-ci-disk now
reclaims only to 20 GiB free. The pinned 0.8.0-alpha.6 still keeps 15% of the
volume free before it creates its update controller; below that its Home opens
without one ('Free disk space before updating'), and the journey waited for a
controller that never came. prepare-ci-disk now reclaims to 20 GiB plus that
reserve, and the journey refuses plainly before starting the published Home
when the runner is below it.
andersalm added a commit that referenced this pull request Oct 6, 2026
…GB rule (#234), installer steps (#253)

alpha.7 is built from develop after #259 merges, which now includes #234 and #253.
alpha.6's System update refuses any release whose support changed (update.rs@252166bc:1687-1691);
its Terminal update accepts it.

(cherry picked from commit 40dde8604026369bfb796db9cef9bed55ee7479f)
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.

2 participants