On this page
Pattern Language
Readable source for guided practices.
Pattern Language describes questions, choices, and steps in plain text. You write it as Pattern Markdown: the words remain readable, while a small vocabulary tells Patternverse when to ask for a response or move to another step.
The features below all use :language 1. Types, optional values, and reusable
flows are additive; existing source remains supported. The editor preview and practices run
through the same compiler and runtime.
Read the code. Try the result.
Each runnable example pairs highlighted source with the real preview. Answer questions, change choices, or edit the code and select Run changes. The panes sit side by side on wide screens and stack on smaller screens. Examples are temporary; AI steps use explicitly selected sample replies.
Your first pattern
This complete example asks a question, uses the answer in a short reflection, and ends. The text inside each block is what the person sees.
Reading the source
Headers describe the pattern. Instructions describe its steps. A named response can be used in later text.
| Syntax | Meaning |
|---|---|
:language 1 | Declares the language version. |
:title | Gives the practice a title. |
focus = !ask | Waits for a text response and names it focus. |
{{focus}} | Places that response into later text. |
!show | Displays authored text. |
-> end | Finishes the pattern explicitly. |
Use name = expression for a value and name = !action for an
interaction result. Bindings are immutable: a name cannot be reassigned. Put the text for a
question or display inside explicit braces. Lines beginning with # are comments.
Document structure
Start with :language 1, then metadata, input/output declarations, imports,
types, helpers, and flows before the main steps. Put attributes before the text in their
action block. Close each explicit block with a brace and finish each execution path with -> end. Declarations describe the program; steps run in authored order.
| Declaration | Contract |
|---|---|
:language 1 | The language tag for all supported features in this guide. |
:title "A check-in" | An optional title for the practice. |
:input topic: text | A required, typed value supplied by the caller. |
:output answer: text | A value every successful completion must return; the annotation is optional. |
:import … | A pinned executable dependency or a named reference-data resource. |
Markdown, references, and literal syntax
Question and display bodies support Markdown paragraphs, headings, emphasis, lists, links,
and quotations. {{binding}} inserts a value and {{entry.answer}} reads a known field. Choices display their labels. Inserted
participant or model text stays data; it cannot introduce another language step.
Prefix reserved syntax with a backslash when it should appear as text, such as \!ask, \-> end, or \{{name}}. Common
indentation is removed from a body while relative indentation is preserved. Explicit braces
keep annotation-shaped prose and lines such as Given: inside the intended body. Earlier
shorthand bodies remain compatible.
Bindings and types
Types are inferred unless you add an annotation such as topic: text. An
annotation checks the value; it does not convert it. For example, a quoted number remains
text and cannot be assigned to a number binding.
| Type | Values |
|---|---|
text | Text, including an empty string. |
number | Numeric values and rating results. |
boolean | true or false. |
choice | A choice with a stable .value and display .label. |
list[T] | An ordered list whose elements share a type, such as list[text] or list[choice]. |
{topic: text} | A record with named, typed fields; read them with entry.topic. |
Optional[T] | A present value of type T, or explicit absence with None. |
Declare public inputs with :input topic: text and outputs with :output entry or a typed output declaration. Every completing path must supply
each output. An annotation can give an empty list its element type, as above; the compatible list<text> and []:text spellings also remain supported.
Inputs and outputs
Inputs are supplied when a run starts, rather than read from surrounding chat or another pattern’s variables. Every declared input must be supplied with its declared type. Outputs identify which completed bindings a caller receives; internal bindings remain local.
Annotations on outputs supply expected types throughout the program. For example, :output notes: list[text] permits notes = [] because the element
type is known. Omitting an output annotation keeps inference. Every path ending with -> end must provide every declared output, including paths that finish early.
The compatible :input topic text spelling also works. Input values are explicit
data, never source text to execute. When another flow calls the practice, it supplies inputs
with :with and receives a record of declared outputs.
Optional values and presence checks
Use Optional[text] when a value may be absent. Assign None for
absence, or a text value for presence. Optional is built in and needs no
import. A binding initialized with None needs an expected type, for example note: Optional[text] = None.
Defaults for absent values
optional ?? fallback returns the contained value when present and evaluates the
fallback only for None. The fallback must match the contained type. Empty text,
zero, false, and empty lists are present values and stay unchanged.
Chains associate right to left: a ?? b ?? fallback means a ?? (b ?? fallback). Arithmetic binds more tightly than ??;
comparisons, Boolean operators, and pipelines bind less tightly. For example, note ?? " default " |> trim trims the selected text. Parenthesize a pipeline inside
the fallback when only that branch should be transformed.
Inside :when note != None, the compiler knows that note is text,
so it can be passed to trim or used in a text reference. Check presence before
accessing an optional record’s fields, doing arithmetic, or calling a helper that expects
the contained type. Direct == None checks work too. A presence check applies within
the branch it proves; it does not automatically carry past a branch join.
list[Optional[text]] allows absent entries in a list; Optional[list[text]] allows the whole list to be absent. An empty list [], empty text "", and None are different values. There
is no implicit truthiness or optional chaining.
Optional values and optional questions
[optional] on a form question permits empty text; it does not produce None. A standalone !ask also returns text, including an empty
answer. Assigning that result to Optional[text] wraps it as present. An
optional input is still required: its caller must explicitly supply a value or typed
absence. Missing inputs are not filled with None.
Expressions and immutable data
Expressions derive values without asking questions or calling a model. Parentheses make grouping explicit, records expose named fields, and lists keep a single element type. The compiler checks every field path and operation.
| Operators | Rule, from strongest to weakest precedence |
|---|---|
(…), entry.field, helper(…) | Grouping, known field access, literals, and function calls. |
-value, *, +, - | Unary minus, then multiplication, then addition/subtraction. Operands are numbers. |
?? | Use a fallback only for None. Right-associative; lower precedence than arithmetic and higher than comparisons. |
<, <=, >, >=, ==, != | Non-chained comparisons. Ordering requires numbers; equality compares compatible types, including structural lists/records and choice IDs. |
not, and, or | Boolean negation, then short-circuit AND, then short-circuit OR. No implicit truthiness. |
|> | Pass the left value as the first argument of the next pure call; pipelines have the lowest precedence. |
|>> | Map the next pure call over one list level, inserting each item as its first argument. Both pipes share the lowest precedence and run left to right. |
Use commas between list items and record fields; trailing commas are accepted. An empty list
needs an expected type or a compatible explicit element annotation. Use concat to combine text or lists. Effects such as !ask, !agent, and semantic suggestions are whole statements, so they cannot be hidden
inside a record, list, helper argument, or pure transformation.
Command reference
Choose the interaction that fits the step. These are the basic building blocks; responses are confirmed by the person using the practice.
| Instruction | Use it to |
|---|---|
!ask | Collect a text response. |
!choose | Offer a single choice, or multiple choices with [multi]. |
!rank | Ask the person to arrange the offered items in order. |
!rate | Collect a rating within an authored range. |
!show | Present text or a reflection. |
!form | Group text, questions, and timers into one worksheet step. |
!timer | Add a countdown with an authored duration. |
!image, !video | Show media with authored alternatives, captions, or playback settings. |
!collect | Build a bounded list of participant-created entries. |
!use | Call a local flow or pinned imported pattern with explicit inputs. |
!refine | Review and revise wording with explicit participant acceptance. |
!agent | Request a model result with a declared type and explicitly supplied context. |
!turn | Request an explicit model-generated conversational turn under its authored contract. |
Questions and ratings
answer = !ask returns text. A standalone question allows an intentionally empty
answer. Use a form for a nonblank required answer or several related fields confirmed
together. Prompt references can use earlier bindings, such as What matters about {{topic}}?.
!rate minimum..maximum returns a finite number within inclusive bounds. Bounds
may be negative or decimal. :low and :high supply endpoint labels; :prefer slider is a presentation preference. The numeric range remains authoritative,
whichever control the host uses. An invalid or out-of-range reply leaves the question pending.
Single choice, multiple choice, and ranking
Give each option a stable ID and a quoted label. A single choice returns choice; [multi] returns list[choice] in catalogue order. A ranking returns every
offered item exactly once, in the participant’s confirmed order.
| Parameter | Meaning |
|---|---|
multi | Allow multiple selections; without it, choose exactly one. |
min=N, max=N | Inclusive multi-selection bounds. The default minimum is 1 and maximum is the offered
count. min=0 permits an explicit empty selection. |
from=selected | Use an existing choices catalogue or list of choices instead of literal options. |
label=description | When ranking records, use a nonblank text field for labels and return the complete original records. |
prefer=… | radio/chips for single choice, checklist/chips for multi, and reorder for ranking. These affect presentation. |
.value is an option’s stable ID; .label is its display wording.
Use IDs in matches. Dynamic catalogues cannot be combined with literal options. Duplicate
IDs, unknown selections, repeated ranking items, and contradictory bounds are rejected. To
rank a subset, choose it first, then pass the returned list to !rank.
Multi-selection and ranking have explicit confirmation controls. The preview uses the
editor’s controls; a host may present single-choice confirmation differently. The accepted
result, type checks, and stable option identities are shared. The legacy :option id "Label" and :from source forms remain supported.
Grouped forms
A form keeps related content together. For example, a single step can show an instruction with a timer directly beneath it.
Text fields in a form are required and multiline by default. [optional] permits
an empty answer; :multiline false requests a single-line field, and :placeholder "A small next step" supplies a hint. A form can also group ratings
and choices. Its completed result is a record, such as reflection.thought and reflection.notes, available after the whole form is submitted. Sibling fields
cannot read one another’s unfinished answers.
A form supports ordered !show, !ask, !rate, !choose, and !timer blocks. Ranking, branching, model requests, child
calls, and nested forms belong between forms. Required text must be nonblank; ratings and choices
use the same typed contracts as standalone steps. All fields are validated and accepted together,
so a rejected field keeps the complete form draft open.
:duration 60- Sets the countdown to 60 seconds.
:blocking true- Keeps Continue unavailable until the timer finishes. The person then confirms continuation.
:sticky false- Keeps the timer in this step. With
true, a started timer moves to the practice’s sticky timer area.
Countdown timers
A timer binds an immutable receipt containing duration_seconds, elapsed_seconds, and completed. Its widget provides start, pause,
resume, and reset; the participant explicitly confirms continuation.
| Attribute | Contract |
|---|---|
:duration N | Required whole seconds, from 1 to 86,400. |
:blocking true/false | Required. A blocking timer must finish before continuation; a nonblocking standalone timer permits continuation after starting. |
:adjustable true | Permit duration changes before starting. Both :min N and :max N are then required and must contain the initial duration. |
:sticky true/false | Defaults to true: a started timer moves to the practice’s timer area. False keeps it in its authored step. |
:persistent true | A form attribute that keeps its nonblocking timer controls available in the visible completed step while the run continues. |
Durations in source are seconds even when an editor control displays minutes. A nonblocking receipt records the clock at continuation; later clock changes do not rewrite that value. Pausing a run pauses its clocks, and leaving removes the countdowns. Reopening historical receipts does not start them again.
Images and video
Media are standalone display effects. They do not bind an answer or block the next step. Attributes are literal configuration; references may appear in the Markdown caption or guidance. The examples below load their external media only when you run them.
Images
:url requires an HTTPS source and :alt requires a meaningful text
alternative. Use exactly "" for a purely decorative image. An optional :title supplies a visible heading. The Markdown body is the caption. Meaningful images
can be enlarged with the pointer or keyboard; a failed load keeps the alternative and source link
available.
Video excerpts
| Attribute | Meaning |
|---|---|
:url, :title | Required HTTPS video source and optional visible/accessibility title. |
:start, :end | Whole seconds or quoted M:SS/H:MM:SS. Both are absolute
positions; end must exceed start. Start defaults to zero and end is otherwise the
source’s end. |
:autoplay, :muted, :loop | Boolean preferences, all false by default. Browser playback policies still apply; looping repeats the excerpt. |
:captions "en" | Prefer an available caption language; it cannot create a missing track. |
Supported sources include YouTube, Vimeo, Dailymotion, and direct MP4/WebM files. Explicit excerpt attributes override timestamps in the shared URL. Dailymotion requires the host’s player configuration. Pause/end controls pause players; playback position is local presentation state rather than a returned binding. Media failures do not fabricate a participant response.
Control flow
A practice can follow a different path based on a response, or repeat a step. The paths are written in the source.
| Instruction | Purpose |
|---|---|
?match | Choose an authored path based on a value, such as a selected choice. |
?branch | Choose an authored path using explicit conditions. |
?loop | Repeat a step, with an optional maximum number of iterations. The person can stop the loop. |
-> end | Complete the practice. |
Local :case arms continue after the match unless they explicitly end. A static
single-choice question can omit :else when every offered ID is covered, as
above. Closed enums work the same way. Text, numbers, and choices without a known catalogue
need a final :else. Match choice IDs, rather than their display labels.
?branch checks :when conditions in order and always needs a final :else. A value read after a decision must be supplied with the same type on
every path that continues to that read. Mutually exclusive arms may supply the same name.
Arms can contain local decisions, but not labels or jumps that escape their region. Braces
do not introduce mutable variables: mutually exclusive arms can provide one binding, while a
later possible reassignment is rejected. Legacy forward labels and :case value -> label remain compatible. Backward jumps are not loops.
Functional loops
?loop[max] name = initial carries an explicitly typed state value through
repeated interactions. Each iteration gets fresh immutable locals, and -> repeat expression supplies the next state of the same type.
The optional bracket is the total number of iterations, including the first. [0] skips the body. Omitting it means no authored maximum; host resource limits
still apply. -> break, reaching the maximum, or the participant’s Leave loop
control continues below the loop. Ending the whole run is a separate action.
A repeated body must include a participant interaction, and its final repeat/break must be last. Bodies are straight-line; loop state and iteration locals do not escape the loop or shadow outer names. Nested same-run repetition and branching are rejected rather than inferred.
Pure helpers, lambdas, and pipelines
Declare a helper with fn before the practice’s steps. Its parameters and result have
explicit types. Helpers use only their parameters and earlier helpers; they do not ask questions,
call models, or read surrounding bindings.
Inline lambdas
map, filter, fold, reduce, find, any, and all accept inline callbacks as well as named helpers. An
underscore marks a parameter whose type is inferred from the input list. Use _.name for a field or trim(_) for a call. Earlier immutable values, such as threshold, can be captured by an inline lambda.
Each _ occurrence introduces a separate parameter, from left to right: _ + _ means (accumulator, item) => accumulator + item in a
fold. To reuse the same parameter, name it: n => n * n. Two-parameter
lambdas use parentheses: (total, item) => total + item.
For nested transforms, name the outer parameter so each inner underscore has a clear owner.
Parameters are local to their lambda; captured values must already be available. Predicate
callbacks must return Boolean values, folds must return the seed’s type, and reducers must
return the list element type. Bodies contain pure expressions; questions, AI calls, and
unseeded shuffle are not allowed. Inline lambdas are supported in callback positions and
cannot be stored or returned as function values. Named fn helpers keep their explicit-parameter
contracts.
A pipeline passes the value on its left as the first argument on its right: value |> trim means trim(value). Use trim, lowercase, and normalize_whitespace for text; count, concat, map, filter, flatten, fold, and reduce for collections. map, filter, and fold take named helpers or inline lambdas. Lists stay homogeneous,
and transformations produce new values.
Use items |>> clean to map a pure helper or built-in over one list level. scores |>> clamp(0, 10) calls clamp(item, 0, 10) for each
score. Mix both pipes freely: notes |>> clean |> join("; ") cleans
each note, then joins the resulting list. Order and length are preserved, including typed
empty results. List-valued results stay nested; additional list arguments are passed whole. |>> provides explicit mapping without recursive or multi-list broadcasting.
| Function | Input and result |
|---|---|
trim(text) | Remove leading and trailing whitespace. |
lowercase(text) | Return lowercase text. |
normalize_whitespace(text) | Normalize runs of whitespace in text. |
clamp(n, min, max) | Bound a number; reject minimum greater than maximum. |
concat(a, b) | Join two texts or two lists of the same element type. |
count(items) | Return the number of elements in a list or choices catalogue. |
map(items, helper) | Call a pure callback once per element; preserve order and length. |
filter(items, helper) | Keep items whose pure callback returns true, in their original order. |
flatten(items) | Remove one list layer. |
shuffle(items[, seed]) | Return a new permutation. Without a text seed, use a whole binding; the order is stable when the run resumes. A seeded call is pure. |
fold(items, seed, helper) | Call a pure callback with accumulator then item; the result keeps the seed’s type. |
reduce(items, helper) | Start with the first element and combine remaining elements in order; return Optional[T], with None for an empty list. |
records(library) | Return a reference library’s typed record list. |
lookup(library, key) | Return the record for a typed reference, or an optional record when the key is arbitrary text. |
Browse the Functions reference for signatures, parameters, return types, and editable examples of every built-in.
Use join and split to combine or separate texts, and contains, starts_with, and ends_with for literal text
checks. sum totals numbers; min and max return
optional extrema. first, last, and predicate-based find return optional elements. Use ?? for an explicit default. any and all test predicates with short-circuit evaluation; distinct keeps each
value’s first occurrence in order.
Reducing without a seed
reduce(items, callback) uses the first element as its initial accumulator. The
callback receives the accumulator and next item and must return the same element type. A
singleton returns its element without invoking the callback; an empty list returns None. Use ?? for an explicit fallback, or fold for an explicit
seed or a different accumulator type. Optional element types are not supported because directly
nested Optional values are not allowed.
Helpers declare parameter and result types, cannot recurse or capture surrounding values,
and may call only earlier helpers. They are named declarations rather than stored function
values or closures. For a multiline pipeline, put |> or |>> at the start of each continuation line. Empty map/filter results retain
their type; an empty fold returns its seed.
Collecting and traversing entries
Use each to run a sequence of interactions once for each item in an existing
list or set of choices. A final -> yield expression chooses each iteration’s result.
The completed binding is a list of those results, in source order.
Each iteration has fresh local bindings. An empty input runs no interactions and returns a
typed empty list. For an open-ended collection, use entries = !collect with a
required finite :max and optional :min. The participant chooses
whether to add another entry after the minimum is met. An explicit final yield chooses the
exported value; existing language-one collections without it keep their record output.
Collection bodies are straight-line sequences. Put more complex branching or nested procedures in a called flow or child pattern. Pausing preserves the current entry and accepted answers; ending the practice does not manufacture a successful collection result.
Participant-created entries
:min defaults to 1 and cannot exceed :max. With :min 0, the participant first chooses whether to start. A record is appended
only after its whole body completes. At the maximum, collection ends without asking to add
another entry. A final yield exports exactly its expression; legacy language-one collections
without a yield export their body’s record fields.
The compatible mapped form !collect with :from items and :as item traverses a frozen source and has no add/finish question. each makes the per-item yield explicit. Empty sources produce typed empty lists,
and invalid replies preserve previously completed entries.
Reusable flows
A flow packages interactive steps behind explicit inputs and outputs. Declare
it before the main steps, then call it with !use. The returned record contains
its declared outputs.
Flows have isolated bindings and cannot capture the caller’s local values. Pass each input
with :with; -> end returns the flow’s outputs. A flow can call sibling
flows or pinned imported patterns, but recursive calls are rejected.
Inputs are passed exactly once. :with topic forwards an input of the same name; :with topic = another_value supplies an expression under a different name. Missing,
extra, or mistyped inputs fail compilation. Only declared outputs are exposed on the returned
record. The caller waits for the child to complete.
Executable imports and reference data
Pinned executable patterns
Mira’s saved-pattern import picker supplies an exact artifact identity and compiled content revision. The template below shows where that value belongs. A title, ordinal version, file path, or URL cannot replace a content pin.
An import only makes a dependency available; !use executes it. Input and output contracts
are checked across the dependency closure, including unused imports. Missing dependencies and
cycles are errors. Existing runs keep the exact imported sources with which they started.
Named reference-data libraries
A published content entry can register a JSON resource through its libraries metadata. The resource declares a record_type and a records list;
each record must exactly match its schema and have a unique, nonblank text ID. A
source-qualified ID such as commons:materials identifies that resource.
records(materials) returns the typed record list. A ref[materials] is a validated ID in that resource, so lookup(materials, reference) returns its record. An arbitrary text lookup can
miss and returns Optional[record type]; check for None before reading
fields. References from another resource are rejected.
Reference data resolves when a new run starts and is frozen with its schema and values in that run. A resource update affects new runs; reopening an existing run uses its original copy. Both forms of import are declarative, with their own validation and resource limits.
Active-pattern message handlers
An events declaration can route on user.message -> handle_message to a local flow while a pattern is waiting for a text answer. The handler takes text inputs message and prompt, and returns disposition as pass or handled. Passing delivers the original answer; handling
returns to the same unanswered question after the side conversation. These handlers run
within active patterns; they do not listen to all chat or operate pause/end controls.
Try help to show an explanation and return to the same pending question. Any other
message passes through as its answer. This example makes the routing decision deterministically.
A handler may also use an explicit classifier with declared context.
The nearest enclosing handler receives active text questions, including questions in called flows. It receives only the submitted message and rendered prompt. Handlers do not intercept themselves, ratings, choice confirmations, or review decisions. A paused or completed pattern receives no new messages. Unsupported event kinds fail compilation.
Data visualization & display
Pass an existing collection to !show to display its records. Describe the attributes
to map, group, or order; the renderer chooses a readable presentation and keeps the original fields
available as text.
Mapping
Effort is horizontal and impact is vertical. Edit a number and run changes to move its point.
Grouping
Rest contains two ideas and Support contains one. Change a category to move an idea into another labelled group.
Ordering
Highest impact comes first: Ask for help, Take a walk, then Take a pause. Change desc to asc to reverse the order.
Relationships
A parent field connects each step to its parent. Notice branches into Pause and Explore; Explore leads to Try.
Split views
Expected and Optimistic appear in separate panels with the same effort and impact scales, so their positions are comparable.
Combining properties
Mapping, grouping, and ordering can describe the same collection together.
:map accepts one or two dimensions. :group creates labelled
groups, :order sorts ascending or descending, :link describes
relationships by ID, and :split separates context views. All are optional. Displays
do not change the collection or ask for a response.
| Property | Presentation |
|---|---|
:map value | A numeric spectrum, inferred time axis, or categorical bands. |
:map effort, impact | Two dimensions: first horizontal, second vertical. |
:group category | Labelled groups without changing mapped positions. |
:order score desc | Stable ordering; asc is the default. |
:link parent | Directed relationships to text IDs, lists of IDs, or choices. A field named parent points from the parent to the current item. |
:split scenario | Separate context views sharing the same axis domains. |
All properties are optional and may appear once in any order. Without them, the result is a labelled collection. Numbers preserve distance, enums preserve declaration order, and consistent ISO date text can become a timeline. There is no separate date type. Nested scalar attributes work; transform values before showing them.
Labels prefer name, title, label, idea, text, then id. Relationships need stable IDs;
empty text or an empty list means no link. Cycles are labelled and shown with dashed edges.
Invalid relationships produce warnings and a labelled fallback. Small screens keep readable
lists with complete attributes, rather than relying on a cramped graphic.
AI and participant control
Ordinary authored text and response references do not request AI wording. An explicit ~ marker can ask for a different phrasing of a predetermined conversational move.
wording = ~ binds generated text for later use; it does not display or accept
the wording. !agent declares its result with :returns, including
typed records and lists. Repeated :context attributes explicitly share bound
values, and :min/:max constrain list results. Other bindings and chat
history are not automatically included.
Typed generation
:returns is a result contract, including exact record fields, homogeneous
lists, optional values, and resource references. :min/:max bound a
returned list. Repeated :context attributes pass explicit values separately from
the authored instructions. Invalid model replies leave the request pending. A type-correct confidence
score is still a model claim, not a measured probability.
Authored intent, flexible wording
~ instruction and ~ { … } request wording for a fixed authored
move. A realized question or display contains one realization without mixed literal body
text. The returned wording does not decide the next step. A bound realization stores text; a
standalone realization displays it. !turn is an explicit delegated conversational
generation step under its own authored prompt.
Closed categories and semantic suggestions
Declare a closed enum with type and a classifier with descriptions for its
categories, explicit context, and a fallback. ?~ requests a model interpretation
within those categories. The authored match determines the next step.
items |> select ~, filter ~, and rank ~ request
suggestions constrained to the offered items. Each returns a record with outcome (decided or uncertain) and a typed items list. These are whole binding statements. Pure filter(items, helper) stays deterministic. A valid model result is still an interpretation or suggestion, and consequential
choices should be reviewed by the participant. A classifier fallback means ambiguity; model errors
leave the step pending instead.
| Operation | Decided result |
|---|---|
select ~ | Exactly one offered item. |
filter ~ | Zero or more originals in catalogue order. |
rank ~ | Every offered original once, in suggested order. |
Every uncertain result has an empty typed list. A decided empty filter is different from uncertainty. Invented IDs, duplicates, incorrect selection counts, and incomplete rankings are rejected. Model interpretation does not stand in for a person’s choice, cancellation, acceptance, or permission to renew a revision budget.
Reviewing and refining wording
!refine presents the initial wording for review before any revision. Its body
runs only when the participant requests a change. End that body with -> propose to offer the next candidate.
The result includes reviewed.value and reviewed.outcome.value.
Outcomes include accepted, unresolved, and limit_reached; completion alone does not mean acceptance. rounds bounds revisions, and an optional renewable flag permits another budget only with
explicit participant approval.
Wording and steps
Where AI is used to phrase a step, that wording is bounded by the authored step. It does not silently invent a new path or make the person’s choices for them.
The source stays portable and inspectable. The person supplies their responses and remains in control of whether to continue.
Pause, end, and replay
Execution waits at an explicit participant or model step. A reply is checked against its exact pending request before it is accepted. Invalid replies leave that step pending; already accepted work remains intact.
| Action | Result |
|---|---|
| Pause / resume | Preserve accepted answers and the pending step; resume returns to it. |
| Leave loop | Exit the current functional loop and continue below it. |
| End run | Cancel the run and active children, with no successful outputs or authored continuation. |
-> end | Complete successfully and return declared outputs. |
| Keep wording | Explicitly accept the current refinement candidate. |
| Finish without keeping it | Finish refinement with an unfinished outcome; inspect the outcome before treating text as accepted. |
Editing a definition never patches an active run. Saved runs pin their source, executable dependencies, reference data, and accepted results. Reopening uses that snapshot and verified reply history, without regenerating already accepted model results. Late or duplicate replies cannot advance a different pending step. These documentation examples keep only a temporary browser run and reset when restarted or left.
Errors, limits, and compatibility
The source editor reports compiler diagnostics with line positions. In an example, edit the code and run changes to see the same checks. A failed compilation shows diagnostics instead of pretending to render a valid program.
| Symptom | What to check |
|---|---|
| Unknown binding or field | Declare the value first, use a known record path, and read form fields only after submission. |
| Optional value used as text/number | Check == None or != None in the branch where the contained value
is used. |
| Empty list has no type | Supply an annotation such as items: list[text] = [] or a typed output. |
| Binding may already be assigned | Use a new name for a derived value; only mutually exclusive branches may supply the same binding. |
| Missing output / branch value | Supply it with the same type on every relevant completing/continuing path. |
| Incomplete match | Cover every known enum variant or static option ID; otherwise add a final :else. |
| Declaration treated as body text | Use explicit braces to close the preceding question or display before the next binding. |
| Rejected model or participant reply | Check exact types, required fields, offered IDs, selection counts, and current request identity. |
| Unavailable import | Use a complete executable pin or a published source-qualified data ID with a matching schema. |
Source size, expression complexity, collection sizes, dependency depth, helper expansion, model results, and display graphics are bounded. Exceeding an execution limit fails explicitly; large visualizations can use a labelled data fallback with warnings. Keep open collections bounded and place substantial reusable procedures behind explicit interfaces.
All current features in this guide use :language 1. Legacy bindings, forward
labels, list<T>, and prior supported version tags retain their
interpretation. New syntax is additive and does not rewrite stored source or active runs.
First-class functions, payload-bearing enum variants, and global event listeners remain
outside the supported language described here. Extension packages have a separate authoring
and delivery design; they are distinct from the executable and data imports above.
Try the editor
Open the editor to explore a practice’s source and preview. Change a line, then restart the preview to try the updated version. Blocks expose common steps, forms, and local decisions; use Source for types, helpers, flows, and other advanced constructs. Ctrl+Space opens source suggestions, and compiler diagnostics identify invalid types or missing values.
Mock replies let you explore AI steps without a model call. Preview does not change an already running practice. Start with a small complete example, then add declarations, interactions, and branches one at a time so each compiler check has a clear purpose.
Open the editor