Repository navigation
Interactions
An interaction describes an explicitly authored sequence of messages. Use it when a diagram should show more than static dependencies. It does not record an observed runtime trace or execute those messages.
main.expec
type Snapshot { title: Text }
type Receipt { id: Text }
interface Storage {
public persist
capability persist(snapshot: Snapshot) returns Receipt
}
component Screen {
public showSaved
capability showSaved(receipt: Receipt) returns Nothing
}
interaction "save and confirm"(snapshot: Snapshot) {
participant screen: Screen
participant storage: Storage
message screen -> storage.persist(snapshot) as receipt
message storage -> screen.showSaved(receipt)
}interaction has a title and parameters. A participant introduces a named endpoint of a concept-like type. message sender -> receiver.operation(arguments) selects a public capability on that receiver. as receipt captures a declared result for later messages.
Declare participants before their messages. A type declaration itself is not a participant instance. Message arguments and captured results obey the normal type rules. An operation returning Nothing cannot supply a reply value.
Messages appear in their authored order. This sequence can inform UML output; it does not imply that the generated implementation follows it. Static dependency links alone cannot invent the sequence.
Interactions can also appear inside concept-like declarations. There is no branch, loop, retry or asynchronous scheduling syntax in the current interaction form.
Related: Concepts and construction · Capabilities and contracts · Output support
Home · Keyword index · Released source 36748015 · pr-44 package
Reference edition: October 7, 2026. Checked language examples do not establish implemented runtime behavior.