main.rs had grown to ~19.8k lines with 8+ unrelated concerns
interleaved function-by-function throughout the file (arg parsing,
boot/health checks, runtime bootstrap, provider client, progress
reporting, model resolution, skill dispatch all mixed together).
Split along those natural boundaries into separate files, keeping
main.rs as a thin entry point (constants, main(), mod declarations,
existing tests).
No logic changed — items moved verbatim, marked pub(crate) where a
new module boundary required it, with `use crate::*;` in each new
file so cross-module references keep resolving through main.rs's
re-exports. Verified with cargo check/clippy/test on this crate and
scripts/fmt.sh; confirmed the few remaining test failures
(provider-detection defaults in the api/rusty-claude-cli crates) are
pre-existing on a clean checkout of main, unrelated to this change.
New files:
- model_provenance.rs — model alias/version resolution
- cli_parse.rs — CLI arg parsing, help, report formatting
- preflight.rs — doctor/health checks, boot snapshot, git status
- bootstrap.rs — runtime bootstrap, LiveCli, session management
- provider_client.rs — Anthropic client, tool executor, MCP wiring
- progress.rs — prompt/hook progress reporting
- skill_dispatch.rs — bare-skill dispatch, cwd guard, diff reports
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>