Chapter 4

Tropes as patterns

A trope, in TropeLang, is a rule about shape — a pattern over the graph that says "when the story looks like this, that trope is present." Nothing in a story file declares "this is a betrayal"; the story states that someone trusted and that someone later broke that trust, and the trope is recognized because the shape is there.

char host [+Protagonist]
char mole [+Ally]
scene the_long_con {
  beat 1 { host -- mole : "trusts completely" }
  beat 2 { evt turn [&Betrays(agent=mole, target=host)] }
}

Recognition by shape

A keyword search for "betrayal" finds only stories that used the word. Recognition by shape finds the betrayal in a story that never names it — one where a "loyal insider" is "revealed" and a stronghold "falls," with no Betrays tag anywhere. Because vocabulary normalizes through the ontology, the engine reduces those surface words to the same underlying structure — trust, then breach, by the same party — and matches on that.

Two kinds of shape do the work. Some tropes are sequences — events in an order, like trust followed by betrayal — matched the way a regular expression matches a string, with room for unrelated events in between. Others are structures — a static arrangement of nodes and edges, like a love triangle or a foil pairing — matched as a small subgraph. Most interesting tropes are a little of both.

What a trope rule looks like

Authors write tropes as rule blocks: a when pattern to match, and a then to assert when it does. Variables like $a bind to whatever node fits, so one rule covers every story of that shape.

rule Betrayal {
  when:
    char $a [+Protagonist]
    char $b [+Ally]
    evt $t [&Betrays(agent=$b, target=$a)]
  then:
    $a [#Betrayed]
}

Most authors rarely write these at first — the standard corpus ships hundreds — but seeing one clarifies the strip: "recognized" means some rule's when found a binding in the graph.

Confirmed, in-flight, and what's missing

A story is usually mid-flight, and the engine reports recognition in degrees. A trope can be confirmed (every condition satisfied), in-flight (some conditions matched, others pending — reported as matched / total, with the missing pieces named), or rejected (a condition was actively violated). An in-flight trope is a setup the story hasn't paid off yet.

That "what's missing" is genuinely useful: as a story takes shape, the engine reports which tropes are live and what each one still needs — a setup looking for its payoff. The same signal feeds coverage, and a future runtime could use it to steer a story toward its own climax. Recognition runs in two passes: a generous one that over-collects candidates by shape, and a strict one that scores each for how well it fits. The strip is the surface of that.