Neuro-Symbolic Cross-Cutting Modernization: AST-Partitioned Agentic Refactoring and Subtractive Software Evolution in Regulated Systems

ABSTRACT Context. Cross-cutting modernization of a regulated, 496K-SLOC industrial system (Enterprise-LIMS, 3,562 source files) must simultaneously refactor user-facing text, exception handling, persistence guards, and audit records without violating regulatory invariants. Delegating such repository-wide changes to a coding agent end-to-end is hazardous because natural-language literals are entangled with control flow: we identify 1,409 sites (including 689 fatal control-flow comparisons) where business branches compare against, or key on, localized strings. Approach. We study a three-stage post-freeze modernization campaign (65 commits over a 21-day active window following the Phase IV baseline): (i) Stage 1 (12 days, 36 commits) aligns all 10 business domains, eliminates 414 inline mock/hardcode sites and all 192 static literals, and culminates in a 527-file structural consolidation; (ii) Stage 2 (5 days, 2 commits) freezes governance specifications, dehydrates 4,161 bilingual contract entries via zero-token deterministic scripts, baselines the 1,409 smells into 689 P1 fatal control-flow comparisons and 720 P2 non-branching display mappings, and applies a four-role compiler-AST partitioner (@vue/compiler-sfc + @babel/parser) that routes the remaining 19,334 frontend text nodes into Green deterministic UI (70.58%), Blue dictionary-bound (0.25%), and Yellow context-ambiguous (29.17%) execution channels (cutting ambiguous flags by 44.99% from 10,252 under line-regex scanning to 5,640, with 100.0% semantic precision on a 100-item stratified sample); and (iii) Stage 3 (4-day intensive sprint, 27 commits) pairs a 50-rule verification gate and canonical persistence recipes (Recipe A/B) with 28 deterministic codemods (4,689 LOC, 183 batch runs) and 6,177 targeted agent production edits, eradicating all 689 P1 fatal control-flow string comparisons while deferring the 720 non-branching P2 display maps to sub-application rollouts. Findings. Under whitespace-insensitive, rename-aware four-dimensional diffs (git diff -w -M -C, capturing 31 structural file moves and 28,744 externalized contract lines), pure production code exhibits a 47.46% replacement rate (52.44% in Stage 1 and 56.75% across frontend views), demonstrating that large-scale modernization is replacement-dominated rather than append-only. Economically, while Tier-3 agent disambiguation averages 57,057 billable tokens per production edit (352.44M billable / 7.40B total tokens across 104 code sessions, including 1,012 gate-remediation loops), offloading ~18,463 repetitive sites to Tier-1/Tier-2 scripts achieves a 0.0% syntax error rate and saves between 64.82M net billable tokens under conservative file-batch estimation and 1.05B counterfactual billable tokens under fine-grained site-level estimation. Five regulatory invariants hold across all 115 physical tables, 380 calculation engine and entity classes (1,567 total Java files scanned), and 18,960 nested locale keys at HEAD. Conversely, static call-graph reachability proves that removing a default actor (-1L) from the high-fan-in persistence handler (Ca=14, I=0.125) impacts 47 unauthenticated asynchronous entry points across 35 classes in 11 modules (43 direct DB writes; weighted blast-radius score 28 >= 8), tripping an automated circuit breaker and escalating to an architectural design proposal. Contribution. We contribute (i) a neuro-symbolic division of labor combining zero-token contract dehydration, AST-guided codemods, and surgical agent disambiguation, (ii) a four-dimensional churn decomposition across a three-stage campaign, (iii) a static call-graph and blast-radius criterion for halting unsafe automation, and (iv) a standalone reproducibility package of 20 audited measurement artifacts from a regulated codebase.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-10
DOI
https://doi.org/10.5281/zenodo.24113471
Primary Topic
Software Engineering Research
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Neuro-Symbolic Cross-Cutting Modernization: AST-Partitioned Agentic Refactoring and Subtractive Software Evolution in Regulated Systems

