Repository navigation
Turnframe 0.2.0
Turnframe 0.2.0 makes progress a guarantee of code: every reply ends on a way forward, the assistant's offers are data the next message is read against first, and an offer is made only when the domain would take it now.
Published at 0.2.0: every crate, on the workspace version again. turnframe-core's public API changed and every crate depends on it, so all of them move together. The design is ADR-021, a conversation always moves forward.
Breaking
WorkflowDefinition::next_stepsreturns typed offers and sees the state:fn next_steps(&self, state: Option<&Self::State>, view: &ViewOf<Self>) -> Vec<NextStep>. To migrate, wrap each sentence asNextStep::new(<the operation it offers>, sentence), adding.with_arguments(json)for values already known.AssistantTurn::offersrecords the next steps a reply offered. A literal that builds anAssistantTurnaddsoffers: Vec::new(). Stored turns read as before.ModelPurpose::TakeUpis a new purpose (ModelPurpose::ALLhas sixteen),UnderstandingInput::offerscarries the last reply's offers, andExtractInput::correctedcarries the dates a correction changes. Literals add the new fields empty.
New
- «yes, rebook it» after an offer runs that offer on its record, with nothing routed again. «no, that's all» declines the offers and is not reported as not understood.
- A next step is offered only when the domain accepts it now: the act is compiled and every command validated against the state before the reply offers it.
- A question asked again says it is still needed and offers the record's next steps beside it. A question no fact answers is told what the record holds and what it still needs.
- A request only a record can do, when none exists yet, is told so and offered to open one:
WorkflowDefinition::record_operationslists what a record could do. - One message that opens a record and acts on it runs both: an act on a record the message opens is checked against the state the opening leaves, when the workflow says what its commands leave (
WorkflowDefinition::state_after, defaulted). - A request about records that can do nothing now («confirm the rebooking» after it left) is answered with where they stand, not reported as not understood.
- A card left open is the next reply's way forward.
turnframe_eval::simulateholds conversations with simulated users: a goal in TOML, a model playing the person, and code scoring each conversation on reached, dead ends, loops and offers refused.
Fixed
- A correction keeps what it does not restate: a date corrected without its year takes the year of the date it changes, and a year the words do not say is never taken from today.
- One request cut in two by the message's parts is one act, and one record asked for twice in a message is created once.
- «open Trip 1» asks where Trip 1 stands, and the reply ends on what the trip still needs, instead of starting a second trip; an answer that is also a record's label is still the answer.
- An answer read as another operation than the one asked is checked as a request; one read only as acts nobody asked for is read again as the act asked, when its own words give the value.
- The check of a copied value is told the words of its part the value leaves out: «the name is X» read as X is no longer found to hold too much, and «can I O?» asks for O.
- An optional value the user did not give is left out, never asked back, and a part found not asked for no longer holds the other acts on its record.
- An answer to a question about a record still to create creates it, and a record named while the message creates the one of its kind is that record.
- A full stop ending the sentence is not part of the value («Lisbon offsite.», «Trip to Rio.»), nor is the sentence's comma or stop written inside closing quotes, while an initialism keeps its own («S.r.l.»).
Measured against OpenAI's gpt-5.4-mini at medium: ten simulated conversations reached their goal ten times with no dead end and no offer refused, and a whole run of the live corpus passed 227 of 228 samples.
What changed, crate by crate, with every migration note, is in the changelog. Minimum supported Rust version: 1.88. Licensed under MIT or Apache-2.0.
cargo add turnframe