In case anyone isn't sure why the original interaction is harassment: relationships within a reporting chain are generally prohibited, for both legal, ethical, and practical reasons. Sex becoming part of the effective job description crosses both legal and ethical lines, and team effectiveness is hindered when people wonder whether someone is getting special treatment because they're sleeping with the boss. A manager…
Tech workers (across all disciplines) need to unionize to combat this kind of thing. As has been pointed out below, HR that is staffed and incentivized by the company management only serves the interests of the management. A union is the only structure that can actually win demands for workers by organizing workers to withhold their labor. It's not a panacea, and there are several historical examples of union leaders…
They seemed to be there only to defend the boss and register me as a complainer. It took me several jobs and this post to learn that.