The work everyone defers, done by machine and returned for review. GreenCode refactors element by element, writes the missing tests and documentation, replaces deficient libraries and ports obsolete languages, then hands it all back as pull requests a team can approve or reject.
Maintenance is risky, invisible and unsponsored. A change to a system with no tests, no current documentation and no living author can break something that matters, so the bare minimum is done and the rest is deferred indefinitely. The cost of doing it properly explains why: manual maintenance runs at $3 to $8 per line of code, with quality assessment, re-testing and project management on top. At that price a million-line application is never cleaned up. It is simply carried.
Automating the work changes what is affordable. GreenCode's second pipeline stage takes maintenance that a team would never be given time for and performs it as a repeatable, measured pass over the whole system.
View full sizeThe stage is driven by the artefacts the mapping stage produced. Static analysis of the indexed code, assessed against recognised quality, security and green software criteria, yields a machine-readable action list in JSON alongside a human-readable report. That list is the work queue.
Generative models then work through it element by element rather than attempting the system in one pass, and produce four kinds of change.
Everything lands on an optimisation branch and comes back as documented pull requests, with the reasoning attached. The maintaining team reviews and approves rather than inherits. Nothing reaches the trunk that a human has not accepted.
The project's review of the state of the art is candid about generated code. Single-pass generation is regularly outperformed by iterative, workflow-based approaches that combine translation, test generation, error correction and call-graph analysis, and copilot-style tools have produced siloed, developer-centric practices that create new forms of AI-induced technical debt at team level. The same review lists a general-purpose replacement for IDE copilots as a non-priority.
The distinction is one of scope. A copilot helps one developer type faster in one file. This stage treats the whole system on one pass, with a record of every change, which is the only level at which duplicated logic, an obsolete dependency or an inefficient pattern repeated three hundred times can actually be dealt with.
Iteration is bounded and checked, not open-ended. After each pass the quality assessment is re-run against the same criteria to confirm the uplift is real, and the generated tests are executed to confirm behaviour has not shifted. The project's requirements set a combined measure covering quality assessment issues, security flaws and error rate that must not rise during optimisation, so an energy gain bought with new defects does not count as a gain. Maintainability is tracked as a composite index, with cognitive complexity expected to hold steady or fall.
This is also a low-energy precursor to the benchmarking stage. Tidier code with fewer redundant operations frequently saves energy before anything has been profiled, and it leaves the later stages a cleaner system to optimise.
A codebase that arrives with the tests and documentation it should always have had, dependencies that are current, obsolete languages retired, and a reviewable trail of what changed and why. That is the mechanism behind legacy code modernisation, and the reason hours move from scaffolding to features, which is what increased productivity and accelerated software development describe. Automated maintenance of a whole codebase is one of the deliverables GreenCode will bring out of the project.
To trial it on a system of your own, get in touch through the contact page.