Perhaps there's a "Plan 9" way to approach the problem which might involve a "less-huge" amount of work.
There is nothing "Plan 9" about this. When a piece of code gets so large as to be impossible to understand, it's time to throw it out and start over.
Where we as "engineers" fail is in not making the case that it is cheaper for the corporate behemoth to re-write rather than extend, embrace, and
bloat. I can't get started on this right now ...