spaghetti-code-killer

Author Unknown

Chapter 4 of 14

The kill mechanism prints clean. Everything around it takes fifteen pages to say nothing useful.

I spread the printouts across the desk — two hundred lines of surrounding architecture on the left, the forty-one lines of the kill code on the right — and read them in parallel. The surrounding sections have three developers' fingerprints layered over each other: whoever built the original system, whoever patched it after, whoever inherited the patches and patched those. The variable naming alone is archaeological evidence. `patientDataObj`. `tmpDataRef`. `data2`. The same concept named differently across twelve invocations because nobody compared notes and nobody had time. Six indentation styles because six people opened the file in six editors and each one reformatted whatever was convenient to them.

The kill mechanism has one style throughout. `patient.lastName`, `nameKey`, `targetList`. Variables named for what they do. The function architecture is deliberate — single responsibility at every level, each piece solving exactly one problem, the pieces assembled by someone who understood what clean code was supposed to look like. That same hand wrote layers nine through twelve: the dosage optimization framework, the validation structure, the safety parameter logic that the conditional check dismantles from inside. I write in the margin: One author. Clean throughout. Layers 9-12. The person who built the room also built the trapdoor.

I start profiling. Naming conventions in one column. Comment frequency in another — the kill mechanism is uncommented, a style choice consistent with the clean sections elsewhere in the author's work. The outer layers are commented defensively, full of disclaimers in the voice of people who expected to be blamed. The deep architecture has no comments because whoever wrote it was sure enough of what they were doing not to explain it.

This is what profiling looks like when the evidence is code instead of behavior. Both read the same way — through what's consistent, what breaks pattern, what the maker couldn't help putting their particular signature on. I've been doing one version of this work for thirteen years. The medium is new. The method isn't. By nine AM I have enough to know what I'm looking for. Now I need to find who had access to put it there.

Victor Russo's corner office has eleven motivational posters. I count them while Ray introduces us because counting things is how I manage my reaction to rooms, and this one requires management. MOVE FAST AND LEARN FASTER. FAIL FORWARD. YOUR ONLY LIMIT IS YOUR MINDSET. On the credenza behind his desk there's a family photo and an award plaque and a small succulent that's the only living thing in the building that looks like it belongs here.

Victor stands to shake our hands with a smile that was calibrated long ago and runs automatically. Expensive suit, silver at the temples, the ease of someone who has spent thirty years making people comfortable in rooms right before he disappoints them. He gestures us into the chairs arranged in front of his desk — the arrangement that says conversation while the desk between us says something else.

"Detective Kowalski. Detective Okonkwo." He settles back. "I want to start by saying we're treating this situation with the utmost seriousness. MediCore's cooperation with this investigation has been and will remain complete and unconditional."

"Seven people died," I say. "Tell me what you know about how CareFlow's dosage calculation system works."

The smile recalibrates slightly. "CareFlow is our flagship medical AI platform. Eighteen months of operation at Sunny Meadows with an exceptional safety record — the error rate compared to manual medication management was—"

"I'm not asking about the error rate," I say. "I'm asking what you know about how the dosage calculation system works. The technical mechanism."

The question lands in a different place than he expected. He expected questions about liability. About MediCore's response. About what the company was doing to ensure this never happened again. He didn't expect someone to ask what he personally understood about his own product.

"The technical specifics are really Derek's area," he says. "He manages the codebase directly."

"You signed off on the product architecture. Three years of deployment decisions. What do you know about the dosage optimization module?"

What Victor Russo knows about the dosage optimization module is that it exists and generates revenue. I read it in his eyes moving across his desk without landing on anything — the executive equivalent of looking for an answer in a room you know it isn't in. He's not stalling. He genuinely has no idea what his product does at the level I'm asking about. He hired people to know things so he wouldn't have to. A legitimate business practice right up until the people you hired write murder into the safety parameters and nobody else looks at the code for two years.

"There were internal concerns raised about certain technical elements," he says finally. The word "concerns" carrying the same load that "bug" has been carrying since this investigation started. "We were in the process of addressing them through our standard review cycle when—"

"When were these concerns raised?"

His fingers go to his watch. "I'd need to consult with legal before I—"

"That's fine," I say. "We can continue through your legal team. I'll also need the complete employment records for your development staff. Everyone who had commit access to the CareFlow repository, going back to the initial deployment."

The smile stays. The calculation behind it is audible. "Of course," he says. "Fully transparent." I write fully transparent in my notebook and underline it, and his smile cools by three degrees.

Derek is watching us approach from the moment we leave Victor's doorway. He's stationed at a standing desk in the open floor with a direct sightline to the corner office, which might be coincidence or might be the posture of someone who has been waiting to see what comes out of that room.

His stress ball has been worked into a permanent kidney shape. There are four energy drink cans on the desk. His monitors show the front-end dashboard — the clean, color-coded patient interface that Victor shows in sales decks — which tells me either he's trying to look busy with something he can explain, or he's been staring at it long enough to stop seeing it.

