sandcastle: forward-port the full-disk provision guard onto main (GOTCHAS #411) #342

Open
matou-build-agent wants to merge 1 commit from forward-port/provision-disk-guard into main

Forward-port: provision_disk_guard onto main

provision_disk_guard is the first thing provision_install_and_build does: it reads free space on docker's data root and refuses under SWARM_MIN_DISK_MB (default 5120) in the #489 cold-store idiom — its own verdict stage with the FATAL captured as the error line (#9), SWARM_EXIT_REASON left unset so the runlog reason stays died-in:<stage>. An unreadable df passes: never red a run on a measurement that was not taken. A full host disk is outside what the harness may clean (the healer charter forbids host cleanup), so the guard's whole job is to make that diagnosis free instead of costing a swarm run and a heal cycle every hour.

Why this PR exists

The guard first landed in idss via a direct edit of the two vendored factory files (.sandcastle/provision-lib.sh + .sandcastle/tests/provision-lib-test.sh). Under ADR 0180 those files are owned by Matou/dev-factory, so a direct edit reds idss CI's drift stage on every run. That edit was reverted and re-landed into idss the ADR-0180 way — off a backport branch cut from the idss FACTORY_REF pin, which is a dead-end that is not on dev-factory main. This PR puts the identical guard on main so the next FACTORY_REF bump that crosses main does not silently drop it (the standing forward-port debt; idss #2178).

The patch is byte-identical to the idss landing: dev-factory main's provision-lib.sh and tests/provision-lib-test.sh differ from the idss post-guard copies only by the guard additions, so this PR is a clean copy-forward.

Proof

$ bash tests/provision-lib-test.sh
provision-lib: 14 groups passed

bash -n clean on both files.

Follow-up (not in this PR)

dev-factory dogfoods its own .sandcastle/ copy, vendored from the self-pin de5ebb85. The drift gate compares .sandcastle/* against that pin (unchanged here), so it stays green; the dogfood copy catches up at the next self-vendor/FACTORY_REF bump, out of scope for this forward-port.

## Forward-port: `provision_disk_guard` onto `main` `provision_disk_guard` is the first thing `provision_install_and_build` does: it reads free space on docker's data root and refuses under `SWARM_MIN_DISK_MB` (default 5120) in the #489 cold-store idiom — its own verdict stage with the FATAL captured as the error line (#9), `SWARM_EXIT_REASON` left unset so the runlog reason stays `died-in:<stage>`. An unreadable `df` passes: never red a run on a measurement that was not taken. A full host disk is outside what the harness may clean (the healer charter forbids host cleanup), so the guard's whole job is to make that diagnosis free instead of costing a swarm run and a heal cycle every hour. ### Why this PR exists The guard first landed in **idss** via a direct edit of the two *vendored* factory files (`.sandcastle/provision-lib.sh` + `.sandcastle/tests/provision-lib-test.sh`). Under **ADR 0180** those files are owned by `Matou/dev-factory`, so a direct edit reds idss CI's drift stage on every run. That edit was reverted and re-landed into idss the ADR-0180 way — off a **backport branch cut from the idss `FACTORY_REF` pin**, which is a dead-end that is **not** on dev-factory `main`. This PR puts the identical guard on `main` so the next `FACTORY_REF` bump that crosses `main` does not silently drop it (the standing forward-port debt; idss #2178). The patch is byte-identical to the idss landing: dev-factory `main`'s `provision-lib.sh` and `tests/provision-lib-test.sh` differ from the idss post-guard copies **only** by the guard additions, so this PR is a clean copy-forward. ### Proof ``` $ bash tests/provision-lib-test.sh provision-lib: 14 groups passed ``` `bash -n` clean on both files. ### Follow-up (not in this PR) dev-factory dogfoods its own `.sandcastle/` copy, vendored from the self-pin `de5ebb85`. The drift gate compares `.sandcastle/*` against that pin (unchanged here), so it stays green; the dogfood copy catches up at the next self-vendor/`FACTORY_REF` bump, out of scope for this forward-port.
sandcastle: forward-port the full-disk provision guard onto main (GOTCHAS #411)
All checks were successful
ci / static (pull_request) Successful in 3m22s
ci / test (pull_request) Successful in 13m0s
068f188d92
`provision_disk_guard` is the first thing `provision_install_and_build` does: it
reads free space on docker's data root and refuses under `SWARM_MIN_DISK_MB`
(default 5120) in the #489 cold-store idiom — its own verdict stage with the
FATAL captured as the error line (#9), `SWARM_EXIT_REASON` left unset so the
runlog reason stays `died-in:<stage>`. An unreadable `df` passes: never red a
run on a measurement that was not taken. The guard frees nothing and is not
meant to — a full host disk is outside what the harness may touch, so only a
human with root clears it; its job is to make that diagnosis free instead of
costing a swarm run and a heal cycle every hour.

Context: the guard first landed in idss via a direct edit of the two vendored
factory files, which reds idss CI's drift stage on every run (ADR 0180: vendored
factory files are owned by Matou/dev-factory, not the consumer). That edit was
reverted and re-landed into idss the ADR-0180 way — off a backport branch cut
from the idss FACTORY_REF pin, a dead-end that is NOT on dev-factory main. This
PR puts the same guard on main so the next FACTORY_REF bump crossing main does
not silently drop it (idss #2178, the standing forward-port debt).

Proven: `bash tests/provision-lib-test.sh` green (14 groups) on this head.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
All checks were successful
ci / static (pull_request) Successful in 3m22s
ci / test (pull_request) Successful in 13m0s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin forward-port/provision-disk-guard:forward-port/provision-disk-guard
git switch forward-port/provision-disk-guard

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff forward-port/provision-disk-guard
git switch forward-port/provision-disk-guard
git rebase main
git switch main
git merge --ff-only forward-port/provision-disk-guard
git switch forward-port/provision-disk-guard
git rebase main
git switch main
git merge --no-ff forward-port/provision-disk-guard
git switch main
git merge --squash forward-port/provision-disk-guard
git switch main
git merge --ff-only forward-port/provision-disk-guard
git switch main
git merge forward-port/provision-disk-guard
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory!342
No description provided.