/**
 * Bootstrap module for application startup, startup mode dispatch, and technical object
 * graph construction.
 * <p>
 * Responsibility: Parse the startup mode from command-line arguments and dispatch to the
 * appropriate inbound adapter. Exactly one inbound adapter is started per process run.
 * For the headless batch path, the bootstrap module also orchestrates configuration loading,
 * schema initialization, and the full adapter wiring.
 * <p>
 * Components:
 * <ul>
 *   <li>{@link de.gecheckt.pdf.umbenenner.bootstrap.BootstrapRunner}
 *       — Orchestrator of startup mode dispatch, configuration loading, schema initialization,
 *       and object graph construction</li>
 *   <li>{@link de.gecheckt.pdf.umbenenner.bootstrap.PdfUmbenennerApplication}
 *       — Application entry point that parses CLI arguments and invokes BootstrapRunner</li>
 *   <li>{@link de.gecheckt.pdf.umbenenner.bootstrap.adapter.Log4jProcessingLogger}
 *       — Logging adapter for application-layer coordination and use case processing</li>
 * </ul>
 * <p>
 * Startup mode dispatch:
 * <ul>
 *   <li><strong>GUI mode</strong> (default): Bootstrap creates and starts the
 *       {@link de.gecheckt.pdf.umbenenner.adapter.in.gui.GuiAdapter}. The GUI adapter manages
 *       the JavaFX lifecycle. Bootstrap returns exit code 0 on normal GUI shutdown and exit
 *       code 1 on any exception thrown by the GUI adapter.</li>
 *   <li><strong>Headless mode</strong> ({@code --headless}): Bootstrap runs the two-phase
 *       headless batch pipeline described below.</li>
 * </ul>
 * <p>
 * Configuration path resolution:
 * <ul>
 *   <li>When {@code --config &lt;path&gt;} is supplied, that path is used as the effective
 *       configuration file path for both the legacy migration step and the configuration port.</li>
 *   <li>When {@code --config} is absent, the default path {@code config/application.properties}
 *       relative to the working directory is applied.</li>
 * </ul>
 * <p>
 * Headless batch startup sequence (two phases):
 * <ul>
 *   <li><em>Bootstrap phase</em> — configuration loading and validation, SQLite schema
 *       initialization. Failures here are hard startup errors (exit code 1).</li>
 *   <li><em>Execution phase</em> — run lock acquisition, adapter wiring, batch use case
 *       execution, outcome-to-exit-code mapping. Document-level failures do not affect the
 *       exit code.</li>
 * </ul>
 * <p>
 * Implementation approach:
 * <ul>
 *   <li>Uses factory pattern with pluggable interfaces for GUI adapter, configuration, run lock,
 *       schema initialization, use case, and command creation — enabling full unit testability</li>
 *   <li>Manually constructs the object graph without framework dependencies</li>
 *   <li>Ensures strict inward dependency direction: all adapters depend on ports, never the
 *       other way around</li>
 *   <li>Separates startup configuration (complete technical parameters for bootstrap and adapter
 *       wiring) from runtime configuration (minimal parameters the application layer depends on)</li>
 *   <li>Schema initialization happens exactly once at startup, before document processing begins</li>
 * </ul>
 * <p>
 * Exit codes:
 * <ul>
 *   <li>0 = headless batch run completed technically successfully (even if individual documents
 *       failed), or GUI terminated normally after the window was shown</li>
 *   <li>1 = hard start, bootstrap, configuration, schema initialization, GUI startup, or critical
 *       infrastructure failure</li>
 * </ul>
 */
package de.gecheckt.pdf.umbenenner.bootstrap;