The fiction I write currently hit a major snag and needs a big overhaul of a major part of the story. A whole, large thread is being injected, a second conflict running in parallel with the main one and nearly as big - maybe smaller scale-wise but possibly even more complex.
Thing is I have a big part of the story according to the old, single-threaded paradigm is already written. Most of it will be reused in almost unchanged shape content-wise, but will require serious edits on the "details" level.
...and with my experience from programming, adding a second, distinct functionality to a pre-existing module with one existing functionality creates much, much more bugs than writing this from scratch separately.
I'm afraid my old story will be full of plot holes, pieces that depend on past that's been changed, on time-space relationships that are no longer valid, on knowledge that due to certain events became available or got lost in the changed version.
For example: when before there was just the dark clouds on the horizon, there comes a whole new layer of plot and subterfuge, opponents at hand, observing the protagonists from the shadows. They will not hesitate to strike at any open vulnerabilities. Suddenly all (common) scenes where the protagonist just didn't care about immediate danger (because there was none) need to either excuse the opponents from striking at the exposed character, or provide some defense, or just turn into battles. Any moments where I leave the protagonist just exposed, and nothing bad happens, as he is most of the time now, become plot holes.
So, are there any trusted techniques to trace such dependencies, and hunt all plot holes depending on changes of the story? Trace locations, knowledge, items to make them end up where they are? Like, in the old "Wolf, goat and cabbage" riddle, introduce a chicken and a sack of grain, and still reuse most of the old solution?