@@ -1584,6 +1584,38 @@ mod tests {
15841584 assert_eq ! ( decoded. label, "phase1_initial_cross_product" ) ;
15851585 }
15861586
1587+ #[ test]
1588+ fn sweep_request_yaml_shape_deserializes_via_serde_json ( ) {
1589+ // Documents the canonical JSON shape (after yq conversion from YAML)
1590+ // for `configs/codec/*.yaml`. If this test breaks, the checked-in
1591+ // YAML configs are stale relative to the Rust DTOs — the
1592+ // scripts/codec_sweep.sh pipeline will fail at runtime.
1593+ let body = r#"{
1594+ "tensor_path": "models/qwen3-tts-0.6b/q_proj.safetensors",
1595+ "grid": {
1596+ "subspaces": [6],
1597+ "centroids": [256, 512, 1024],
1598+ "residual_depths": [0],
1599+ "rotations": [
1600+ { "kind": "identity" },
1601+ { "kind": "hadamard", "dim": 4096 }
1602+ ],
1603+ "distances": ["AdcU8"],
1604+ "lane_widths": ["F32x16"],
1605+ "residual_centroids": 256,
1606+ "calibration_rows": 2048,
1607+ "measurement_rows": 512,
1608+ "seed": 42
1609+ },
1610+ "measure": ["reconstruction_icc_held_out", "token_agreement_top1"],
1611+ "label": "spec-drift guard"
1612+ }"# ;
1613+ let req: WireSweepRequest = serde_json:: from_str ( body) . expect ( "YAML→JSON shape parses" ) ;
1614+ // 1 × 3 × 1 × 2 × 1 × 1 = 6 candidates.
1615+ assert_eq ! ( req. grid. cardinality( ) , 6 ) ;
1616+ assert_eq ! ( req. measure. len( ) , 2 ) ;
1617+ }
1618+
15871619 #[ test]
15881620 fn sweep_measure_serializes_snake_case ( ) {
15891621 let m = WireMeasure :: ReconstructionIccHeldOut ;
0 commit comments