PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
February 28, 20260 citationsOpen Access

Automated Typing of Legacy Software Projects Using Agentic AI

View Full Paper
CPClemens Pohle

Key Points

  • The primary aim is to explore automated typing solutions for legacy software projects using agentic AI, particularly targeting type coverage and correctness.
  • Conducted a systematic literature review to identify existing limitations in automated typing approaches.
  • Proposed a three-phase typing approach: type-checking setup, type annotation generation, and strict type checking.
  • Implemented the first two phases in a tool named AgenticTyper for JavaScript and TypeScript repositories.
  • Evaluated the approach using three proprietary legacy codebases containing 456,000 lines of code.
  • Phase one resolved all 633 initial type checking errors for $25 in LLM API costs, compared to eight hours of manual effort.
  • Phase two achieved 86-96% type coverage with zero remaining errors, costing $4 to $95 and requiring 4-70 hours of human review.
  • Identified 135 confirmed bugs and 40 possible bugs thanks to improved type coverage, previously unknown to developers.
  • A benchmark against prior tools showed that many failed to achieve more than 81.5% coverage and introduced thousands of type errors.

Abstract

Legacy systems are business-critical software products that are difficult to understand and modify. Many are written in dynamically typed languages like JavaScript or Python, which lack the benefits of static type annotations for documentation, error prevention, and maintainability. Manually retrofitting types to large legacy codebases requires significant effort, often taking years. Existing automated approaches have limited practical applicability: static type inference cannot handle dynamic language features, dynamic inference requires comprehensive test suites, and probabilistic inference is inherently unsound. No prior approach achieves both high type coverage and correctness at the repository level. In this thesis, I investigate the use of agentic Artificial Intelligence (AI) —systems composed of Large Language Model (LLM) -based agents—to enable automated typing of legacy software projects. Through a systematic literature review, I identify the challenges and limitations of existing approaches. To overcome these, I propose a three-phase typing approach: (1) type-checking setup with initial error resolution, (2) type annotation and definition generation, and (3) strict type checking with refactoring. I implement the first two phases in AgenticTyper, an open-source tool for JavaScript and TypeScript repositories. My key innovation is a transpilation-based behavior preservation mechanism that prevents unintended modifications and addresses trust issues when using LLMs on production code. I evaluate the approach through a case study on three proprietary legacy repositories with 456, 000 lines of code. Phase one successfully sets up type checking and resolves all 633 initial errors for 25 in LLM API costs, compared to eight hours of manual effort for a single repository. Phase two achieves 86-96% type coverage with zero remaining type errors, costing 4 to 95 and requiring 4-70 hours of human review time depending on repository size. AgenticTyper surfaces 135 manually confirmed bugs and 40 possible bugs through increased type coverage that were previously unknown to the developers. A comparison with prior work shows that most existing tools are inapplicable or achieve at most 81. 5% coverage while introducing thousands of type errors. Furthermore, a non-agentic LLM baseline fails to preserve runtime behavior. The results validate that agentic AI enables automated typing at a practical level that prior approaches could not achieve, substantially reduces manual effort compared to fully manual typing, and identifies numerous existing issues. However, full automation is not achieved: human review remains essential for high-quality results, as manual cleanup reduces the number of added lines by 15-41% without sacrificing type coverage. Ultimately, the resulting pull requests, comprising 35, 000 inserted lines, were merged by the development team, demonstrating the approach's practical value.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Clemens Pohle (2026) studied this question.

synapsesocial.com/papers/69a287240a974eb0d3c029d2https://doi.org/10.48444/h_docs-pub-623
Ask AI
Helpful
Bookmark
Share
View Full Paper

Also Consider

Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context:

  1. 1Agentic-AI SDLC: Strategic Pitfalls and How to Survive Them2026
  2. 2ACE: Automated Technical Debt Remediation with Validated Large Language Model Refactorings2025
  3. 3Evaluating the Efficacy of Artificial Intelligence in Software Engineering: A Post-February 2026 Analysis2026
  4. 4Refactor Flow: AI-Based Semantic-Preserving Code Translation for Legacy Modernization2026
  5. 5Paradigms of Generative Artificial Intelligence in Automating Corporate Code Writing2025