Mostly generated by Gemini; TODO annotations added for cases where we should support a better way of doing various parts of this. Assisted-by: Gemini 3 Pro --------- Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>