Abstract:As large language model (LLM)-based intelligent programming assistants gradually reshape software engineering paradigms, AI-generated code has become a critical digital asset, while the resulting ambiguity in intellectual property ownership and risks to software supply chain security are becoming increasingly severe. Code watermarking, serving as a “digital anchor” for copyright ownership confirmation and provenance tracking, faces unique difficulties due to the strict syntactic constraints and low information entropy of programming languages. To address problems in current research, such as fragmented technical approaches and incomplete evaluation systems, this study provides a systematic classification of existing research and develops a theoretical model from a full-lifecycle perspective. First, a novel lifecycle-based classification framework is proposed that categorizes existing techniques into three paradigms: backdoor triggering during training, sampling-bias embedding during inference, and semantic-rephrasing embedding after generation. Their operating mechanisms and evolutionary paths are then analyzed in depth. Second, the constraining relationships among key performance metrics of code watermarking are analyzed in depth, revealing the inherent contradictions and trade-off logic among fidelity, robustness, and watermark capacity under current technological conditions. Furthermore, an adversarial game perspective is introduced to analyze attack methods involving destruction, deception, and detection, and evaluation benchmarks ranging from functional consistency to adversarial traceability capabilities are reviewed. Finally, in view of the limitations of existing techniques in engineering usability and full-lifecycle evaluation, future research directions are outlined, including dynamic protection and ecosystem integration across the entire DevOps pipeline, aiming to promote the transition of relevant technologies from the proof-of-concept stage to industrial-grade application scenarios.