feat(installer): add transactional P0-P9 state machine
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/greenfield-install Pipeline was successful

This commit is contained in:
be-coder-05
2026-08-05 12:20:49 -05:00
parent 033bb7aa87
commit 229f643a84
13 changed files with 1726 additions and 155 deletions
@@ -12,6 +12,20 @@ with no snapshot to fall back to.
Protection is layered. Each layer is independent; a later layer catches what an
earlier one misses.
## Layer 0 — Transaction journal (install-wide recovery)
The unified installer opens a private journal under
`${XDG_STATE_HOME:-~/.local/state}/mosaic/install/` before the first target
mutation. Every mutation scope records its path, prior snapshot, and reversal
instructions before it is touched. Journal write/sync failure is fatal, and P9
seals successful journals with a SHA-256 sidecar. See
[Installer state machine and recovery](./installer-state-machine.md).
This transaction journal is distinct from the retained operator-only backup
below. The transaction journal is required for correctness and rollback;
Layer 2's durable backup remains a separately stated, fail-open recovery bonus
for a manifest bug that the normal transaction did not detect.
## Layer 1 — Manifest-owned sync (prevention)
The single source of truth for ownership is