AimsDNA damage repair (DDR) plays a pivotal role in hepatocellular carcinoma (HCC), driving oncogenesis, progression, and therapeutic response. However, the mechanisms of DDR mediated immune cells and immuno-modulatory pathways in HCC are yet ill-defined. MethodsOur study introduces an innovative deep machine learning framework for precise DDR assessment, utilizing single-cell RNA sequencing (scRNA-seq) and bulk RNA-seq data. Single-cell RNA sequencing data were obtained and in total 85,628 cells of primary or post-immunotherapy cases were analyzed. Large-scale HCC datasets, including 1027 patients in house together with public datasets, were used for 101 machine-learning models and a novel DDR feature was derived at single-cell resolution (DDRscore). Druggable targets were predicted using the reverse phase protein array (RPPA) proteomic profiling of 169 HCC patients and RNA-seq data from 22 liver cancer cell lines. ResultsOur investigation reveals a dynamic interplay of DDR with natural killer cells and B cells in the primary HCC microenvironment, shaping a tumor-promoting immune milieu through metabolic programming. Analysis of HCC post-immunotherapy demonstrates elevated DDR levels that induces epithelial-mesenchymal transition and fibroblast-like transformation, reshaping the fibrotic tumor microenvironment. Conversely, attenuated DDR promotes antigen cross-presentation by dendritic cells and CD8+ T cells, modulating the inflammatory tumor microenvironment. Regulatory network analysis identifies the CXCL10-CXCR3 axis as a key determinant of immunotherapeutic response in low DDR HCC, potentially regulated by transcription factors GATA3, REL, and TBX21. Using machine learning techniques by combining bulk RNA-seq data in house together with public datasets, we introduce DDRscore, a robust consensus DDR scoring system to predict overall survival and resistance to PD-1 therapy in HCC patients. Finally, we identify BRAF as a potential therapeutic target for high DDRscore patients. ConclusionOur comprehensive findings advance our understanding of DDR and the tumor microenvironment in HCC, providing insights into immune regulatory mechanisms mediated via DDR pathways.