Chen Jiang
Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
preprint

Neuro-Symbolic Cross-Cutting Modernization: AST-Partitioned Agentic Refactoring and Subtractive Software Evolution in Regulated Systems

Chen Jiang
preprint en

Abstract

ABSTRACT Context. Cross-cutting modernization of a regulated, 496K-SLOC industrial system (Enterprise-LIMS, 3,562 source files) must simultaneously refactor user-facing text, exception handling, persistence guards, and audit records without violating regulatory invariants. Delegating such repository-wide changes to a coding agent end-to-end is hazardous because natural-language literals are entangled with control flow: we identify 1,409 sites (including 689 fatal control-flow comparisons) where business branches compare against, or key on, localized strings. Approach. We study a three-stage post-freeze modernization campaign (65 commits over a 21-day active window following the Phase IV baseline): (i) Stage 1 (12 days, 36 commits) aligns all 10 business domains, eliminates 414 inline mock/hardcode sites and all 192 static literals, and culminates in a 527-file structural consolidation; (ii) Stage 2 (5 days, 2 commits) freezes governance specifications, dehydrates 4,161 bilingual contract entries via zero-token deterministic scripts, baselines the 1,409 smells into 689 P1 fatal control-flow comparisons and 720 P2 non-branching display mappings, and applies a four-role compiler-AST partitioner (@vue/compiler-sfc + @babel/parser) that routes the remaining 19,334 frontend text nodes into Green deterministic UI (70.58%), Blue dictionary-bound (0.25%), and Yellow context-ambiguous (29.17%) execution channels (cutting ambiguous flags by 44.99% from 10,252 under line-regex scanning to 5,640, with 100.0% semantic precision on a 100-item stratified sample); and (iii) Stage 3 (4-day intensive sprint, 27 commits) pairs a 50-rule verification gate and canonical persistence recipes (Recipe A/B) with 28 deterministic codemods (4,689 LOC, 183 batch runs) and 6,177 targeted agent production edits, eradicating all 689 P1 fatal control-flow string comparisons while deferring the 720 non-branching P2 display maps to sub-application rollouts. Findings. Under whitespace-insensitive, rename-aware four-dimensional diffs (git diff -w -M -C, capturing 31 structural file moves and 28,744 externalized contract lines), pure production code exhibits a 47.46% replacement rate (52.44% in Stage 1 and 56.75% across frontend views), demonstrating that large-scale modernization is replacement-dominated rather than append-only. Economically, while Tier-3 agent disambiguation averages 57,057 billable tokens per production edit (352.44M billable / 7.40B total tokens across 104 code sessions, including 1,012 gate-remediation loops), offloading ~18,463 repetitive sites to Tier-1/Tier-2 scripts achieves a 0.0% syntax error rate and saves between 64.82M net billable tokens under conservative file-batch estimation and 1.05B counterfactual billable tokens under fine-grained site-level estimation. Five regulatory invariants hold across all 115 physical tables, 380 calculation engine and entity classes (1,567 total Java files scanned), and 18,960 nested locale keys at HEAD. Conversely, static call-graph reachability proves that removing a default actor (-1L) from the high-fan-in persistence handler (Ca=14, I=0.125) impacts 47 unauthenticated asynchronous entry points across 35 classes in 11 modules (43 direct DB writes; weighted blast-radius score 28 >= 8), tripping an automated circuit breaker and escalating to an architectural design proposal. Contribution. We contribute (i) a neuro-symbolic division of labor combining zero-token contract dehydration, AST-guided codemods, and surgical agent disambiguation, (ii) a four-dimensional churn decomposition across a three-stage campaign, (iii) a static call-graph and blast-radius criterion for halting unsafe automation, and (iv) a standalone reproducibility package of 20 audited measurement artifacts from a regulated codebase.

Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon