Main Entry Sequence
Process InitializationThis reference documents the binary startup flow in sequential execution order from process entry in src/main.rs:
- Panic Hook Installation:
std::panic::set_hook(...)registers crash logging and runtime diagnostic probes. - Runtime Context Snapshot: Captures arguments, terminal vs. GUI session detection, and environment variables.
- CLI Argument Parsing:
Cli::parse()evaluates command-line options and switches. - Launcher Maintenance: Handles desktop shortcut creation or removal if requested.
- Working Directory Alignment:
align_process_working_dir_to_runtime_layout()resolves relative paths across portable and installed environments. - Review UI Auto-Enable: Defaults to interactive Review UI mode when launched with no arguments in a desktop session.
- Config Assurance:
load_config("config.toml")verifies configuration integrity and ensures template files exist. - Review UI Bootstrap: Runs
run_review_ui_bootstrap(...)to prompt for album roots before launching the main session. - Validation Pipeline: Validates OS compatibility, database connectivity, and required asset paths before execution.
- Mode Dispatch: Routes to the selected mode (Review UI server, Database batch runner, or Scraper).