Skip to content

Refactor large Rust modules into smaller files - #49

Merged
senamakel merged 5 commits into
mainfrom
split-large-rust-files
Aug 13, 2026
Merged

Refactor large Rust modules into smaller files#49
senamakel merged 5 commits into
mainfrom
split-large-rust-files

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

  • split every Rust source file to 500 lines or fewer
  • move inline and standalone tests into *_tests.rs files
  • preserve the latest upstream engine, cancellation, lane-routing, and fuzz-test changes
  • keep module APIs and runtime behavior unchanged

Why

Large modules made navigation and maintenance difficult. This reorganizes production code by responsibility and keeps tests consistently separated without changing public behavior.

Validation

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features
  • verified every Rust file is at most 500 lines
  • verified extracted test files use the _tests.rs suffix

senamakel and others added 3 commits August 14, 2026 00:21
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…arge-rust-files

# Conflicts:
#	src/engine.rs
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 222 files, which is 122 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ceecd07b-d5e0-4b4a-a554-300063045caa

📥 Commits

Reviewing files that changed from the base of the PR and between 75a4dea and 7f64f0f.

📒 Files selected for processing (222)
  • .github/workflows/ci.yml
  • AGENTS.md
  • src/browser/protocol.rs
  • src/browser/protocol_tests.rs
  • src/browser/routing.rs
  • src/browser/routing_tests.rs
  • src/caps/agent.rs
  • src/caps/agent/runner.rs
  • src/caps/agent_tests.rs
  • src/caps/host/script.rs
  • src/caps/host/script/runner.rs
  • src/caps/host/script_tests.rs
  • src/caps/host/script_tests/script_tests_part_01_tests.rs
  • src/caps/host/script_tests/script_tests_part_02_tests.rs
  • src/caps/mock.rs
  • src/caps/mock_tests.rs
  • src/caps/mod.rs
  • src/caps/mod_tests.rs
  • src/caps/tasks.rs
  • src/caps/tasks_tests.rs
  • src/catalog.rs
  • src/catalog/contracts/group_01.rs
  • src/catalog/contracts/group_02.rs
  • src/catalog/contracts/group_03.rs
  • src/catalog_tests.rs
  • src/companion/auth.rs
  • src/companion/auth_tests.rs
  • src/companion/control.rs
  • src/companion/control_tests.rs
  • src/companion/relay.rs
  • src/companion/relay_tests.rs
  • src/companion/server.rs
  • src/companion/server/api.rs
  • src/companion/server/handlers.rs
  • src/companion/server_tests.rs
  • src/companion/tabs.rs
  • src/companion/tabs_tests.rs
  • src/compiler.rs
  • src/compiler_tests.rs
  • src/data.rs
  • src/data_tests.rs
  • src/engine.rs
  • src/engine/api.rs
  • src/engine/build.rs
  • src/engine/build/activation.rs
  • src/engine/build/handlers.rs
  • src/engine/build/outcome.rs
  • src/engine/build/wiring.rs
  • src/engine/resumable.rs
  • src/engine/routing.rs
  • src/engine/run_state.rs
  • src/engine/state.rs
  • src/engine_tests.rs
  • src/engine_tests/engine_tests_part_01_tests.rs
  • src/engine_tests/engine_tests_part_02_tests.rs
  • src/engine_tests/engine_tests_part_03_tests.rs
  • src/engine_tests/engine_tests_part_04_tests.rs
  • src/engine_tests/engine_tests_part_05_tests.rs
  • src/engine_tests/engine_tests_part_06_tests.rs
  • src/error.rs
  • src/error_tests.rs
  • src/expr.rs
  • src/expr_tests.rs
  • src/expr_tests/expr_tests_part_01_tests.rs
  • src/expr_tests/expr_tests_part_02_tests.rs
  • src/fan_out_contract_tests.rs
  • src/fanout_tests.rs
  • src/gates/gates_tests.rs
  • src/gates/mod.rs
  • src/graph/builder/builder_tests.rs
  • src/graph/builder/implementation.rs
  • src/graph/builder/mod.rs
  • src/graph/channel/channel_tests.rs
  • src/graph/channel/mod.rs
  • src/graph/channel/state.rs
  • src/graph/checkpoint/checkpoint_tests.rs
  • src/graph/checkpoint/checkpoint_tests/checkpoint_tests_part_01_tests.rs
  • src/graph/checkpoint/checkpoint_tests/checkpoint_tests_part_02_tests.rs
  • src/graph/checkpoint/file.rs
  • src/graph/checkpoint/file/checkpointer.rs
  • src/graph/checkpoint/in_memory.rs
  • src/graph/checkpoint/mod.rs
  • src/graph/command/command_tests.rs
  • src/graph/command/mod.rs
  • src/graph/compiled/compiled_tests.rs
  • src/graph/compiled/compiled_tests/compiled_tests_part_01_tests.rs
  • src/graph/compiled/compiled_tests/compiled_tests_part_02_tests.rs
  • src/graph/compiled/compiled_tests/compiled_tests_part_03_tests.rs
  • src/graph/compiled/compiled_tests/compiled_tests_part_04_tests.rs
  • src/graph/compiled/compiled_tests/compiled_tests_part_05_tests.rs
  • src/graph/compiled/compiled_tests/compiled_tests_part_06_tests.rs
  • src/graph/compiled/compiled_tests/compiled_tests_part_07_tests.rs
  • src/graph/compiled/compiled_tests/compiled_tests_part_08_tests.rs
  • src/graph/compiled/executor.rs
  • src/graph/compiled/executor/api.rs
  • src/graph/compiled/executor/node_execution.rs
  • src/graph/compiled/executor/outcomes.rs
  • src/graph/compiled/executor/persistence.rs
  • src/graph/compiled/executor/run_loop.rs
  • src/graph/compiled/mod.rs
  • src/graph/compiled/test.rs
  • src/graph/ids/ids_tests.rs
  • src/graph/ids/mod.rs
  • src/graph/observability/in_memory.rs
  • src/graph/observability/mod.rs
  • src/graph/observability/observability_tests.rs
  • src/graph/observability/observability_tests/observability_tests_part_01_tests.rs
  • src/graph/observability/observability_tests/observability_tests_part_02_tests.rs
  • src/graph/recursion/mod.rs
  • src/graph/recursion/recursion_tests.rs
  • src/graph/reducer/mod.rs
  • src/graph/reducer/reducer_tests.rs
  • src/graph/status/mod.rs
  • src/graph/status/status_tests.rs
  • src/graph/stream/mod.rs
  • src/graph/stream/stream_tests.rs
  • src/graph_ops.rs
  • src/graph_ops_tests.rs
  • src/ids.rs
  • src/ids_tests.rs
  • src/lane_context_tests.rs
  • src/lib.rs
  • src/lib_tests.rs
  • src/loop_tests.rs
  • src/loop_tests/loop_tests_part_01_tests.rs
  • src/loop_tests/loop_tests_part_02_tests.rs
  • src/main.rs
  • src/main_tests.rs
  • src/merge_tests.rs
  • src/migrate.rs
  • src/migrate_tests.rs
  • src/model/agent.rs
  • src/model/agent_tests.rs
  • src/model/inputs.rs
  • src/model/inputs_tests.rs
  • src/model/mod.rs
  • src/model/mod_tests.rs
  • src/model/node_kind.rs
  • src/model/node_kind_tests.rs
  • src/nodes/control_flow/condition.rs
  • src/nodes/control_flow/condition_tests.rs
  • src/nodes/control_flow/dedup.rs
  • src/nodes/control_flow/dedup_tests.rs
  • src/nodes/control_flow/gather.rs
  • src/nodes/control_flow/gather_tests.rs
  • src/nodes/control_flow/loop_node.rs
  • src/nodes/control_flow/loop_node_tests.rs
  • src/nodes/control_flow/merge.rs
  • src/nodes/control_flow/merge_tests.rs
  • src/nodes/control_flow/scatter.rs
  • src/nodes/control_flow/scatter_tests.rs
  • src/nodes/control_flow/split_out.rs
  • src/nodes/control_flow/split_out_tests.rs
  • src/nodes/control_flow/switch.rs
  • src/nodes/control_flow/switch_tests.rs
  • src/nodes/control_flow/transform.rs
  • src/nodes/control_flow/transform_tests.rs
  • src/nodes/execution.rs
  • src/nodes/integration/agent.rs
  • src/nodes/integration/agent_request.rs
  • src/nodes/integration/agent_request_tests.rs
  • src/nodes/integration/agent_tests.rs
  • src/nodes/integration/agent_tests/agent_tests_part_01_tests.rs
  • src/nodes/integration/agent_tests/agent_tests_part_02_tests.rs
  • src/nodes/integration/cancellation_propagation_tests.rs
  • src/nodes/integration/code.rs
  • src/nodes/integration/code_tests.rs
  • src/nodes/integration/envelope.rs
  • src/nodes/integration/envelope_tests.rs
  • src/nodes/integration/gate.rs
  • src/nodes/integration/gate_tests.rs
  • src/nodes/integration/http_request.rs
  • src/nodes/integration/http_request_tests.rs
  • src/nodes/integration/memory.rs
  • src/nodes/integration/memory_tests.rs
  • src/nodes/integration/output_parser.rs
  • src/nodes/integration/output_parser_tests.rs
  • src/nodes/integration/schema.rs
  • src/nodes/integration/schema_tests.rs
  • src/nodes/integration/spawn.rs
  • src/nodes/integration/spawn_tests.rs
  • src/nodes/integration/sub_workflow.rs
  • src/nodes/integration/sub_workflow/execution.rs
  • src/nodes/integration/sub_workflow_tests.rs
  • src/nodes/integration/sub_workflow_tests/sub_workflow_tests_part_01_tests.rs
  • src/nodes/integration/tool_call.rs
  • src/nodes/integration/tool_call_tests.rs
  • src/nodes/map.rs
  • src/nodes/map_tests.rs
  • src/nodes/mod.rs
  • src/nodes/mod_tests.rs
  • src/nodes/release.rs
  • src/nodes/release_tests.rs
  • src/observability.rs
  • src/observability_tests.rs
  • src/store/file/journal/journal_tests.rs
  • src/store/file/journal/mod.rs
  • src/store/file/mod.rs
  • src/store/file/proposals/mod.rs
  • src/store/file/proposals/proposals_tests.rs
  • src/store/file/store_impl.rs
  • src/store/file/workflow_store_impl.rs
  • src/store/types/mod.rs
  • src/store/types/types_tests.rs
  • src/validate.rs
  • src/validate/agents.rs
  • src/validate/loops.rs
  • src/validate/scatter.rs
  • src/validate_tests.rs
  • src/validate_tests/validate_tests_part_01_tests.rs
  • src/validate_tests/validate_tests_part_02_tests.rs
  • src/validate_tests/validate_tests_part_03_tests.rs
  • src/visualization.rs
  • src/visualization_tests.rs
  • tests/complex_graphs/composition_tests.rs
  • tests/complex_graphs/concurrency_and_failures_tests.rs
  • tests/complex_graphs_tests.rs
  • tests/fuzz_graph.proptest-regressions
  • tests/fuzz_graph.rs
  • tests/loop_e2e.rs
  • tests/loop_e2e/loop_e2e_part_01_tests.rs
  • tests/loop_e2e/loop_e2e_part_02_tests.rs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@senamakel senamakel self-assigned this Aug 13, 2026
The coverage command previously excluded `*_tests.rs` files by default, which silently dropped unit-test coverage from the gate. The new invocation disables that default exclusion while still filtering out dependencies, build output, and integration-test sources, preserving the historical semantics of the 90% line threshold. Additionally, the fuzz determinism property now strips scheduler-only observations like poll counts and step stamps before comparing runs, since those values legitimately vary with timing and do not reflect workflow data or routing.

Auto-committed-on: dragonfly
@senamakel
senamakel merged commit 3f3416e into main Aug 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant