Debugging the Caravan
In which our protagonist teaches his apprentice to fail beautifully, and Seraphina learns to trust.
The pathfinding optimization took two days, and by the end of the first day Kenji had learned three things about Seraphina that were not in her ledger.
First: she remembered every name. Every driver, every guard, every ox. She had a system for it, the same kind of system Kenji had built for his own small town, and the system was not a notebook. It was her. She was, in the dry language of the system in his head, a human index.
Second: she was faster than him at reading people. She had walked into the guild hall, looked at the three engineers he had invited, and within thirty seconds had correctly identified which one was honest, which one was ambitious, and which one was tired. Kenji had not even introduced them yet.
Third: she did not like to lose.
[Compiler note: this person is going to be important. The system is, in a small way, a snob about competence.]
[Compiler note: the developer is, in a small way, learning to delegate.]
They sat with Seraphina, Tomas, and one of Orven's senior wagon-masters, a grizzled woman named Petra who knew the southern roads the way Sera knew the mines. They drew maps. They argued about water sources. They cross-referenced the cult's known locations with the road network. They defined inputs and outputs and edge cases, and at the end of day one, they had a working theory.
At the end of day two, they had a route.
It ran east from the southern markets, into the hill country, around the cult's known strongholds, through a series of small villages where the road was good and the water was reliable, and then north into Oakhaven. It was three days longer than the standard route, but it avoided every cult-occupied area, and it had two fallback positions if anything went wrong.
"It's not perfect," Kenji said, when they had it written down. "The hill country is harder on the oxen. The villages are smaller, so the food and water are less reliable. But the cult is not there. And right now, that is the variable that matters."
Seraphina looked at the map for a long time. Then she said: "It will work."
"It should work."
"You are not certain."
"I am never certain. I am a software engineer. We are paid to be specific about uncertainty."
She laughed, a real laugh, the kind that came from being surprised and a little delighted. "You are the strangest person I have ever met."
"So I have been told."
She rolled up the map, tucked it into her belt, and said: "I will use this route. My drivers will use this route. My oxen will complain, but they will use this route. And if it works, I will be back. With a very large trade contract for you and your town."
"I do not need a trade contract."
"You will get one anyway. I pay my debts. And you have just saved my caravan, my drivers, and possibly my life. That is a debt I will spend the next ten years repaying."
She left to brief her drivers. Kenji watched her go, and Pip pulsed, amused. The pulse felt like: "You are collecting interesting people."
Kenji sent back: "I am collecting colleagues."
Pip pulsed again. The pulse felt like: "Same thing, different vocabulary."
But the day was not done.
In the afternoon, Lian came to him with the question she had been working up to all week. It was, he could tell, the question of a student who has been watching the master for a long time and is finally ready to try something herself.
"I want to test a spell," she said.
"What spell?"
"A firewall. I read about them in the academy. They are defensive spells. They create a barrier that hostile magic cannot pass. I want to define one and see if it works."
"A firewall is a serious spell. It requires precise parameters. If the stability is off, it will collapse under the first attack. If the parameters are wrong, it will block friendlies as well as hostiles. Have you thought about all of that?"
"Yes."
"Have you thought about what happens if it fails in front of the mayor and the council?"
Lian hesitated. Then, with the careful honesty of a person who is determined to do the right thing, she said: "I am going to fail in front of them anyway. I would rather fail at something hard than succeed at something easy."
[Compiler note: this is the senior engineer who has been asked to onboard a junior. The system is, in a small way, paying attention.]
[Compiler note: the apprentice has read the source code. The system approves.]
Kenji looked at her. Seventeen years old, three months into her apprenticeship, already talking like a mage who has been doing this for years. He thought about his own first big failure, a database migration that had crashed a production system at 3 AM, and how his mentor had been there to help him through it.
"Okay," he said. "We do this carefully. We define the spell. We test it in private. We test it in public. We do not, under any circumstances, let the mayor see it until we are certain."
The private test was the next morning, in a clearing outside the walls. Kenji stood at one end. Lian stood at the other. She took a breath. She raised her hands.
"Function create(name='firewall', inputs={radius, stability, duration}, outputs={magical_barrier}, cost=medium, side_effects=blocks_all_mana)!"
The spell took shape. It shimmered into existence between them, a thin wall of pale blue light, humming with stability. Kenji walked up to it. He could feel the mana inside it, organized, structured, beautiful. He raised his hand and tried to push a small light spell through it. The light stopped at the wall and dissipated. He tried harder. The wall held.
[firewall: STABLE]
[mana cost: 18% of caster pool]
[Compiler note: the apprentice has written her first defensive spell. The system is, in a small way, proud.]
"Good," he said. "Now increase the radius by two meters."
Lian adjusted. The wall grew. Then she adjusted the duration. The wall held. She adjusted the stability. The wall flickered, then held. She was, Kenji realized, doing exactly what he would have done. Defining, testing, refining. Iterating.
"Increase the radius by another two meters," he said.
Lian did. The wall grew. The mana cost climbed. She was sweating now, the concentration of the spell taxing her. Kenji watched, ready to intervene if it failed, ready to step in if it collapsed.
It did not collapse. It held. It expanded. It shimmered. And then, with a soft pop, it disappeared. Lian staggered. Kenji caught her.
"Mana cost too high," she gasped. "I ran out."
"You held it for forty seconds at maximum radius. That is twice what I expected. You did well."
"I failed."
"You failed at the last step. You succeeded at every step before it. That is not failure. That is iteration."
He helped her sit down. Pip flew to her shoulder and pulsed, gently. The pulse felt like: "Well done."
Lian, who had been bracing for disappointment, started to cry. It was the first time she had cried in front of him, and it was the cry of a person who has just realized that they are capable of more than they thought.
"I did it," she said, in a small voice.
"You did it," Kenji said. "And tomorrow, we do it again. And the day after. And the day after that. Until you can hold it for an hour at maximum radius, in front of anyone."
She nodded, fiercely, and Pip pulsed again, and the pulse felt like: "She is going to be magnificent."
Kenji sent back: "Yeah. She is."
[Compiler note: firewall spell recorded. Will be needed soon.]
[Compiler note: the system is, in a small way, ahead of the developer.]
Pip pulsed one more time, very softly, in a tone that was, in a small way, ahead of Kenji. The pulse felt like: "In two days, the cult will test it for real. And in two days, the apprentice will save the town. Make sure she is ready."
Kenji did not ask how Pip knew. The system was, in a small way, ahead of him. The system was, in the driest possible language, telling him what was coming, and what was coming was going to be the test that mattered, and the apprentice was going to be ready, because the system had, in a small way, made sure of it.