refactor: Split engine.rs (4734 LoC) into 17 submodules (1139 LoC core)#130
refactor: Split engine.rs (4734 LoC) into 17 submodules (1139 LoC core)#1302witstudios merged 2 commits intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (18)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Break the 4733-line engine.rs into engine/mod.rs (2650 lines) plus
11 focused submodules. All extracted methods remain as `impl Engine`
blocks — no public API changes, all 130 tests pass unmodified.
New structure:
- engine/definitions/{templates,agent_defs,swarm_defs,schedules,triggers}.rs
- engine/{scheduler,trigger_executor,session_repair,pty_operations,subscriptions}.rs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract spawn, worktree_ops, agent_lifecycle, status, and helpers from mod.rs, reducing it from 2776 to 1139 lines. Combined with the first extraction, engine.rs went from 4734 to 1139 lines across 17 submodule files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
be14fa0 to
ce7f9cf
Compare
Summary
engine.rs(4,734 lines) into 17 focused submodule files underengine/mod.rsreduced to 1,139 lines (struct definitions,new(),handle_request()dispatch, initialization, and tests)impl Engineblocks — Rust allows splitting these across files in submodulesModule breakdown
mod.rsspawn.rshandle_spawn,handle_spawn_shellagent_lifecycle.rsstatus.rsworktree_ops.rshelpers.rsdefinitions/subscriptions.rsscheduler.rstrigger_executor.rssession_repair.rspty_operations.rsTest plan
cargo test -p pu-engine— all 130 tests pass (119 unit + 11 integration)cargo fmt --all— no formatting issuescargo test -p pu-engine --no-run— zero warnings🤖 Generated with Claude Code