Main Entry Sequence

Process Initialization

This reference documents the binary startup flow in sequential execution order from process entry in src/main.rs:

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