fix(mock): refuse a prepared control of another wire version #9235
All Vouch review confidence checks passed
Residual risk 0.32 = Change Risk (0.48) × (1 − Review Confidence (0.34)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 523 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 62% · 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.375
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #9235"
general
weight: 0.35
claude[bot]
Description
Problem
The engine holds a prepared control and a layout each to the version of the wire: a control of another version draws
FAILED_PRECONDITIONon either role, before the layout is read; a layout of another versionINVALID_ARGUMENT. A mock worker on the SGLang wire compared the two with each other instead:INVALID_ARGUMENT, the code of the layout test.Example: a gateway that stamped another version on the control kept a test over mock workers green where a real worker refuses every such request.
Solution
preparedrefuses a control whose version is not the wire's withFAILED_PRECONDITION, on either role, behind the decode of the control and ahead of the raw media test, in the order of the engine. The layout test of a decode worker is unchanged and now reads as the engine's: a layout of another version or binding than its control drawsINVALID_ARGUMENT.What a caller of the mock reads otherwise: the three shapes above now draw
FAILED_PRECONDITION. A request the engine takes is still taken.Left out as before: the engine tests that a binding is whole ahead of its version, so a control of another version with a binding that is not whole reads
FAILED_PRECONDITIONhere andINVALID_ARGUMENTon the engine; also a binding's contract names, a control's timeout, the request options, the media layout and the bounds on lengths.Ready check
preparedincrates/mock_worker/src/grpc/sglang.rs), beside the ones it already makes; the constant comes from the module the file already takes its wire records from. No gateway or engine code changes; no new public item, flag or dependency.generateincrates/engine_servicer/src/sglang/native.rsandvalidate_manifestincrates/grpc_client/src/sglang_managed.rs, by a read of that code.Changes
crates/mock_worker/src/grpc/sglang.rs:preparedrefuses a control of another version than the wire's. Tests: the fixture's binding is whole, so each case draws its code from the check it names on the engine too; one new case in the prefill test, two in the decode test; the decode test's case of an aged version now ages the layout, the side its status code belongs to.crates/mock_worker/README.md: the sentence on the prepared request a worker refuses.Test Plan
cargo test -p mock-worker: 437 passed, 0 failed.INVALID_ARGUMENTand took the pair that agrees on another version.cargo test -p smg --test grpc_pd_tests: 46 passed, 0 failed, the prepared-input test of the gateway among them: the gateway stamps the version the mock now asks for.cargo clippy -p mock-worker --all-targets -- -D warnings,cargo doc -p mock-worker --no-depswith warnings denied andcargo +nightly fmt -p mock-worker -- --checkare clean.Release note
The mock worker on the SGLang wire now refuses a prepared control whose version is not the wire's, on a prefill and on a decode worker, with
FAILED_PRECONDITION, as the engine does. Before, a prefill worker took such a control, and a decode worker took it when its layout carried the same version and answeredINVALID_ARGUMENTotherwise. A test over mock workers that sends a control of another version now reads the engine's refusal.Numbers
| metric | before | after | setup |
|---|---|---|---|
| request shapes of the three above that a mock worker answers with
FAILED_PRECONDITION| 0 | 3 | the new cases of the prefill test and of the decode test |