1.6 KiB
1.6 KiB
1. Extract Data Models
- 1.1 Create
src/models.rsfile - 1.2 Move pure structs and enums (
ModelSource,ModelProvenance,SessionLifecycleSummary, etc.) frommain.rstomodels.rs - 1.3 Add
pub(crate)visibility to the moved items - 1.4 Update
main.rsandmain_tests.rstouse crate::models::* - 1.5 Run
cargo checkandcargo testto ensure successful compilation and tests
2. Extract Error Handling
- 2.1 Create
src/error.rsfile - 2.2 Move
classify_error_kind,split_error_hint, and global error enums toerror.rs - 2.3 Update imports across
main.rs,main_tests.rs, andmodels.rs - 2.4 Verify with
cargo checkandcargo test
3. Extract Rendering & UI Logic
- 3.1 Create
src/render.rsfile - 3.2 Move output formatting, Markdown rendering logic, and UI reports (e.g.,
format_model_report,push_output_block) - 3.3 Re-wire imports and resolve any dependency cycles between
render.rsandmodels.rs - 3.4 Verify with
cargo checkandcargo test
4. Extract REPL & Core Engine
- 4.1 Create
src/repl.rsfile - 4.2 Move
LiveClistruct andrun_replloop - 4.3 Move command parsing and execution logic
- 4.4 Finalize import paths across all newly extracted modules
- 4.5 Run full
cargo test --workspaceandcargo fmt --all
5. Cleanup main.rs
- 5.1 Ensure
main.rsonly contains module declarations (mod models; mod error;, etc.), CLI argument definitions, and thefn main()entrypoint - 5.2 Remove unused imports in
main.rs - 5.3 Final verification of the
rusty-claude-clibuild