feat: add app initialization module with startup sequence

Implements core startup infrastructure:
- AppConfig for data directory paths
- ensure_data_dir() to create ~/.local/share/mc/
- verify_cli_dependencies() async CLI availability check
- load_with_migration() for state file loading with migration support
- init() main entry point coordinating lock acquisition and setup
- StartupWarning enum for non-fatal issues (missing CLIs, state reset)
- InitError enum with conversion to McError

Also exposes Bridge::with_data_dir() publicly (was test-only).

Includes 11 tests covering directory creation, lock acquisition,
lock contention, corrupt file handling, and config paths.

bd-3jh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
teernisse
2026-02-26 10:29:19 -05:00
parent 61a068ad99
commit 0ad1b30941
3 changed files with 489 additions and 2 deletions

View File

@@ -167,8 +167,7 @@ impl<L: LoreCli, B: BeadsCli> Bridge<L, B> {
}
}
/// Create a bridge with a custom data directory (for testing)
#[cfg(test)]
/// Create a bridge with a custom data directory
pub fn with_data_dir(lore: L, beads: B, data_dir: PathBuf) -> Self {
Self {
lore,