DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/ApplicationState/Internal/Persistence/MementoLoader.rs
1//! # MementoLoader - Persistence layer
2//!
3//! Loads `ApplicationState` memento JSON from disk during boot.
4//! Two flavours: best-effort (returns empty on failure) and
5//! result-typed (surfaces failures explicitly during recovery).
6//!
7//! Layout (one export per file, file name = identity):
8//! - `LoadInitialMementoFromDisk::Fn` - best-effort loader for
9//! `ApplicationState::default()`. Backs up corrupted files, creates the
10//! parent directory on read errors.
11//! - `LoadMementoWithRecovery::Fn` - result-typed loader used during recovery
12//! flows; surfaces FS / parse failures.
13//! - `AttemptMementoRecovery::Fn` (internal) - write a `.backup` sibling for
14//! the corrupted content.
15//! - `CreateCorruptedBackup::Fn` (internal) - write a timestamped
16//! `.json.corrupted.<ts>` sibling.
17//!
18//! ## Status
19//!
20//! Zero callers as of 2026-05-02 - pending wire-up from
21//! `Environment::StorageProvider` boot path.
22
23pub mod AttemptMementoRecovery;
24
25pub mod CreateCorruptedBackup;
26
27pub mod LoadInitialMementoFromDisk;
28
29pub mod LoadMementoWithRecovery;