Module motifs

Module motifs 

Source
Expand description

Conversational motifs — a standard library of high-confidence flow fragments.

Most developers don’t want to invent flow topology; they want vetted primitives: collect these slots, confirm then commit, require a disclosure, answer an FAQ then resume, hand off. A Motif is a factory for a pre-configured StageSpec (or OverlaySpec) that you append with Conversation::add_stage / add_overlay and wire with .next(..) as usual. Motifs are just lowered through the validated IR — same fail-loud guarantees as hand-written stages (a mis-built commit motif fails compile() exactly like a hand-written one would).

let convo = Conversation::new("booking")
    .add_stage(Motif::collect_frame::<Booking>("collect"))
        .next("confirm", Guard::captured(["party_size"]))
    .add_stage(Motif::confirm_then_commit("confirm", "book", "user_confirmed"))
        .next("done", Guard::called_ok("book"))
    .add_stage(Motif::handoff("done"))
    .require(["done"])
    .compile()?;

Structs§

Motif
Namespace of conversational motif factories.