Season 3 Episode 2

The King's Problem

Key scene illustration
Key scene illustration

In which our protagonist reads the books, and the books do not lie, but they are not telling the whole truth.


The books were in the next room, and the books were, in the driest possible language, the longest single piece of documentation Kenji had been asked to read since the legacy payroll manual at his old job in Tokyo.

There were twelve of them. Each one was the size of a small chest. Each one was filled with columns of numbers in the careful hand of the royal accountants, and the columns were, Kenji saw within the first hour, beautiful. The columns were consistent. The columns were cross-referenced. The columns were, in his professional opinion, the work of competent people who had been told to record the truth.

The truth, however, was wrong.

He did not say anything on the first day. He sat at the long table in the treasury room, with Pip orbiting his head and Lian beside him with her notebook, and he read. Elara stood by the door, sword at her hip, watching the door the way a person watches a door when the door has opinions.

The system pulsed at the edge of his vision, and the pulse was the pulse it used when the system was about to learn something it had not wanted to learn.

[Analyzer: treasury book 1 of 12]
[Source: royal accountants, central kingdoms, current year]
[Cross-reference: tax records, tariff logs, mine output]
[Compiler note: 47 cross-references resolve to a sum that is 4.7% lower than the books claim. The system is, in a small way, suspicious.]

Four point seven percent. The discrepancy was, in his old job, the kind of number that made a senior engineer put down his coffee and start a Slack thread with the words I think we have a problem. The discrepancy was not a typo. The discrepancy was not a rounding error. The discrepancy was, in the language of the system in his head, a leak in the pipe.

He read for two days. He mapped the system. He drew diagrams on scraps of paper. He wrote pseudocode for the treasury's flow of money, the way he had once written pseudocode for a service mesh. He traced where the gold came in (taxes, tariffs, royal mines) and where it went out (military, infrastructure, court expenses, debt service). He calculated what should have been in the treasury at the end of each year, and he compared it to what the books said was actually there.

The numbers did not match. They were close. They were within a percent or two. But they were not exact, and in a system that had been running for decades, a one percent discrepancy compounded to a large number.

"There is about a five percent annual leakage," Kenji said, on the morning of day three. The king was in the doorway. The king had been standing in the doorway for the last two days, asking short questions and receiving longer answers, and the king was, Kenji had come to realize, the kind of person who learned by listening. "Which means that over the last ten years, the treasury has lost roughly forty percent of what it should have. That is a kingdom-poverty-level amount of money."

"Where is it going?" the king asked.

"I do not know yet. The books are accurate. The accountants are not lying. The numbers are just incomplete."

"How can numbers be incomplete?"

Kenji thought about how to explain this. He thought about his old job, about the times a customer had complained that the system was wrong, and the system had been right, and the customer had been right, because the system was not measuring the thing the customer actually cared about.

"The books track what enters and what leaves the official treasury. They do not track the unofficial treasury. The unofficial treasury is money that is moved before it reaches the books. It is collected by someone, somewhere, and then it disappears."

"The corruption is upstream."

"The corruption is upstream. The books are downstream. The answer is: you are reading the wrong books."

The king stared at him. Then he said, very quietly: "I have been reading the wrong books for ten years."

"For longer than that, Your Majesty. The leakage has been compounding."

The king sat down. The king did not usually sit down in the middle of an audience. The king sat down now.

"How do we read the right books?" he asked.

"We trace the money. We follow it from the source, through every transaction, until it either reaches the treasury or disappears. We need access to the tax collectors, the tariff officials, the mine managers, and the court accountants. We need to follow the gold."

"That will take months."

"It will take weeks. I have a faster method."

Kenji closed his eyes. He held out his hand. He thought, in the language he and the system had built together over three months of debugging: Function create(name='audit', inputs={target=coin, scope=all_in_treasury}, outputs={transaction_history, mana_signature_map}, cost=medium, stability=very_high)!

The spell was, in the language of his old world, a tracing query. A diagnostic that asked the system: where has this data been? Who has touched it? What is its provenance?

[audit: scope = all_in_treasury]
[mana_signature_map: 2,847 distinct signatures across 18,000 coins]
[Compiler note: the spell is working. The system approves.]
[Compiler note: this is a function the developer did not ask for. The system is, in a small way, ahead of the developer.]

The treasury room shimmered. A thousand points of light appeared in the air, each one tracking a single coin. The lights moved, slowly, drawing a map in the air. They clustered. They diverged. They formed patterns.

And the patterns were not what anyone expected.

"Here," Kenji said, pointing. "These coins came from the southern mines. They passed through three intermediate hands before reaching the treasury. The intermediate hands were not the official tax collectors. They were someone else."

"Who?"

"I do not know their names. But the mana signatures are consistent. The same three signatures, on every southern coin. They have been intercepting the tax revenue, taking a cut, and then passing the rest along. The cut is being moved somewhere else."

"Where?"

"I am still tracing. But the pattern is clear. There is a network. There is a system. And the system has a name."

He looked at the map. He looked at the three consistent signatures. He looked at the way they connected to the court, to the palace, to the council chambers, the way the mana signatures pooled like water in the low places of a system that was supposed to be flat.

[Trace: signature cluster 1 of 3]
[Source: tax collection office, southern provinces]
[Frequency: appears on 38% of southern-origin coins]
[Compiler note: the signature belongs to a person, not an office. The person has a title. The title is Baron.]

"Baron Vex," Kenji said, very quietly.

The king's face went pale. He did not say anything for a long time. The light in the treasury room hummed. The signatures pulsed. The map drew itself in pale blue lines in the air between them, and the map was, in the driest possible language, a confession.

"How long?" the king asked, finally.

"Ten years, at minimum. Probably longer. The signatures are layered. The current baron inherited a system his father built."

"My council."

"Has been part of this for at least a generation. Probably two."

The king put his head in his hands. He stayed like that for a long time. Pip orbited his head, slow and quiet, and the pulse was the pulse the dragonfly used when the system was watching a person make a decision the person was not going to be allowed to take back.

"Show me everything," the king said, at last. "Every name. Every signature. Every coin. I want the full map. I want to know who has been stealing from my kingdom."

"I will need a week. Maybe two."

"You have a month. Take whatever you need. Hire whoever you need. Bring me the names."

He stood up. He walked to the door. He paused, with his hand on the frame, and did not look back.

"And Kenji," he said, in the driest possible language. "Do not tell anyone. Not yet. Not until we have the full picture. I have been king for twenty-three years, and I have just learned that half of my council has been stealing from me. I would like to know which half before I start arresting people."

He left. The room was quiet. The signatures still pulsed in the air. Elara, who had been listening from the doorway the whole time, said, very calmly: "You are going to need a list."

"I am going to need a list," Kenji agreed.

He looked at the map. He looked at the way the three signatures fanned out, like roots under a city, into forty, fifty, sixty separate hands. He thought about his old job, about the times he had found a single bad line of code that had been propagating through a system for years, and about the way the line had always been someone senior, protected by the structure around them.

Pip pulsed, very softly, and the pulse felt like: "This is bigger than the kingdom."

Kenji sent back: "Yeah. It is."

He started writing names. The Compiler hummed, in a tone that was, in a small way, ahead of him, and the long list of names that was going to break the kingdom open began, in the driest possible language, with the letter V.