"Walk me through what you know about your predecessor," I say. "Not the code. Him."

Derek exhales and picks up the stress ball. "I told you, I never met him. Everything I know is—"

"Through the code. I know. But you've been living in his architecture for twenty-two months. You know things about how he worked."

The ball moves in slow circles in his hand. He's thinking about what to give me, which is different from figuring out what to say — he knows what to say, he's deciding how much of it is safe. I wait.

"He was better than the job required," he says finally. "The kind of engineer who could have been building something more significant. The core architecture, layers one through twelve — that's all him. The design decisions in that section are the kind you make when you're thinking three steps ahead. He didn't just solve the problem in front of him. He was designing for futures the rest of the codebase never reached." He puts the ball down. "Then there's everything below layer eight. Which I don't touch."

"It's not a decision I made," he says, and the defensiveness in it tells me it was absolutely a decision he made. "The patches I've been doing — scheduling interface, patient database connector, the reporting module — those are all in the upper layers. The deep callbacks handle their own logic as long as nothing breaks. And nothing has broken." He hears himself saying this the moment it leaves his mouth. "The logs reported everything within normal parameters," he says. "There was nothing flagged."

"The logs reported what the code told them to report," I say. "Below layer eight — what's down there that you haven't looked at?"

The energy drink can is fascinating to him right now. "The dosage optimization framework. The safety parameter validation structure. The interaction matrices." A pause. "The full execution path from the patient profile query to the dispensing authorization. I understand the inputs and I understand the outputs. What happens in between is — it works the way he built it, and I haven't had reason to trace it."

"Until now," Ray says, from the chair across the desk, where he's been quiet and present in exactly the way that makes people talk. Derek looks at him. "Until now," he agrees, quietly.

The git blame output covers my screen by six. The MediCore codebase has three regular contributor IDs cycling through the commit history — the original developers in 2021, Derek's account starting in 2023, a contractor handle that appears for six months and then vanishes. But for the dosage optimization layers, the validation framework, the kill mechanism itself — one account dominates. Burst commits in June 2022, another cluster in August, a final dense grouping in September. Each burst three to four days. The timestamps run from early evening into the small hours, later as the September sessions go on: June at 9 PM, 11 PM; August at 11 PM, 1 AM; September at 2:34 AM, 2:17 AM, 3:01 AM.

Someone who worked through problems until they were finished, regardless of the clock. Someone who coded in sustained sprints — not the incremental daily commits of a developer who goes home at six and picks up in the morning, but the deep-dive pattern of someone who stayed inside a problem until the problem gave.

I pull the full account history. First commit April 2022, onboarding activity, reasonable hours. Then the architecture work begins and the timestamps slide. The deeper the commit goes into the callback layers, the later the timestamp. By September the deep architecture commits are all after midnight, clustered tight, three nights of surgical work on the same forty-one-line function. The kill mechanism didn't get written in one sitting. Someone went back to it. Refined it. Made sure it was right. The account ID is `mchen-medicore`. The attached email: `mchen_dev@medicore-internal.com`.

I write the account ID on a sticky note and pin it to the corkboard — one thread, next to the callback architecture map and the execution traces and the seven names in alphabetical order on Dr. Vance's case summary, one end of something I don't have the other end of yet. Then I send the employment records request to HR with a copy to Ray. Name, full employment history, access privileges, departure date, any documented performance or ethics notes. Standard language. I've filed a hundred of these. The name will be in my inbox by morning.

The apartment is the same as I left it — always the goal and never entirely reassuring, but the light by the door is on a timer and it works. I drop my bag and stand in the entry hall: my jacket on the hook, my umbrella on the rack, the space where a second jacket would go. I don't think about that.

The kitchen yields leftover rice and a judgment call on something I bought last Tuesday that I make and lose. I eat the rice standing at the counter, scrolling through the commit timeline on my phone. `mchen-medicore`. The September timestamps. The pattern of someone who worked deepest when the building was empty, who saved the most precise work for the quietest hours.

I know that pattern. Not from this investigation. From before, from the years when I knew what a developer's late-night schedule looked like up close, from a specific version of 2 AM that had nothing to do with a murder investigation. But that's not relevant. That's a different category of knowledge and I keep it there.

The request is filed. The system will work. The name will arrive formatted correctly in a standard HR response and it will either mean something or it won't, and either way I'll have the next step by eight AM. I close the laptop on the nightstand. The room goes dark except for the standby light and the thin line under the door. The callback layers arrange themselves in the dark behind my eyelids — the tree structure of them, the seventeen descending levels, the kill code sitting at layer twelve like something at the center of a building you've been walking through for days and only now understand the architecture of.

I count down from seventeen and fall asleep before I reach the bottom.

← PreviousContentsNext →