Season 3 Episode 1

The Royal Summons

Key scene illustration
Key scene illustration

In which our protagonist enters a different kind of codebase, and discovers that legacy code is the worst kind.


The road to the capital took two weeks.

Kenji, Elara, Lian, and Pip rode in a small carriage, with a guard of ten, and they talked about the kingdom, the king, and the long list of problems that the letter had hinted at. Elara was quiet most of the way. She had never been to the capital. She had spent her entire adult life in Oakhaven, defending walls, knowing everyone, being known. Now she was going to a place where she would be nobody.

"You will be fine," Kenji said, on the third day, when she was particularly quiet.

"I am not worried about being fine. I am worried about being effective. In Oakhaven, I know every guard, every merchant, every street. In the capital, I will be a stranger with a sword."

"You will be the Strange Captain. The king's letter called you that. He is going to introduce you as the woman who held Oakhaven against the cult. That is not nothing."

"It is less than I want it to be."

"It is a start. That is all anything is."

She looked at him. She did not say anything. But she took his hand, and they rode in silence for a while, and the road went on.

The capital, when they finally reached it, was a system shock.

It was huge. Five times the size of Oakhaven, with stone walls three times as high, a castle that was a small city, a market that was a town, and a population that Kenji could not even estimate. The streets were paved. The sewers were organized. There were street lamps that lit up at dusk, fueled by a mana lamp that someone had designed and built and was now maintaining.

It was, in the language of his old job, a production system. It worked. It had been working for a long time. And like all production systems, it had been patched and patched and patched, until the original architecture was almost invisible under the layers of fixes.

"This is legacy code," Kenji said, to no one in particular.

Lian, who had been reading her notebook, looked up. "What?"

"Legacy code. Code that has been in production for so long that no one remembers the original design. The original developers are gone. The documentation is missing. The patches have been applied by dozens of different people, each of whom understood a different part. The system works, mostly, but no one really knows why."

"Is that bad?"

"It is not bad. It is just the way it is. And it is what the king has asked me to debug."

They were escorted to the castle. The king, Theodore, met them in a small audience chamber, not the throne room. He was, Kenji saw, a man in his fifties, with the tired eyes of a person who has been responsible for a long time and has not had a good night's sleep in years. He had a kind face, though, and a careful handshake, and a habit of looking at people as if he was actually listening to them.

"Strange Sage," the king said, smiling slightly. "I have heard a great deal about you. Most of it is true, which is unusual."

"I try to be consistent, Your Majesty."

"Good. Consistency is rare. So is competence. You have both." He turned to Elara. "Strange Captain. I am told you held the walls during the siege."

"I did, Your Majesty. With the Strange Sage's firewall."

"I am told you also walked the walls with him at midnight. I am told a great many things. I am told you are now an item."

Elara did not flinch. "We are, Your Majesty."

"Good. I like it when competent people find each other. It makes my job easier." He turned to Lian. "And you must be the apprentice. The one who learned to cast a firewall in three months. The academy is very interested in you."

"I am still learning, Your Majesty," Lian said, quietly.

"Of course you are. We are all still learning. The day we stop is the day we become useless."

He led them to a small room, with a table covered in papers, and a single chair. The chair was for the king. The other people in the room stood.

"Here is the problem," the king said. "My treasury is being drained. I do not know by whom. I do not know how much. I have accountants who tell me the books balance, but the money is not where it should be. My spies tell me there is corruption, but they cannot prove it. My nobles tell me everything is fine, but the kingdom is poor, and the southern kingdoms are richer, and I do not know why."

He paused. He looked at Kenji.

"You debug systems. I have a system that is broken. I need you to debug it."

"Show me the books," Kenji said.

The king smiled. It was the smile of a person who has been waiting for someone to say that for a very long time.

"I was hoping you would say that. The books are in the next room. They are very, very long."

# WORLD.md (updated)

## Status
- Location: capital city, royal court
- King Theodore: met, personable, competent, tired
- Elara: introducing as "Strange Captain," official couple acknowledged
- Lian: introducing as apprentice, academy interested
- New mission: debug the royal treasury

## Lessons
- Legacy code is the kind that has been patched too many times
- The original developers are always gone by the time you arrive
- A king who says "show me the books" is a king worth serving