refactor(gateway): the create-worker step's tests sit in a sibling file, not in the production module #4318
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.43) × (1 − Review Confidence (0.30)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 399 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 50% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4318"
general
weight: 0.35
claude[bot]
What
model_gateway/src/workflow/steps/local/create_worker.rswas 2,584 lines, 1,488 of them three inline#[cfg(test)]modules. The largest,tests(1,280 lines), sat between the step's production code and the two small modules after it, and a rename in the production part moved every test line in the diff. The repository keeps such tests as sibling files already (the policies'cache_aware/tests.rs, the KV index'schain_index/tests.rsandtoken_tree/tests.rs, the worker manager'smanager/tests.rs).That module moves to
model_gateway/src/workflow/steps/local/create_worker/tests.rs, the test-sibling form:create_worker.rskeeps#[cfg(test)] mod tests;where the block was, the sibling holds the module's body at the shallower depth. The module path stayscreate_worker::tests, so every one of its 32 tests keeps its name; no production line changes.Changes
model_gateway/src/workflow/steps/local/create_worker.rs: the module's body (lines 1,098-2,376) replaced bymod tests;-> 1,306 lines. The 1,097 lines before the block and the 209 after it are byte for byte the same.model_gateway/src/workflow/steps/local/create_worker/tests.rs(new, 1,263 lines): the module's body with one level of indentation removed; rustfmt re-joined statements that now fit a line at the shallower depth (26 lines into 12), the only differences; 269 of the 273 lines carrying a string literal are unchanged, the four others now sit on the joined lines of their calls.Test plan
No behaviour change and no production change; the proof is the test list by name:
cargo test -p smg --lib -- --liston the base commit and on this head: 3,674 names before, 3,674 after, identical lists (diffempty).cargo +nightly fmt -p smg -- --checkclean;cargo clippy -p smg --all-targets -- -D warningsclean.cargo check --workspace --all-targets.cargo test -p smg --lib -- workflow::steps::local::create_worker::tests(the moved module's tests): 32 passed, 0 failed, 0 ignored. The whole gateway integration suite is not re-run for this change: no production line changes, and the lib test list is the proof the tests are all still there.Owed
Nothing on an engine. One open pull request of another author changes this file's test module as part of a wider change; its test hunks land in the sibling file after a rebase (a note left on it).
Notes
Behaviour and performance unchanged: a test-module move, no production line changes.
Release note
Internal: the create-worker step's tests live in a sibling file (
create_worker/tests.rs); no change in behaviour.Numbers
| metric | before | after | setup |
|---|---|---|---|
|
create_worker.rs| 2,584 lines (1,280 of them the moved module) | 1,306 lines |wc -l||
create_worker/tests.rs| 0 lines (no file yet) | 1,263 lines |wc -l|| gateway lib tests by name (
cargo test -p smg --lib -- --list) | 3,674 | 3,674 (the same names) | the two lists,diffempty || the moved module's tests (
cargo test -p smg --lib -- workflow::steps::local::create_worker::tests) | same as after (no test added or removed) | 32 passed, 0 failed, 0 ignored | same command on this head |