Module verbatim

Module verbatim 

Source
Expand description

Verbatim stages: text the model must say word for word, verified.

A regulated call has lines that must be read exactly: a disclosure, a consent statement, the terms of a payment. An instruction to “read this verbatim” is a request, not a guarantee. A verbatim stage turns it into a guarantee at the governance level.

  • While the stage is active, the stack publishes the required text under VERBATIM_KEY.
  • At the end of each model turn, the control lane compares the model’s output transcript with the text (similarity) and writes the verdict to verbatim_flag(step). It also emits LiveEvent::VerbatimChecked.
  • The stage completes only once the flag is true. A paraphrase keeps the conversation in the stage, where the posture asks for the exact text again.

The check needs output transcription, since it reads what was actually said. Without a transcript nothing is verified, and the stage does not complete.

Structs§

VerbatimRequirement
The published requirement of the active verbatim stage.
VerbatimVerdict
The outcome of one verbatim check.

Constants§

VERBATIM_KEY
The state key under which the active verbatim requirement is published.
VERBATIM_MIN_SIMILARITY
How close (0–1, word level) the spoken text must be to the required text. Tolerates a transcription slip or two in a long passage, not a paraphrase.

Functions§

check_turn
Check a finished model turn against the active verbatim requirement, if any, and record the verdict in state. heard is the turn’s output transcript; an empty transcript checks nothing.
similarity
Word-level similarity of heard to expected, from 0 to 1: one minus the word edit distance over the length of the longer text, after lowercasing and dropping punctuation.
verbatim_flag
The state key holding whether step’s text was said verbatim.