arXiv:2610.36549cs.SEOct 2026

Manuscript Offprint

arXiv:2610.36549

From Ripple to Boundary: Deterministic Impact Boundaries for LLM-Based Software Evolution

Jiameng Bai, Zhitao Wang, Long Wang, Keyue Qian, Sai Wu

Jiameng Bai 1^{1}, Zhitao Wang 2,∗^{2,*}, Long Wang 2^{2}, Keyue Qian 1^{1}, Sai Wu 1,∗^{1,*}

1^{1}Zhejiang University, Hangzhou, China

2^{2}WeChat Pay, Tencent, Shenzhen, China

{baijiameng,kyqian,wusai}@zju.edu.cn

{zhitaowang,oliverlwang}@tencent.com

Abstract—The landscape of software evolution is undergoing a fundamental paradigm shift in the era of Large Language Models (LLMs). As industrial software engineering increasingly transitions toward design-driven code generation, the bottleneck of evolution has shifted from writing code to maintaining deterministic consistency between multi-source design assets (e.g., sequence diagrams, class diagrams) and the generated code. When a design asset changes, LLM agents currently lack a deterministic impact boundary to identify which code must be evolved, leading to two failure modes: hallucinating missing changes or breaking unrelated code. Probabilistic approaches—such as semantic retrieval or text-based diffing—fail to capture the structural ripple effects across highly interconnected design dependencies.

To address this, we propose a paradigm shift from probabilistic semantic retrieval to deterministic structural constraints. We formalize the design assets as a Knowledge Graph (KG) and organize them into a content-addressed Merkle Directed Acyclic Graph (DAG). Our key insight reveals a topological isomorphism between the logical ripple effect of a design change and the content hash propagation within the DAG. By leveraging this, we transform ambiguous impact analysis into verifiable structural operations. Through a two-phase diffing process, we extract a precise causal chain that defines the exact modification boundary. This boundary enables deterministic context injection, providing the LLM agent with strictly scoped code and design updates, thereby fundamentally guaranteeing evolution safety. As a by-product, the KG serves as an agent-queryable knowledge base for natural language design retrieval. Early deployment on a large-scale industrial payment platform demonstrates that our mechanism successfully computes the exact impact boundary and generates incremental code modifications that meet the expected design changes.

Index Terms—Software evolution, knowledge graphs, change impact analysis.

I. INTRODUCTION

The landscape of software evolution is undergoing a fundamental paradigm shift. In our domain of industrial payment software development, we have transitioned toward a design-driven code generation paradigm. To make this concrete, consider an API-based transaction system: a sequence diagram captures a specific business use case, where each Message corresponds to an API or function call, often augmented with decision rule tables. Instead of manual coding, developers define these multi-source design assets (sequence diagrams, class diagrams, and rule tables) as the single source of truth, from which LLM agents synthesize and evolve the actual code.

However, as the design asset base scales, this evolutionary paradigm exposes a critical vulnerability during incremental iterations: when a design changes, the LLM agent lacks a deterministic impact boundary. Consider a scenario: a core interface's signature (e.g., its function name or request structure) is modified. Since this interface is invoked by dozens of messages across multiple sequence diagrams, this single logical change triggers a massive ripple effect. In a design-to-code setting, every affected sequence diagram dictates that its corresponding generated code must be evolved accordingly. Traditional approaches fail to capture this structural propagation. Text-based version control operates on physical text, losing logical dependencies. Even when leveraging LLMs to deduce the impact based on semantic similarity or RAG, the results remain probabilistic. Fundamentally, LLMs inherently lack the capability to perform deterministic transitive closure calculations over complex graph structures, making them prone to missing deep cascaded dependencies. This boundary ambiguity leads to two failure modes: under-modification (hallucinating or missing necessary code changes) and over-modification (breaking unrelated shared code).

To address this, we propose a paradigm shift: moving from probabilistic semantic retrieval to deterministic structural constraints. Because design assets are highly interconnected (e.g., a message invokes an interface defined in a class diagram), we model them as a directed graph and store them in a Knowledge Graph (KG) to explicitly capture their complex logical dependencies. Building upon this KG, our key insight is to organize it into a content-addressed Merkle Directed Acyclic Graph (DAG). Inspired by the underlying architecture of Git, each design node is stored via shallow serialization, and its content hash is derived from its own properties and its children's hashes. This structural representation makes the logical ripple effect computable: any leaf-level change inherently alters the hashes of its ancestors. By comparing the hashes of new and old snapshots, our two-phase diffing process efficiently prunes unchanged subtrees and drills down into the modified ones, yielding a precise causal chain of impact (e.g., "Interface X is affected because its request structure changed, consequently affecting Sequence Y").

∗^{*}Corresponding authors.

(a) Multi-Source Design Network

(b) The Ripple Effect

(c) Code Evolution Impact

Figure

Fig. 1. The Design Ripple Challenge: (a) A multi-source design network across class diagrams, sequence diagrams, and behavior/logic layers; (b) A single field edit in the Request DataType triggers a structural ripple effect across multiple sequence diagrams; (c) The ripple necessitates incremental code generation.

Crucially, instead of relying on probabilistic agentic search during generation, our system leverages this computed causal chain to perform deterministic context injection. The agent is provided with a pre-packaged specification containing the precise causal chain, the newly fetched design assets, and the existing code, all strictly confined within the computed boundary. This rigid structural constraint eliminates the need for the LLM to “search” for context, ensuring that incremental code evolution is restricted to truly affected regions.

Beyond automated evolution, the constructed KG yields a valuable by-product: it serves as an agent-queryable knowledge base. During the design phase, when developers need to understand complex structural dependencies (e.g., “Which sequences invoke this interface?”), an LLM agent can safely traverse the graph via natural language and multi-step Cypher queries. This unlocks the design assets from static documents into an interactive, dynamic engineering asset, assisting human designers in their daily workflows.

We have deployed this mechanism on a large-scale industrial payment microservice platform. Early evidence from real-world flow modifications demonstrates that our approach effectively constrains the agent's generative process, ensuring that code changes are precisely scoped and safe. By treating design changes as hash propagation over a Merkle DAG, we shift LLM-based software evolution from probabilistic context retrieval to deterministic structural enforcement.