7.4 KiB
7.4 KiB
TODO checklist
Project status: first-draft preview is implemented and committed. This checklist tracks remaining work to reach end-to-end provisioning (apply mode), plus follow-ups and QA.
Conventions:
- Completed
- [-] In progress
- Pending
Core execution
- [-] Add “apply mode” switch to orchestrator to perform destructive actions after preview validation
- Introduce CLI flag --apply guarded by clear logs and safety checks (not preview) src/cli/args.rs
- Wire partition application and udev settle orchestrator::run() → partition::apply_partitions()
- [-] Wire mkfs → mount → maybe write fstab → build/write report src/orchestrator/run.rs
- Wire mkfs: plan_filesystems + make_filesystems src/orchestrator/run.rs + src/fs/plan.rs
- Wire mounts (plan/apply) src/mount/ops.rs
- maybe write fstab src/mount/ops.rs
- build/write report src/report/state.rs
- Partition application (destructive) in partition::apply_partitions()
- Boot mode detection and BIOS boot policy
- Implement UEFI detection via /sys/firmware/efi: is_efi_boot()
- Planner skips BIOS boot partition when UEFI-booted: partition::plan_partitions()
- Future: revisit bootblock/bootloader specifics for BIOS vs EFI (confirm if any BIOS-targets require bios_boot) docs/ARCHITECTURE.md
- Translate PartitionPlan to sgdisk commands (create GPT, partitions in order with alignment and names)
- Enforce idempotency when required via idempotency::is_empty_disk(); abort on non-empty
- Capture partition GUIDs, names, device paths via sgdisk -i parsing; map to PartitionResult
- Call util::udev_settle() after changes; consistent Error::Tool/Error::Partition mapping
- [-] Filesystem creation in fn make_filesystems(...)
- Base mkfs implemented for vfat/btrfs/bcachefs (UUID capture via blkid)
- Apply btrfs RAID profile when topology requires it (multi-device): pass -m raid1 -d raid1 in mkfs.btrfs src/fs/plan.rs
- Force mkfs.btrfs in apply path with -f to handle leftover signatures from partial runs src/fs/plan.rs
- Compression/tuning mapping from config
- btrfs: apply compression as mount options during mounting phase src/mount/ops.rs
- bcachefs: map compression/checksum/cache_mode to format flags (deferred) src/fs/plan.rs
- Consider verifying UUID consistency across multi-device filesystems and improve error messages
- Mount planning and application in mount::ops
- Implement fn plan_mounts(...): map FsResult UUIDs into
/var/cache/{UUID}using cfg.mount.base_dir, and synthesize options per FS kind - Implement fn apply_mounts(...): mkdir -p targets, perform mount syscalls (nix), structured errors
- Implement fn maybe_write_fstab(...): deterministic entries + idempotent writes when enabled in config
- Option synthesis (btrfs: compress=zstd:3, ssd/ssd_spread when appropriate; vfat defaults) src/mount/ops.rs
- Implement fn plan_mounts(...): map FsResult UUIDs into
- Reporting implementation in report::state
- Implement fn build_report(...): include disks, partitions (with GUIDs), filesystems (uuid, label, kind), mounts, and status
- Implement fn write_report(...): atomic write via tempfile + rename, robust IO error mapping
- Consider monotonic sequence number or boot-epoch marker src/report/state.rs
Discovery, idempotency, safety
- Device discovery with removable policy: exclude
/sys/class/block/*/removable == 1by default; allow via--allow-removablesrc/device/discovery.rs - Idempotency detection via blkid; filesystem label / PARTLABEL checks src/idempotency/mod.rs
- Emptiness checks (idempotency::is_empty_disk) and skip during preview mode src/orchestrator/run.rs
- Optional: additional include/exclude helpers (e.g. path allowlist) and stronger heuristics for device class selection (NVMe/SATA only, etc.)
CLI, config, defaults
- Built-in sensible defaults (no YAML required) src/config/loader.rs
- Overlays from CLI: log level, file logging, fstab, removable policy, topology src/config/loader.rs
- Preview flags (
--show,--report) and topology selection (-t/--topology) src/cli/args.rs - Add
--applyflag to toggle execute mode and keep preview non-destructive by default src/cli/args.rs - Consider environment variable overlays src/config/loader.rs
- Consider hidden/dev flags behind features (e.g.,
--dry-run-verbose,--trace-io) src/cli/args.rs
Orchestrator tracing and spans
- Add per-phase timing/spans in orchestrator::run (discovery, plan, partition apply, mkfs, mount, report)
- Preview JSON includes filesystems_planned and mount scheme src/orchestrator/run.rs
Logging/utilities
- which_tool/run_cmd/run_cmd_capture/udev_settle implemented src/util/mod.rs
- Optional: enrich debug spans around all shell-outs (command-line echo with redactions if needed)
- Confirm file logging idempotence and guard path creation src/logging/mod.rs
Docs and tests
- Exhaustive README with usage and JSON shapes README.md
- Audit rustdoc coverage for all public functions and important helpers; beef up where minimal
- Topology planning tests (unit-level) for single/dual/raid1/ssd+hdd setups src/partition/plan.rs
- Filesystem planning tests for RAID1 aggregation and bcachefs mapping src/fs/plan.rs
- Orchestrator preview tests (JSON contains filesystems_planned/mount section) src/orchestrator/run.rs
- Integration tests in QEMU/KVM matrix; exercise
/dev/vd*topologies and ensure safe abort on unexpected signatures
Packaging and integration
- Provide build profile for static musl and Alpine initramfs integration (Cargo config + CI)
- Add minimal init script / docs for integrating into early boot
Stretch goals and polish
- Dry-run mode that outputs proposed sgdisk/mkfs/mount commands in detail with “why” annotations
- Richer structured report schema (typed disks/partitions/filesystems/mounts) and tooling to diff reports across runs
- Optional telemetry hooks / metrics (phase durations, device counts) behind features
Stale TODOs to review/remove
- Validate and remove TODOs in:
- src/fs/plan.rs (mapping/mkfs largely implemented)
- src/util/mod.rs (helpers implemented)
- src/logging/mod.rs (if file layer is already idempotent)