Chapter 10

Literate authoring

Nobody starts by writing graphs; the natural starting point is prose — a paragraph describing what happens — with the structure added after. TropeLang is built to be written that way: a perfectly valid .trl file can be nothing but prose, and you can add structure progressively, where it earns its keep.

Prose is a first-class citizen

Triple-quoted blocks hold raw prose. On their own, they're inert — they parse, they round-trip, they just don't say anything to the engine yet. An all-prose file is a legitimate starting point in its own right.

"""
A con man arrives in a sleepy town and marks a wealthy
collector, paranoid but vain. He earns the man's trust,
then lets him see only what he wants seen — and makes
the switch.
"""

Because prose blocks sit right alongside structure, you don't have to choose. You can structure the beat that matters for recognition and leave the connective tissue as a sentence. The same block can describe a moment and carry the facts that make it machine-readable.

char vale [+Protagonist] [+Grifter]
char renn [+Antagonist] [+Collector] [+Paranoid]
scene the_appraisal {
  beat 1 {
    """ Vale earns the collector's trust. """
    vale -- renn : "the appraisal"
  }
  beat 2 {
    evt the_switch [&Deceives(agent=vale, target=renn)]
  }
}

The conversion loop

Turning prose into structure is an iterative loop, and it's the same loop whether you do it by hand or point an AI at the document:

  1. Read a prose block and the structure already around it.
  2. Convert it into facts — entities, edges, tags — reusing names already declared rather than inventing new ones.
  3. Check: does it validate, and does it round-trip cleanly?
  4. Preview: what does recognition now find, and how did drams move?
  5. Apply, then repeat on the next block the gap points to.

The loop is closed over the buffer itself — read text, analyze, patch a span, re-analyze — with the host validating before anything commits. Every result (a diagnostic, a recognized trope, a coverage number) is tied to a character offset, so feedback maps straight back to an edit. There's no separate model to keep in sync with the file; the file is the model.

That loop — and the surface that lets your own tools drive it — is the last piece of the picture. It, along with where all of this is heading, is the final chapter.