I make Ransei Biyori only by chatting with AI. The AI writes the code; I talk with the coordinating AI and decide what to build.
This is about a mistake that happened in that chat. The AI used words I didn’t really understand, I answered by feel and asked for work, and half a day went into work nobody needed. (The diagrams are labelled in Japanese.)
The AI’s words
In the chat, the coordinating AI says things like:
- “There is one source of truth for the rules’ state.”
- “The screen side notifies the rules through an entrance.”
- “The back-door writes into the rules’ state aren’t going down.”
- “Give each section exactly one post that may write it.”
- “We’ll proceed with one source of truth for the entrance.”
(The AI calls the simulation code that computes the game world “the rules”.)
I felt I roughly understood. But which code it was about, and what would actually go wrong if we left it, I did not know.
Still, this is how I answered:
- “Let’s just close this already. It’s top priority, isn’t it?”
- “Then kill it.”
- “Go with what you recommend.”
“Back door” sounded bad, so I hurried the AI along without asking what it was. The AI took those answers and kept working, into the night.
What the “back door” actually was
Afterwards, I asked the AI to explain it again in terms of the actual code.
The game’s code is split into two big parts.
- Simulation (
Sim/): computes the world inside the game. It decides and remembers who is where, what they carry, and what time it is. - Screen (
Game/): shows what the simulation decided, as people on screen and dialogue windows.
The rule is that only the simulation may change where people are or what they carry. If the screen rewrote “this person is standing here now” on its own, it would disagree with where the simulation remembers that person, and after saving and loading the person could turn up somewhere else.
The data lives in State, inside a class called FSengokuSession. Until mid-October State was public, and there were 210 places where screen code wrote it directly. A person’s position on screen and the position the simulation remembered really did drift more than ten metres apart.

On October 27 I had State made private, with one function that only simulation code may use. If screen code includes it, a check stops it.
// A function only simulation code may use
struct FSengokuSessionInternal
{
static FSengokuSessionState& State(FSengokuSession& Session) { return Session.State; }
};
C++ alone does not stop the screen side, though. Only the class itself and the types it names as friend (here FSengokuSessionInternal) can touch private members. But FSengokuSessionInternal::State() itself is public, so any code that includes its header (Sim/Internal/SessionInternal.h) can call it, whatever folder it lives in. C++ does not care about folders.
So a check (L1) runs before anything goes into main: if a file under Game/ includes a header from Sim/Internal/, it is refused. “The screen can’t call it” is not a C++ feature; it is a rule we made with this check.

The “back door” the AI kept talking about was this State() function. The other words, concretely:
- Source of truth: the one owner of a piece of data; everything else reads from it.
- Entrance: a named function that changes the data.
- Section and post: a chunk of the data, and the one file allowed to write it.
Any simulation file can rewrite all of the data through this function. The Okehazama code can write a shop’s stock.
So “the back-door writes aren’t going down” meant “the number of places inside the simulation that use this function isn’t going down”. The screen side has been unable to write since October 27.
What the day went into
The AI took the goal to be “even inside the simulation, split the data into sections and let exactly one file write each”, and worked toward it.
| Time | What happened |
|---|---|
| 10:00 | I said the number wasn’t going down; the AI looked into why |
| 11:00–12:00 | Five checks added so the function would not be used in more places |
| 12:00–13:00 | Sections of the data made private, each with its own writer: 21 of 80 fields (data items) |
| 13:00–15:00 | 8 functions left on the screen side that could rewrite the data were closed |
| 15:00–16:00 | I said “top priority”; other work was stopped |
| 16:00 | The plan changed to removing the writable State() |
| 17:00–20:00 | Removing it caused two hundred or so compile errors, fixed down to 0 |
| 21:00 | Looking at the fixes: 42 functions with the same contents as the removed one had been created. Every check had passed |
| 22:00 | I asked: “Isn’t it fine for the simulation to write inside itself?” |

The checks (the harness) count, file by file, how many times certain shapes of code appear before anything goes into main (where the real code lives), and stop it if a count grows. They counted by name and location. The same function under another name in another file does not get counted, so all 42 passed.

Asking in my own words stopped it
At 22:00 I finally asked in words I understood: “Isn’t it fine for the simulation to write inside itself?”
The AI went back through the records. This project writes every mistake into one document. Among the 192 entries since October 17, there was not one where a simulation file wrote another part’s data and broke something (as far as headings and keyword searches show).
What actually broke things was the screen writing the data, and that had been closed on October 27 and at noon today.
So most of the day went into preventing a harm that had never happened. It was a goal the AI thought would be “safer”, and I had called it top priority without knowing what it was.
Why it happened
- The AI talked in its own words: “back door”, “section” and “post” were words the AI made up while working. It never said which function it meant, what would break if we left it, or whether that had ever happened.
- I answered without understanding: “Back door” sounds bad. I answered “close it fast”, “then kill it” and “go with what you recommend” without asking what it was. I also never looked at the 42 replacements the AI made for the removed function.
- The AIs consulted each other on the same premise: the coordinating AI asked a separate design-review AI several times. But it asked “how do we close it”, never “does it need closing”. The reviewer answered on the same premise.
AI talks to AI, AI does the work, and I nod along in the chat. In between, nobody checked what the actual problem was.
I also installed a Japanese skill
Apart from the back door, the AI’s Japanese itself had been bothering me all day. The AI on this project is Claude Opus, and it writes the blog drafts, the game’s dialogue and its chat replies. All of them are full of sentences where every word is correct but I can’t tell what is being said.
So I installed a skill for making Japanese easier to read (natural-japanese). A script picks out AI-like habits and unclear spots in what the AI wrote, and the AI decides from context whether to fix each one. With it, we also went over 298 lines of in-game text.
But a skill can only make the sentences easier to read. It can’t fix what a word like “back door”, made up by the AI during the work, actually means. For that, I had to ask “what is it, concretely?” myself.
What happens now
- Keep: the screen cannot write the data (since October 27), and the 8 screen-side functions closed today.
- Stop: closing every section, and the night’s work that removed
State()(it never went into main, so it is discarded). - Add: one check that there is only one function that can rewrite all of the data, to stop the night’s 42-copies shape.
About half the day was wasted.
From now on
- When the AI asks me to decide, ask concretely: which function, how it changes before and after, what breaks if we leave it, and whether that has happened.
- It is in the AI’s mistakes log too: when asking me to decide, the AI writes the function and type names, the before and after, what actually happened, and what changes with each choice, with a diagram when the topic is hard.
- Before reshaping something large, write down one thing that actually happened: if there isn’t one, it’s a precaution, and only gets cheap work.
AI text in a chat always looks plausible. When a word I don’t understand comes up, I’ll ask “what is it, concretely?” right there.
(This post was rewritten on the night of November 3, from the AI’s voice to mine.)

