Files
fruix/docs/reports/phase7-system-closure-freebsd.md

75 lines
3.1 KiB
Markdown

# Phase 7.2: Minimal FreeBSD system closure generated from the Fruix system model
Date: 2026-04-01
## Summary
This step materializes the Phase 7.1 Fruix operating-system description into a reproducible system closure under `/frx/store`.
Added files:
- `tests/system/materialize-phase7-system-closure.scm`
- `tests/system/run-phase7-system-closure.sh`
## Validation command
Run command:
```sh
METADATA_OUT=/tmp/phase7-system-closure-metadata.txt \
./tests/system/run-phase7-system-closure.sh
```
## What the harness does
The harness:
1. ensures the local Guile/Fibers/Shepherd runtime needed for the generated system is available
2. loads the declarative Phase 7 operating-system object
3. materializes the referenced FreeBSD base packages into `/frx/store`
4. materializes local Guile and Shepherd prefixes into `/frx/store`
5. generates a Fruix system closure store item containing:
- boot assets
- a merged system profile
- generated `/etc` files
- an activation script
- a Shepherd configuration
- a generated FreeBSD `rc.d` launcher for Shepherd
6. reruns the same materialization a second time and verifies that the same closure path is produced
## Observed results
Observed metadata included:
- `closure_path=/frx/store/...-fruix-system-fruix-freebsd`
- `closure_rebuild_path=/frx/store/...-fruix-system-fruix-freebsd`
- `kernel_store=/frx/store/...-freebsd-kernel-15.0-STABLE`
- `bootloader_store=/frx/store/...-freebsd-bootloader-15.0-STABLE`
- `guile_store=/frx/store/...-fruix-guile-runtime-3.0`
- `guile_extra_store=/frx/store/...-fruix-guile-extra-3.0`
- `shepherd_store=/frx/store/...-fruix-shepherd-runtime-1.0.9`
- `profile_bin_sh=/frx/store/...-fruix-system-fruix-freebsd/profile/bin/sh`
- `profile_sbin_init=/frx/store/...-fruix-system-fruix-freebsd/profile/sbin/init`
- `profile_rc=/frx/store/...-fruix-system-fruix-freebsd/profile/etc/rc`
- `init_integration=freebsd-init+rc.d-shepherd`
## Important findings
- the FreeBSD system definition now materializes into a single reproducible system closure store item rather than remaining only a logical specification
- the closure uses a Guix-like split between:
- referenced store items for package/runtime content
- generated configuration and activation payload in the system closure itself
- the first integrated init strategy is now concretely encoded in the closure contents:
- FreeBSD init and rc infrastructure from the base system profile
- a generated `fruix_shepherd` rc script
- a generated Shepherd configuration that writes a deterministic ready marker
- rerunning the same materialization produced the same closure path, which is the current prototype proof of reproducible closure generation for this phase
## Conclusion
Phase 7.2 is satisfied on the current FreeBSD prototype track:
- a declarative Fruix system description now generates a real system closure under `/frx/store`
- that closure contains boot files, `/etc` payloads, activation payload, and Shepherd launch integration
- the next step is to materialize a root filesystem tree from this closure and statically validate it for later image construction work