Choices nobody can see
I shipped a demo story with a dead gate. Nothing crashed. The story ran, the endings worked, and one of the ten choices could never appear.
The gate was on a staircase. To see the choice you needed a variable called
wick to hold the value taken. There were two
routes up to that landing: one where you pick up the wick, one where you
don't. The gate sat somewhere only the second route could reach. Six
scenes, ten choices, and I had played it maybe twenty times without
noticing, because I always went the same way.
That is the class of bug worth spending time on. Broken links are easy: you click the choice, the scene doesn't load, you fix it. A gate that can never open is different, because the thing that would show you the problem is the thing that is missing.
What a link checker sees
Most authoring tools have a structural check. It walks the graph of scenes and arrows, finds scenes nothing points at, endings nothing leads to, arrows to scenes that no longer exist. All of that is genuinely useful and all of it is free, because it only needs to know that the arrow is there.
What it cannot see is that the arrow is there but gated on a condition the story never satisfies. The scene exists, the arrow is drawn, the text is written, and no reader will ever read it. Structurally the story is perfect.
Walking it the way a reader does
So the checker plays the story instead of reading it. Enter a scene, apply the assignments in its text, evaluate every outgoing gate against the resulting state, follow the ones that pass. When it arrives somewhere new, it remembers where it is and what the variables hold at that moment, then keeps going.
The important part is what it remembers. Two routes that arrive at the same scene with the same variable values are, from that point on, identical: everything ahead of them depends only on the scene and the values. So it keeps a set of scene plus values, and when a pair is already in the set it stops. Without that, a story with two loops would run forever; with it, loops terminate as soon as they come back around to a state already visited.
Why it stays finite, and where it doesn't
Eight true/false flags is 256 combinations. That is nothing. But a counter that can go from 0 to 50 is 51 more values per scene, and two counters is worse, and this is where naive checking dies.
Two reductions keep it alive for ordinary stories.
Numbers only matter where a gate asks about them. If the
only gate that reads oil is oil >= 3, then 0, 1
and 2 all behave identically, 3, 4, 5 behave identically, and so on. So
before walking anything, the checker collects every number the gates
compare against, per variable, and collapses all the values in each gap to
one representative. A variable that only ever appears in three comparisons
now has five possible values instead of fifty.
Variables are dropped when they stop mattering. Working backwards from each scene, the checker asks a simple question: is there any gate ahead of this point that still reads this variable? If not, the variable is thrown away at this scene. This never changes an answer, because a value nothing ahead can read cannot affect anything ahead. What it buys is the case where branches rejoin: the flag that told the branches apart is usually dead by the join, so the two states collapse into one and everything after that is walked once instead of twice.
For some stories that still isn't enough. The search has a hard ceiling, and when it hits it, it says so: how many states it got through, which scene was under the most pressure, and how many scenes and endings it did not get to. It does not quietly return "no problems found", because a checker that gives up and reports a clean story is worse than no checker at all.
The second opinion
When the search does give up, one more thing runs: two hundred playthroughs with random choices, using the same gates and the same variables. Whatever the exact search couldn't certify, the sampler reports as "never came up in 200 runs". On a story I built to break it, the wording comes out like this:
200 random playthroughs reached 99 of them; 4 never came up. A rare route can hide from 200 runs, so treat those as places to look, not as broken.
That is weaker evidence than a proof, and it is labelled as weaker. It is also the same technique other people use as their only check, and for spotting the obvious cases it works.
What it won't tell you
Three things, all of them worth being clear about.
It can't find softlocks. "You can still reach an ending from here" requires deciding whether any path out of a state reaches a terminal scene, and that question has no general automatic answer worth shipping. The famous example is the Hitchhiker's Guide game, where missing a junk-mail letter on Earth makes the game unwinnable hours later. A checker that claims to catch that is lying to you.
It doesn't model history. There is no "visited three turns ago" in the story format, partly because that makes the state space unbounded. If you need it, the honest version is a counter, because a counter is visible.
It can't judge whether a reachable choice is worth reaching. A scene two players in a thousand find is technically fine and practically dead. The sampler gives you a number for that, and the decision about what to do with it is yours, not the tool's.
Why bother
Because writing branching fiction means holding a state machine in your head while you write prose, and you can't. Not at forty scenes, not while you're also trying to make a sentence land. The machine keeps its own accounts and gets them right; your job is the sentence.
The demo story that shipped with the bug is fixed now. The gate on the stairs can open. But the reason I noticed is that a machine walked every route, and I hadn't.